Commit 8e8e1400ef6fd423904dc90fe51a10cf26381f72

Authored by yiren
1 parent b6a46925

核销后通知,邀请函显示优惠券和充值限制

... ... @@ -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()
},
/**
... ...
... ... @@ -12,7 +12,7 @@
<view class="lineBox">
<view class="line"></view>
<image wx:if="{{detail.is_examine=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG713.png" mode="" />
<image wx:if="{{detail.is_expire=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" />
<image wx:if="{{detail.is_expire=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" />
</view>
<image class="qcode" src="{{detail.qrcode}}" mode="" />
<view class="orderNumber font28r">
... ...
... ... @@ -20,7 +20,7 @@
</view>
<view class="info info1">
<view class="info_left font32r">
退款原因(至少选1项)
退款原因(最多选1项)
</view>
</view>
<radio-group bindchange="radioChange" class="checklist radio-label">
... ...
... ... @@ -39,6 +39,7 @@ Page({
priceInfo:'',
scoreInfo:'',
discount:'',
dataStr:Date.now()*1/1000,
},
/**
* 生命周期函数--监听页面加载
... ...
... ... @@ -192,7 +192,7 @@
<view class="rubric rubric1">
特别优惠
</view>
<view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1'}}">
<view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1' && dataStr<(coupon_data.etime*1)}}">
<view class="left">
<view class="top">
<text>{{coupon_data.aname}}</text>
... ... @@ -216,7 +216,8 @@
</view>
</navigator>
</view>
<view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data}}">
<!-- 当前日期要大于限制结束日期 -->
<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)))}}">
<view class="left">
<view class="top">
<text>{{recharge_data.rname}}</text>
... ...
... ... @@ -21,11 +21,13 @@ Page({
let list=this.data.list;
list=list.concat(res.data)
if(res.data.length<this.size){
this.hasMore=false
this.hasMore=false
}
let date=Date.now()*1;
let date=Date.now()*1/1000;
list.forEach(item=>{
if(date>item.etime){
item.is_expire='0'
let etime=item.etime*1
if(date<etime){
item.is_expire='0';
}else{
item.is_expire='1';
... ...
... ... @@ -14,7 +14,7 @@
<image wx:if="{{item.is_examine=='1'}}" src="https://qn.colorcun.com/WechatIMG713.png" class="imgs1" mode="" />
<image wx:if="{{item.is_expire=='1'}}" src="https://qn.colorcun.com/WechatIMG714.png" class="imgs1" mode="" />
<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>
<view class="font24r texts smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}}-{{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view>
<view class="font24r texts smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}} 至 {{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view>
</view>
</block>
<block wx:else>
... ...
... ... @@ -17,7 +17,7 @@
</view>
<view class="bottom flex-lr">
<view class="content flex-cc">
<image src="https://xt04.colorcun.com/NewRecharge/order/9.png" mode="" />
<image src="https://qn.colorcun.com/WechatIMG3.png" mode="" />
<view class="texts">
订单实时提醒
</view>
... ... @@ -29,7 +29,7 @@
</view>
</view>
<view class="content flex-cc">
<image src="https://xt04.colorcun.com/NewRecharge/order/9.png" mode="" />
<image src="https://qn.colorcun.com/WechatIMG4.png" mode="" />
<view class="texts">
订单实时提醒
</view>
... ...
... ... @@ -57,7 +57,7 @@ page {
.bottom image {
width: 132rpx;
height: 132rpx;
margin-bottom: 60rpx;
margin-bottom: 40rpx;
}
.left {
... ...