|
@@ -51,7 +51,7 @@ import { useDict } from '@/utils/dict.js';
|
|
|
import DictTag from '@/components/DictTag/index.vue'
|
|
|
import { wxMakePhoneCall } from '@/utils/wxRequest.js'
|
|
|
import { computed } from 'vue';
|
|
|
-const orderId = ref('');
|
|
|
+const secondOrderId = ref('');
|
|
|
const detaile = ref({});
|
|
|
const verify = ref(null);
|
|
|
const {
|
|
@@ -81,18 +81,17 @@ const getOrderDetail = async () => {
|
|
|
uni.showLoading({
|
|
|
title: '数据加载中...'
|
|
|
});
|
|
|
- const res = await getVolunteerOrderInfo({ orderId: orderId.value });
|
|
|
- // const ad_res = await getAddress(res.data.addressId);
|
|
|
-
|
|
|
- let data = res.data.secondOrder;
|
|
|
- detaile.value = { ...res.data.secondOrder, address:res.data.address.address,serveTimes:res.data.secondOrder.updateTime }
|
|
|
- if (data.orderStatus === '3') {
|
|
|
-
|
|
|
+ const res = await getVolunteerOrderInfo({ secondOrderId: secondOrderId.value });
|
|
|
+
|
|
|
+ // Update to match the actual data structure where properties are at the top level
|
|
|
+ detaile.value = { ...res.data, serveTimes: res.data.updateTime || null }
|
|
|
+
|
|
|
+ if (res.data.orderStatus === '3') {
|
|
|
orderStatus.value = true;
|
|
|
}
|
|
|
- if (res.data.secondOrder.updateTime) {
|
|
|
+ if (res.data.updateTime) {
|
|
|
timer = setInterval(() => {
|
|
|
- const timeDiff = Math.abs(new Date() - new Date(res.data.secondOrder.updateTime));
|
|
|
+ const timeDiff = Math.abs(new Date() - new Date(res.data.updateTime));
|
|
|
const units = {
|
|
|
day: Math.floor(timeDiff / (1000 * 60 * 60 * 24)),
|
|
|
hour: Math.floor(timeDiff / (1000 * 60 * 60)),
|
|
@@ -124,7 +123,7 @@ const getOrderDetail = async () => {
|
|
|
const change = (e) => {
|
|
|
if (e.state && !orderStatus.value) {
|
|
|
|
|
|
- getTimesByDate(orderId.value).then(res => {
|
|
|
+ getTimesByDate(secondOrderId.value).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
uni.showToast({
|
|
|
title: '已开始服务',
|
|
@@ -146,7 +145,7 @@ const change = (e) => {
|
|
|
icon: 'success',
|
|
|
success: () => {
|
|
|
setTimeout(() => {
|
|
|
- uni.redirectTo({ url: `/pages_classify/pages/order/index?orderId=${orderId.value}` });
|
|
|
+ uni.redirectTo({ url: `/pages_classify/pages/order/index?secondOrderId=${secondOrderId.value}` });
|
|
|
}, 800)
|
|
|
}
|
|
|
})
|
|
@@ -156,7 +155,7 @@ const change = (e) => {
|
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
- orderId.value = options.orderId;
|
|
|
+ secondOrderId.value = options.secondOrderId;
|
|
|
getOrderDetail();
|
|
|
|
|
|
})
|