|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { OrderState, orderStateList } from '@/services/constants'
|
|
|
|
|
import { getOrderByIdAPI } from '@/services/order'
|
|
|
|
|
import { getOrderByIdAPI, cancleOrderAPI } from '@/services/order'
|
|
|
|
|
import type { LogisticItem, OrderResult } from '@/types/order'
|
|
|
|
|
import { onLoad, onReady } from '@dcloudio/uni-app'
|
|
|
|
|
import { ref, getCurrentInstance, unref } from 'vue'
|
|
|
|
@ -10,22 +10,23 @@ import QQMapWX from '@/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js'
|
|
|
|
|
|
|
|
|
|
// 获取屏幕边界到安全区域距离
|
|
|
|
|
const { safeAreaInsets } = uni.getSystemInfoSync()
|
|
|
|
|
|
|
|
|
|
// 地图经纬度
|
|
|
|
|
const location = uni.getStorageSync('location')
|
|
|
|
|
const orderStatus = ref('')
|
|
|
|
|
// 页面渲染完毕,绑定动画效果
|
|
|
|
|
// 页面加载
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
getMemberOrderByIdData(options.orderId)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const isLoading = ref(false)
|
|
|
|
|
// 获取订单详情
|
|
|
|
|
const order = ref<OrderResult>()
|
|
|
|
|
const getMemberOrderByIdData = async (orderId) => {
|
|
|
|
|
const params = {
|
|
|
|
|
orderId: orderId,
|
|
|
|
|
latitude: 31.163973,
|
|
|
|
|
longitude: 121.404032,
|
|
|
|
|
latitude: location.latitude,
|
|
|
|
|
longitude: location.longitude,
|
|
|
|
|
}
|
|
|
|
|
isLoading.value = true
|
|
|
|
|
const res = await getOrderByIdAPI(params)
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
const data = res.data
|
|
|
|
@ -34,6 +35,7 @@ const getMemberOrderByIdData = async (orderId) => {
|
|
|
|
|
const end = data.appointmentTimeEnd.slice(11, 16)
|
|
|
|
|
data.appointmentTime = str + ' ' + start + '-' + end
|
|
|
|
|
order.value = data
|
|
|
|
|
isLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 确认收货
|
|
|
|
@ -44,27 +46,25 @@ const handleCancleOrder = () => {
|
|
|
|
|
confirmColor: '#3775F6',
|
|
|
|
|
success: async (success) => {
|
|
|
|
|
if (success.confirm) {
|
|
|
|
|
// const res = await putMemberOrderReceiptByIdAPI(query.id)
|
|
|
|
|
// 更新订单状态
|
|
|
|
|
// order.value = res.result
|
|
|
|
|
const res = await cancleOrderAPI({ id: order.value.id })
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const handleAcceptConfirm = () => {
|
|
|
|
|
uni.navigateTo({ url: '/payment/detail/detail' })
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<view class="viewport">
|
|
|
|
|
<template v-if="1">
|
|
|
|
|
<template v-if="!isLoading">
|
|
|
|
|
<view class="order-detail">
|
|
|
|
|
<view class="status">
|
|
|
|
|
<view class="title">{{ order.orderStatus.desc }}</view>
|
|
|
|
|
<template v-if="order.orderStatus.code == '520192817293693253'">
|
|
|
|
|
<view class="title">{{ order.orderStatus.desc }}</view>
|
|
|
|
|
<view class="desc">预约时间:{{ order.appointmentTime }}</view>
|
|
|
|
|
<view class="action">
|
|
|
|
|
<view class="button" @click="handleCancleOrder">取消订单</view>
|
|
|
|
|
<view class="button cancle" @click="handleCancleOrder">取消订单</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
</view>
|
|
|
|
@ -130,13 +130,17 @@ page {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
.button {
|
|
|
|
|
padding: 14rpx 40rpx;
|
|
|
|
|
padding: 10rpx 30rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border: 2rpx solid #D5D6DB;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
color: #0D0D26;
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
&.cancle {
|
|
|
|
|
border: 2rpx solid #E30000;
|
|
|
|
|
color: #E30000;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|