Commit 2acecd7c5c000d2784e1104d8fb641739a7ab349

Authored by yvan.ni
1 parent 379c3b02

等级卡过期的显示

pages/user/cardinfo/cardinfo.js
@@ -41,6 +41,7 @@ Page({ @@ -41,6 +41,7 @@ Page({
41 user_card: null,//会员买的卡 41 user_card: null,//会员买的卡
42 free:null,//分佣的数据 42 free:null,//分佣的数据
43 expiryDate:"",//卡到期时间 43 expiryDate:"",//卡到期时间
  44 + is_guoqi:0, //卡是不是过期
44 45
45 }, 46 },
46 47
@@ -124,12 +125,20 @@ Page({ @@ -124,12 +125,20 @@ Page({
124 userId: getApp().globalData.user_id, 125 userId: getApp().globalData.user_id,
125 }, 126 },
126 }).then(res => { 127 }).then(res => {
127 - 128 +
128 var GradeCardID = res.data.data[0].GradeCardID; 129 var GradeCardID = res.data.data[0].GradeCardID;
129 var expiryDate = res.data.data[0].ExpiryDate 130 var expiryDate = res.data.data[0].ExpiryDate
130 console.log(GradeCardID, "卡的id", res.data.data[0]); 131 console.log(GradeCardID, "卡的id", res.data.data[0]);
  132 + var now=ut.gettimestamp();
  133 + var str = expiryDate.replace(/-/g, '/');
  134 + var end = new Date(str);
  135 + end = Date.parse(end) / 1000;
  136 + var is_guoqi=0;
  137 + if(end<now) is_guoqi=1;
  138 +
  139 +
131 ee.setData({cardid: GradeCardID, 140 ee.setData({cardid: GradeCardID,
132 - expiryDate: expiryDate 141 + expiryDate: expiryDate,is_guoqi:is_guoqi,
133 }); 142 });
134 143
135 144
pages/user/cardinfo/cardinfo.wxml
@@ -12,7 +12,8 @@ @@ -12,7 +12,8 @@
12 <view class="flex-space-between"> 12 <view class="flex-space-between">
13 <view style="color:{{user_card.CardColor}}"> 13 <view style="color:{{user_card.CardColor}}">
14 <view class="fs36 h36" style="font-weight:bold">{{user_card.CardName}}</view> 14 <view class="fs36 h36" style="font-weight:bold">{{user_card.CardName}}</view>
15 - <view class="fs22 h22" style="margin-top:15rpx">会员将在{{filters.replace_time2(expiryDate)}}到期</view> 15 + <view wx:if="{{!is_guoqi}}" class="fs22 h22" style="margin-top:15rpx">会员将在{{filters.replace_time2(expiryDate)}}到期</view>
  16 + <view wx:else class="fs22 h22" style="margin-top:15rpx">会员已在{{filters.replace_time2(expiryDate)}}过期</view>
16 </view> 17 </view>
17 <view bindtap="xufei" class="renew fs28" style="background:{{user_card.CardColor}}">立即续费 18 <view bindtap="xufei" class="renew fs28" style="background:{{user_card.CardColor}}">立即续费
18 </view> 19 </view>
@@ -23,12 +24,17 @@ @@ -23,12 +24,17 @@
23 <view class="Member" 24 <view class="Member"
24 style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png'); filter: drop-shadow(40px 0 0 {{user_card.CardColor}});"> 25 style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png'); filter: drop-shadow(40px 0 0 {{user_card.CardColor}});">
25 </view> 26 </view>
26 - <view style="color:{{user_card.CardColor}}">正在享受{{user_card.CardName}}会员特权  
27 - </view> 27 + <view wx:if="{{!is_guoqi}}" style="color:{{user_card.CardColor}}">正在享受{{user_card.CardName}}会员特权</view>
  28 + <view wx:else style="color:{{user_card.CardColor}}">享受更低价格,请续费哦</view>
28 </view> 29 </view>
29 - <view class="flex-vertical" bindtap="Share_pictures"> 30 + <view wx:if="{{!is_guoqi}}" class="flex-vertical" bindtap="Share_pictures">
30 <view style="color:{{user_card.CardColor}}">邀请新朋友</view> 31 <view style="color:{{user_card.CardColor}}">邀请新朋友</view>
31 - <image class="share" src="{{url}}/miniapp/images/plus/Forward.png"></image> 32 + <!-- <image class="share" src="{{url}}/miniapp/images/plus/Forward.png"></image> -->
  33 + <view style="overflow: hidden; margin-left: 10rpx;">
  34 + <view class="Member"
  35 + style="background-image:url('{{url}}/miniapp/images/plus/Forward.png'); filter: drop-shadow(40px 0 0 {{user_card.CardColor}});">
  36 + </view>
  37 + </view>
32 </view> 38 </view>
33 </view> 39 </view>
34 40