|
@@ -8,14 +8,14 @@
|
|
|
<view class="page-wrap">
|
|
|
<view class="status-content">
|
|
|
<view class="status-item" v-if="orderDetails.status==0">
|
|
|
- <view class="text">请尽快完成付款,还剩 {{countdown}}</view>
|
|
|
- <view class="btn-wrap u-flex u-row-center">
|
|
|
+ <view class="text"><text v-if="countdown!='支付超期'"> 请尽快完成付款,还剩 </text>{{countdown}}</view>
|
|
|
+ <view class="btn-wrap u-flex u-row-center" v-if="countdown!='支付超期'">
|
|
|
<view class="btn cancel" @click="cancelOrder">取消订单</view>
|
|
|
<view class="btn" @click="gotoPay(orderDetails.id)">立即支付</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="status-item" v-else-if="orderDetails.status==3">
|
|
|
- <view class="text">距离演出开始,还剩 {{countdown}}</view>
|
|
|
+ <view class="text"><text v-if="countdown!='已超期'">距离演出开始,还剩 </text>{{countdown}}</view>
|
|
|
</view>
|
|
|
<view class="status-item" v-else>
|
|
|
<view class="text">{{orderDetails.status|filterOrderState}}</view>
|
|
@@ -130,17 +130,20 @@
|
|
|
loadingPage:true,
|
|
|
staticUrl:this.$commonConfig.staticUrl,
|
|
|
orderDetails:{},
|
|
|
- deadline: new Date("2023-12-01").getTime(), // 设置截止时间为某个日期的时间戳
|
|
|
+ deadline: null, // 设置截止时间为某个日期的时间戳
|
|
|
countdown: '', // 用于显示倒计时时间
|
|
|
+ // 状态(0待支付,2超时取消,3支付完成,待使用,4退款中,5己退款,6退款失败,7己使用,8己超期)
|
|
|
orderInfo:{
|
|
|
0:[{name:'需付金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'}],
|
|
|
1:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
2:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
- 3:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
+ 3:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
4:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
- 5:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
- 6:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
+ 5:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'},{name:'备注信息',key:'remark'}],
|
|
|
+ 6:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'},{name:'备注信息',key:'remark'}],
|
|
|
7:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
|
|
|
+ 8:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
|
|
|
+ 9:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
|
|
|
},
|
|
|
tipsArr:[
|
|
|
'1.请提前到达影院现场,找到自助取票机,打印纸质电影票,完成取票',
|
|
@@ -156,6 +159,7 @@
|
|
|
singleModalQr:false,
|
|
|
singleQrContent:{},
|
|
|
formerNotice:'',
|
|
|
+ countdownTimer:null,//订单倒计时
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -171,12 +175,18 @@
|
|
|
onUnload() {
|
|
|
// 页面离开时停止计时器
|
|
|
// clearInterval(this.timer)
|
|
|
+ clearInterval(this.countdownTimer)
|
|
|
},
|
|
|
mounted() {
|
|
|
// 每秒更新倒计时时间
|
|
|
- setInterval(() => {
|
|
|
+ this.countdownTimer = setInterval(() => {
|
|
|
const now = new Date().getTime();
|
|
|
const distance = this.deadline - now;
|
|
|
+ // console.log('distance',distance);
|
|
|
+ if(distance<0){
|
|
|
+ this.countdown = '支付超期';
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
// 计算倒计时时间,可以根据需求自定义显示方式
|
|
|
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
|
@@ -225,7 +235,11 @@
|
|
|
this.$u.api.orderDetails({id:id}).then(res=>{
|
|
|
this.loadingPage = false;
|
|
|
this.orderDetails = res.data
|
|
|
- this.deadline = new Date(`${res.data.performDate} ${res.data.performTimeStart}`).getTime();
|
|
|
+ if(res.data.status==0){//待支付
|
|
|
+ this.deadline = new Date(`${res.data.cancelDateTime}`).getTime();
|
|
|
+ }else if(res.data.status==3){//待使用
|
|
|
+ this.deadline = new Date(`${res.data.performDateTime}`).getTime();
|
|
|
+ }
|
|
|
if(res.data.status==3){
|
|
|
this.qrContent.qrcode = res.data.parentQrcodeNo;
|
|
|
this.qrContent.time = Date.now();
|
|
@@ -239,6 +253,8 @@
|
|
|
// console.log('this.deadline',this.deadline);
|
|
|
// console.log('orderDetails',JSON.parse(JSON.stringify(res.data)));
|
|
|
}).catch(err=>{
|
|
|
+ uni.$u.toast('获取数据失败,!请重试')
|
|
|
+ uni.navigateBack();
|
|
|
console.log('getOrderDetails',err);
|
|
|
})
|
|
|
},
|