From c24e49083d4419300bcee0f0ca926c084037d665 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期三, 08 一月 2025 09:04:48 +0800
Subject: [PATCH] 1.订单支付倒计时配置 2.服务热线配置

---
 pages/order/order-detail.vue |   65 ++++++++++++++++++++++++++++++--
 1 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index 5008b47..e1b2d99 100644
--- a/pages/order/order-detail.vue
+++ b/pages/order/order-detail.vue
@@ -16,6 +16,8 @@
 			// #endif
 			salesTypeDef: 0,
 			salesTypeList: [],
+			order_cancel_time: 15,
+			tel: '',
 		};
 	},
 	onUnload() {
@@ -23,6 +25,8 @@
 	},
 	async onLoad(options) {
 		console.log('options', options)
+		// 获取支付配置
+		await this.getOrderCancelTimeConfig()
 
 		this.id = options.id || ''
 		if (this.id) {
@@ -54,7 +58,8 @@
 					let serverTime = res.data;
 
 					//倒计时
-					var nowdate = serverTime - 1000 * 60 * 15
+					// var nowdate = serverTime - 1000 * 60 * 15
+					var nowdate = serverTime - 1000 * 60 * this.order_cancel_time
 
 					var change = false
 
@@ -121,7 +126,33 @@
 
 	},
 
+	onShow() {
+		this.getHotLineConfig()
+	},
+
 	methods: {
+
+		async getHotLineConfig() {
+			this.$message.showLoading()
+			const {
+				code,
+				data
+			} = await this.$http.request('get', `/v2/config-param/base/getBaseString`, {
+				params: {
+					paramGroup: "servicehotline",
+					paramKey: "hotline_tel"
+
+				}
+			})
+			this.$message.hideLoading()
+
+			if (code === 0) {
+				// 电话
+				console.log(data)
+				this.tel =data
+			}
+		},
+
 		// 商品评论
 		commentButtonClick() {
 			// 跳转的到评论列表
@@ -203,7 +234,8 @@
 					})
 					let serverTime = res.data;
 					//先判断要不要字节变成已取消
-					var nowdate = serverTime - 1000 * 60 * 15
+					// var nowdate = serverTime - 1000 * 60 * 15
+					var nowdate = serverTime - 1000 * 60 * this.order_cancel_time
 					// var nowdate = new Date().getTime() - 1000 * 60 * 5
 					var diff = new Date(this.dto.createTime).getTime() - nowdate
 
@@ -223,8 +255,13 @@
 		async callTel() {
 			await this.$message.confirm('是否拨打客服电话')
 			uni.makePhoneCall({
-				phoneNumber: '19288780072'
+				phoneNumber: this.tel
 			});
+			// uni.makePhoneCall({
+			// 	phoneNumber: '19288780072'
+			// });
+
+			
 		},
 
 		async getTelNum() {
@@ -238,6 +275,26 @@
 				console.log(data)
 
 			})
+		},
+
+		async getOrderCancelTimeConfig() {
+			this.$message.showLoading()
+			const {
+				code,
+				data
+			} = await this.$http.request('get', `/v2/config-param/base/getBaseString`, {
+				params: {
+					paramGroup: "order",
+					paramKey: "order_cancel_time"
+
+				}
+			})
+			this.$message.hideLoading()
+
+			if (code === 0) {
+				console.log(data)
+				this.order_cancel_time =data
+			}
 		},
 
 		async getItemList() {
@@ -919,7 +976,7 @@
 			<view class="flex m-t-12">
 				<view class="flex1 w-fit m-auto icon-view" @click.stop="callTel">
 					<image src="/static/common/icon-call.png" class="icon icon-call m-r-10  img100"></image>
-					拨打19288780072
+					{{ tel || '' }}
 				</view>
 				<view class="flex1 w-fit m-auto icon-view flex flex-wrap-normal" open-type="contact">
 					<image src="/static/common/icon-wx.png" class="icon icon-call m-t-2  m-r-10 img100"></image>

--
Gitblit v1.9.3