完善茶艺师套餐功能

This commit is contained in:
wangxiaowei
2026-03-28 16:42:40 +08:00
parent 69b0dce2bd
commit 4729dc5ae8
22 changed files with 816 additions and 550 deletions

View File

@ -66,54 +66,35 @@
<wd-img :src="`${OSS}images/home/home_image_15.png`" width="690rpx" height="148rpx" mode="scaleToFill" />
</view>
<view class="mx-30rpx pb-30rpx flex justify-between">
<view class="w-216rpx rounded-20rpx pb-20rpx box-border" style="background: linear-gradient( 180deg, #EAFFF9 0%, #F6F7F9 100%);"
@click="router.navigateTo(`/bundle/package/detail`)">
<view class="px-10rpx pt-10rpx flex justify-center">
<wd-img width="204rpx" height="124rpx" :src="`${OSS}images/home/home_image_16.png`" radius="16rpx" mode="aspectFill" />
</view>
<view class="px-12rpx mt-8rpx">
<view class="text-28rpx font-bold text-[#303133] line-1">清风套餐</view>
<view class="text-[#FF5951] mt-6rpx flex items-baseline font-400">
<text class="text-28rpx"></text>
<text class="text-30rpx">298</text>
<text class="text-24rpx">/2小时</text>
<view class="package-row px-30rpx pb-30rpx">
<view class="flex flex-wrap justify-between">
<view
v-for="(item, idx) in teaPackageList"
:key="item.id || idx"
class="w-216rpx rounded-20rpx pb-20rpx box-border mb-20rpx"
:style="{
background: idx === 0
? 'linear-gradient( 180deg, #EAFFF9 0%, #F6F7F9 100%)'
: idx === 1
? 'linear-gradient( 180deg, #FFF3FB 0%, #F6F7F9 100%)'
: 'linear-gradient( 180deg, #FFF9EA 0%, #F6F7F9 100%)'
}"
@click="router.navigateTo(`/bundle/package/detail?id=${item.id}`)"
>
<view class="px-10rpx pt-10rpx flex justify-center">
<wd-img width="204rpx" height="124rpx" :src="item.img" radius="16rpx" mode="aspectFill" />
</view>
</view>
</view>
<view class="w-216rpx rounded-20rpx pb-20rpx box-border" style="background: linear-gradient( 180deg, #FFF3FB 0%, #F6F7F9 100%);">
<view class="px-10rpx pt-10rpx flex justify-center">
<wd-img width="204rpx" height="124rpx" :src="`${OSS}images/home/home_image_17.png`" radius="16rpx" mode="aspectFill" />
</view>
<view class="px-12rpx mt-8rpx">
<view class="text-28rpx font-bold text-[#303133] line-1">明月套餐</view>
<view class="text-[#FF5951] mt-6rpx flex items-baseline font-400">
<text class="text-28rpx"></text>
<text class="text-30rpx">598</text>
<text class="text-24rpx">/2小时</text>
</view>
</view>
</view>
<view class="w-216rpx rounded-20rpx pb-20rpx box-border" style="background: linear-gradient( 180deg, #FFF9EA 0%, #F6F7F9 100%);">
<view class="px-10rpx pt-10rpx flex justify-center">
<wd-img width="204rpx" height="124rpx" :src="`${OSS}images/home/home_image_18.png`" radius="16rpx" mode="aspectFill" />
</view>
<view class="px-12rpx mt-8rpx">
<view class="text-28rpx font-bold text-[#303133] line-1">鹤鸣套餐</view>
<view class="text-[#FF5951] mt-6rpx flex items-baseline font-400">
<text class="text-28rpx"></text>
<text class="text-30rpx">998</text>
<text class="text-24rpx">/2小时</text>
<view class="px-12rpx mt-8rpx">
<view class="text-28rpx font-bold text-[#303133] line-1">{{ item.title }}</view>
<view class="text-[#FF5951] mt-6rpx flex items-baseline font-400">
<text class="text-28rpx">¥</text>
<text class="text-30rpx">{{ item.discount_price }}</text>
<text class="text-24rpx">/{{ item.hour }}小时</text>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="mt-24rpx relative w-690rpx h-224rpx mx-30rpx" @click="router.navigateTo(`/bundle_b/pages/tea-specialist/list`)">
<wd-img width="690rpx" height="224rpx" :src="`${OSS}images/home/home_image14.png`" mode="scaleToFill" />
</view> -->
</view>
<view>
@ -194,7 +175,8 @@
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, getHomeCouponPopup, claimIndexCoupon, getWxacode } from '@/api/home'
import { getHomeBannerList, getHomeCouponPopup, claimIndexCoupon } from '@/api/home'
import { getTeaPackageList } from '@/api/tea-package'
import { getHomeTeaStoreList } from '@/api/tea-room'
import { useUserStore } from '@/store'
import { useToast } from 'wot-design-uni'
@ -233,6 +215,9 @@
let lastLocation = { lat: 0, lng: 0 }
const canLocation = ref<boolean>(false)
// 套餐列表
const teaPackageList = ref<Array<any>>([])
// 显示优惠券弹窗
const showCoupon = ref<boolean>(false)
@ -355,6 +340,11 @@
getHomeBannerList().then(res => {
swiperList.value = res.list.map(item => item.address)
})
// 获取套餐列表
getTeaPackageList().then(res => {
teaPackageList.value = res
})
},
/**
@ -362,6 +352,7 @@
*/
handleToCity: () => {
uni.$on('locationUpdate', params => {
console.log("🚀 ~ params:", params)
uni.$off('locationUpdate')
city.value = params.city
city_id.value = params.id
@ -560,4 +551,19 @@ page {
line-height: 44rpx;
border-radius: 0 0 16rpx 16rpx;
}
/* 套餐一行三列布局样式 */
.package-row {
width: 100%;
}
.package-row .flex {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.package-row .w-216rpx {
margin-right: 0;
margin-left: 0;
}
</style>