完善茶艺师套餐功能

This commit is contained in:
wangxiaowei
2026-03-28 16:42:40 +08:00
parent 69b0dce2bd
commit 4729dc5ae8
22 changed files with 816 additions and 550 deletions

View File

@ -27,24 +27,24 @@
const levelMap = {
gold: {
icon: `${OSS}icon/icon_gold_medal.png`,
text: '金牌茶艺师'
text: '云华茶艺师'
},
senior: {
icon: `${OSS}icon/icon_senior_medal.png`,
text: '高级茶艺师'
text: '竹影茶艺师'
},
intermediate: {
icon: `${OSS}icon/icon_intermediate_medal.png`,
text: '中级茶艺师'
text: '明月茶艺师'
},
junior: {
icon: `${OSS}icon/icon_junior_medal.png`,
text: '初级茶艺师'
text: '清风茶艺师'
},
enthusiast: {
icon: `${OSS}icon/icon_enthusiast_medal.png`,
text: '茶艺爱好者'
}
// enthusiast: {
// icon: `${OSS}icon/icon_enthusiast_medal.png`,
// text: '茶艺爱好者'
// }
}
</script>

View File

@ -73,8 +73,13 @@
// 可用优惠券数量
const useCoupon = ref<number>(0)
// 优惠券类型
const typeId = ref<number>(1) // 1茶艺师 2茶室 3个人中心 4套餐优惠券,这个页面是普通的茶艺师列表和茶艺师套餐列表共用的,所以需要区分
onLoad(async (args) => {
typeId.value = args.typeId || 1
teaRoomId.value = args.id
checkedId.value = args.couponId || 0
@ -87,15 +92,7 @@
* 初始化优惠券列表
*/
handleInitCoupon: async (price) => {
// const res = await getTeaSpecialistCoupons()
// const coupon = res.map( item => {
// return {
// ...item,
// user_coupon_id: item.id,
// }
// })
// couponList.value.use = coupon
const res = await getCoupons({type_id: 1, price}) // 1茶艺师 2茶室 3 个人中心
const res = await getCoupons({type_id: typeId.value, price}) // 1茶艺师 2茶室 3个人中心 4套餐优惠券
useCoupon.value = res.count.yes_use
couponList.value.use = res.result.filter(item => item.is_use == 0)
console.log("🚀 ~ couponList.value.use:", couponList.value.use)

View File

@ -185,8 +185,8 @@
</view>
<view class="font-400 text-26rpx leading-36rpx text-#606266">专属圈子</view>
</view>
<view class="flex flex-wrap items-center mt-16rpx">
<view class="mr-8rpx bg-[#4C9F44] text-[#fff] px-10rpx leading-34rpx font-400 text-24rpx rounded-4rpx">123</view>
<view class="flex flex-wrap items-center mt-16rpx" v-for="(item, index) in info.label" :key="index">
<view class="mr-8rpx bg-[#4C9F44] text-[#fff] px-10rpx leading-34rpx font-400 text-24rpx rounded-4rpx">{{ item }}</view>
</view>
</view>
</view>
@ -329,6 +329,7 @@ const info = ref({
price: 0, // 服务费
mileage_price: 0, // 车马费
server_type: 0, // 服务方式 1到店 2上门 3两者都有
label: [], // 专属圈子标签
})
const latitude = ref<number>(0) // 纬度
const longitude = ref<number>(0) // 经度

View File

@ -103,9 +103,11 @@
</view>
<view class="flex flex-wrap items-center mt-14rpx">
<view
class="mr-8rpx bg-[#4C9F44] text-[#fff] px-10rpx leading-34rpx font-400 text-24rpx rounded-4rpx">
123</view>
<view
class="mr-8rpx bg-[#4C9F44] text-[#fff] px-10rpx leading-34rpx font-400 text-24rpx rounded-4rpx"
v-for="(labelText, index) in item.label" :key="index">
{{ labelText }}
</view>
</view>
<view class="flex items-center justify-between mt-18rpx">

View File

@ -117,6 +117,7 @@
</view>
</view>
<!-- 优惠 -->
<view class="mt-52rpx">
<view class="flex justify-between items-center text-30rpx text-[#303133] leading-42rpx">
<view>优惠</view>
@ -231,7 +232,7 @@
<!-- 茶艺师信息 -->
<view class="flex items-center bg-white p-20rpx rounded-10rpx mb-20rpx mt-20rpx">
<view class="mr-28rpx relative">
<wd-img width="200rpx" height="200rpx" radius="10rpx" :src="info.image"></wd-img>
<wd-img width="200rpx" height="200rpx" radius="10rpx" :src="info.image" @click="previewImage(info.image, [info.image])"></wd-img>
</view>
<view class="">
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">
@ -405,15 +406,11 @@
<script lang="ts" setup>
import { useMessage, useToast } from 'wot-design-uni'
import { digits } from '@/utils/test'
import { router, toTimes, toPlus, getCurrentDate } from '@/utils/tools'
import { router, toPlus, previewImage } from '@/utils/tools'
import PriceFormat from '@/components/PriceFormat.vue'
import { ReserveServiceCategory, OrderType } from '@/utils/order'
import { getTeaSpecialistDetails, getTeaTypeList, createTeaSpecialistOrder } from '@/api/tea'
import { getNext7Days} from '@/api/tea-room'
import type { ITeaSpecialistDetailsFields, ITeaSpecialistFuture7DaysResult, ITeaTypeListResult } from '@/api/types/tea'
import { TeaSpecialistLevelValue } from '@/utils/teaSpecialist'
import type { IUserAddressListResult } from '@/api/types/user'
import { OrderType } from '@/utils/order'
import { getTeaTypeList, createTeaSpecialistOrder } from '@/api/tea'
import type { ITeaSpecialistFuture7DaysResult, ITeaTypeListResult } from '@/api/types/tea'
import BookingTime from '@/components/BookingTime.vue'
import { CouponType } from '@/utils/coupon'
import { getTeaSpecialistDetail, getTeaSpecialistFeeDetails } from '@/api/tea-specialist'
@ -426,10 +423,6 @@
const isSubmitting = ref(false)
// 服务方式
const serviceType = ref<Array<any>>([
{type: 1, name: '到店服务'},
{type: 2, name: '上门服务'},
])
const serviceTypeValue = ref<number>(1)
// 选择茶馆
@ -597,6 +590,14 @@
}
}
// 初始化时间组件默认值,兼容 H5 端不自动触发 @change 的情况
startTimeValue.value = String(minTimestamp)
// #ifdef H5
// 仅在 H5 环境下手动触发,避免小程序端组件抛出 @change 造成执行两次
Door.handleStartTimePicker({ value: minTimestamp as number })
// #endif
// 初始化数据
Reserve.handleInit()
})
@ -606,7 +607,10 @@
* 初始化-获取茶叶列表
*/
handleInit: async () => {
const tea = await getTeaTypeList()
const tea = await getTeaTypeList({
team_user_id: id.value,
type: 1
})
teaList.value = tea as ITeaTypeListResult[]
},
@ -818,7 +822,7 @@
})
// 获取预定了几个小时
router.navigateTo(`/bundle_b/pages/tea-specialist/coupon?couponId=${selectCouponId.value}&price=${costBill.value.order_amount}`)
router.navigateTo(`/bundle_b/pages/tea-specialist/coupon?couponId=${selectCouponId.value}&price=${costBill.value.order_amount}&typeId=1`)
},
/**