添加以下4个页面的内容分享

1. 首页
2. 包间列表
3. 茶艺师列表
4. 茶艺师详情
This commit is contained in:
wangxiaowei
2026-01-08 02:30:57 +08:00
parent 40c2b0dd6c
commit 2b58bac9ac
7 changed files with 103 additions and 27 deletions

View File

@ -68,7 +68,15 @@
</wd-popup>
<view>
<navbar :title="isReserve ? '预约茶艺师' : '茶艺师详情'" fixed :left-arrow="false">
<navbar fixed layoutLeft hideLeftIcon>
<template #left>
<view class="h-48rpx flex items-center" @click="Detail.handleBack">
<view class="mt-4rpx">
<wd-icon name="thin-arrow-left" size="30rpx" color="#121212" ></wd-icon>
</view>
<view class="text-[#303133] text-36rpx ml-24rpx leading-48rpx">{{isReserve ? '预约茶艺师' : '茶艺师详情'}}</view>
</view>
</template>
<template #right>
<view class="flex items-center ml-114rpx">
<!-- <view class="mr-16rpx flex items-center" @click="Detail.handleCollect">
@ -403,20 +411,21 @@
const tipMoney = ref<string>('') // 其他打赏金额
onLoad(async (args) => {
console.log("🚀 ~ args:", args)
const userStore = useUserStore()
userInfo.value = userStore.userInfo
id.value = args.id || 0
Detail.handleGetTeaSpecialistDetail()
// 获取茶艺师详情
const res = await getTeaSpecialistDetail({
team_user_id: args.id,
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
// 如果是从分享进入的未登录的情况下
uni.$on('refreshTeaSpecialistDetails', (params) => {
// 处理未登录的情况下
id.value = id.value
uni.$off('refreshTeaSpecialistDetails')
Detail.handleGetTeaSpecialistDetail()
})
info.value = res.teamaster
console.log("🚀 ~ res:", res)
// rate.value = info.value.star
// tabList.value = info.value.textarea
// console.log("🚀 ~ tabList:", res)
@ -440,7 +449,32 @@
// })
})
onUnload(() => {
uni.$off('refreshTeaSpecialistDetails')
})
// 茶艺师分享
onShareAppMessage(() => {
return {
title: info.value.name || '预约茶艺师',
path: `/bundle_b/pages/tea-specialist/detail?id=${id.value}`,
}
})
const Detail = {
/**
* 获取茶艺师详情
*/
handleGetTeaSpecialistDetail: async () => {
const res = await getTeaSpecialistDetail({
team_user_id: id.value,
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
})
info.value = res.teamaster
},
/**
* TODO 处理收藏-暂时不要
*/
@ -523,6 +557,15 @@
// id.value - 茶艺师的ID
router.navigateTo(`/bundle_b/pages/tea-specialist/reserve?id=${id.value}`)
},
/**
* 分享的页面没有栈所以需要switch方法跳转
*/
handleBack: () => {
router.navigateBack().catch(err => {
router.switchTab('/pages/index/index')
})
}
}
</script>

View File

@ -12,8 +12,8 @@
<view class="home-bg w-[100%] sticky top-0 left-0 z-100">
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
<template #left>
<view class="flex items-center">
<view class="mt-4rpx" @click="router.navigateBack()">
<view class="flex items-center" @click="List.handleBack">
<view class="mt-4rpx">
<wd-icon name="thin-arrow-left" size="30rpx" color="#121212"></wd-icon>
</view>
<view class="text-[#303133] text-36rpx ml-24rpx leading-48rpx">预约茶艺师</view>
@ -196,6 +196,13 @@
})
// 茶室分享(仅页面右上角分享,无需按钮分享)
onShareAppMessage(() => {
return {
title: '茶艺师列表',
path: `/bundle_b/pages/tea-specialist/list`,
}
})
const List = {
/**
@ -230,7 +237,6 @@
router.navigateTo(`/bundle_b/pages/tea-specialist/detail?id=${id}`)
},
/**
* 获取茶艺师等级
* @param value
@ -255,6 +261,15 @@
list.value = []
getMescroll().resetUpScroll()
},
/**
* 分享的页面没有栈所以需要switch方法跳转
*/
handleBack: () => {
router.navigateBack().catch(err => {
router.switchTab('/pages/index/index')
})
}
}
</script>