调试茶艺师订单接口

This commit is contained in:
wangxiaowei
2026-01-03 01:40:12 +08:00
parent 66ee35285d
commit 3a31777431
18 changed files with 717 additions and 344 deletions

View File

@ -91,7 +91,7 @@
<!-- 轮播图 -->
<view class="mx-30rpx">
<wd-swiper value-key="image" height="400rpx"
:indicator="{ type: 'dots-bar' }" :list="swiperList" v-model:current="current" mode="aspectFit"></wd-swiper>
:indicator="{ type: 'dots-bar' }" :list="info.image_arr" mode="aspectFit"></wd-swiper>
</view>
<!-- 昵称显示 -->
@ -99,27 +99,34 @@
<view class="font-bold text-34rpx leading-48rpx text-#303133 pt-36rpx">{{ info.name }}</view>
<view class="flex items-center justify-between mt-4rpx">
<view class="flex items-center">
<wd-rate v-model="rate" readonly active-color="#FF5951" allow-half active-icon="star-filled" icon="star" space="4rpx"/>
<wd-rate v-model="info.star" readonly active-color="#FF5951" allow-half active-icon="star-filled" icon="star" space="4rpx"/>
<view class="font-400 text-26rpx text-#606266 ml-8rpx">{{ info.star }} 推荐</view>
</view>
<view class="font-400 text-22rpx leading-32rpx text-#6A6363">已预约 {{ info.reservation_num > 10 ? info.reservation_num + '+' : info.reservation_num }}</view>
<view class="font-400 text-22rpx leading-32rpx text-#6A6363">已预约 {{ Number(info.sold) > 10 ? Number(info.sold) + '+' : Number(info.sold) }}</view>
</view>
<view class="flex items-center mt-24rpx">
<view class="flex items-center">
<wd-img :src="`${OSS}icon/icon_store_cert.png`" width="36rpx" height="36rpx"></wd-img>
</view>
<text class="ml-8rpx font-400 text-24rpx leading-4rpx text-#303133">商家认证</text>
</view>
<view class="flex items-center justify-between mt-24rpx">
<view class="flex items-center">
<view class="mr-20rpx" v-if="is90">
<wd-tag color="#FF5951" bg-color="#FEF1F0" custom-class="!rounded-6rpx !px-16rpx !py-4rpx !h-40rpx !w-144rpx">90后茶艺师</wd-tag>
<view class="mr-20rpx">
<wd-tag color="#FF5951" bg-color="#FEF1F0" custom-class="!rounded-6rpx !px-16rpx !py-4rpx !h-40rpx !w-144rpx">{{ info.age_range }}后茶艺师</wd-tag>
</view>
<view class="w-160rpx h-40rpx relative mr-44rpx top-6rpx">
<view class="absolute left-0 top-0 h-36rpx flex items-start">
<wd-img :src="`${OSS}icon/icon_gold_medal.png`" width="36rpx" height="36rpx"></wd-img>
</view>
<view>
<tea-specialist-level :level="TeaSpecialistLevelValue[info.teamasterLevel?.[0]?.level_name] || 'junior'"></tea-specialist-level>
<tea-specialist-level :level="info.level"></tea-specialist-level>
</view>
</view>
</view>
<view class="font-400 text-24rpx leading-34rpx text-#818CA9">距离您{{ info.distance }}km 预计{{ info.speed }}分钟</view>
<view class="font-400 text-24rpx leading-34rpx text-#818CA9">距离您{{ info.distance }}km {{ info.is_time }}</view>
</view>
</view>
@ -129,22 +136,22 @@
<view class="flex justify-between items-center mx-88rpx text-center mt-30rpx">
<view>
<view class="font-400 text-28rpx leading-40rpx text-#606266">性别</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.gender == 1 ? '男' : '女' }}</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.sex == 1 ? '男' : '女' }}</view>
</view>
<view class="w-4rpx h-66rpx bg-#F6F7F9"></view>
<view>
<view class="font-400 text-28rpx leading-40rpx text-#606266">年龄</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.both }}</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.both }}</view>
</view>
<view class="w-4rpx h-66rpx bg-#F6F7F9"></view>
<view>
<view class="font-400 text-28rpx leading-40rpx text-#606266">身高</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.height }}cm</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.height }}cm</view>
</view>
<view class="w-4rpx h-66rpx bg-#F6F7F9"></view>
<view>
<view class="font-400 text-28rpx leading-40rpx text-#606266">体重</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.weight }}kg</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.weight }}kg</view>
</view>
</view>
@ -162,7 +169,7 @@
<view class="font-400 text-26rpx leading-36rpx text-#606266">兴趣爱好</view>
</view>
<view class="mt-20rpx font-400 text-28rpx leading-40rpx text-#303133">
“{{ info.real.interests }}”
{{ info.hobby_introduce }}
</view>
</view>
</view>
@ -171,17 +178,16 @@
<view class="content-tab">
<wd-tabs v-model="tab">
<block v-for="(item, index) in tabList" :key="index">
<wd-tab :title="item.title">
<view class="content mx-30rpx mt-44rpx">{{ item.content }}</view>
</wd-tab>
</block>
<wd-tab title="费用说明"></wd-tab>
<wd-tab title="项目介绍"></wd-tab>
<wd-tab title="禁忌说明"></wd-tab>
<wd-tab title="下单须知"></wd-tab>
</wd-tabs>
</view>
<!-- 费用说明 -->
<view class="mx-30rpx mt-44rpx">
<view >
<!-- 费用说明 -->
<view v-if="tab === 0">
<view class="font-bold text-32rpx leading-44rpx text-#303133">
费用说明
</view>
@ -206,7 +212,7 @@
<view class="w-8rpx h-8rpx rounded-8rpx bg-#6A6363 mr-14rpx"></view>
<view class="flex-1 flex items-center justify-between font-500 text-26rpx leading-48rpx text-#303133">
<view>车马费</view>
<view>{{ info.fare_price }}/公里</view>
<view>{{ info.mileage_price }}/公里</view>
</view>
</view>
</view>
@ -238,22 +244,84 @@
</view>
</view>
</view>
</view>
</view>
<view class="h-4rpx bg-#F6F7F9 mt-40rpx mb-26rpx"></view>
<!-- 温馨提示 -->
<!-- 项目介绍 -->
<view v-if="tab === 1">
<view class="font-bold text-32rpx leading-44rpx text-#303133">
项目介绍
</view>
<view class="mt-24rpx">
<view>
<view class="flex items-center">
<view class="mr-14rpx">
<wd-icon name="info-circle" size="36rpx" color="#707070"></wd-icon>
<view class="font-bold text-28rpx leading-48rpx text-[#303133]">自饮七步</view>
<view class="mt-24rpx font-500 text-[#303133] text-26rpx leading-48rpx">
<view>
<text class="mr-20rpx"> 选茶</text>
<text class="mr-20rpx"> 择器</text>
<text class="mr-20rpx"> 备水</text>
</view>
<view>
<text class="mr-20rpx"> 入境</text>
<text class="mr-20rpx"> 冲泡</text>
<text class="mr-20rpx"> 品茗</text>
<text class="mr-20rpx"> 回味</text>
</view>
<view class="font-bold text-28rpx leading-48rpx text-#303133">温馨提示</view>
</view>
</view>
<view class="mt-24rpx">
<view class="font-bold text-28rpx leading-48rpx text-[#303133]">对饮八式</view>
<view class="mt-24rpx font-500 text-[#303133] text-26rpx leading-48rpx">
<view>
<text class="mr-20rpx"> 洗尘</text>
<text class="mr-20rpx"> 坦呈</text>
<text class="mr-20rpx"> 苏酲</text>
<text class="mr-20rpx"> 法度</text>
</view>
<view>
<text class="mr-20rpx"> 养成</text>
<text class="mr-20rpx"> 身受</text>
<text class="mr-20rpx"> 分享</text>
<text class="mr-20rpx"> 放下</text>
</view>
</view>
</view>
</view>
</view>
<view class="flex items-center mt-24rpx">
<view class="w-8rpx h-8rpx rounded-8rpx bg-#6A6363 mr-12rpx"></view>
<view class="font-500 text-26rpx leading-48rpx text-#F29747">茶艺师需提前一小时预约两小时起订</view>
<!-- 禁忌说明 -->
<view v-if="tab === 2">
<view class="font-bold text-32rpx leading-44rpx text-#303133">
禁忌说明
</view>
<view class="mt-24rpx font-500 text-26rpx leading-48rpx text-[#303133]">
<view>绿色正规茶艺师综合服务平台</view>
<view>为确保平台营运的合法合规和避免不必要的纠纷禁止茶师私添加客户微信</view>
<view>禁止茶师私自收款(现金微信支付宝红包或转帐等)</view>
<view>禁止茶师私下接受宴请</view>
<view>以及从事除平台项目之外的其它内容和活动</view>
</view>
</view>
<!-- 下单须知 -->
<view v-if="tab === 3">
<view class="font-bold text-32rpx leading-44rpx text-#303133">
下单须知
</view>
<view class="mt-24rpx font-500 text-26rpx leading-48rpx text-[#303133]">
茶艺师出发后客户取消订单车费不予返还敬请谅解
</view>
<view class="mt-24rpx">
<view class="flex items-center">
<view class="mr-14rpx">
<wd-icon name="info-circle" size="36rpx" color="#707070"></wd-icon>
</view>
<view class="font-bold text-28rpx leading-48rpx text-#303133">温馨提示</view>
</view>
<view class="flex items-center mt-24rpx">
<view class="w-8rpx h-8rpx rounded-8rpx bg-#6A6363 mr-12rpx"></view>
<view class="font-500 text-26rpx leading-48rpx text-#F29747">茶艺师需提前一小时预约两小时起订</view>
</view>
</view>
</view>
@ -262,7 +330,7 @@
<!-- 操作按钮 -->
<view>
<view v-if="!isReserve" class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] bg-white mt-24rpx pt-36rpx pb-28rpx">
<view v-if="!isReserve" class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] mt-24rpx pt-36rpx pb-28rpx">
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff" @click="Detail.handleReserveTeaspecialist">立即邀约</view>
</view>
@ -283,7 +351,7 @@
<script lang="ts" setup>
import TeaSpecialistLevel from '@/components/TeaSpecialistLevel.vue'
import { useMessage } from 'wot-design-uni'
import { getTeaSpecialistDetails, collectTeaSpecialist, getTeaSpecialistRewardAmounts, teaSpecialistInvite } from '@/api/tea'
import { getTeaSpecialistDetail } from '@/api/tea-specialist'
import { ITeaSpecialistDetailsFields } from '@/api/types/tea'
import type { ITeaSpecialistRewardAmountsResult } from '@/api/types/tea'
import { toast } from '@/utils/toast'
@ -295,36 +363,33 @@
const OSS = inject('OSS')
// tab
const tab = ref<number>(1)
const tabList = ref<Array<{id: number, status: number, content: string, title: string}>>([
{id: 0, status: 0, content: '', title: ''},
])
const tab = ref<number>(0)
// 用户信息
const userInfo = ref<IUserInfoVo>(null)
// 茶艺师
const id = ref<number>(0)
const info = reactive<ITeaSpecialistDetailsFields>({
const info = ref({
id: 0,
name: '',
star: 0,
image: '',
reservation_num: 0,
distance: 0,
speed: 0,
real: { gender: 1, both: 18, height: 165, weight: 53, interests: '爱好茶艺,喜欢旅游,把爱好当工作' },
teamasterlabel: [],
teamasterLevel: [],
price: 0,
fare_price: 0,
collect: 0,
up_status: 0,
textarea: []
image_arr: [], // 轮播图
name: '', // 茶艺师名字
star: 0, // 茶艺师评分
sold: 0, // 已预约
age_range: '00', // 茶艺师年龄段
level: 1, // 茶艺师等级
distance: 0, // 距离
is_time: '', // 预计到达
sex: 0, // 性别
both: 0, // 年龄
weight: 0, // 体重
height: 0, // 身高
hobby_introduce: '', // 兴趣爱好介绍
price: 0, // 服务费
mileage_price: 0, // 车马费
})
const latitude = ref<number>(0) // 纬度
const longitude = ref<number>(0) // 经度
const is90 = ref<boolean>(false)
// 是否是预约茶艺师页面
const isReserve = ref<boolean>(false)
@ -332,17 +397,6 @@
// 弹窗
const message = useMessage('wd-message-box-slot')
// 轮播图
const swiperList = ref<string[]>([
`${OSS}images/banner1.png`,
`${OSS}images/banner1.png`,
`${OSS}images/banner1.png`
])
const current = ref<number>(0)
// 评分
const rate = ref<number>(1)
// 打赏茶艺师
const showTipTeaSpecialistPopup = ref<boolean>(false)
const tipList = ref<Array<ITeaSpecialistRewardAmountsResult>>([])
@ -357,35 +411,35 @@
id.value = args.id || 0
// 获取茶艺师详情
const res = await getTeaSpecialistDetails({
id: args.id,
const res = await getTeaSpecialistDetail({
team_user_id: args.id,
latitude: uni.getStorageSync('latitude'),
longitude: uni.getStorageSync('longitude'),
user_id: userInfo.value.id || 0
})
// 将返回的数据合并到 reactive 对象中
Object.assign(info, res.teamaster || {})
rate.value = info.star
tabList.value = info.textarea
console.log("🚀 ~ tabList:", res)
info.value = res.teamaster
console.log("🚀 ~ res:", res)
// 茶艺师是否上线
// if (info.up_status == 0) {
// isReserve.value = true
// rate.value = info.value.star
// tabList.value = info.value.textarea
// console.log("🚀 ~ tabList:", res)
// // 茶艺师是否上线
// // if (info.up_status == 0) {
// // isReserve.value = true
// // }
// if (info.value.teamasterlabel) {
// info.value.teamasterlabel.map(item => {
// if (item.label_name == '90后茶艺师') {
// is90.value = true
// }
// })
// }
if (info.teamasterlabel) {
info.teamasterlabel.map(item => {
if (item.label_name == '90后茶艺师') {
is90.value = true
}
})
}
// 获取打赏金额
getTeaSpecialistRewardAmounts().then((res: Array<ITeaSpecialistRewardAmountsResult>) => {
tipList.value = res
})
// getTeaSpecialistRewardAmounts().then((res: Array<ITeaSpecialistRewardAmountsResult>) => {
// tipList.value = res
// })
})
const Detail = {
@ -393,27 +447,27 @@
* TODO 处理收藏-暂时不要
*/
handleCollect: async () => {
let status = info.collect == 0 ? 1 : 0
await collectTeaSpecialist({
id: id.value,
status
})
// let status = info.collect == 0 ? 1 : 0
// await collectTeaSpecialist({
// id: id.value,
// status
// })
info.collect = info.collect == 0 ? 1 : 0
// info.collect = info.collect == 0 ? 1 : 0
},
/**
* TODO 处理分享-暂时不要
*/
handleShare: () => {
const url = window.location.href
const { name, real, image} = info
const params = {
title: name,
desc: real?.interests,
imgUrl: image,
link: url
}
// const url = window.location.href
// const { name, real, image} = info
// const params = {
// title: name,
// desc: real?.interests,
// imgUrl: image,
// link: url
// }
},
/**