完善茶室订单
This commit is contained in:
@ -7,24 +7,24 @@
|
||||
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">选择时间</view>
|
||||
|
||||
<view class="">
|
||||
<view class="booking-time ">
|
||||
<wd-tabs v-model="selectedDay" color="#4C9F44">
|
||||
<block v-for="item in days" :key="item">
|
||||
<view class="booking-time">
|
||||
<wd-tabs v-model="selectedDay" color="#4C9F44" @click="bookingTime.handleChangeTimeTab">
|
||||
<block v-for="item in day.time" :key="item">
|
||||
<scroll-view scroll-y>
|
||||
<wd-tab :title="`${item}`" :name="item">
|
||||
<wd-tab :title="`${item.display}`" :name="item.display">
|
||||
<view class="">
|
||||
<view class="!h-500rpx mt-30rpx">
|
||||
<view class="grid grid-cols-4 gap-x-20rpx gap-y-20rpx mx-30rpx">
|
||||
<view v-for="item in timeList" :key="item.time"
|
||||
<view v-for="item2 in item.time_slots" :key="item2.start_time"
|
||||
class="h-72rpx rounded-16rpx flex items-center justify-center text-28rpx leading-40rpx"
|
||||
:class="[
|
||||
item.disabled
|
||||
item2.disabled == 0
|
||||
? 'bg-[#F7F7F7] text-[#C9C9C9]' // 禁用高亮
|
||||
: selectedTime.includes(item.time)
|
||||
: selectedTime.includes(item2.start_time)
|
||||
? 'bg-[#F1F8F0] text-[#4C9F44]' // 选中高亮
|
||||
: 'bg-[#F7F7F7] text-[#303133]', // 可选高亮
|
||||
]" @click="!item.disabled && bookingTime.handleSelectTime(item.time)">
|
||||
{{ item.time }}
|
||||
]" @click="item2.disabled == 1 && bookingTime.handleSelectTime(item2.start_time, item2.timestamp)">
|
||||
{{ item2.start_time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -55,6 +55,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="BookingTime">
|
||||
import {toast} from '@/utils/toast'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
/**
|
||||
@ -67,78 +69,88 @@
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
day: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// ...其它props
|
||||
})
|
||||
|
||||
|
||||
// 初始化时间
|
||||
onMounted(() => {
|
||||
bookingTime.handleInitTime()
|
||||
// bookingTime.handleInitTime()
|
||||
})
|
||||
|
||||
/** 日期相关 **/
|
||||
const timeList = [
|
||||
{ time: '09:00', disabled: true },
|
||||
{ time: '09:30', disabled: false },
|
||||
{ time: '10:00', disabled: false },
|
||||
{ time: '10:30', disabled: false },
|
||||
{ time: '11:00', disabled: false },
|
||||
{ time: '11:30', disabled: false },
|
||||
]
|
||||
const weekMap = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
||||
|
||||
const days = ref<string[]>([])
|
||||
const selectedDay = ref<number>(0)
|
||||
const selectedTime = ref<string[]>([])
|
||||
const selectedTimeStamp = ref<number[]>([])
|
||||
const countSelectedTime = ref<number>(0)
|
||||
|
||||
const bookingTime = {
|
||||
// 初始化时间逻辑
|
||||
handleInitTime: () => {
|
||||
const today = new Date()
|
||||
const result: string[] = []
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const d = new Date(today)
|
||||
d.setDate(today.getDate() + i)
|
||||
const month = d.getMonth() + 1
|
||||
const date = d.getDate()
|
||||
const week = weekMap[d.getDay()]
|
||||
result.push(`${month}/${date}${week}`)
|
||||
}
|
||||
days.value = result
|
||||
},
|
||||
|
||||
// 选择的时间高亮显示
|
||||
handleSelectTime: (time: string) => {
|
||||
handleSelectTime: (time: string, timestamp: number) => {
|
||||
const idx = selectedTime.value.indexOf(time)
|
||||
if (idx > -1) {
|
||||
selectedTime.value.splice(idx, 1) // 取消选中
|
||||
selectedTimeStamp.value.splice(idx, 1)
|
||||
} else {
|
||||
selectedTime.value.push(time) // 选中
|
||||
selectedTimeStamp.value.push(timestamp)
|
||||
}
|
||||
|
||||
// 计算时长
|
||||
countSelectedTime.value = selectedTime.value.length * 0.5
|
||||
countSelectedTime.value = selectedTime.value.length * 1
|
||||
},
|
||||
|
||||
// 确认选择的时间
|
||||
handleConfirmSelectedTime: () => {
|
||||
console.log('确认选择的时间:', selectedDay.value, selectedTime.value)
|
||||
if (selectedTime.value.length === 0) {
|
||||
toast.info('请选择时间')
|
||||
return
|
||||
}
|
||||
|
||||
if (selectedTime.value.length < props.day.minimum_time) {
|
||||
toast.info(props.day.minimum_time + '小时起订')
|
||||
return
|
||||
}
|
||||
|
||||
const data = [
|
||||
selectedDay.value,
|
||||
selectedTime.value.sort(),
|
||||
selectedTimeStamp.value.sort(),
|
||||
]
|
||||
emit('selectedTime', data)
|
||||
showPopup.value = false
|
||||
},
|
||||
|
||||
// 切换时间tab的时候把之前选中的时间重置
|
||||
handleChangeTimeTab: () => {
|
||||
selectedTime.value = []
|
||||
selectedTimeStamp.value = []
|
||||
countSelectedTime.value = 0
|
||||
},
|
||||
|
||||
// 重置选择的时间
|
||||
resetSelectedTime: () => {
|
||||
selectedTime.value = []
|
||||
selectedTimeStamp.value = []
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
const showPopup = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val: boolean) => emit('update:modelValue', val)
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const emit = defineEmits(['update:modelValue', 'selectedTime'])
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@ -12,14 +12,15 @@
|
||||
<view class="ml-20rpx text-30rpx text-[#303133] leading-42rpx">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="absolute right-0 top-6rpx right-60rpx" v-if="item.type !== PayCategory.WeChatPay">可用{{ userInfo.user_money }}</view>
|
||||
<view class="absolute right-0 top-6rpx right-60rpx" v-if="item.type == PayCategory.PlatformBalance">可用{{ userInfo.user_money }}</view>
|
||||
<view class="absolute right-0 top-6rpx right-60rpx" v-if="item.type == PayCategory.StoreBalance && storeMoney > 0">可用{{ storeMoney }}</view>
|
||||
</wd-radio>
|
||||
</block>
|
||||
</wd-radio-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="Pay">
|
||||
<script lang="ts" setup name="RechargeBtn">
|
||||
/**
|
||||
* Pay 支付组件
|
||||
* @description 用于展示支付
|
||||
@ -71,6 +72,11 @@
|
||||
hideWechat: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
storeMoney: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<view class="mb-20rpx" @click="onCheck(coupon.id)">
|
||||
<view class="mb-20rpx" @click="onCheck(coupon.user_coupon_id)">
|
||||
<view class="coupon h-210rpx flex items-center">
|
||||
<view class="w-260rpx h-[100%] rounded-l-16rpx rounded-tr-0 rounded-br-0 flex flex-col items-center justify-center" :class="canUse ? 'bg-[#4C9F44]' : 'bg-[#F2F2F2]'">
|
||||
<view class="flex" :class="canUse ? 'text-[#fff]' : 'text-[#BFC2CC]'">
|
||||
<view class="text-72rpx leading-100rpx">{{ coupon.amount }}</view>
|
||||
<view class="text-52rpx leading-100rpx">{{ coupon.coupon_price }}</view>
|
||||
<view class="text-32rpx leading-44rpx mt-40rpx ml-10rpx">元</view>
|
||||
</view>
|
||||
<view class="text-26rpx font-400 leading-36rpx text-center" :class="canUse ? 'text-[#fff]' : 'text-[#BFC2CC]'">满120元可用</view>
|
||||
<view class="text-26rpx font-400 leading-36rpx text-center" :class="canUse ? 'text-[#fff]' : 'text-[#BFC2CC]'">满{{ coupon.use_price }}元可用</view>
|
||||
</view>
|
||||
<view class="bg-[#fff] w-490rpx h-[100%] rounded-r-16rpx rounded-tl-0 rounded-bl-0 flex justify-between items-center">
|
||||
<view class="ml-30rpx line-1">
|
||||
<view class="text-34rpx leading-48rpx line-1" :class="canUse ? 'text-[#303133]' : 'text-[#909399]'">茶室优惠</view>
|
||||
<view class="mt-40rpx text-[#909399] text-24rpx leading-34rpx" :class="canUse ? 'text-[#909399]' : 'text-[#BFC2CC]'">有效期至 2022-08-12</view>
|
||||
<view class="text-34rpx leading-48rpx line-1" :class="canUse ? 'text-[#303133]' : 'text-[#909399]'">{{ coupon.title }}</view>
|
||||
<view class="mt-40rpx text-[#909399] text-24rpx leading-34rpx" :class="canUse ? 'text-[#909399]' : 'text-[#BFC2CC]'">有效期至 {{ coupon.effect_time }}</view>
|
||||
</view>
|
||||
<view class="h-100% mr-70rpx mt-58rpx" v-if="showChecked">
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
<wd-radio :value="coupon.user_coupon_id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -30,9 +30,11 @@
|
||||
defineProps<{
|
||||
coupon: {
|
||||
id: number
|
||||
amount: number
|
||||
limit: number
|
||||
expire: string
|
||||
coupon_price: number
|
||||
use_price: number
|
||||
title: string
|
||||
effect_time: string
|
||||
user_coupon_id: number
|
||||
}
|
||||
canUse: boolean
|
||||
showChecked: boolean
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -1,26 +1,28 @@
|
||||
<template>
|
||||
<view v-for="(item, index) in 10" :key="index">
|
||||
<view v-for="(item, index) in list" :key="index">
|
||||
<view class="flex items-center">
|
||||
<view class="w-200rpx h-200rpx">
|
||||
<wd-img width="100%" height="100%" :src="`${OSS}images/reserve_room/reserve_room_image2.png`"
|
||||
radius="10rpx"/>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx" v-if="!isGroupBuying">
|
||||
<view class="text-28rpx text-[#303133] leading-40rpx line-1 w-420rpx">双人包间这个是标题名双人包间这个是标题名双人包间这个是标题名</view>
|
||||
<view class="text-28rpx text-[#303133] leading-40rpx line-1 w-420rpx">{{ item.title }}</view>
|
||||
<view class="mt-22rpx flex">
|
||||
<view class="mr-20rpx flex items-start">
|
||||
<wd-tag color="#40AE36" bg-color="#40AE36" plain custom-class="!rounded-4rpx">文艺小清新</wd-tag>
|
||||
</view>
|
||||
<view class="flex items-start">
|
||||
<wd-tag color="#F55726" bg-color="#F55726" plain>全息投影</wd-tag>
|
||||
</view>
|
||||
<template v-for="(label, labelIndex) in item.label" :key="labelIndex">
|
||||
<view class="mr-20rpx flex items-start" v-if="label.category_id == 1">
|
||||
<wd-tag color="#40AE36" bg-color="#40AE36" plain custom-class="!rounded-4rpx">文艺小清新</wd-tag>
|
||||
</view>
|
||||
<view class="flex items-start" v-if="label.category_id == 2">
|
||||
<wd-tag color="#F55726" bg-color="#F55726" plain>全息投影</wd-tag>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="flex justify-between items-end">
|
||||
<price-format color="#FF5951" class="m-r-10" :first-size="34" :second-size="26"
|
||||
:subscript-size="26" :price="23.02" weight="500"></price-format>
|
||||
:subscript-size="26" :price="item.price" weight="500"></price-format>
|
||||
<view>
|
||||
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 10+</view>
|
||||
<view class="w-104rpx h-52rpx mt-16rpx text-26rpx font-400 text-[#4C9F44] leading-52rpx text-center border-[2rpx] border-[#4C9F44] rounded-10rpx" @click="roomList.toPage('detail', 1)">预定</view>
|
||||
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 {{ item.buy_nums > 10 ? item.buy_nums + '+' : item.buy_nums }}</view>
|
||||
<view class="w-104rpx h-52rpx mt-16rpx text-26rpx font-400 text-[#4C9F44] leading-52rpx text-center border-[2rpx] border-[#4C9F44] rounded-10rpx" @click="RoomList.toPage('detail', item.store_id, item.id, item.price)">预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -49,14 +51,15 @@
|
||||
</view>
|
||||
<view class="absolute bottom-0 right-0">
|
||||
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 10+</view>
|
||||
<view class="w-104rpx h-52rpx mt-16rpx text-26rpx font-400 text-[#4C9F44] leading-52rpx text-center border-[2rpx] border-[#4C9F44] rounded-10rpx" @click="roomList.toPage('detail', 1)">预定</view>
|
||||
<view class="w-104rpx h-52rpx mt-16rpx text-26rpx font-400 text-[#4C9F44] leading-52rpx text-center border-[2rpx] border-[#4C9F44] rounded-10rpx" @click="RoomList.toPage('detail', item.store_id, item.id, item.price)">预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-around items-center ml-12rpx mt-18rpx" v-if="isReserve && !isGroupBuying">
|
||||
<view class="w-20rpx text-center" v-for="(item, index) in 24" :key="index">
|
||||
<view class="font-400 text-20rpx text-[#606266] leading-28rpx">{{ item }}</view>
|
||||
<view class="h-12rpx rounded-6rpx bg-[#4C9F44] mt-4rpx" :class="`${index === 1 || index === 11 ? 'bg-[#C9C9C9]' : ''}`"></view>
|
||||
<view class="flex justify-around items-center ml-12rpx mt-18rpx" v-if="isReserve">
|
||||
<view class="w-20rpx text-center" v-for="(timeItem, timeIndex) in item.room_time" :key="timeIndex">
|
||||
<view class="font-400 text-20rpx text-[#606266] leading-28rpx">{{ timeItem.value }}</view>
|
||||
<!-- timeItem.status: 1可选 2不可选 -->
|
||||
<view class="h-12rpx rounded-6rpx bg-[#4C9F44] mt-4rpx" :class="`${timeItem.status == 2 ? 'bg-[#C9C9C9]' : ''}`"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-24rpx gap" v-if="index !== props.list.length - 1">
|
||||
@ -73,6 +76,7 @@
|
||||
|
||||
import PriceFormat from '@/components/PriceFormat.vue'
|
||||
import {ReserveServiceCategory} from '@/utils/order'
|
||||
import { router } from '@/utils/tools';
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
@ -80,7 +84,7 @@
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
type: Array as () => Array<any>,
|
||||
default: () => []
|
||||
},
|
||||
// 是否开启预定
|
||||
@ -100,13 +104,11 @@
|
||||
}
|
||||
})
|
||||
|
||||
const roomList = {
|
||||
toPage: (type: string, id: number) => {
|
||||
const RoomList = {
|
||||
toPage: (type: string, id: number, roomId: number, price: number) => {
|
||||
if (type === 'detail') {
|
||||
let type = props.isGroupBuying ? ReserveServiceCategory.GroupBuying : ReserveServiceCategory.ReserveRoom
|
||||
uni.navigateTo({
|
||||
url: `/bundle/tea-room/detail?id=${id}&type=${type}`
|
||||
})
|
||||
const type = props.isGroupBuying ? ReserveServiceCategory.GroupBuying : ReserveServiceCategory.ReserveRoom
|
||||
router.navigateTo(`/bundle/tea-room/detail?storeId=${id}&roomId=${roomId}&type=${type}&price=${price}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user