|
...
|
...
|
@@ -18,8 +18,15 @@ Page({ |
|
|
|
},
|
|
|
|
certificateDetail:{},
|
|
|
|
exp_date:{},
|
|
|
|
is_time:false,//是否继续执行
|
|
|
|
timeList:[],//定时器列表
|
|
|
|
timers:null,
|
|
|
|
},
|
|
|
|
stopWaiting() {
|
|
|
|
for (var i = 0; i < this.data.timeList.length; i++) {
|
|
|
|
clearTimeout(this.data.timeList[i]); //清除了所有定时器
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
...
|
...
|
@@ -28,7 +35,7 @@ Page({ |
|
|
|
id:options.id
|
|
|
|
})
|
|
|
|
console.log(this.data.id);
|
|
|
|
this.getDetail()
|
|
|
|
this.getDetail('1')
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -44,7 +51,7 @@ Page({ |
|
|
|
onShow() {
|
|
|
|
|
|
|
|
},
|
|
|
|
getDetail(){
|
|
|
|
getDetail(num){
|
|
|
|
App.Activity.GetOrderRechargeByid({
|
|
|
|
id:this.data.id
|
|
|
|
}).then(res=>{
|
|
...
|
...
|
@@ -60,11 +67,53 @@ Page({ |
|
|
|
detail,
|
|
|
|
exp_date
|
|
|
|
})
|
|
|
|
console.log('detaildetail',{...this.data.detail});
|
|
|
|
console.log('exp_date',{...this.data.exp_date});
|
|
|
|
this.getSeller(res.data.sellerid)
|
|
|
|
console.log('is_examine',detail.is_examine);
|
|
|
|
if(detail.is_examine=='0'){
|
|
|
|
this.setData({
|
|
|
|
is_time:true,
|
|
|
|
detail,
|
|
|
|
exp_date
|
|
|
|
})
|
|
|
|
this.myUpdate()
|
|
|
|
}else{
|
|
|
|
this.setData({
|
|
|
|
is_time:false,
|
|
|
|
detail,
|
|
|
|
exp_date
|
|
|
|
})
|
|
|
|
wx.showModal({
|
|
|
|
title: '已核销',
|
|
|
|
cancelText:'取消',
|
|
|
|
confirmText:'朕知道了',
|
|
|
|
content: '核销成功!',
|
|
|
|
success: function (res) {
|
|
|
|
if (res.confirm) { //这里是点击了确定以后
|
|
|
|
wx.reLaunch({
|
|
|
|
url: '/pages/me/coupon_news'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(num=='1'){
|
|
|
|
this.getSeller(res.data.sellerid)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 轮询查询是否核销
|
|
|
|
myUpdate() {
|
|
|
|
var is_time = this.data.is_time//是否继续执行
|
|
|
|
console.log('is_time',is_time)
|
|
|
|
if (!is_time) {
|
|
|
|
console.log( '已核销!轮询停止')
|
|
|
|
clearTimeout(this.timers)
|
|
|
|
} else {
|
|
|
|
console.log("继续轮询");
|
|
|
|
this.timers= setTimeout(() => {
|
|
|
|
this.getDetail()
|
|
|
|
}, 5000);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 获取商家信息
|
|
|
|
getSeller(sid){
|
|
|
|
App.Customer.GetSellerDetail({
|
|
...
|
...
|
@@ -91,7 +140,7 @@ Page({ |
|
|
|
this.setData({
|
|
|
|
sellerObj
|
|
|
|
})
|
|
|
|
console.log({...sellerObj});
|
|
|
|
console.log('sellerObj',{...sellerObj});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 申请退款
|
|
...
|
...
|
@@ -110,14 +159,14 @@ Page({ |
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide() {
|
|
|
|
|
|
|
|
this.stopWaiting()
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload() {
|
|
|
|
|
|
|
|
this.stopWaiting()
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|