调试接口
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
<view class="booking-time">
|
||||
<wd-tabs v-model="selectedDay" color="#4C9F44" @click="BookingTime.handleChangeTimeTab">
|
||||
<scroll-view scroll-y class="!h-500rpx pb-100rpx">
|
||||
<block v-for="item in day.time" :key="item">
|
||||
<block v-for="(item, index) in day.time" :key="index">
|
||||
<wd-tab :title="`${item.display}`" :name="item.display">
|
||||
<view class="">
|
||||
<view class=" mt-30rpx">
|
||||
|
||||
@ -1,22 +1,45 @@
|
||||
<template>
|
||||
<view class="p-30rpx rounded-16rpx mb-20rpx bg-white" @click="onCheck(coupon.id)">
|
||||
<view class="flex justify-between items-start relative ">
|
||||
<view class="w-180rpx h-180rpx">
|
||||
<wd-img width="100%" height="100%" :src="coupon.tea_store_group.img"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx line-1" :class="canUse ? '' : 'opacity-40'">
|
||||
<view class="text-32rpx text-[#303133] leading-44rpx line-1 w-350rpx">{{ coupon.tea_store_group.title }}</view>
|
||||
<view class="text-26rpx text-[#6A6363] leading-36rpx mt-30rpx flex">
|
||||
<view class="line-1">{{ coupon.store_msg.name }}</view>
|
||||
<view class="mx-14rpx">|</view>
|
||||
<view>{{ coupon.tea_store_group.hour }}小时</view>
|
||||
<template v-if="couponType == 'coupon'">
|
||||
<view class="flex justify-between items-start relative ">
|
||||
<view class="w-180rpx h-180rpx">
|
||||
<wd-img width="100%" height="100%" :src="coupon.tea_store_group.img"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx line-1" :class="canUse ? '' : 'opacity-40'">
|
||||
<view class="text-32rpx text-[#303133] leading-44rpx line-1 w-350rpx">{{ coupon.tea_store_group.title }}</view>
|
||||
<view class="text-26rpx text-[#6A6363] leading-36rpx mt-30rpx flex">
|
||||
<view class="line-1">{{ coupon.store_msg.name }}</view>
|
||||
<view class="mx-14rpx">|</view>
|
||||
<view>{{ coupon.tea_store_group.hour }}小时</view>
|
||||
</view>
|
||||
<!-- <view class="text-24rpx leading-34rpx text-[#909399] mt-16rpx">有效期:2025-01-01至2025-05-05</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</view>
|
||||
<!-- <view class="text-24rpx leading-34rpx text-[#909399] mt-16rpx">有效期:2025-01-01至2025-05-05</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</template>
|
||||
|
||||
<template v-if="couponType == 'groupCoupon'">
|
||||
<view class="flex justify-between items-start relative ">
|
||||
<view class="w-180rpx h-180rpx">
|
||||
<wd-img width="100%" height="100%" :src="coupon?.img" radius="16rpx"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx line-1" :class="canUse ? '' : 'opacity-40'">
|
||||
<view class="text-32rpx text-[#303133] leading-44rpx line-1 w-350rpx">{{ coupon?.title }}</view>
|
||||
<view class="text-26rpx text-[#6A6363] leading-36rpx mt-30rpx flex">
|
||||
<view class="line-1 w-150rpx">{{ coupon.store_msg.name }}</view>
|
||||
<view class="mx-14rpx">|</view>
|
||||
<view>{{ coupon?.hour }}小时</view>
|
||||
</view>
|
||||
<!-- TODO暂时隐藏 -->
|
||||
<!-- <view class="text-24rpx leading-34rpx text-[#909399] mt-16rpx">有效期:2025-01-01至2025-05-05</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -41,10 +64,14 @@
|
||||
}
|
||||
store_msg: {
|
||||
name: string
|
||||
}
|
||||
},
|
||||
img?: string //兼容团购优惠券-图片
|
||||
title?: string //兼容团购优惠券-团购券标题
|
||||
hour?: number //兼容团购优惠券-使用时长
|
||||
}
|
||||
canUse: boolean
|
||||
checked: boolean
|
||||
couponType: string
|
||||
onCheck: (id: number) => void
|
||||
}>()
|
||||
</script>
|
||||
|
||||
@ -8,20 +8,20 @@
|
||||
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex items-center w-400rpx" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1">{{ order.store_name }}</view>
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1">{{ order.name }}</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-400 text-28rpx leading-40rpx">
|
||||
<text class="text-[#4C9F44]" v-if="order.order_status === TeaRoomPackageOrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="order.order_status === TeaRoomPackageOrderStatus.Used">已使用</text>
|
||||
<text class="text-[#C9C9C9]" v-if="order.order_status === TeaRoomPackageOrderStatus.Refunded">已退款</text>
|
||||
<text class="text-[#4C9F44]" v-if="order.status === GroupComboOrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="order.status === GroupComboOrderStatus.Used">已使用</text>
|
||||
<text class="text-[#C9C9C9]" v-if="order.status === GroupComboOrderStatus.Refunded">已退款</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-22rpx">
|
||||
<view class="flex">
|
||||
<view class="mr-28rpx">
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.img"></wd-img>
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.image"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view @click="ComboCard.handleToOrderDetail">
|
||||
@ -30,14 +30,15 @@
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">{{ order.hour }}小时</wd-tag>
|
||||
</view>
|
||||
<view class="font-400 leading-36rpx text-26rpx text-[#606266]">
|
||||
<view class="mt-12rpx" v-if="order.operation_type === StoreType.Direct">{{ order.introduce }}</view>
|
||||
<view class="mt-12rpx" v-if="order.operation_type === StoreType.Direct">适用包间 {{ order.room_title }}</view>
|
||||
<!-- TODO 字段先隐藏 -->
|
||||
<!-- <view class="mt-10rpx">有效期至2025-03-23</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end" v-if="order.order_status === TeaRoomPackageOrderStatus.ToUse">
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end" v-if="order.status === GroupComboOrderStatus.ToUse">
|
||||
<view
|
||||
@click="ComboCard.handleOrderRefund(OrderSource.Combo)"
|
||||
@click="ComboCard.handleOrderRefund(order, OrderSource.Combo)"
|
||||
class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133]"
|
||||
:class="order.operation_type === StoreType.Direct ? ' mr-28rpx' : ''">
|
||||
申请退款
|
||||
@ -61,32 +62,31 @@
|
||||
<view class="mr-10rpx flex items-center">
|
||||
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex items-center" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
|
||||
<view class="flex items-center w-400rpx" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1">{{ order.name }}</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-400 text-28rpx leading-40rpx mt-12rpx">
|
||||
<text class="text-[#4C9F44]" v-if="orderStatus === OrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="orderStatus === OrderStatus.Used">已使用</text>
|
||||
<text class="text-[#C9C9C9]" v-if="orderStatus === OrderStatus.Refunded">已退款</text>
|
||||
<text class="text-[#4C9F44]" v-if="order.status === DouYinOrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="order.status === DouYinOrderStatus.Used">已使用</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-22rpx">
|
||||
<view class="flex">
|
||||
<view class="mr-28rpx">
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.image"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view @click="ComboCard.handleToOrderDetail">
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字</view>
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">{{ order.title }}</view>
|
||||
<view>
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">3小时</wd-tag>
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">{{ order.hour }}小时</wd-tag>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end">
|
||||
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44]" v-if="type === OrderSource.DouYin">立即预定</view>
|
||||
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44]" v-if="order.status === DouYinOrderStatus.ToUse">立即预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -219,12 +219,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ComboCard">
|
||||
import { OrderSource, OrderStatus, TeaRoomOrderStatus, TeaRoomPackageOrderStatus } from '@/utils/order'
|
||||
import { OrderSource, OrderStatus, TeaRoomOrderStatus, GroupComboOrderStatus, DouYinOrderStatus } from '@/utils/order'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleTGOrderRefundHooks } from '@/hooks/useOrder'
|
||||
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
|
||||
import { StoreType } from '@/utils/tea'
|
||||
import { router } from '@/utils/tools'
|
||||
import { PayOrderType } from '@/utils/pay'
|
||||
|
||||
/**
|
||||
* ComboCard 套餐卡片组件
|
||||
@ -270,14 +271,46 @@
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
handleOrderRefund: (source: string) => {
|
||||
switch (source) {
|
||||
case OrderSource.Combo:
|
||||
router.navigateTo(`/bundle/order/after-sales/after-sales?orderId=${props.order.id}&storeId=${props.order.store_id}&comboId=${props.order.group_id}&orderType=${OrderSource.Combo}&orderStatus=${OrderStatus.AfterSaleApply}`)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
handleOrderRefund: (order: any, source: string) => {
|
||||
message.confirm({
|
||||
title: '是否申请退款?',
|
||||
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') {
|
||||
let orderType: number = 0
|
||||
switch (source) {
|
||||
case OrderSource.Combo:
|
||||
orderType = PayOrderType.ComboRefund
|
||||
let res = handleRefundOrderHooks(order.id, orderType)
|
||||
if (res) {
|
||||
uni.$emit('refreshComboOrderList')
|
||||
}
|
||||
// TODO 这里调用删除直营订单的接口
|
||||
break;
|
||||
case OrderSource.DouYin:
|
||||
// TODO 这里调用删除抖音订单的接口
|
||||
break;
|
||||
case OrderSource.TeaRoom:
|
||||
// 这里调用删除茶室订单的接口
|
||||
handleTRDeleteOrderHooks(props.order.id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
@ -371,7 +404,7 @@
|
||||
handleToOrderDetail: () => {
|
||||
switch (props.type) {
|
||||
case OrderSource.Combo:
|
||||
router.navigateTo(`/bundle/order/platform/order-detail?orderId=${props.order.id}&orderStatus=${props.orderStatus}`)
|
||||
router.navigateTo(`/bundle/order/platform/order-detail?orderId=${props.order.id}`)
|
||||
break;
|
||||
case OrderSource.DouYin:
|
||||
router.navigateTo(`/bundle/order/douyin/douyin-order-detail?orderId=${props.order.id}&orderStatus=${props.orderStatus}`)
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
<template v-for="(label, labelIndex) in item.label" :key="labelIndex">
|
||||
<view class="mr-20rpx flex items-start">
|
||||
<wd-tag
|
||||
:color="randomLabelColor(labelIndex)"
|
||||
:bg-color="randomLabelColor(labelIndex)"
|
||||
:color="randomLabelColor(Number(labelIndex))"
|
||||
:bg-color="randomLabelColor(Number(labelIndex))"
|
||||
plain
|
||||
custom-class="!rounded-4rpx"
|
||||
>{{ label.label_name }}</wd-tag>
|
||||
@ -51,7 +51,7 @@
|
||||
<view class="flex mb-52rpx" :class="`${spec ? 'mt-10rpx' : 'mt-55rpx'}`">
|
||||
<view class="mr-14rpx">
|
||||
<price-format color="#FF5951" :first-size="34" :second-size="26"
|
||||
:subscript-size="26" :price="item.price" weight="500"></price-format>
|
||||
:subscript-size="26" :price="item.discount_price" weight="500"></price-format>
|
||||
</view>
|
||||
<view class="relative">
|
||||
<wd-img width="56rpx" height="56rpx" :src="`${OSS}icon/icon_sale.png`" radius="10rpx"/>
|
||||
|
||||
Reference in New Issue
Block a user