From 1ad1737e00e5f6b4d1aa59747cbe36db3138fbd6 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期四, 19 九月 2024 16:15:27 +0800
Subject: [PATCH] 1
---
pages/order/order-detail.vue | 121 ++++++++++++++++++++++++----------------
1 files changed, 72 insertions(+), 49 deletions(-)
diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index c93affa..4340a8b 100644
--- a/pages/order/order-detail.vue
+++ b/pages/order/order-detail.vue
@@ -15,19 +15,7 @@
type: 'partner',
// #endif
salesTypeDef: 0,
- salesTypeList: [{
- label: '请选择售后类型',
- value: '',
- },
- {
- label: '换货',
- value: 'barters',
- },
- {
- label: '退货',
- value: 'returns',
- },
- ],
+ salesTypeList: [],
};
},
onUnload() {
@@ -53,51 +41,70 @@
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.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
+ 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
} else {
- //相差
- 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
-
+ tt = alltime
}
+ this.dto.bctime = `0${parseInt(alltime / 60)}:${tt<10?'0':''}${tt}`
+ change = true
+
+ }
- if (change)
- this.$forceUpdate()
- }, 1000)
- }
+ if (change)
+ this.$forceUpdate()
+ }, 1000)
+
}
+
+ this.$http.request('get', '/api/code/value', {
+ params: {
+ type: 'after_sale_type'
+ }
+ }).then(res => {
+ var data = res.data;
+
+ let tmpData = data.map(item => ({
+ value: item.value,
+ label: item.label
+ }));
+
+ // 将 '全部' 选项插入到 tmpData 的开头
+ this.salesTypeList = tmpData;
+ this.salesTypeList.unshift({
+ label: '全部',
+ value: ''
+ });
+
+ })
+
},
methods: {
salesTypeChange(e) {
@@ -126,6 +133,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() {
--
Gitblit v1.9.3