From d7ad4f31d11d07a74814b0e177891c6b71442f20 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期一, 23 九月 2024 10:04:40 +0800
Subject: [PATCH] update

---
 pages/order/order-detail.vue |   76 ++++++++++++++++++++------------------
 1 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index 4340a8b..2ee8c07 100644
--- a/pages/order/order-detail.vue
+++ b/pages/order/order-detail.vue
@@ -41,45 +41,49 @@
 					pictureList: []
 				}
 				this.showSales = options.showsales && true || false
-				this.timer = setInterval(() => {
-					//倒计时
-					var nowdate = new Date().getTime() - 1000 * 60 * 5
-					var change = false
 
-					//计算倒计时
-					var diff = new Date(this.dto.createTime).getTime() - nowdate
-					console.log('diff', diff)
-					if (diff <= 2000 && true) {
-						//超过了5分钟
-						this.dto.statusBackend = 'CANCEL'
-						this.dto.statusBackendStr = '已取消'
-						this.dto.status = 'CANCEL'
-						this.dto.statusStr = '已取消'
+				if (this.dto.statusBackend === 'PENDING' || this.dto.status === 'PENDING') {
 
-						this.dto.bctime = ''
-						// console.log('change cancel', this.dto)
-						change = true
-						clearInterval(this.timer)
-						this.timer = undefined
-					} else {
-						//相差
-						var alltime = parseInt(diff / 1000)
-						var tt = 0
-						if (alltime > 60) {
-							tt = alltime - parseInt(alltime / 60) * 60
+
+					this.timer = setInterval(() => {
+						//倒计时
+						var nowdate = new Date().getTime() - 1000 * 60 * 5
+						var change = false
+
+						//计算倒计时
+						var diff = new Date(this.dto.createTime).getTime() - nowdate
+						console.log('diff', diff)
+						if (diff <= 2000 && true) {
+							//超过了5分钟
+							this.dto.statusBackend = 'CANCEL'
+							this.dto.statusBackendStr = '已取消'
+							this.dto.status = 'CANCEL'
+							this.dto.statusStr = '已取消'
+
+							this.dto.bctime = ''
+							// console.log('change cancel', this.dto)
+							change = true
+							clearInterval(this.timer)
+							this.timer = undefined
 						} else {
-							tt = alltime
+							//相差
+							var alltime = parseInt(diff / 1000)
+							var tt = 0
+							if (alltime > 60) {
+								tt = alltime - parseInt(alltime / 60) * 60
+							} else {
+								tt = alltime
+							}
+							this.dto.bctime = `0${parseInt(alltime / 60)}:${tt<10?'0':''}${tt}`
+							change = true
+
 						}
-						this.dto.bctime = `0${parseInt(alltime / 60)}:${tt<10?'0':''}${tt}`
-						change = true
-
-					}
 
 
-					if (change)
-						this.$forceUpdate()
-				}, 1000)
-
+						if (change)
+							this.$forceUpdate()
+					}, 1000)
+				}
 
 
 			}
@@ -562,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>
@@ -609,8 +613,8 @@
 		</view>
 		<view class="info-container bg-white br-4 m-t-12" v-if="!showSales">
 			<view class="form-item flex">
-				<view class="label">订单金额:</view>
-				<view class="value m-l-a m-r-0 text-right">+{{ dto.totalAmount || '0' }}</view>
+				<view class="label">商品金额:</view>
+				<view class="value m-l-a m-r-0 text-right">+{{ dto.flowerAmount || '0' }}</view>
 			</view>
 			<view class="form-item flex">
 				<view class="label">运费:</view>

--
Gitblit v1.9.3