Commit fdbbc44839430278c9efeda4a55be793116509b1
1 parent
c7baf5fb
优惠券的修改
Showing
2 changed files
with
6 additions
and
3 deletions
pages/user/coupons/coupons.js
| ... | ... | @@ -57,6 +57,7 @@ Page({ |
| 57 | 57 | b_isuse_arr:null,//包邮券的已使用的内容 |
| 58 | 58 | |
| 59 | 59 | isloading:0, //正在加载中的代码 |
| 60 | + isset:0, | |
| 60 | 61 | }, |
| 61 | 62 | // 点击选中二维码 |
| 62 | 63 | click: function(e) { |
| ... | ... | @@ -235,7 +236,7 @@ Page({ |
| 235 | 236 | if(big_arr.length==0 && this.data.b_can_arr){ |
| 236 | 237 | big_arr=this.data.b_can_arr; |
| 237 | 238 | } |
| 238 | - init_num=this.data.b_can_arr.length; | |
| 239 | + if(this.data.b_can_arr) init_num=this.data.b_can_arr.length; | |
| 239 | 240 | |
| 240 | 241 | wx.showLoading(); th.data.isloading=1; |
| 241 | 242 | getApp().request.promiseGet("/api/weshop/users/listQuan", { |
| ... | ... | @@ -246,6 +247,8 @@ Page({ |
| 246 | 247 | var a = res.data; |
| 247 | 248 | val = a.data.total; |
| 248 | 249 | var details = a.data.pageData; |
| 250 | + | |
| 251 | + th.setData({isset:1}); | |
| 249 | 252 | |
| 250 | 253 | //没有找到优惠券的时候 |
| 251 | 254 | if (details.length == 0 && th.data.current_page==1) { |
| ... | ... | @@ -289,6 +292,7 @@ Page({ |
| 289 | 292 | }, |
| 290 | 293 | |
| 291 | 294 | overdue:function(){ |
| 295 | + | |
| 292 | 296 | if(this.data.isloading) return; |
| 293 | 297 | |
| 294 | 298 | var len = this.data.details.length; |
| ... | ... | @@ -348,7 +352,6 @@ Page({ |
| 348 | 352 | }); |
| 349 | 353 | |
| 350 | 354 | |
| 351 | - | |
| 352 | 355 | setTimeout(function () { |
| 353 | 356 | if(th.data.current_page==1) details=big_arr; |
| 354 | 357 | for (var i = 0; i < details.length; i++) { | ... | ... |
pages/user/coupons/coupons.wxml
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | (<text class='y_sz'>{{number}}</text>)</view> |
| 21 | 21 | </view> |
| 22 | 22 | |
| 23 | -<view class='noCoupons' wx:if='{{details.length==0}}'> | |
| 23 | +<view class='noCoupons' wx:if='{{details.length==0 && isset}}'> | |
| 24 | 24 | <image src='{{iurl}}miniapp/images/user/wqnone.png'></image> |
| 25 | 25 | <view class='no_wz1'>没有微券?</view> |
| 26 | 26 | <view class='no_wz2'>快去兑换吧</view> | ... | ... |