对接接口

This commit is contained in:
wangxiaowei
2025-10-16 16:26:57 +08:00
parent 76da09be91
commit 2f59d0e8ba
21 changed files with 405 additions and 197 deletions

View File

@ -68,7 +68,7 @@
</wd-popup>
<view>
<navbar :title="isReserve ? '预约茶艺师' : '茶艺师详情'" fixed>
<navbar :title="isReserve ? '预约茶艺师' : '茶艺师详情'" fixed :left-arrow="false">
<template #right>
<view class="flex items-center ml-114rpx">
<view class="mr-16rpx flex items-center" @click="Detail.handleCollect">
@ -92,18 +92,18 @@
<!-- 昵称显示 -->
<view class="bg-white rounded-t-16rpx px-30rpx">
<view class="font-bold text-34rpx leading-48rpx text-#303133 pt-36rpx">茶艺师的名字</view>
<view class="flex items-center justify-between">
<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"/>
<view class="font-400 text-26rpx text-#606266 ml-8rpx">4.5 推荐</view>
<view class="font-400 text-26rpx text-#606266 ml-8rpx">{{ info.star }} 推荐</view>
</view>
<view class="font-400 text-22rpx leading-32rpx text-#6A6363">已预约 10+</view>
<view class="font-400 text-22rpx leading-32rpx text-#6A6363">已预约 {{ info.reservation_num > 10 ? info.reservation_num + '+' : info.reservation_num }}</view>
</view>
<view class="flex items-center justify-between mt-24rpx">
<view class="flex items-center">
<view class=" mr-20rpx">
<view class="mr-20rpx" v-if="is90">
<wd-tag color="#FF5951" bg-color="#FEF1F0" custom-class="!rounded-6rpx !px-16rpx !py-4rpx !h-40rpx">90后茶艺师</wd-tag>
</view>
<view class="w-160rpx h-40rpx relative mr-44rpx top-6rpx">
@ -111,11 +111,11 @@
<wd-img :src="`${OSS}icon/icon_gold_medal.png`" width="36rpx" height="36rpx"></wd-img>
</view>
<view>
<tea-specialist-level :level="'junior'"></tea-specialist-level>
<tea-specialist-level :level="TeaSpecialistLevelValue[info.teamasterLevel[0].level_name]"></tea-specialist-level>
</view>
</view>
</view>
<view class="font-400 text-24rpx leading-34rpx text-#818CA9">距离您10.3km 预计30分钟</view>
<view class="font-400 text-24rpx leading-34rpx text-#818CA9">距离您{{ info.distance }}km 预计{{ info.speed }}分钟</view>
</view>
</view>
@ -125,22 +125,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"></view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.gender == 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">21</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.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">165cm</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.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">53kg</view>
<view class="font-bold text-30rpx leading-42rpx text-#303133 mt-12rpx">{{ info.real.weight }}kg</view>
</view>
</view>
@ -158,7 +158,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 }}
</view>
</view>
</view>
@ -180,25 +180,25 @@
<view class="font-400 text-26rpx leading-36rpx text-#606266">计费标准</view>
</view>
<view class=" mt-22rpx">
<view class="mt-22rpx">
<view class="flex items-center justify-between">
<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>160/小时</view>
<view>{{ info.price }}/小时</view>
</view>
</view>
<view class="flex items-center justify-between mt-20rpx">
<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>3.00/公里</view>
<view>{{ info.fare_price }}/公里</view>
</view>
</view>
</view>
</view>
<view class="">
<view>
<view class="flex items-center mt-24rpx">
<view class="mr-12rpx flex items-center">
<wd-img :src="`${OSS}icon/icon_info.png`" width="36rpx" height="36rpx"></wd-img>
@ -247,7 +247,7 @@
</view>
<!-- 操作按钮 -->
<view class="">
<view>
<!-- 邀约状态下的按钮 -->
<view v-if="isReserve" class="mx-60rpx rounded-8rpx h-90rpx leading-90rpx text-center mt-52rpx bg-#4C9F44 text-#fff text-30rpx leading-42rpx font-bold"
@click="Detail.handleReserve">
@ -270,10 +270,31 @@
<script lang="ts" setup>
import TeaSpecialistLevel from '@/components/TeaSpecialistLevel.vue'
import { useMessage } from 'wot-design-uni'
import { getTeaSpecialistDetails } from '@/api/tea'
import { ITeaSpecialistDetailsFields } from '@/api/types/tea'
import {toast} from '@/utils/toast'
import {TeaSpecialistLevelValue} from '@/utils/teaSpecialist'
const OSS = inject('OSS')
// 茶艺师
const id = ref<number>(0)
const info = reactive<ITeaSpecialistDetailsFields>({
name: '',
star: 0,
reservation_num: 0,
distance: 0,
speed: 0,
real: { gender: 1, both: 18, height: 165, weight: 53, interests: '爱好茶艺,喜欢旅游,把爱好当工作' },
teamasterlabel: [],
teamasterLevel: [],
price: 0,
fare_price: 0,
})
const latitude = ref<number>(0) // 纬度
const longitude = ref<number>(0) // 经度
const is90 = ref<boolean>(false)
// 是否是预约茶艺师页面
const isReserve = ref<boolean>(false)
@ -289,7 +310,7 @@
const current = ref<number>(0)
// 评分
const rate = ref(4.5)
const rate = ref<number>(1)
// 打赏主茶艺师
const showTipTeaSpecialistPopup = ref<boolean>(false)
@ -302,6 +323,30 @@
const isOtherTip = ref<boolean>(false) // 是否是其他打赏金额
const tipMoney = ref<Number>(0) // 其他打赏金额
onLoad(async (args) => {
id.value = args.id || 0
latitude.value = args.lat || 0
longitude.value = args.lng || 0
// 获取茶艺师详情
const res = await getTeaSpecialistDetails({
id: args.id,
latitude: latitude.value,
longitude: longitude.value
})
// 将返回的数据合并到 reactive 对象中
Object.assign(info, res.teamaster || {})
rate.value = info.star
if (info.teamasterlabel) {
info.teamasterlabel.map(item => {
if (item.label_name == '90后茶艺师') {
is90.value = true
}
})
}
})
const Detail = {
// 处理收藏
handleCollect: () => {