Commit fdbbc44839430278c9efeda4a55be793116509b1

Authored by yvan.ni
1 parent c7baf5fb

优惠券的修改

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