完善茶艺师接口对接

This commit is contained in:
wangxiaowei
2026-01-05 00:39:06 +08:00
parent 237df8d039
commit 39c64a2504
29 changed files with 1204 additions and 651 deletions

View File

@ -103,7 +103,7 @@
</view>
<!-- <view class="font-400 text-24rpx text-[#D2D0D0] leading-34rpx">请尽快领取会员权益</view> -->
</view>
<view class="mt-50rpx ml-24rpx">
<!-- <view class="mt-50rpx ml-24rpx">
<scroll-view class="w-[100%] whitespace-nowrap" :scroll-x="true" scroll-left="120">
<view class="scroll-item mr-20rpx" v-for="(item, index) in couponList" :key="index">
<view class="font-bold text-22rpx text-[#AF6400] leading-32rpx mt-6rpx">{{ item.type_id == 1 ? '茶艺师券' : '茶室券' }}</view>
@ -118,7 +118,7 @@
</view>
</view>
</scroll-view>
</view>
</view> -->
</view>
<!-- 非会员下的状态 -->
@ -133,6 +133,24 @@
</view>
</view>
<!-- 优惠券 -->
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx px-30rpx py-20rpx flex items-center justify-between" v-if="isLogin && couponList.length > 0">
<scroll-view class="w-[100%] whitespace-nowrap" :scroll-x="true" scroll-left="120">
<view class="scroll-item mr-20rpx" v-for="(item, index) in couponList" :key="index">
<view class="font-bold text-22rpx text-[#AF6400] leading-32rpx mt-6rpx">{{ item.type_id == 1 ? '茶艺师券' : '茶室券' }}</view>
<view class="font-bold text-[#1C1C1D] leading-34rpx mt-8rpx">
<text class="text-24rpx">¥</text>
<text class="text-30rpx">{{ item.coupon_price }}</text>
</view>
<view class="font-400 text-20rpx leading-28rpx text-[#1C1C1D]">{{ item.name }}</view>
<view class="font-400 text-20rpx w-126rpx h-40rpx rounded-20rpx mt-18rpx leading-40rpx mx-auto"
:class="item.use == 1 ? 'bg-[#E6E3DF]' : 'bg-[#FCCA84]'" @click="My.handleClaimCoupon(item.id, item.type_id)">
{{ item.use == 1 ? '已领取' : '立即领取' }}
</view>
</view>
</scroll-view>
</view>
<!-- 团购 -->
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx px-56rpx py-48rpx flex items-center justify-between">
<view class="flex items-center" @click="router.navigateTo('/bundle/order/douyin/order-list')">
@ -174,7 +192,7 @@
</view>
<!-- 茶艺师订单 -->
<!-- <view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
<view class="px-30rpx pt-30rpx py-24rpx">茶艺师订单</view>
<view class="flex relative px-30rpx">
<view v-for="(item, index) in teaReserveMenuList" :key="index">
@ -186,7 +204,7 @@
</view>
</view>
</view>
</view> -->
</view>
<!-- 更多服务 -->
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
@ -237,7 +255,8 @@
</template>
<script lang="ts" setup>
import { TeaRoomOrderStatusText, TeaSpecialistOrderStatusText } from '@/utils/order'
import { TeaRoomOrderStatusText } from '@/utils/order'
import { TeaSpecialistManageOrderStatusText } from '@/utils/teaSpecialistOrder'
import { toast } from '@/utils/toast'
import { router } from '@/utils/tools'
import { useUserStore } from '@/store'
@ -282,11 +301,11 @@
// 茶艺师订单
const teaReserveMenuList = reactive([
{ id: 1, title: '全部订单', icon: `${OSS}icon/icon_tea_all_order.png`, badge: '', status: TeaSpecialistOrderStatusText.All },
{ id: 2, title: '待付款', icon: `${OSS}icon/icon_tea_wait_pay_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Pending },
{ id: 3, title: '预约单', icon: `${OSS}icon/icon_tea_reserve_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Pay },
{ id: 4, title: '待确认', icon: `${OSS}icon/icon_tea_wait_confirm_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Confirm },
{ id: 4, title: '已完', icon: `${OSS}icon/icon_tea_finish_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Finished },
{ id: 1, title: '全部订单', icon: `${OSS}icon/icon_tea_all_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.All },
{ id: 2, title: '待付款', icon: `${OSS}icon/icon_tea_wait_pay_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Unpaid },
{ id: 3, title: '预约单', icon: `${OSS}icon/icon_tea_reserve_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Reserved },
{ id: 4, title: '服务中', icon: `${OSS}icon/icon_tea_wait_confirm_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Service },
{ id: 5, title: '已完', icon: `${OSS}icon/icon_tea_wait_confirm_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Completed },
])
// 更多服务
@ -321,6 +340,8 @@
isVip.value = true
}
})
My.handleInit()
} else {
Object.keys(user.value).forEach(key => {
user.value[key] = ''
@ -368,13 +389,17 @@
/**
* 领取优惠券
*/
handleClaimCoupon: async (id: number) => {
handleClaimCoupon: async (id: number, type_id: number) => {
await claimMyCoupon({id})
toast.info('领取成功')
My.handleInit()
getUserInfo().then(res => {
user.value = res
})
if (type_id == 1) {
router.navigateTo('/bundle_b/pages/tea-specialist/list')
}
},
// 跳转到个人信息