完善茶室订单
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
<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="flex items-center" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
@ -24,7 +24,7 @@
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view @click="comboCard.handleToOrderDetail">
|
||||
<view @click="ComboCard.handleToOrderDetail">
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字</view>
|
||||
<view>
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">3小时</wd-tag>
|
||||
@ -51,7 +51,7 @@
|
||||
<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="flex items-center" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
@ -68,7 +68,7 @@
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view @click="comboCard.handleToOrderDetail">
|
||||
<view @click="ComboCard.handleToOrderDetail">
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字</view>
|
||||
<view>
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">3小时</wd-tag>
|
||||
@ -91,18 +91,17 @@
|
||||
<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.store_name }}</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-400 text-28rpx leading-40rpx mt-12rpx text-[#4C9F44]">
|
||||
<text v-if="orderStatus === OrderStatus.Consuming">消费中</text>
|
||||
<text v-if="orderStatus === OrderStatus.Reserved">已预约</text>
|
||||
<text v-if="orderStatus === OrderStatus.Serving">服务中</text>
|
||||
<text v-if="orderStatus === OrderStatus.Finished" class="text-[#606266]">完成</text>
|
||||
<text v-if="orderStatus === OrderStatus.Pending" class="text-[#FF5951]" >待付款</text>
|
||||
<text v-if="orderStatus === OrderStatus.Cancelled" class="text-[#C9C9C9]" >订单取消</text>
|
||||
<text v-if="order.order_status === TeaRoomOrderStatus.Pending" class="text-[#FF5951]" >待付款</text>
|
||||
<text v-if="order.order_status === TeaRoomOrderStatus.Consumption">消费中</text>
|
||||
<text v-if="order.order_status === TeaRoomOrderStatus.Pay">已预约</text>
|
||||
<text v-if="order.order_status === TeaRoomOrderStatus.Finished" class="text-[#606266]">完成</text>
|
||||
<text v-if="order.order_status === TeaRoomOrderStatus.Cancelled" class="text-[#C9C9C9]" >订单取消</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-22rpx">
|
||||
@ -111,31 +110,32 @@
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></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 @click="ComboCard.handleToOrderDetail">
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">{{ order.room_name }}</view>
|
||||
<view class="font-400 leading-36rpx text-26rpx text-[#606266] mt-34rpx">
|
||||
<view>预约时间:03/18 08:00-12:00</view>
|
||||
<view class="mt-18rpx">预约时长:2小时</view>
|
||||
<view>预约时间:{{ order.day_time }} {{ order.start_time }}-{{ order.end_time }}</view>
|
||||
<view class="mt-18rpx">预约时长:{{ order.hours }}小时</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template v-if="orderStatus === OrderStatus.Finished || orderStatus === OrderStatus.Cancelled">
|
||||
<!-- 操作按钮 -->
|
||||
<template v-if="order.order_status === OrderStatus.Finished || order.order_status === OrderStatus.Cancelled">
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end"
|
||||
@click="comboCard.handleDeleteOrder(OrderSource.TeaRoom)">
|
||||
@click="ComboCard.handleDeleteOrder(OrderSource.TeaRoom)">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center">
|
||||
删除订单
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-if="orderStatus === OrderStatus.Pending">
|
||||
<template v-if="order.order_status === TeaRoomOrderStatus.Pending">
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center"
|
||||
@click="comboCard.handleCancelOrder(OrderSource.TeaRoom)">取消订单</view>
|
||||
@click="ComboCard.handleCancelOrder(OrderSource.TeaRoom)">取消订单</view>
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44] flex items-center justify-center"
|
||||
@click="comboCard.handleToPayOrder(OrderSource.TeaRoom)">去支付</view>
|
||||
@click="ComboCard.handleToPayOrder(OrderSource.TeaRoom)">去支付</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
@ -147,7 +147,7 @@
|
||||
<view class="mr-28rpx">
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1" @click="comboCard.handleToOrderDetail">
|
||||
<view class="flex-1" @click="ComboCard.handleToOrderDetail">
|
||||
<view class="flex items-center relative">
|
||||
<view class="w-400rpx flex items-center">
|
||||
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">茶艺师</view>
|
||||
@ -187,7 +187,7 @@
|
||||
<view>
|
||||
<view v-if="orderStatus === OrderStatus.Finished || orderStatus === OrderStatus.Cancelled"
|
||||
class="flex items-center text-28rpx mt-28rpx justify-end"
|
||||
@click="comboCard.handleDeleteOrder(OrderSource.TeaSpecialist)">
|
||||
@click="ComboCard.handleDeleteOrder(OrderSource.TeaSpecialist)">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] flex items-center justify-center">
|
||||
删除订单
|
||||
</view>
|
||||
@ -195,11 +195,11 @@
|
||||
<view v-if="orderStatus === OrderStatus.Pending"
|
||||
class="flex items-center text-28rpx mt-28rpx justify-end">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center"
|
||||
@click="comboCard.handleCancelOrder(OrderSource.TeaSpecialist)">
|
||||
@click="ComboCard.handleCancelOrder(OrderSource.TeaSpecialist)">
|
||||
取消订单
|
||||
</view>
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44] flex items-center justify-center"
|
||||
@click="comboCard.handleToPayOrder(OrderSource.TeaSpecialist)">去支付</view>
|
||||
@click="ComboCard.handleToPayOrder(OrderSource.TeaSpecialist)">去支付</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -210,9 +210,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ComboCard">
|
||||
import { OrderSource, OrderStatus } from '@/utils/order'
|
||||
import { OrderSource, OrderStatus, TeaRoomOrderStatus } from '@/utils/order'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks } from '@/hooks/useOrder'
|
||||
|
||||
/**
|
||||
* ComboCard 套餐卡片组件
|
||||
@ -236,14 +237,18 @@
|
||||
orderStatus: {
|
||||
type: String,
|
||||
default: OrderStatus.ToUse
|
||||
},
|
||||
|
||||
order: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
// 取消订单弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
|
||||
const comboCard = {
|
||||
const ComboCard = {
|
||||
// 跳转到对饮茶室的详情页
|
||||
handleToStore: () => {
|
||||
uni.navigateTo({
|
||||
@ -276,7 +281,8 @@
|
||||
// TODO 这里调用删除抖音订单的接口
|
||||
break;
|
||||
case OrderSource.TeaRoom:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
// 这里调用删除茶室订单的接口
|
||||
handleTRDeleteOrderHooks(props.order.id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
@ -306,27 +312,29 @@
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
switch (source) {
|
||||
case OrderSource.Direct:
|
||||
// TODO 这里调用删除直营订单的接口
|
||||
break;
|
||||
case OrderSource.Franchise:
|
||||
// TODO 这里调用删除加盟订单的接口
|
||||
break;
|
||||
case OrderSource.DouYin:
|
||||
// TODO 这里调用删除抖音订单的接口
|
||||
break;
|
||||
case OrderSource.TeaRoom:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (res.action == 'confirm') {
|
||||
switch (source) {
|
||||
case OrderSource.Direct:
|
||||
// TODO 这里调用删除直营订单的接口
|
||||
break;
|
||||
case OrderSource.Franchise:
|
||||
// TODO 这里调用删除加盟订单的接口
|
||||
break;
|
||||
case OrderSource.DouYin:
|
||||
// TODO 这里调用删除抖音订单的接口
|
||||
break;
|
||||
case OrderSource.TeaRoom:
|
||||
// 这里调用删除茶室订单的接口
|
||||
handleTRCancelOrderHooks(props.order.id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 点击确认按钮回调事件
|
||||
toast.info('订单取消成功')
|
||||
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
@ -385,9 +393,7 @@
|
||||
})
|
||||
break;
|
||||
case OrderSource.TeaRoom:
|
||||
uni.navigateTo({
|
||||
url: `/bundle/order/tea-room/order-detail?orderStatus=${props.orderStatus}&toPay=true`
|
||||
})
|
||||
handleTRToPayHooks(props.order.id, props.order.room_name, props.order.store_id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
uni.navigateTo({
|
||||
|
||||
Reference in New Issue
Block a user