完善茶艺师接口对接

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

@ -10,6 +10,31 @@
<template>
<view class="home-bg">
<!-- 领取优惠券 -->
<wd-overlay :show="showCoupon" @click="showCoupon = false">
<view class="flex flex-col justify-center items-center h-100%">
<view class="w-652rpx h-590rpx relative" >
<wd-img :src="`${OSS}images/home/home_image8.png`" width="100%" height="100%"></wd-img>
<view class="absolute top-82rpx left-1/2 transform -translate-x-1/2 flex flex-col items-center">
<view class="font-bold text-30rpx leading-42rpx text-[#E64545]">正在发送一波优惠券</view>
<view class="font-bold text-[#313131] text-36rpx leading-50rpx mt-38rpx">你有待领取的优惠券</view>
<view class="mt-220rpx " @click.stop="showCoupon = false">
<view class="h-90rpx relative">
<wd-img :src="`${OSS}images/home/home_image9.png`" width="342rpx" height="90rpx"></wd-img>
<view class="absolute top-20rpx left-1/2 transform -translate-x-1/2 flex flex-col items-center" @click.stop="Index.handleToGetCoupon">立即领取</view>
</view>
</view>
</view>
</view>
<view class="mt-80rpx" @click.stop="showCoupon = false">
<wd-img :src="`${OSS}icon/icon_close2.png`" width="72rpx" height="72rpx"></wd-img>
</view>
</view>
</wd-overlay>
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
<template #left>
@ -30,7 +55,14 @@
<view :style="{ paddingTop: navbarHeight + 'px' }">
<view class="mt-32rpx mx-30rpx">
<wd-swiper height="240rpx" indicatorPosition="bottom-left" :indicator="{ type: 'dots-bar' }" :list="swiperList" v-model:current="current" mode="aspectFit"></wd-swiper>
<wd-swiper
height="240rpx"
indicatorPosition="bottom-left"
:indicator="{ type: 'dots-bar' }"
:list="swiperList"
v-model:current="current"
mode="aspectFit"
@click="Index.handleBanner"></wd-swiper>
</view>
<view class="mt-40rpx flex items-center h-36rpx mx-30rpx">
@ -114,14 +146,14 @@
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { LOCATION_DENY_TIME_KEY, handleEnsureLocationAuthHooks, LOCATION_DEFAULT_CITY, handleGetLocationCity, LOCATION_CITY_KEY, handleForceGetLocation } from '@/hooks/useLocation'
import { getHomeBannerList } from '@/api/home'
import { getHomeBannerList, getHomeCouponPopup } from '@/api/home'
import { getHomeTeaStoreList } from '@/api/tea-room'
import { useUserStore } from '@/store'
const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight')
/** 轮播图 **/
// 轮播图
const swiperList = ref<string[]>([])
const current = ref<number>(0)
@ -143,6 +175,10 @@
let lastLocation = { lat: 0, lng: 0 }
const canLocation = ref<boolean>(false)
// 显示优惠券弹窗
const showCoupon = ref<boolean>(false)
onShow(async () => {
// if (canLocation) {
// const location = await handleGetLocationCity(latitude.value, longitude.value)
@ -166,6 +202,16 @@
}
}
}
const userStore = useUserStore()
const userId = userStore.userInfo?.id
if (userId) {
// 获取首页优惠券弹窗
const res = await getHomeCouponPopup()
if (Number(res.status) === 0) {
showCoupon.value = true
}
}
})
onLoad(async() => {
@ -299,6 +345,46 @@
longitude.value = params.longitude
Index.handleResetSearch()
}
},
/**
* 跳转领取优惠券页面
*/
handleToGetCoupon: () => {
showCoupon.value = false
router.switchTab('/pages/my/my')
},
/**
* 轮播图跳转
*/
handleBanner: (e: any) => {
switch(e.index){
case 0:
// 跳转到茶艺师入驻
router.navigateTo('/bundle/settle-in/tea-specialist')
break;
case 1:
// 跳转到茶馆入驻
router.navigateTo('/bundle/settle-in/tea-room')
break;
case 2:
// 跳转到茶艺师列表
router.navigateTo('/bundle_b/pages/tea-specialist/list')
break;
case 3:
// 跳转到充值会员
router.navigateTo('/bundle/vip/benefits')
break;
}
// if (e.index == 2) {
// // 跳转到茶艺师列表
// router.navigateTo(`/bundle_b/pages/tea-specialist/list`)
// }
console.log("🚀 ~ e:", e)
// const index = e.currentTarget.dataset.index
}
}
</script>