调试接口

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

@ -297,7 +297,8 @@
*/
handleToRefund: () => {
message.confirm({
title: '是否申请退款?',
title: '提示',
msg: '是否申请退款?',
confirmButtonText: '确定',
cancelButtonText: '取消',
cancelButtonProps: {
@ -308,7 +309,7 @@
}
}).then((res) => {
if (res.action == 'confirm') {
let res = handleRefundOrderHooks(order.value.user_group.id, PayOrderType.ComboRefund)
let res = handleRefundOrderHooks(order.value.id, PayOrderType.ComboRefund)
if (res) {
OrderDetail.handleInit()
uni.$emit('refreshComboOrderList')

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>

View File

@ -86,7 +86,7 @@
</view>
<!-- 昵称 -->
<view class="flex justify-between items-center" @click="showEditNicknamePopup = true">
<view class="flex justify-between items-center mb-54rpx" @click="showEditNicknamePopup = true">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">昵称</view>
<view class="flex justify-end">
<view class="flex items-center">
@ -100,20 +100,19 @@
</view>
</view>
<!-- TODO 暂时隐藏-修改手机号 -->
<!-- <view class="flex justify-between items-center" @click="Profile.handleToEditMobile">
<view class="flex justify-between items-center">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">修改手机号</view>
<view class="flex justify-end">
<view class="flex items-center">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">
+86 {{ maskedMobile }}
</view>
<view>
<wd-icon name="arrow-right" size="32rpx" color="#C0C4CC" />
</view>
<wd-button type="text" open-type="getPhoneNumber" @getphonenumber="Profile.handleToEditMobile" custom-class="!p-0 !m-0 !bg-transparent !h-auto !leading-normal !w-300rpx !text-right">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx" v-if="maskedMobile">
+86 {{ maskedMobile }}
</view>
<view class="font-400 text-[#303133] text-30rpx leading-42rpx" v-else>点击绑定</view>
</wd-button>
</view>
</view>
</view> -->
</view>
</view>
<view class="bg-white rounded-16rpx mt-144rpx mx-30rpx px-30rpx py-32rpx text-center font-400 text-[#303133] text-30rpx leading-42rpx" @click="showLogoutPopup = true">
@ -129,6 +128,7 @@
import type { IUserResult } from '@/api/types/user'
import { router } from '@/utils/tools'
import { useUserStore } from '@/store'
import { getMobileByMnp } from '@/api/user'
const OSS = inject('OSS')
const showLogoutPopup = ref<boolean>(false) // 是否显示退出登录弹出框
@ -221,10 +221,8 @@
/**
* 修改手机号
*/
handleToEditMobile: () => {
uni.navigateTo({
url: '/pages/login/mobile?type=edit&userId=123' // userId仅做测试使用实际请传真实用户ID
})
handleToEditMobile: async (e: any) => {
const res = await getMobileByMnp(e.code)
},
/**

View File

@ -499,11 +499,11 @@
uni.$off('chooseCoupon')
if (type === CouponType.Discount) {
selectedCoupon.value = {id: params.coupon.user_coupon_id, name: `${params.coupon.name}${params.coupon.coupon_price}` }
selectedCoupon.value = {id: params.coupon.id, name: `${params.coupon.name}${params.coupon.coupon_price}` }
bill.value.coupon = params.coupon.coupon_price
selectCouponId.value = params.coupon.id // 这里的ID是在数据表自增的ID保存下来是为了回显列表的,没有其他作用
} else {
selectedGroupCoupon.value = {id: params.coupon.group_id, name: `团购券-${params.coupon?.title}` }
selectedGroupCoupon.value = {id: params.coupon.id, name: `团购券-${params.coupon?.title}` }
bill.value.groupCoupon = params.coupon.coupon_price
selectGroupCouponId.value = params.coupon.id // 这里的ID是在数据表自增的ID保存下来是为了回显列表的,没有其他作用
}
@ -513,6 +513,7 @@
// 获取预定了几个小时
const count = bill.value.service.num
console.log("🚀 ~ bill.value:", bill.value)
console.log("🚀 ~ selectCouponId:", selectCouponId.value)
router.navigateTo(`/bundle/coupon/coupon?id=${id.value}&numbers=${count}&type=${type}&storeId=${storeId.value}&couponId=${selectCouponId.value}&groupCouponId=${selectGroupCouponId.value}`)
@ -588,7 +589,6 @@
} catch (error) {
uni.hideLoading()
isSubmitting.value = false
toast.info('订单提交失败,请稍后重试')
return
}
// 正常流程下isSubmitting.value 会在支付回调中重置

View File

@ -164,7 +164,8 @@
order_id: res.order_id,
pay_way: 2,
order_source: PayOrderSource.MINI, //订单来源1-小程序; 2-h5; 3app
order_type: PayOrderType.Recharge
order_type: PayOrderType.Recharge,
store_id: 0
})
wechatPay(pay.pay.config).then((res) => {