From 056997b07e61fc99d5c311d0c5489b9de48fd9bc Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 24 九月 2024 17:25:16 +0800
Subject: [PATCH] update 细节和订单确认收货(写死了商户号)
---
pages/order/order-detail.vue | 93 +++++++++++++++++++++++++++++++---------------
1 files changed, 62 insertions(+), 31 deletions(-)
diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index bc12076..8a444b5 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() {
@@ -54,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
@@ -98,6 +87,28 @@
}
+
+ 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 +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() {
@@ -183,9 +210,12 @@
extraData: {
// merchant_id: '',
// merchant_trade_no: '',
+ merchant_id: '1661512517',
+ merchant_trade_no: tmp.id || '',
transaction_id: tmp.dto && tmp.dto.paymentTrId || ''
},
- async success() {
+ async success(info) {
+ console.log('info', info)
//dosomething
// 发送请求
tmp.$message.showLoading()
@@ -200,6 +230,7 @@
tmp.$message.hideLoading()
if (code === 0) {
tmp.getDetail()
+ tmp.$store.dispatch('getCurrentInfo')
}
},
fail(e) {
@@ -538,7 +569,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>
@@ -584,29 +615,29 @@
</view>
</view>
<view class="info-container bg-white br-4 m-t-12" v-if="!showSales">
- <view class="form-item">
- <view class="label">订单金额:</view>
- <view class="value">+{{ dto.totalAmount || '0' }}</view>
+ <view class="form-item flex">
+ <view class="label">商品金额:</view>
+ <view class="value m-l-a m-r-0 text-right">+{{ dto.flowerAmount || '0' }}</view>
</view>
- <view class="form-item">
+ <view class="form-item flex">
<view class="label">运费:</view>
- <view class="value">+{{ dto.transportFee || '0' }}</view>
+ <view class="value m-l-a m-r-0 text-right">+{{ dto.transportFee || '0' }}</view>
</view>
- <view class="form-item">
+ <view class="form-item flex">
<view class="label">打包费:</view>
- <view class="value">+{{ dto.packingFee || '0' }}</view>
+ <view class="value m-l-a m-r-0 text-right">+{{ dto.packingFee || '0' }}</view>
</view>
- <view class="form-item t-red">
+ <view class="form-item flex t-red">
<view class="label">优惠:</view>
- <view class="value">-{{ dto.memberCouponAmount || '0' }}</view>
+ <view class="value m-l-a m-r-0 text-right">-{{ dto.memberCouponAmount || '0' }}</view>
</view>
- <view class="form-item t-red">
+ <view class="form-item flex t-red">
<view class="label">实际支付:</view>
- <view class="value">¥{{ dto.paymentAmount || '0' }}</view>
+ <view class="value m-l-a m-r-0 text-right">¥{{ dto.paymentAmount || '0' }}</view>
</view>
-
-
- <!-- <view class="form-item">
+
+
+ <!-- <view class="form-item">
<view class="label">支付金额:</view>
<view class="value">{{ dto.paymentAmount || '-' }}</view>
</view>
@@ -627,7 +658,7 @@
<view class="label">优惠券:</view>
<view class="value">{{ dto.memberCouponName || '-' }}</view>
</view> -->
- <!-- <view class="form-item">
+ <!-- <view class="form-item">
<view class="label">优惠金额:</view>
<view class="value">{{ dto.memberCouponAmount || '-' }}</view>
</view> -->
--
Gitblit v1.9.3