From eff85736b74d685de612154b0fe0cb064f293c0c Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期五, 20 九月 2024 23:43:31 +0800 Subject: [PATCH] 1 --- pages/order/order-detail.vue | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue index 5526c16..8feb5ab 100644 --- a/pages/order/order-detail.vue +++ b/pages/order/order-detail.vue @@ -42,8 +42,9 @@ } this.showSales = options.showsales && true || false + if (this.dto.statusBackend === 'PENDING' || this.dto.status === 'PENDING') { - if (this.dto.statusBackend === 'PENDING') { + this.timer = setInterval(() => { //倒计时 var nowdate = new Date().getTime() - 1000 * 60 * 5 @@ -93,7 +94,7 @@ } }).then(res => { var data = res.data; - + let tmpData = data.map(item => ({ value: item.value, label: item.label @@ -136,6 +137,22 @@ // description: 'descriptiondescriptiondescriptiondescriptiondescription' // }] } + if (this.dto.statusBackend === 'PENDING') { + //先判断要不要字节变成已取消 + var nowdate = new Date().getTime() - 1000 * 60 * 5 + var diff = new Date(this.dto.createTime).getTime() - nowdate + + if (diff <= 2000 && true) { + //超过了5分钟 + this.dto.statusBackend = 'CANCEL' + this.dto.statusBackendStr = '已取消' + this.dto.status = 'CANCEL' + this.dto.statusStr = '已取消' + this.dto.bctime = '' + this.$forceUpdate() + } + } + } }, async callTel() { @@ -549,7 +566,7 @@ </view> <view class="form-item"> <view class="label">下单日期:</view> - <view class="value">{{ dto.paymentTime || '-' }}</view> + <view class="value">{{ dto.createTime || '-' }}</view> </view> <view class="form-item" v-if="dto.cancelTime&&(dto.status==='CANCEL'||dto.status==='REFUND')"> <view class="label">取消时间:</view> -- Gitblit v1.9.3