Commit 9941be620208b0df690e3e35645d7947c4278808
1 parent
d9df84d6
礼包的购买功能实现,兑换实现
Showing
6 changed files
with
132 additions
and
74 deletions
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -18,13 +18,16 @@ Page({ | @@ -18,13 +18,16 @@ Page({ | ||
18 | contentdown: '加载更多', | 18 | contentdown: '加载更多', |
19 | contentrefresh: '加载中...', | 19 | contentrefresh: '加载中...', |
20 | contentnomore: '已加载全部' | 20 | contentnomore: '已加载全部' |
21 | - } | 21 | + }, |
22 | + is_read:0,//礼包列表是否全部加载完毕 | ||
22 | }, | 23 | }, |
23 | onLoad: function(options) { | 24 | onLoad: function(options) { |
24 | var th = this; | 25 | var th = this; |
26 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
27 | + my_confirm.open_cancel(0); | ||
25 | th.setData({ | 28 | th.setData({ |
26 | getStorageID: a.stoid, | 29 | getStorageID: a.stoid, |
27 | - getUserID: 5682130 | 30 | + getUserID: d.user_id |
28 | }) | 31 | }) |
29 | }, | 32 | }, |
30 | onShow: function() { | 33 | onShow: function() { |
@@ -40,7 +43,7 @@ Page({ | @@ -40,7 +43,7 @@ Page({ | ||
40 | GetBuyPrice: function(e) { | 43 | GetBuyPrice: function(e) { |
41 | var that = this.data; | 44 | var that = this.data; |
42 | var th = this; | 45 | var th = this; |
43 | - var lbId = e.currentTarget.dataset.lbId;//活动id | 46 | + var id = e.currentTarget.dataset.id;//活动id |
44 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 47 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
45 | my_confirm.open( | 48 | my_confirm.open( |
46 | "是否确定购买该礼包", | 49 | "是否确定购买该礼包", |
@@ -50,11 +53,12 @@ Page({ | @@ -50,11 +53,12 @@ Page({ | ||
50 | my_confirm.open_cancel(0); | 53 | my_confirm.open_cancel(0); |
51 | }, | 54 | }, |
52 | function() { | 55 | function() { |
56 | + my_confirm.open_cancel(0); | ||
53 | var json = { | 57 | var json = { |
54 | "actId": '', //活动Id | 58 | "actId": '', //活动Id |
55 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 59 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
56 | "buyType": '2', //1=积分兑换 2=余额购买 | 60 | "buyType": '2', //1=积分兑换 2=余额购买 |
57 | - "lbId": lbId, //礼包Id | 61 | + "lbId": id, //礼包Id |
58 | "storeId": that.getStorageID, //商家Id | 62 | "storeId": that.getStorageID, //商家Id |
59 | "userId": that.getUserID, //用户ID | 63 | "userId": that.getUserID, //用户ID |
60 | "buyFrom": 2 | 64 | "buyFrom": 2 |
@@ -70,7 +74,20 @@ Page({ | @@ -70,7 +74,20 @@ Page({ | ||
70 | }, // 设置请求的 header | 74 | }, // 设置请求的 header |
71 | success: function (res) { | 75 | success: function (res) { |
72 | if (res.data.code == 0) { | 76 | if (res.data.code == 0) { |
73 | - window.location.href = th.data.url + '/Mobile/Payment/getPay.html?stoid=' + that.getStorageID + '&order_sn=' + res.data.data.orderSn + '&recharge_type=6'; | 77 | + res=res.data.data; |
78 | + wx.requestPayment({ | ||
79 | + timeStamp: String(res.timeStamp), | ||
80 | + nonceStr: res.nonceStr, | ||
81 | + package: res.packageValue, | ||
82 | + signType: res.signType, | ||
83 | + paySign: res.paySign, | ||
84 | + success: function (n) { | ||
85 | + | ||
86 | + }, | ||
87 | + fail: function (n) { | ||
88 | + | ||
89 | + } | ||
90 | + }); | ||
74 | } else { | 91 | } else { |
75 | getApp().my_warnning(res.data.msg, 0, th); | 92 | getApp().my_warnning(res.data.msg, 0, th); |
76 | } | 93 | } |
@@ -87,7 +104,7 @@ Page({ | @@ -87,7 +104,7 @@ Page({ | ||
87 | GetBuyIntegral: function(e) { | 104 | GetBuyIntegral: function(e) { |
88 | var that = this.data; | 105 | var that = this.data; |
89 | var th = this; | 106 | var th = this; |
90 | - var lbId = e.currentTarget.dataset.lbId;//活动id | 107 | + var id = e.currentTarget.dataset.id;//活动id |
91 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 108 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
92 | my_confirm.open( | 109 | my_confirm.open( |
93 | "是否确定兑换该礼包", | 110 | "是否确定兑换该礼包", |
@@ -97,16 +114,25 @@ Page({ | @@ -97,16 +114,25 @@ Page({ | ||
97 | my_confirm.open_cancel(0); | 114 | my_confirm.open_cancel(0); |
98 | }, | 115 | }, |
99 | function() { | 116 | function() { |
100 | - getApp().request.post('/api/weshop/marketing/buy/receive/gift/record/insert', { | ||
101 | - data: { | ||
102 | - "actId": '', //活动Id | ||
103 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
104 | - "buyType": '1', //1=积分兑换 2=余额购买 | ||
105 | - "lbId": 26, //礼包Id | ||
106 | - "storeId": that.getStorageID, //商家Id | ||
107 | - "userId": that.getUserID //用户ID | ||
108 | - }, | ||
109 | - success: function success(res) { | 117 | + my_confirm.open_cancel(0); |
118 | + var json = { | ||
119 | + "actId": '', //活动Id | ||
120 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
121 | + "buyType": '1', //1=积分兑换 2=余额购买 | ||
122 | + "lbId": id, //礼包Id | ||
123 | + "storeId": that.getStorageID, //商家Id | ||
124 | + "userId": that.getUserID //用户ID | ||
125 | + }; | ||
126 | + var data = JSON.stringify(json); | ||
127 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | ||
128 | + wx.request({ | ||
129 | + url: url, | ||
130 | + data: data, | ||
131 | + method: 'post', | ||
132 | + header: { | ||
133 | + 'content-type': 'application/json' | ||
134 | + }, // 设置请求的 header | ||
135 | + success: function (res) { | ||
110 | if (res.data.code == 0) { | 136 | if (res.data.code == 0) { |
111 | getApp().my_warnning("兑换成功!", 1, th); | 137 | getApp().my_warnning("兑换成功!", 1, th); |
112 | } else { | 138 | } else { |
@@ -129,7 +155,7 @@ Page({ | @@ -129,7 +155,7 @@ Page({ | ||
129 | _this.setData({ | 155 | _this.setData({ |
130 | loadingType: 1 | 156 | loadingType: 1 |
131 | }) | 157 | }) |
132 | - getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | 158 | + getApp().request.get('/api/weshop/marketing/giftbag/page', { |
133 | data: { | 159 | data: { |
134 | "storeId": that.getStorageID, //商家ID | 160 | "storeId": that.getStorageID, //商家ID |
135 | "userId": that.getUserID, //用户ID | 161 | "userId": that.getUserID, //用户ID |
@@ -153,30 +179,43 @@ Page({ | @@ -153,30 +179,43 @@ Page({ | ||
153 | }) | 179 | }) |
154 | } else { | 180 | } else { |
155 | var wareCard = that.wareCard; | 181 | var wareCard = that.wareCard; |
182 | + var is_read = 0; | ||
156 | if (wareCard.length < res.data.data.total) { | 183 | if (wareCard.length < res.data.data.total) { |
157 | for (var i = 0; i < res.data.data.pageData.length; i++) { | 184 | for (var i = 0; i < res.data.data.pageData.length; i++) { |
158 | wareCard.push(res.data.data.pageData[i]); | 185 | wareCard.push(res.data.data.pageData[i]); |
159 | } | 186 | } |
187 | + }else{ | ||
188 | + is_read:1 | ||
160 | } | 189 | } |
161 | _this.setData({ | 190 | _this.setData({ |
162 | - wareCard: wareCard | ||
163 | - }) | ||
164 | - _this.setData({ | 191 | + wareCard: wareCard, |
192 | + is_read: is_read, | ||
165 | loadingType: 0 | 193 | loadingType: 0 |
166 | }) | 194 | }) |
167 | 195 | ||
168 | } | 196 | } |
169 | } else { | 197 | } else { |
170 | - getApp().my_warnning(res.data.msg, 0, th); | 198 | + getApp().my_warnning(res.data.msg, 0, _this); |
171 | } | 199 | } |
172 | } | 200 | } |
173 | }) | 201 | }) |
174 | 202 | ||
175 | }, | 203 | }, |
176 | - //界面跳转 | ||
177 | - goto: function(e) { | 204 | + //销毁界面跳转 |
205 | + redirectTo: function(e) { | ||
206 | + var th = this; | ||
207 | + var url = e.currentTarget.dataset.url; | ||
208 | + //销毁跳转 | ||
209 | + wx.redirectTo({ | ||
210 | + url: url | ||
211 | + }); | ||
212 | + }, | ||
213 | + //不销毁界面跳转 | ||
214 | + navigateTo:function(e){ | ||
178 | var th = this; | 215 | var th = this; |
179 | var url = e.currentTarget.dataset.url; | 216 | var url = e.currentTarget.dataset.url; |
180 | - getApp().goto(url); | 217 | + wx.navigateTo({ |
218 | + url: url, | ||
219 | + }) | ||
181 | } | 220 | } |
182 | }) | 221 | }) |
183 | \ No newline at end of file | 222 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.wxml
1 | <view class="top_img"> | 1 | <view class="top_img"> |
2 | <view class="top_img"> | 2 | <view class="top_img"> |
3 | - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | 3 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image> |
4 | </view> | 4 | </view> |
5 | <view class="top_title"> | 5 | <view class="top_title"> |
6 | <view class="top_title_box"> | 6 | <view class="top_title_box"> |
@@ -8,18 +8,18 @@ | @@ -8,18 +8,18 @@ | ||
8 | </view> | 8 | </view> |
9 | <view class="top_title_box_S"></view> | 9 | <view class="top_title_box_S"></view> |
10 | <view class="top_title_box"> | 10 | <view class="top_title_box"> |
11 | - <a data-event-opts="{{[['tap',[['MyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="goto" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a> | 11 | + <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a> |
12 | </view> | 12 | </view> |
13 | </view> | 13 | </view> |
14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> | 14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
15 | <view class="content_box"> | 15 | <view class="content_box"> |
16 | - <view class="content_box_ware" bindtap="goto" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}"> | ||
17 | - <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img"> | ||
18 | - <image src="{{iurl+items.lbUrl}}"></image> | 16 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}"> |
17 | + <view class="content_box_img"> | ||
18 | + <image src="{{iurl+items.lbUrl}}" lazy-load="true"></image> | ||
19 | </view> | 19 | </view> |
20 | <view class="content_box_title"> | 20 | <view class="content_box_title"> |
21 | <view class="content_ware_title"> | 21 | <view class="content_ware_title"> |
22 | - <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{items.giftTitle}}</text> | 22 | + <text bindtap="__e">{{items.giftTitle}}</text> |
23 | </view> | 23 | </view> |
24 | <view class="content_ware_type"> | 24 | <view class="content_ware_type"> |
25 | <block wx:if="{{items.payMoney>0}}"> | 25 | <block wx:if="{{items.payMoney>0}}"> |
@@ -45,32 +45,32 @@ | @@ -45,32 +45,32 @@ | ||
45 | <text>{{"已售:"+items.giftQty+"件"}}</text> | 45 | <text>{{"已售:"+items.giftQty+"件"}}</text> |
46 | </view> | 46 | </view> |
47 | <block wx:if="{{items.payMoney>0}}"> | 47 | <block wx:if="{{items.payMoney>0}}"> |
48 | - <view class="box_button_buy" data-lbId="{{items.lbId}}" bindtap="GetBuyPrice"> | ||
49 | - <button data-event-opts="{{[['tap',[['GetBuyPrice',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}">立即购买{{items.lbId}}</button> | 48 | + <view class="box_button_buy" bindtap="GetBuyPrice" data-id="{{items.lbId}}"> |
49 | + <button>立即购买</button> | ||
50 | </view> | 50 | </view> |
51 | </block> | 51 | </block> |
52 | <block wx:if="{{items.payIntegral>0}}"> | 52 | <block wx:if="{{items.payIntegral>0}}"> |
53 | - <view class="box_button_dui" bindtap="GetBuyIntegral" data-lbId="{{items.lbId}}"> | ||
54 | - <button data-event-opts="{{[['tap',[['GetBuyIntegral',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}">立即兑换</button> | 53 | + <view class="box_button_dui" bindtap="GetBuyIntegral" data-id="{{items.lbId}}"> |
54 | + <button>立即兑换</button> | ||
55 | </view> | 55 | </view> |
56 | </block> | 56 | </block> |
57 | </view> | 57 | </view> |
58 | </view> | 58 | </view> |
59 | </block> | 59 | </block> |
60 | - <block wx:if="{{isEmpty==true}}"> | 60 | + <block wx:if="{{isEmpty==true && wareCard.length<2}}"> |
61 | <view class="foot_empty"> | 61 | <view class="foot_empty"> |
62 | <view> | 62 | <view> |
63 | - <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}"></image> | 63 | + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> |
64 | </view> | 64 | </view> |
65 | <view> | 65 | <view> |
66 | <text>当前暂无礼包</text> | 66 | <text>当前暂无礼包</text> |
67 | </view> | 67 | </view> |
68 | <view class="foot_empty_button"> | 68 | <view class="foot_empty_button"> |
69 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | 69 | + <text bindtap="__e">去获取</text> |
70 | </view> | 70 | </view> |
71 | </view> | 71 | </view> |
72 | </block> | 72 | </block> |
73 | - <view class="foot_box"> | 73 | + <view wx:if="{{is_read}}" class="foot_box"> |
74 | <text>———— 到底了 ————</text> | 74 | <text>———— 到底了 ————</text> |
75 | </view> | 75 | </view> |
76 | </view> | 76 | </view> |
pages/giftpack/giftpacklist/giftpacklist.wxml
1 | <view class="box data-v-3a5b7e36"> | 1 | <view class="box data-v-3a5b7e36"> |
2 | <view class="box_top data-v-3a5b7e36"> | 2 | <view class="box_top data-v-3a5b7e36"> |
3 | - <image src="{{giftImage}}" class="data-v-3a5b7e36"></image> | 3 | + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true"></image> |
4 | </view> | 4 | </view> |
5 | <view class="box_title data-v-3a5b7e36"> | 5 | <view class="box_title data-v-3a5b7e36"> |
6 | <view class="top_title data-v-3a5b7e36"> | 6 | <view class="top_title data-v-3a5b7e36"> |
7 | - <text class="data-v-3a5b7e36">{{giftTitle}}</text> | 7 | + <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> |
8 | </view> | 8 | </view> |
9 | <view class="top_time data-v-3a5b7e36"> | 9 | <view class="top_time data-v-3a5b7e36"> |
10 | <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | 10 | <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> |
@@ -40,19 +40,19 @@ | @@ -40,19 +40,19 @@ | ||
40 | <view class="box_ware_box data-v-3a5b7e36"> | 40 | <view class="box_ware_box data-v-3a5b7e36"> |
41 | <view class="box_ware_img data-v-3a5b7e36"> | 41 | <view class="box_ware_img data-v-3a5b7e36"> |
42 | <block wx:if="{{item.lbType==1}}"> | 42 | <block wx:if="{{item.lbType==1}}"> |
43 | - <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36"></image> | 43 | + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true"></image> |
44 | </block> | 44 | </block> |
45 | <block wx:if="{{item.lbType==2}}"> | 45 | <block wx:if="{{item.lbType==2}}"> |
46 | - <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36"></image> | 46 | + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> |
47 | </block> | 47 | </block> |
48 | <block wx:if="{{item.lbType==3}}"> | 48 | <block wx:if="{{item.lbType==3}}"> |
49 | - <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36"></image> | 49 | + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> |
50 | </block> | 50 | </block> |
51 | <block wx:if="{{item.lbType==4}}"> | 51 | <block wx:if="{{item.lbType==4}}"> |
52 | - <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36"></image> | 52 | + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> |
53 | </block> | 53 | </block> |
54 | <block wx:if="{{item.lbType==5}}"> | 54 | <block wx:if="{{item.lbType==5}}"> |
55 | - <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36"></image> | 55 | + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> |
56 | </block> | 56 | </block> |
57 | </view> | 57 | </view> |
58 | <view class="box_ware_item data-v-3a5b7e36"> | 58 | <view class="box_ware_item data-v-3a5b7e36"> |
@@ -67,13 +67,13 @@ | @@ -67,13 +67,13 @@ | ||
67 | </view> | 67 | </view> |
68 | <view class="box_ware_code data-v-3a5b7e36"> | 68 | <view class="box_ware_code data-v-3a5b7e36"> |
69 | <block wx:if="{{isBuy==0&item.lbType==1}}"> | 69 | <block wx:if="{{isBuy==0&item.lbType==1}}"> |
70 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | 70 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="__e" class="data-v-3a5b7e36"></image> |
71 | </block> | 71 | </block> |
72 | <block wx:if="{{isBuy==0&item.lbType==2}}"> | 72 | <block wx:if="{{isBuy==0&item.lbType==2}}"> |
73 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[0]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | 73 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image> |
74 | </block> | 74 | </block> |
75 | <block wx:if="{{isBuy==0&item.lbType==3}}"> | 75 | <block wx:if="{{isBuy==0&item.lbType==3}}"> |
76 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[1]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | 76 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image> |
77 | </block> | 77 | </block> |
78 | <block wx:if="{{isBuy==0&item.lbType>3}}"> | 78 | <block wx:if="{{isBuy==0&item.lbType>3}}"> |
79 | <text class="data-v-3a5b7e36">已自动到账</text> | 79 | <text class="data-v-3a5b7e36">已自动到账</text> |
@@ -96,22 +96,22 @@ | @@ -96,22 +96,22 @@ | ||
96 | <view class="foot_button data-v-3a5b7e36"> | 96 | <view class="foot_button data-v-3a5b7e36"> |
97 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | 97 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
98 | <view class="foot_button_left data-v-3a5b7e36"> | 98 | <view class="foot_button_left data-v-3a5b7e36"> |
99 | - <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | 99 | + <text bindtap="__e" class="data-v-3a5b7e36">立即购买</text> |
100 | </view> | 100 | </view> |
101 | </block> | 101 | </block> |
102 | <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | 102 | <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
103 | <view class="foot_button_right data-v-3a5b7e36"> | 103 | <view class="foot_button_right data-v-3a5b7e36"> |
104 | - <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | 104 | + <text bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> |
105 | </view> | 105 | </view> |
106 | </block> | 106 | </block> |
107 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | 107 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
108 | <view class="foot_button_buy data-v-3a5b7e36"> | 108 | <view class="foot_button_buy data-v-3a5b7e36"> |
109 | - <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | 109 | + <text bindtap="__e" class="data-v-3a5b7e36">立即购买</text> |
110 | </view> | 110 | </view> |
111 | </block> | 111 | </block> |
112 | <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> | 112 | <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> |
113 | <view class="foot_button_intalge data-v-3a5b7e36"> | 113 | <view class="foot_button_intalge data-v-3a5b7e36"> |
114 | - <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | 114 | + <text bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> |
115 | </view> | 115 | </view> |
116 | </block> | 116 | </block> |
117 | </view> | 117 | </view> |
@@ -119,7 +119,7 @@ | @@ -119,7 +119,7 @@ | ||
119 | <block wx:if="{{isBuy==0}}"> | 119 | <block wx:if="{{isBuy==0}}"> |
120 | <view class="foot_button data-v-3a5b7e36"> | 120 | <view class="foot_button data-v-3a5b7e36"> |
121 | <view class="foot_button_buy data-v-3a5b7e36"> | 121 | <view class="foot_button_buy data-v-3a5b7e36"> |
122 | - <text data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即使用</text> | 122 | + <text bindtap="__e" class="data-v-3a5b7e36">立即使用</text> |
123 | </view> | 123 | </view> |
124 | </view> | 124 | </view> |
125 | </block> | 125 | </block> |
pages/giftpack/mygiftpack/mygiftpack.js
@@ -18,7 +18,8 @@ Page({ | @@ -18,7 +18,8 @@ Page({ | ||
18 | contentdown: '加载更多', | 18 | contentdown: '加载更多', |
19 | contentrefresh: '加载中...', | 19 | contentrefresh: '加载中...', |
20 | contentnomore: '已加载全部' | 20 | contentnomore: '已加载全部' |
21 | - } | 21 | + }, |
22 | + is_resad:0,//数据是否全部加载完成 | ||
22 | }, | 23 | }, |
23 | 24 | ||
24 | onLoad: function(options) { | 25 | onLoad: function(options) { |
@@ -27,7 +28,7 @@ Page({ | @@ -27,7 +28,7 @@ Page({ | ||
27 | var th = this; | 28 | var th = this; |
28 | th.setData({ | 29 | th.setData({ |
29 | getStorageID: a.stoid, | 30 | getStorageID: a.stoid, |
30 | - getUserID: 5682130 | 31 | + getUserID: d.user_id |
31 | }) | 32 | }) |
32 | }, | 33 | }, |
33 | onShow: function() { | 34 | onShow: function() { |
@@ -100,27 +101,28 @@ Page({ | @@ -100,27 +101,28 @@ Page({ | ||
100 | loadingType: 2 | 101 | loadingType: 2 |
101 | }) | 102 | }) |
102 | } else { | 103 | } else { |
103 | - // console.log(_this.wareCard.length); | ||
104 | - // console.log(res.data.data.pageData.length); | ||
105 | var wareCard = that.wareCard; | 104 | var wareCard = that.wareCard; |
105 | + var is_resad = 0; | ||
106 | // if (_this.wareCard.length < res.data.data.pageData.length) { | 106 | // if (_this.wareCard.length < res.data.data.pageData.length) { |
107 | if (wareCard.length < res.data.data.total) { | 107 | if (wareCard.length < res.data.data.total) { |
108 | for (var i = 0; i < res.data.data.pageData.length; i++) { | 108 | for (var i = 0; i < res.data.data.pageData.length; i++) { |
109 | wareCard.push(res.data.data.pageData[i]); | 109 | wareCard.push(res.data.data.pageData[i]); |
110 | } | 110 | } |
111 | + }else{ | ||
112 | + is_resad=1 | ||
111 | } | 113 | } |
112 | _this.setData({ | 114 | _this.setData({ |
113 | - wareCard: wareCard | 115 | + wareCard: wareCard, |
116 | + is_resad: is_resad | ||
114 | }) | 117 | }) |
115 | 118 | ||
116 | // _this.loadingType = 0; | 119 | // _this.loadingType = 0; |
117 | _this.setData({ | 120 | _this.setData({ |
118 | loadingType: 0 | 121 | loadingType: 0 |
119 | }) | 122 | }) |
120 | - console.log(_this.wareCard); | ||
121 | } | 123 | } |
122 | } else { | 124 | } else { |
123 | - console.log(res.data.msg); | 125 | + |
124 | } | 126 | } |
125 | } | 127 | } |
126 | }); | 128 | }); |
@@ -146,10 +148,22 @@ Page({ | @@ -146,10 +148,22 @@ Page({ | ||
146 | var Time = new Date(TimeNum); | 148 | var Time = new Date(TimeNum); |
147 | return Time.getTime() / 1000; | 149 | return Time.getTime() / 1000; |
148 | }, | 150 | }, |
149 | - goto: function(e) { | 151 | + //销毁界面跳转 |
152 | + redirectTo: function (e) { | ||
150 | var th = this; | 153 | var th = this; |
151 | - var url = e.currentTarget.dataset.url; | ||
152 | - getApp().goto(url); | 154 | + var url = e.currentTarget.dataset.url; |
155 | + //销毁跳转 | ||
156 | + wx.redirectTo({ | ||
157 | + url: url | ||
158 | + }); | ||
159 | + }, | ||
160 | + //不销毁界面跳转 | ||
161 | + navigateTo: function (e) { | ||
162 | + var th = this; | ||
163 | + var url = e.currentTarget.dataset.url; | ||
164 | + wx.navigateTo({ | ||
165 | + url: url, | ||
166 | + }) | ||
153 | } | 167 | } |
154 | 168 | ||
155 | }); | 169 | }); |
156 | \ No newline at end of file | 170 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.wxml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | </view> | 5 | </view> |
6 | <view class="top_title"> | 6 | <view class="top_title"> |
7 | <view class="top_title_box"> | 7 | <view class="top_title_box"> |
8 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="goto" data-url="/pages/giftpack/buygiftpack/giftpackbuy">礼包列表</text> | 8 | + <text class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/buygiftpack/giftpackbuy">礼包列表</text> |
9 | </view> | 9 | </view> |
10 | <view class="top_title_box_S"></view> | 10 | <view class="top_title_box_S"></view> |
11 | <view class="top_title_box"> | 11 | <view class="top_title_box"> |
@@ -14,13 +14,12 @@ | @@ -14,13 +14,12 @@ | ||
14 | </view> | 14 | </view> |
15 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | 15 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
16 | <view class="content_box"> | 16 | <view class="content_box"> |
17 | - <view class="content_box_ware"> | ||
18 | - <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img" bindtap="__e"> | 17 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> |
18 | + <view class="content_box_img"> | ||
19 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> | 19 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> |
20 | - <image src="{{iurl+item.lbUrl}}"></image> | 20 | + <image src="{{iurl+item.lbUrl}}" lazy-load="true"></image> |
21 | <block wx:if="{{item.actType!=0}}"> | 21 | <block wx:if="{{item.actType!=0}}"> |
22 | <view class="{{[item.actType==1?'content_box_img_title content_box_img_ground1':item.actType==2?'content_box_img_title content_box_img_ground2':item.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> | 22 | <view class="{{[item.actType==1?'content_box_img_title content_box_img_ground1':item.actType==2?'content_box_img_title content_box_img_ground2':item.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> |
23 | - <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift01.png'}}"></image> --> | ||
24 | <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}"></image> | 23 | <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}"></image> |
25 | <!-- <block wx:if="{{item.$orig.actType==1}}"> --> | 24 | <!-- <block wx:if="{{item.$orig.actType==1}}"> --> |
26 | <block wx:if="{{item.actType==1}}"> | 25 | <block wx:if="{{item.actType==1}}"> |
@@ -43,7 +42,7 @@ | @@ -43,7 +42,7 @@ | ||
43 | </view> | 42 | </view> |
44 | <view class="content_box_title"> | 43 | <view class="content_box_title"> |
45 | <view class="content_ware_title"> | 44 | <view class="content_ware_title"> |
46 | - <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{item.giftTitle}}</text> | 45 | + <text bindtap="__e">{{item.giftTitle}}</text> |
47 | </view> | 46 | </view> |
48 | <view class="content_ware_type"> | 47 | <view class="content_ware_type"> |
49 | <block wx:if="{{item.actType==0&item.payMoney>0}}"> | 48 | <block wx:if="{{item.actType==0&item.payMoney>0}}"> |
@@ -83,26 +82,28 @@ | @@ -83,26 +82,28 @@ | ||
83 | </view> | 82 | </view> |
84 | </view> | 83 | </view> |
85 | <view class="content_box_button"> | 84 | <view class="content_box_button"> |
86 | - <button data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">立即使用</button> | 85 | + <button bindtap="__e">立即使用</button> |
87 | </view> | 86 | </view> |
88 | </view> | 87 | </view> |
89 | </block> | 88 | </block> |
90 | - <block wx:if="{{this.isEmpty==true}}"> | 89 | + <block wx:if="{{isEmpty==true}}"> |
91 | <view class="foot_empty"> | 90 | <view class="foot_empty"> |
92 | <view> | 91 | <view> |
93 | - <image src="../../static/img/gift07.png"></image> | 92 | + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> |
94 | </view> | 93 | </view> |
95 | <view> | 94 | <view> |
96 | <text>当前暂无礼包</text> | 95 | <text>当前暂无礼包</text> |
97 | </view> | 96 | </view> |
98 | <view class="foot_empty_button"> | 97 | <view class="foot_empty_button"> |
99 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | 98 | + <text bindtap="__e">去获取</text> |
100 | </view> | 99 | </view> |
101 | </view> | 100 | </view> |
102 | </block> | 101 | </block> |
102 | + <block wx:if="{{is_resad}}"> | ||
103 | <view class="foot_box"> | 103 | <view class="foot_box"> |
104 | <text>———— 到底了 ————</text> | 104 | <text>———— 到底了 ————</text> |
105 | </view> | 105 | </view> |
106 | + </block> | ||
106 | </view> | 107 | </view> |
107 | <!-- 引入提示组件 --> | 108 | <!-- 引入提示组件 --> |
108 | <warn id="warn"></warn> | 109 | <warn id="warn"></warn> |
pages/user/index/index.wxml
@@ -212,10 +212,14 @@ | @@ -212,10 +212,14 @@ | ||
212 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> | 212 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> |
213 | <view class="four-level-word">我的地址</view> | 213 | <view class="four-level-word">我的地址</view> |
214 | </view> | 214 | </view> |
215 | - <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_service" > | 215 | + <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_service" > |
216 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> | 216 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> |
217 | <view class="four-level-word">我的服务</view> | 217 | <view class="four-level-word">我的服务</view> |
218 | </view> | 218 | </view> |
219 | + <view class="item t-c" data-url="/pages/giftpack/buygiftpack/giftpackbuy" bindtap="goto"> | ||
220 | + <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> | ||
221 | + <view class="four-level-word">我的礼包</view> | ||
222 | + </view> | ||
219 | </view> | 223 | </view> |
220 | 224 | ||
221 | 225 |