chengjie 6 vuotta sitten
vanhempi
commit
4ea72cc04e
3 muutettua tiedostoa jossa 25 lisäystä ja 7 poistoa
  1. 20 3
      package4/main/activate.js
  2. 1 0
      package4/main/giftcard.js
  3. 4 4
      package4/main/giftcard.wxml

+ 20 - 3
package4/main/activate.js

@@ -92,9 +92,26 @@ Page({
92 92
           for (var i = 0; i < productList.length; i++) {
93 93
             productList[i].IsActivate = 1;
94 94
           }
95
-          that.setData({
96
-            List: productList,
97
-          });
95
+
96
+          if (productList.length>0){
97
+            that.setData({
98
+              List: productList,
99
+            });
100
+          }
101
+          else{
102
+            wx.removeStorageSync("HasActivate");
103
+            wx.showModal({
104
+              title: '提醒',
105
+              content: '产品已激活。',
106
+              showCancel: false,
107
+              confirmText: "去首页",
108
+              success:function(){
109
+                wx.reLaunch({
110
+                  url: '../../pages/index/index',
111
+                })
112
+              }
113
+            });
114
+          }
98 115
         }
99 116
       }
100 117
       wx.hideLoading();

+ 1 - 0
package4/main/giftcard.js

@@ -13,6 +13,7 @@ Page({
13 13
     this.setData({
14 14
       Containnerheight: common.getSystemHeight(),
15 15
       ProgramList: server.getProgramList(),
16
+      CurrentUserID:app.globalData.userInfo.UserID,
16 17
     });
17 18
 
18 19
     this.init(giftID,userID);

+ 4 - 4
package4/main/giftcard.wxml

@@ -26,15 +26,15 @@
26 26
     <view class='text9'>{{GiftInfo.UseTime}}</view>
27 27
   </view>
28 28
 
29
-  <button class='btn1 FlexRow' open-type="getUserInfo" bindgetuserinfo="goto"  wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID==0}}">
29
+  <button class='btn1 FlexRow' open-type="getUserInfo" bindgetuserinfo="goto"  wx:if="{{GiftInfo.PayType==5 && (GiftInfo.ExchangeUserID==0 || GiftInfo.ExchangeUserID==CurrentUserID)}}">
30 30
     <view>立即领取</view>
31 31
   </button>
32
-  <view class='btn2 btn1 FlexRow' wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID>0}}">
32
+  <view class='btn2 btn1 FlexRow' wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID>0 && GiftInfo.ExchangeUserID!=CurrentUserID}}">
33 33
     <view>已被领取</view>
34 34
   </view>
35 35
 
36
-  <view class='text10' wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID==0}}">“允许微信授权”才能完成领取</view>
37
-  <view class='text14 text10' bindtap='gotoDefault' wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID>0}}">返回首页</view>
36
+  <view class='text10' wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID==0}}">该功能需要微信授权</view>
37
+  <view class='text14 text10' bindtap='gotoDefault' wx:if="{{GiftInfo.PayType==5 && GiftInfo.ExchangeUserID>0}}">前往产品首页</view>
38 38
   
39 39
   <view class='text11 FlexRow'>如遇问题,请切换到“唱意教育家长助手”中
40 40
     <view class='text12' bindtap='gotoFeedback'>咨询客服</view>。</view>