Showing
9 changed files
with
73 additions
and
20 deletions
| @@ -18,8 +18,15 @@ Page({ | @@ -18,8 +18,15 @@ Page({ | ||
| 18 | }, | 18 | }, |
| 19 | certificateDetail:{}, | 19 | certificateDetail:{}, |
| 20 | exp_date:{}, | 20 | exp_date:{}, |
| 21 | + is_time:false,//是否继续执行 | ||
| 22 | + timeList:[],//定时器列表 | ||
| 23 | + timers:null, | ||
| 24 | + }, | ||
| 25 | + stopWaiting() { | ||
| 26 | + for (var i = 0; i < this.data.timeList.length; i++) { | ||
| 27 | + clearTimeout(this.data.timeList[i]); //清除了所有定时器 | ||
| 28 | + } | ||
| 21 | }, | 29 | }, |
| 22 | - | ||
| 23 | /** | 30 | /** |
| 24 | * 生命周期函数--监听页面加载 | 31 | * 生命周期函数--监听页面加载 |
| 25 | */ | 32 | */ |
| @@ -28,7 +35,7 @@ Page({ | @@ -28,7 +35,7 @@ Page({ | ||
| 28 | id:options.id | 35 | id:options.id |
| 29 | }) | 36 | }) |
| 30 | console.log(this.data.id); | 37 | console.log(this.data.id); |
| 31 | - this.getDetail() | 38 | + this.getDetail('1') |
| 32 | }, | 39 | }, |
| 33 | 40 | ||
| 34 | /** | 41 | /** |
| @@ -44,7 +51,7 @@ Page({ | @@ -44,7 +51,7 @@ Page({ | ||
| 44 | onShow() { | 51 | onShow() { |
| 45 | 52 | ||
| 46 | }, | 53 | }, |
| 47 | - getDetail(){ | 54 | + getDetail(num){ |
| 48 | App.Activity.GetOrderRechargeByid({ | 55 | App.Activity.GetOrderRechargeByid({ |
| 49 | id:this.data.id | 56 | id:this.data.id |
| 50 | }).then(res=>{ | 57 | }).then(res=>{ |
| @@ -60,11 +67,53 @@ Page({ | @@ -60,11 +67,53 @@ Page({ | ||
| 60 | detail, | 67 | detail, |
| 61 | exp_date | 68 | exp_date |
| 62 | }) | 69 | }) |
| 63 | - console.log('detaildetail',{...this.data.detail}); | ||
| 64 | - console.log('exp_date',{...this.data.exp_date}); | ||
| 65 | - this.getSeller(res.data.sellerid) | 70 | + console.log('is_examine',detail.is_examine); |
| 71 | + if(detail.is_examine=='0'){ | ||
| 72 | + this.setData({ | ||
| 73 | + is_time:true, | ||
| 74 | + detail, | ||
| 75 | + exp_date | ||
| 76 | + }) | ||
| 77 | + this.myUpdate() | ||
| 78 | + }else{ | ||
| 79 | + this.setData({ | ||
| 80 | + is_time:false, | ||
| 81 | + detail, | ||
| 82 | + exp_date | ||
| 83 | + }) | ||
| 84 | + wx.showModal({ | ||
| 85 | + title: '已核销', | ||
| 86 | + cancelText:'取消', | ||
| 87 | + confirmText:'朕知道了', | ||
| 88 | + content: '核销成功!', | ||
| 89 | + success: function (res) { | ||
| 90 | + if (res.confirm) { //这里是点击了确定以后 | ||
| 91 | + wx.reLaunch({ | ||
| 92 | + url: '/pages/me/coupon_news' | ||
| 93 | + }) | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + }) | ||
| 97 | + } | ||
| 98 | + if(num=='1'){ | ||
| 99 | + this.getSeller(res.data.sellerid) | ||
| 100 | + } | ||
| 66 | }) | 101 | }) |
| 67 | }, | 102 | }, |
| 103 | + // 轮询查询是否核销 | ||
| 104 | + myUpdate() { | ||
| 105 | + var is_time = this.data.is_time//是否继续执行 | ||
| 106 | + console.log('is_time',is_time) | ||
| 107 | + if (!is_time) { | ||
| 108 | + console.log( '已核销!轮询停止') | ||
| 109 | + clearTimeout(this.timers) | ||
| 110 | + } else { | ||
| 111 | + console.log("继续轮询"); | ||
| 112 | + this.timers= setTimeout(() => { | ||
| 113 | + this.getDetail() | ||
| 114 | + }, 5000); | ||
| 115 | + } | ||
| 116 | + }, | ||
| 68 | // 获取商家信息 | 117 | // 获取商家信息 |
| 69 | getSeller(sid){ | 118 | getSeller(sid){ |
| 70 | App.Customer.GetSellerDetail({ | 119 | App.Customer.GetSellerDetail({ |
| @@ -91,7 +140,7 @@ Page({ | @@ -91,7 +140,7 @@ Page({ | ||
| 91 | this.setData({ | 140 | this.setData({ |
| 92 | sellerObj | 141 | sellerObj |
| 93 | }) | 142 | }) |
| 94 | - console.log({...sellerObj}); | 143 | + console.log('sellerObj',{...sellerObj}); |
| 95 | }) | 144 | }) |
| 96 | }, | 145 | }, |
| 97 | // 申请退款 | 146 | // 申请退款 |
| @@ -110,14 +159,14 @@ Page({ | @@ -110,14 +159,14 @@ Page({ | ||
| 110 | * 生命周期函数--监听页面隐藏 | 159 | * 生命周期函数--监听页面隐藏 |
| 111 | */ | 160 | */ |
| 112 | onHide() { | 161 | onHide() { |
| 113 | - | 162 | + this.stopWaiting() |
| 114 | }, | 163 | }, |
| 115 | 164 | ||
| 116 | /** | 165 | /** |
| 117 | * 生命周期函数--监听页面卸载 | 166 | * 生命周期函数--监听页面卸载 |
| 118 | */ | 167 | */ |
| 119 | onUnload() { | 168 | onUnload() { |
| 120 | - | 169 | + this.stopWaiting() |
| 121 | }, | 170 | }, |
| 122 | 171 | ||
| 123 | /** | 172 | /** |
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | <view class="lineBox"> | 12 | <view class="lineBox"> |
| 13 | <view class="line"></view> | 13 | <view class="line"></view> |
| 14 | <image wx:if="{{detail.is_examine=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG713.png" mode="" /> | 14 | <image wx:if="{{detail.is_examine=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG713.png" mode="" /> |
| 15 | - <image wx:if="{{detail.is_expire=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" /> | 15 | + <image wx:if="{{detail.is_expire=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" /> |
| 16 | </view> | 16 | </view> |
| 17 | <image class="qcode" src="{{detail.qrcode}}" mode="" /> | 17 | <image class="qcode" src="{{detail.qrcode}}" mode="" /> |
| 18 | <view class="orderNumber font28r"> | 18 | <view class="orderNumber font28r"> |
| @@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
| 20 | </view> | 20 | </view> |
| 21 | <view class="info info1"> | 21 | <view class="info info1"> |
| 22 | <view class="info_left font32r"> | 22 | <view class="info_left font32r"> |
| 23 | - 退款原因(至少选1项) | 23 | + 退款原因(最多选1项) |
| 24 | </view> | 24 | </view> |
| 25 | </view> | 25 | </view> |
| 26 | <radio-group bindchange="radioChange" class="checklist radio-label"> | 26 | <radio-group bindchange="radioChange" class="checklist radio-label"> |
| @@ -192,7 +192,7 @@ | @@ -192,7 +192,7 @@ | ||
| 192 | <view class="rubric rubric1"> | 192 | <view class="rubric rubric1"> |
| 193 | 特别优惠 | 193 | 特别优惠 |
| 194 | </view> | 194 | </view> |
| 195 | - <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1'}}"> | 195 | + <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1' && dataStr<(coupon_data.etime*1)}}"> |
| 196 | <view class="left"> | 196 | <view class="left"> |
| 197 | <view class="top"> | 197 | <view class="top"> |
| 198 | <text>{{coupon_data.aname}}</text> | 198 | <text>{{coupon_data.aname}}</text> |
| @@ -216,7 +216,8 @@ | @@ -216,7 +216,8 @@ | ||
| 216 | </view> | 216 | </view> |
| 217 | </navigator> | 217 | </navigator> |
| 218 | </view> | 218 | </view> |
| 219 | - <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data}}"> | 219 | + <!-- 当前日期要大于限制结束日期 --> |
| 220 | + <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> | ||
| 220 | <view class="left"> | 221 | <view class="left"> |
| 221 | <view class="top"> | 222 | <view class="top"> |
| 222 | <text>{{recharge_data.rname}}</text> | 223 | <text>{{recharge_data.rname}}</text> |
| @@ -21,11 +21,13 @@ Page({ | @@ -21,11 +21,13 @@ Page({ | ||
| 21 | let list=this.data.list; | 21 | let list=this.data.list; |
| 22 | list=list.concat(res.data) | 22 | list=list.concat(res.data) |
| 23 | if(res.data.length<this.size){ | 23 | if(res.data.length<this.size){ |
| 24 | - this.hasMore=false | 24 | + this.hasMore=false |
| 25 | } | 25 | } |
| 26 | - let date=Date.now()*1; | 26 | + let date=Date.now()*1/1000; |
| 27 | list.forEach(item=>{ | 27 | list.forEach(item=>{ |
| 28 | - if(date>item.etime){ | 28 | + item.is_expire='0' |
| 29 | + let etime=item.etime*1 | ||
| 30 | + if(date<etime){ | ||
| 29 | item.is_expire='0'; | 31 | item.is_expire='0'; |
| 30 | }else{ | 32 | }else{ |
| 31 | item.is_expire='1'; | 33 | item.is_expire='1'; |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | <image wx:if="{{item.is_examine=='1'}}" src="https://qn.colorcun.com/WechatIMG713.png" class="imgs1" mode="" /> | 14 | <image wx:if="{{item.is_examine=='1'}}" src="https://qn.colorcun.com/WechatIMG713.png" class="imgs1" mode="" /> |
| 15 | <image wx:if="{{item.is_expire=='1'}}" src="https://qn.colorcun.com/WechatIMG714.png" class="imgs1" mode="" /> | 15 | <image wx:if="{{item.is_expire=='1'}}" src="https://qn.colorcun.com/WechatIMG714.png" class="imgs1" mode="" /> |
| 16 | <button wx:if="{{item.is_examine=='1' || (item.is_expire=='0'&& item.is_examine=='0')}}" class="flex-cc card-info font30r font-bold smooth">{{item.is_examine=='1' ? '去评价' : (item.is_expire=='0'&& item.is_examine=='0') ?'去使用': ''}}</button> | 16 | <button wx:if="{{item.is_examine=='1' || (item.is_expire=='0'&& item.is_examine=='0')}}" class="flex-cc card-info font30r font-bold smooth">{{item.is_examine=='1' ? '去评价' : (item.is_expire=='0'&& item.is_examine=='0') ?'去使用': ''}}</button> |
| 17 | - <view class="font24r texts smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}}-{{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view> | 17 | + <view class="font24r texts smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}} 至 {{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view> |
| 18 | </view> | 18 | </view> |
| 19 | </block> | 19 | </block> |
| 20 | <block wx:else> | 20 | <block wx:else> |
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | </view> | 17 | </view> |
| 18 | <view class="bottom flex-lr"> | 18 | <view class="bottom flex-lr"> |
| 19 | <view class="content flex-cc"> | 19 | <view class="content flex-cc"> |
| 20 | - <image src="https://xt04.colorcun.com/NewRecharge/order/9.png" mode="" /> | 20 | + <image src="https://qn.colorcun.com/WechatIMG3.png" mode="" /> |
| 21 | <view class="texts"> | 21 | <view class="texts"> |
| 22 | 订单实时提醒 | 22 | 订单实时提醒 |
| 23 | </view> | 23 | </view> |
| @@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
| 29 | </view> | 29 | </view> |
| 30 | </view> | 30 | </view> |
| 31 | <view class="content flex-cc"> | 31 | <view class="content flex-cc"> |
| 32 | - <image src="https://xt04.colorcun.com/NewRecharge/order/9.png" mode="" /> | 32 | + <image src="https://qn.colorcun.com/WechatIMG4.png" mode="" /> |
| 33 | <view class="texts"> | 33 | <view class="texts"> |
| 34 | 订单实时提醒 | 34 | 订单实时提醒 |
| 35 | </view> | 35 | </view> |
-
Please register or login to post a comment