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 | 18 | contentdown: '加载更多', |
| 19 | 19 | contentrefresh: '加载中...', |
| 20 | 20 | contentnomore: '已加载全部' |
| 21 | - } | |
| 21 | + }, | |
| 22 | + is_read:0,//礼包列表是否全部加载完毕 | |
| 22 | 23 | }, |
| 23 | 24 | onLoad: function(options) { |
| 24 | 25 | var th = this; |
| 26 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
| 27 | + my_confirm.open_cancel(0); | |
| 25 | 28 | th.setData({ |
| 26 | 29 | getStorageID: a.stoid, |
| 27 | - getUserID: 5682130 | |
| 30 | + getUserID: d.user_id | |
| 28 | 31 | }) |
| 29 | 32 | }, |
| 30 | 33 | onShow: function() { |
| ... | ... | @@ -40,7 +43,7 @@ Page({ |
| 40 | 43 | GetBuyPrice: function(e) { |
| 41 | 44 | var that = this.data; |
| 42 | 45 | var th = this; |
| 43 | - var lbId = e.currentTarget.dataset.lbId;//活动id | |
| 46 | + var id = e.currentTarget.dataset.id;//活动id | |
| 44 | 47 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 45 | 48 | my_confirm.open( |
| 46 | 49 | "是否确定购买该礼包", |
| ... | ... | @@ -50,11 +53,12 @@ Page({ |
| 50 | 53 | my_confirm.open_cancel(0); |
| 51 | 54 | }, |
| 52 | 55 | function() { |
| 56 | + my_confirm.open_cancel(0); | |
| 53 | 57 | var json = { |
| 54 | 58 | "actId": '', //活动Id |
| 55 | 59 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| 56 | 60 | "buyType": '2', //1=积分兑换 2=余额购买 |
| 57 | - "lbId": lbId, //礼包Id | |
| 61 | + "lbId": id, //礼包Id | |
| 58 | 62 | "storeId": that.getStorageID, //商家Id |
| 59 | 63 | "userId": that.getUserID, //用户ID |
| 60 | 64 | "buyFrom": 2 |
| ... | ... | @@ -70,7 +74,20 @@ Page({ |
| 70 | 74 | }, // 设置请求的 header |
| 71 | 75 | success: function (res) { |
| 72 | 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 | 91 | } else { |
| 75 | 92 | getApp().my_warnning(res.data.msg, 0, th); |
| 76 | 93 | } |
| ... | ... | @@ -87,7 +104,7 @@ Page({ |
| 87 | 104 | GetBuyIntegral: function(e) { |
| 88 | 105 | var that = this.data; |
| 89 | 106 | var th = this; |
| 90 | - var lbId = e.currentTarget.dataset.lbId;//活动id | |
| 107 | + var id = e.currentTarget.dataset.id;//活动id | |
| 91 | 108 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 92 | 109 | my_confirm.open( |
| 93 | 110 | "是否确定兑换该礼包", |
| ... | ... | @@ -97,16 +114,25 @@ Page({ |
| 97 | 114 | my_confirm.open_cancel(0); |
| 98 | 115 | }, |
| 99 | 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 | 136 | if (res.data.code == 0) { |
| 111 | 137 | getApp().my_warnning("兑换成功!", 1, th); |
| 112 | 138 | } else { |
| ... | ... | @@ -129,7 +155,7 @@ Page({ |
| 129 | 155 | _this.setData({ |
| 130 | 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 | 159 | data: { |
| 134 | 160 | "storeId": that.getStorageID, //商家ID |
| 135 | 161 | "userId": that.getUserID, //用户ID |
| ... | ... | @@ -153,30 +179,43 @@ Page({ |
| 153 | 179 | }) |
| 154 | 180 | } else { |
| 155 | 181 | var wareCard = that.wareCard; |
| 182 | + var is_read = 0; | |
| 156 | 183 | if (wareCard.length < res.data.data.total) { |
| 157 | 184 | for (var i = 0; i < res.data.data.pageData.length; i++) { |
| 158 | 185 | wareCard.push(res.data.data.pageData[i]); |
| 159 | 186 | } |
| 187 | + }else{ | |
| 188 | + is_read:1 | |
| 160 | 189 | } |
| 161 | 190 | _this.setData({ |
| 162 | - wareCard: wareCard | |
| 163 | - }) | |
| 164 | - _this.setData({ | |
| 191 | + wareCard: wareCard, | |
| 192 | + is_read: is_read, | |
| 165 | 193 | loadingType: 0 |
| 166 | 194 | }) |
| 167 | 195 | |
| 168 | 196 | } |
| 169 | 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 | 215 | var th = this; |
| 179 | 216 | var url = e.currentTarget.dataset.url; |
| 180 | - getApp().goto(url); | |
| 217 | + wx.navigateTo({ | |
| 218 | + url: url, | |
| 219 | + }) | |
| 181 | 220 | } |
| 182 | 221 | }) |
| 183 | 222 | \ No newline at end of file | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.wxml
| 1 | 1 | <view class="top_img"> |
| 2 | 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 | 4 | </view> |
| 5 | 5 | <view class="top_title"> |
| 6 | 6 | <view class="top_title_box"> |
| ... | ... | @@ -8,18 +8,18 @@ |
| 8 | 8 | </view> |
| 9 | 9 | <view class="top_title_box_S"></view> |
| 10 | 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 | 12 | </view> |
| 13 | 13 | </view> |
| 14 | 14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
| 15 | 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 | 19 | </view> |
| 20 | 20 | <view class="content_box_title"> |
| 21 | 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 | 23 | </view> |
| 24 | 24 | <view class="content_ware_type"> |
| 25 | 25 | <block wx:if="{{items.payMoney>0}}"> |
| ... | ... | @@ -45,32 +45,32 @@ |
| 45 | 45 | <text>{{"已售:"+items.giftQty+"件"}}</text> |
| 46 | 46 | </view> |
| 47 | 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 | 50 | </view> |
| 51 | 51 | </block> |
| 52 | 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 | 55 | </view> |
| 56 | 56 | </block> |
| 57 | 57 | </view> |
| 58 | 58 | </view> |
| 59 | 59 | </block> |
| 60 | - <block wx:if="{{isEmpty==true}}"> | |
| 60 | + <block wx:if="{{isEmpty==true && wareCard.length<2}}"> | |
| 61 | 61 | <view class="foot_empty"> |
| 62 | 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 | 64 | </view> |
| 65 | 65 | <view> |
| 66 | 66 | <text>当前暂无礼包</text> |
| 67 | 67 | </view> |
| 68 | 68 | <view class="foot_empty_button"> |
| 69 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | |
| 69 | + <text bindtap="__e">去获取</text> | |
| 70 | 70 | </view> |
| 71 | 71 | </view> |
| 72 | 72 | </block> |
| 73 | - <view class="foot_box"> | |
| 73 | + <view wx:if="{{is_read}}" class="foot_box"> | |
| 74 | 74 | <text>———— 到底了 ————</text> |
| 75 | 75 | </view> |
| 76 | 76 | </view> | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
| 1 | 1 | <view class="box data-v-3a5b7e36"> |
| 2 | 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 | 4 | </view> |
| 5 | 5 | <view class="box_title data-v-3a5b7e36"> |
| 6 | 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 | 8 | </view> |
| 9 | 9 | <view class="top_time data-v-3a5b7e36"> |
| 10 | 10 | <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> |
| ... | ... | @@ -40,19 +40,19 @@ |
| 40 | 40 | <view class="box_ware_box data-v-3a5b7e36"> |
| 41 | 41 | <view class="box_ware_img data-v-3a5b7e36"> |
| 42 | 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 | 44 | </block> |
| 45 | 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 | 47 | </block> |
| 48 | 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 | 50 | </block> |
| 51 | 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 | 53 | </block> |
| 54 | 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 | 56 | </block> |
| 57 | 57 | </view> |
| 58 | 58 | <view class="box_ware_item data-v-3a5b7e36"> |
| ... | ... | @@ -67,13 +67,13 @@ |
| 67 | 67 | </view> |
| 68 | 68 | <view class="box_ware_code data-v-3a5b7e36"> |
| 69 | 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 | 71 | </block> |
| 72 | 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 | 74 | </block> |
| 75 | 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 | 77 | </block> |
| 78 | 78 | <block wx:if="{{isBuy==0&item.lbType>3}}"> |
| 79 | 79 | <text class="data-v-3a5b7e36">已自动到账</text> |
| ... | ... | @@ -96,22 +96,22 @@ |
| 96 | 96 | <view class="foot_button data-v-3a5b7e36"> |
| 97 | 97 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
| 98 | 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 | 100 | </view> |
| 101 | 101 | </block> |
| 102 | 102 | <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
| 103 | 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 | 105 | </view> |
| 106 | 106 | </block> |
| 107 | 107 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
| 108 | 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 | 110 | </view> |
| 111 | 111 | </block> |
| 112 | 112 | <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> |
| 113 | 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 | 115 | </view> |
| 116 | 116 | </block> |
| 117 | 117 | </view> |
| ... | ... | @@ -119,7 +119,7 @@ |
| 119 | 119 | <block wx:if="{{isBuy==0}}"> |
| 120 | 120 | <view class="foot_button data-v-3a5b7e36"> |
| 121 | 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 | 123 | </view> |
| 124 | 124 | </view> |
| 125 | 125 | </block> | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
| ... | ... | @@ -18,7 +18,8 @@ Page({ |
| 18 | 18 | contentdown: '加载更多', |
| 19 | 19 | contentrefresh: '加载中...', |
| 20 | 20 | contentnomore: '已加载全部' |
| 21 | - } | |
| 21 | + }, | |
| 22 | + is_resad:0,//数据是否全部加载完成 | |
| 22 | 23 | }, |
| 23 | 24 | |
| 24 | 25 | onLoad: function(options) { |
| ... | ... | @@ -27,7 +28,7 @@ Page({ |
| 27 | 28 | var th = this; |
| 28 | 29 | th.setData({ |
| 29 | 30 | getStorageID: a.stoid, |
| 30 | - getUserID: 5682130 | |
| 31 | + getUserID: d.user_id | |
| 31 | 32 | }) |
| 32 | 33 | }, |
| 33 | 34 | onShow: function() { |
| ... | ... | @@ -100,27 +101,28 @@ Page({ |
| 100 | 101 | loadingType: 2 |
| 101 | 102 | }) |
| 102 | 103 | } else { |
| 103 | - // console.log(_this.wareCard.length); | |
| 104 | - // console.log(res.data.data.pageData.length); | |
| 105 | 104 | var wareCard = that.wareCard; |
| 105 | + var is_resad = 0; | |
| 106 | 106 | // if (_this.wareCard.length < res.data.data.pageData.length) { |
| 107 | 107 | if (wareCard.length < res.data.data.total) { |
| 108 | 108 | for (var i = 0; i < res.data.data.pageData.length; i++) { |
| 109 | 109 | wareCard.push(res.data.data.pageData[i]); |
| 110 | 110 | } |
| 111 | + }else{ | |
| 112 | + is_resad=1 | |
| 111 | 113 | } |
| 112 | 114 | _this.setData({ |
| 113 | - wareCard: wareCard | |
| 115 | + wareCard: wareCard, | |
| 116 | + is_resad: is_resad | |
| 114 | 117 | }) |
| 115 | 118 | |
| 116 | 119 | // _this.loadingType = 0; |
| 117 | 120 | _this.setData({ |
| 118 | 121 | loadingType: 0 |
| 119 | 122 | }) |
| 120 | - console.log(_this.wareCard); | |
| 121 | 123 | } |
| 122 | 124 | } else { |
| 123 | - console.log(res.data.msg); | |
| 125 | + | |
| 124 | 126 | } |
| 125 | 127 | } |
| 126 | 128 | }); |
| ... | ... | @@ -146,10 +148,22 @@ Page({ |
| 146 | 148 | var Time = new Date(TimeNum); |
| 147 | 149 | return Time.getTime() / 1000; |
| 148 | 150 | }, |
| 149 | - goto: function(e) { | |
| 151 | + //销毁界面跳转 | |
| 152 | + redirectTo: function (e) { | |
| 150 | 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 | 170 | \ No newline at end of file | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.wxml
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | </view> |
| 6 | 6 | <view class="top_title"> |
| 7 | 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 | 9 | </view> |
| 10 | 10 | <view class="top_title_box_S"></view> |
| 11 | 11 | <view class="top_title_box"> |
| ... | ... | @@ -14,13 +14,12 @@ |
| 14 | 14 | </view> |
| 15 | 15 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| 16 | 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 | 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 | 21 | <block wx:if="{{item.actType!=0}}"> |
| 22 | 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 | 23 | <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}"></image> |
| 25 | 24 | <!-- <block wx:if="{{item.$orig.actType==1}}"> --> |
| 26 | 25 | <block wx:if="{{item.actType==1}}"> |
| ... | ... | @@ -43,7 +42,7 @@ |
| 43 | 42 | </view> |
| 44 | 43 | <view class="content_box_title"> |
| 45 | 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 | 46 | </view> |
| 48 | 47 | <view class="content_ware_type"> |
| 49 | 48 | <block wx:if="{{item.actType==0&item.payMoney>0}}"> |
| ... | ... | @@ -83,26 +82,28 @@ |
| 83 | 82 | </view> |
| 84 | 83 | </view> |
| 85 | 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 | 86 | </view> |
| 88 | 87 | </view> |
| 89 | 88 | </block> |
| 90 | - <block wx:if="{{this.isEmpty==true}}"> | |
| 89 | + <block wx:if="{{isEmpty==true}}"> | |
| 91 | 90 | <view class="foot_empty"> |
| 92 | 91 | <view> |
| 93 | - <image src="../../static/img/gift07.png"></image> | |
| 92 | + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> | |
| 94 | 93 | </view> |
| 95 | 94 | <view> |
| 96 | 95 | <text>当前暂无礼包</text> |
| 97 | 96 | </view> |
| 98 | 97 | <view class="foot_empty_button"> |
| 99 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | |
| 98 | + <text bindtap="__e">去获取</text> | |
| 100 | 99 | </view> |
| 101 | 100 | </view> |
| 102 | 101 | </block> |
| 102 | + <block wx:if="{{is_resad}}"> | |
| 103 | 103 | <view class="foot_box"> |
| 104 | 104 | <text>———— 到底了 ————</text> |
| 105 | 105 | </view> |
| 106 | + </block> | |
| 106 | 107 | </view> |
| 107 | 108 | <!-- 引入提示组件 --> |
| 108 | 109 | <warn id="warn"></warn> | ... | ... |
pages/user/index/index.wxml
| ... | ... | @@ -212,10 +212,14 @@ |
| 212 | 212 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> |
| 213 | 213 | <view class="four-level-word">我的地址</view> |
| 214 | 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 | 216 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> |
| 217 | 217 | <view class="four-level-word">我的服务</view> |
| 218 | 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 | 223 | </view> |
| 220 | 224 | |
| 221 | 225 | ... | ... |