调试接口

This commit is contained in:
wangxiaowei
2025-12-23 03:30:22 +08:00
parent 90e9448b68
commit 3af440cd21
17 changed files with 149 additions and 82 deletions

View File

@ -100,7 +100,7 @@
<!-- 描述信息 -->
<view class="text-[#909399] text-26rpx leading-36rpx mb-40rpx mt-20rpx">
<view class="ml-80rpx" v-if="orderStatus === TeaRoomOrderStatus.Pay || orderStatus === TeaRoomOrderStatus.Consumption">使用过程中有任何问题请联系客服</view>
<view class="flex items-center justify-center" v-if="orderStatus === TeaRoomOrderStatus.Pending">
<!-- <view class="flex items-center justify-center" v-if="orderStatus === TeaRoomOrderStatus.Pending">
<view class="flex items-center mr-6rpx">
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_time.png`"/>
</view>
@ -111,14 +111,21 @@
</view>
<view>订单自动取消</view>
</view>
</view>
</view> -->
<view class="ml-80rpx" v-if="orderStatus === TeaRoomOrderStatus.Finished">品一口香茗让生活慢下来从一杯好茶开始</view>
<view v-if="orderStatus === TeaRoomOrderStatus.Refunded" class="text-center mt-14rpx">
<view class="text-40rpx text-[#303133] leading-56rpx">
<view>退款成功{{ order.order_amount }}</view>
</view>
<view class="text-28rpx text-[#606266] leading-54rpx mt-20rpx">谢谢您的信任我们一定会做的更好</view>
<view class="text-24rpx text-[#606266] leading-34rpx mt-12rpx">{{ order.update_dtime }}</view>
</view>
</view>
<view class="mx-30rpx coupon-bg" >
<view class="flex items-center px-30rpx pt-30rpx pb-40rpx">
<view class="mr-30rpx">
<wd-img width="190rpx" height="190rpx" :src="order.room_msg.img" mode="scaleToFill"></wd-img>
<wd-img width="190rpx" height="190rpx" :src="order.room_msg.img" mode="scaleToFill" radius="10rpx"></wd-img>
</view>
<view class="flex-1">
<view class="flex justify-between items-center" @click="OrderDetail.handleToStore">
@ -145,9 +152,11 @@
<view class="mt-28rpx pb-36rpx">
<view class="text-30rpx leading-42rpx text-[#303133] px-30rpx">预约信息</view>
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx">
<view class="mb-20rpx px-30rpx">预约时间{{ order.day_time }} {{ order?.renew_dtime?.start_time || order?.start_time }}-{{ order?.renew_dtime?.end_time || order?.end_time }}</view>
<view class="mb-20rpx px-30rpx">预约时间{{ order.day_time }} {{ order?.start_time }}-{{ order?.end_time }}</view>
<view class="flex justify-between items-center pl-30rpx" >
<view>预约时长{{ order.hours }}小时</view>
<view>
预约时长{{ Number(order.hours) + Number(order.renew_hour || 0) }}小时
</view>
<!-- 已预约和消费中显示一键续订 -->
<view v-if="orderStatus === TeaRoomOrderStatus.Pay || orderStatus === TeaRoomOrderStatus.Consumption"
class="bg-[#4C9F44] rounded-[100rpx_0rpx_0rpx_100rpx] font-bold text-28rpx leading-40rpx text-[#fff] w-170rpx h-56rpx flex justify-center items-center"
@ -155,10 +164,20 @@
一键续订
</view>
</view>
<!-- <view class="mt-20rpx px-30rpx" >续订时长1小时</view> -->
<!-- <view class="mb-20rpx px-30rpx" v-if="order.renew_hour">续订时长{{ order?.renew_hour }}小时</view> -->
</view>
</view>
</view>
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="order.renew_hour">
<view class="text-[#303133] text-32rpx leading-44rpx">续订信息</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>续订时长</view>
<view>{{ order.renew_hour }} 小时</view>
</view>
</view>
<!-- 已预约和消费中显示开门锁 -->
<view class="bg-white rounded-16rpx mx-30rpx mt-20rpx" v-if="orderStatus === TeaRoomOrderStatus.Pay || orderStatus === TeaRoomOrderStatus.Consumption">
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx px-30rpx">开门锁</view>
@ -193,7 +212,7 @@
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">适用门店</view>
<view class="mt-26rpx flex items-center">
<view class="mr-24rpx">
<wd-img width="170rpx" height="170rpx" :src="order.store_msg.image"></wd-img>
<wd-img width="170rpx" height="170rpx" :src="order.store_msg.image" radius="10rpx"></wd-img>
</view>
<view class="flex-1 flex justify-between items-center relative">
<view class="">
@ -244,9 +263,9 @@
</view>
<!-- 操作按钮 -->
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx">
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx" v-if="orderStatus !== TeaRoomOrderStatus.Refunded">
<!-- 已预约 -->
<view class="flex items-center justify-center text-32rpx leading-44rpx leading-90rpx text-center !mt-34rpx" v-if="orderStatus == TeaRoomOrderStatus.Pay || orderStatus == TeaRoomOrderStatus.Consumption">
<view class="flex items-center justify-center text-32rpx leading-44rpx leading-90rpx text-center !mt-34rpx" v-if="orderStatus == TeaRoomOrderStatus.Pay">
<wd-button custom-class="!text-32rpx !w-630rpx !h-90rpx !bg-[#4C9F44] !rounded-8rpx !text-[#fff]" open-type="share">分享房间给朋友</wd-button>
</view>
@ -257,21 +276,15 @@
</view>
<view class="w-360rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleToPay">立即支付{{ order.order_amount }}</view>
</view>
<!-- <view class="flex items-center justify-between mx-58rpx mt-34rpx" v-if="orderStatus === TeaRoomOrderStatus.Pending">
<!-- 消费中 -->
<view class="flex items-center justify-between mx-58rpx mt-34rpx" v-if="orderStatus == TeaRoomOrderStatus.Consumption">
<view class="flex items-center">
<view class="text-28rpx leading-40rpx text-[#606266] mr-16rpx" @click="OrderDetail.handleCancelOrder">取消</view>
<view class="flex items-center">
<view class="mr-16rpx mt-[-8rpx]">
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="23.02"></price-format>
</view>
<view class="flex items-center text-[#4C9F44]" >
<view class="text-24rpx mr-10rpx" @click="showCostPopup = true">费用明细</view>
<wd-icon name="arrow-down" size="24rpx" color="#4C9F44"></wd-icon>
</view>
</view>
<!-- 分享出去的订单不要显示申请退款 -->
<view class="text-28rpx leading-40rpx text-[#606266] mr-16rpx" @click="OrderDetail.handleRefundOrder" v-if="!shareSource">申请退款</view>
</view>
<view class="w-178rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff]">立即预定</view>
</view> -->
<wd-button custom-class="!text-32rpx !w-360rpx !h-90rpx !bg-[#4C9F44] !rounded-8rpx !text-[#fff]" open-type="share">分享房间给朋友</wd-button>
</view>
<!-- 交易完成 -->
<view @click="OrderDetail.handleAgainReserve" class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx"
@ -279,8 +292,6 @@
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
</view>
</view>
</view>
</template>
@ -289,7 +300,7 @@
import { useMessage } from 'wot-design-uni'
import {toast} from '@/utils/toast'
import { getTeaRoomOrderDetail } from '@/api/tea-room'
import { handleTRCancelOrderHooks, handleTRToPayHooks, handleToTRStoreHooks } from '@/hooks/useOrder'
import { handleTRCancelOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
import type { ITeaSpecialistOrderDetailsResult } from '@/api/types/tea'
import { router } from '@/utils/tools'
import { ReserveServiceCategory, OrderType } from '@/utils/order'
@ -298,6 +309,7 @@
import { transferOrder } from '@/api/user'
import { toTimes, copy } from '@/utils/tools'
import { useUserStore } from '@/store'
import { PayOrderType } from '@/utils/pay'
const OSS = inject('OSS')
@ -356,6 +368,7 @@
// 订单
const orderId = ref<number>(0)
const order = ref<ITeaSpecialistOrderDetailsResult>({
id: 0,
order_amount: '',
order_sn: '',
store_id: 0,
@ -389,6 +402,7 @@
dtime: '',
update_dtime: '',
renew_price: 0,
renew_hour: 0,
renew_dtime: {
start_time: '',
end_time: '',
@ -636,8 +650,6 @@
* 转让订单
*/
handleTransferOrder: async () => {
console.log('开始转让订单2')
message.confirm({
title: '提示',
msg: '是否接收该笔订单?',
@ -663,6 +675,34 @@
}).catch(() => {
// 点击取消按钮回调事件
})
},
/**
* 申请退款
*/
handleRefundOrder: () => {
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(async (res) => {
if (res.action == 'confirm') {
// 改为当前退款订单ID
let res = await handleRefundOrderHooks(order.value.id, PayOrderType.TeaRoom)
console.log("🚀 ~ res:", res)
if (res) {
OrderDetail.handleInit()
uni.$emit('refreshOrderList')
}
}
}).catch(() => {})
}
}
</script>