调试接口
This commit is contained in:
@ -271,6 +271,8 @@
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -285,12 +287,19 @@
|
||||
import { ReserveServiceCategory, OrderType } from '@/utils/order'
|
||||
import type { ITeaSpecialistFuture7DaysResult } from '@/api/types/tea'
|
||||
import { getNext7Days, renewTeaRoomOrder } from '@/api/tea-room'
|
||||
import { transferOrder } from '@/api/user'
|
||||
import { toTimes, copy } from '@/utils/tools'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const title = ref<string>('')
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
|
||||
// 消息弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
|
||||
// 续订包间
|
||||
const showRenewPopup = ref<boolean>(false)
|
||||
const timeList = [
|
||||
@ -333,9 +342,6 @@
|
||||
// 订单倒计时取消
|
||||
const time = ref<number>(30 * 60 * 60 * 1000)
|
||||
|
||||
// 取消订单弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
// 费用明细
|
||||
const showCostPopup = ref<boolean>(false) // 是否显示退款详情弹出框
|
||||
|
||||
@ -392,11 +398,30 @@
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const currentDate = `${year}-${month}-${day}`;
|
||||
|
||||
onLoad(async (args) => {
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
// 页面分享来源
|
||||
const shareSource = ref<string>('')
|
||||
|
||||
onLoad((args) => {
|
||||
shareSource.value = args.shareSource || ''
|
||||
if (args.orderId) {
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
}
|
||||
|
||||
const token = uni.getStorageSync('token')
|
||||
|
||||
if (token && shareSource.value === 'TransferOrder') {
|
||||
// 处理转让订单
|
||||
OrderDetail.handleTransferOrder()
|
||||
}
|
||||
|
||||
// 如果是从分享进入的未登录的情况下(TransferOrder),需要转让订单
|
||||
uni.$on('transferOrder', () => {
|
||||
// 处理未登录的情况下
|
||||
uni.$off('transferOrder')
|
||||
OrderDetail.handleTransferOrder()
|
||||
})
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
@ -407,7 +432,8 @@
|
||||
if (e.from === 'button') {
|
||||
return {
|
||||
title: `我在${order.value.store_msg.name}预定了${order.value.room_msg.title},一起来吧!`,
|
||||
path: `/pages/share/tea-room/share-order-detail?orderId=${orderId.value}`,
|
||||
// path: `/pages/share/tea-room/share-order-detail?orderId=${orderId.value}&shareSource=TransferOrder`,
|
||||
path: `/bundle/order/tea-room/order-detail?orderId=${orderId.value}&shareSource=TransferOrder`,
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -564,8 +590,40 @@
|
||||
handleChooseRenewTime: (item) => {
|
||||
console.log("🚀 ~ item:", item)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 转让订单
|
||||
*/
|
||||
handleTransferOrder: async () => {
|
||||
console.log('开始转让订单2')
|
||||
|
||||
message.confirm({
|
||||
title: '提示',
|
||||
msg: '是否接收该笔订单?',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
cancelButtonProps: {
|
||||
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.action == 'confirm') {
|
||||
console.log('开始转让订单3')
|
||||
|
||||
transferOrder(orderId.value).then(res => {
|
||||
console.log('开始转让订单4', res)
|
||||
|
||||
toast.success('订单接收成功')
|
||||
router.redirectTo('/bundle/order/tea-room/order-list', 500)
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user