5 Commits

Author SHA1 Message Date
ef85346d0e 完善功能 2026-05-20 14:05:47 +08:00
99263e7bb6 修改版本号 2026-05-20 14:05:37 +08:00
e987030a70 更新版本号和完善一店一码的功能 2026-05-16 14:21:31 +08:00
4c33f1b460 修改功能 2026-05-13 09:53:09 +08:00
473e40b817 完善功能 2026-05-09 16:50:00 +08:00
16 changed files with 571 additions and 116 deletions

View File

@ -67,7 +67,7 @@ export function getHomeTeaStoreList(data: IHomeTeaStoreListParams) {
* 获取茶室开通城市列表
*/
export function getOpenCityList() {
return http.Post<IOpenCityListResult>('/api/teaStore/teaStoreCity', null,
return http.Post<IOpenCityListResult>('/api/teaStore/teaStoreCity', {},
{
meta: { ignoreAuth: true }
}
@ -85,7 +85,7 @@ export function getTeaRoomSearchHistory() {
* 清除茶室搜索历史
*/
export function clearTeaRoomSearchHistory() {
return http.Post('/api/teaStore/delTeaStoreSearchHistory', null)
return http.Post('/api/teaStore/delTeaStoreSearchHistory', {})
}
/**
@ -97,6 +97,7 @@ export interface IRoomDetailParams {
longitude: number
user_id: number
room_id?: number
is_scan?: boolean
}
export function getTeaRoomDetail(data: IRoomDetailParams) {

View File

@ -70,7 +70,7 @@
<template v-if="tab === 0">
<view class="flex items-center bg-white p-20rpx rounded-10rpx mx-30rpx mb-20rpx relative"
v-for="(item, index) in list" :key="index">
<view class="mr-28rpx relative z-2" @click="Collect.handlePreviewImage(item.image)">
<view class="mr-28rpx relative z-2" @click="Collect.handlePreviewImage(item.image, item.image_arr)">
<wd-img width="260rpx" height="320rpx" :src="item.image" mode="aspectFill"
radius="10rpx"></wd-img>
<view
@ -88,6 +88,9 @@
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-12rpx">
{{ item.name }}
</view>
<view class="tea-specialist-level-badge flex items-center shrink-0 mr-12rpx">
<text class="tea-specialist-level-badge__text ml-6rpx">{{ GetTeaSpecialistLevelLabel(item.level) }}</text>
</view>
<view class="flex items-center">
<wd-icon name="star-on" size="22rpx" color="#FF5951"></wd-icon>
<view class="font-400 text-24rpx text-[#FF5951] leading-34rpx ml-6rpx">
@ -101,24 +104,32 @@
</view>
</view>
<view class="flex items-center mb-14rpx">
<view class="flex flex-wrap items-center mb-14rpx gap-y-12rpx">
<!-- 到店服务标签 -->
<view class="mr-12rpx" v-if="item.server_type == 1 || item.server_type == 3">
<view class="mr-12rpx shrink-0"
v-if="item.server_type == 1 || item.server_type == 3">
<wd-tag color="#F55726" bg-color="#F55726" plain
custom-class="!rounded-4rpx">到店服务</wd-tag>
custom-class="!rounded-4rpx whitespace-nowrap">到店服务</wd-tag>
</view>
<!-- 上门服务标签 -->
<view class="mr-12rpx" v-if="item.server_type == 2 || item.server_type == 3">
<view class="mr-12rpx shrink-0"
v-if="item.server_type == 2 || item.server_type == 3">
<wd-tag color="#40AE36" bg-color="#40AE36" plain
custom-class="!rounded-4rpx">上门服务</wd-tag>
custom-class="!rounded-4rpx whitespace-nowrap">上门服务</wd-tag>
</view>
<view class="mr-12rpx">
<wd-tag color="#818CA9" bg-color="#F3F3F3">{{ item.both }}岁</wd-tag>
<view class="mr-12rpx shrink-0" v-if="item.is_mileage == 1">
<!-- 醒目的红色实心标签 -->
<wd-tag color="#FFF" bg-color="#FF5951"
custom-class="!rounded-4rpx whitespace-nowrap border-none !px-12rpx">免费出行</wd-tag>
</view>
<view class="flex items-center mt-8rpx">
<view class="mr-12rpx shrink-0">
<wd-tag color="#818CA9" bg-color="#F3F3F3"
custom-class="whitespace-nowrap">{{ item.both }}岁</wd-tag>
</view>
<view class="flex items-center shrink-0">
<wd-img
:src="item.sex == 1 ? `${OSS}icon/icon_man.png` : `${OSS}icon/icon_woman.png`"
width="28rpx" height="28rpx"></wd-img>
@ -173,9 +184,10 @@ import { ref } from 'vue'
import { toast } from '@/utils/toast'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { getCollectTeaRoomList, collectTeaRoom } from '@/api/tea-room'
import { collectTeaRoom } from '@/api/tea-room'
import { getCollectTeaSpecialistList, collectTeaSpecialist } from '@/api/tea-specialist'
import { router, previewImage } from '@/utils/tools'
import { GetTeaSpecialistLevelLabel } from '@/utils/teaSpecialist'
const tab = ref<number>(0)
const OSS = inject('OSS')
@ -276,8 +288,8 @@ const Collect = {
/**
* 预览图片
*/
handlePreviewImage: (img: any) => {
previewImage(img, [img])
handlePreviewImage: (img: any, imageList: any) => {
previewImage(img, imageList)
},
// 取消收藏茶艺师
@ -319,4 +331,21 @@ page {
background-image: url(#{$OSS}images/collect/collect_image1.png);
background-size: 100% 100%;
}
.tea-specialist-level-badge {
height: 40rpx;
padding: 0 14rpx 0 8rpx;
border-radius: 999rpx;
background: linear-gradient(135deg, #f7fbf4 0%, #e5f5de 100%);
border: 1rpx solid rgba(76, 159, 68, 0.18);
box-shadow: 0 6rpx 16rpx rgba(76, 159, 68, 0.08);
}
.tea-specialist-level-badge__text {
color: #2f7d32;
font-size: 22rpx;
line-height: 22rpx;
font-weight: 600;
letter-spacing: 2rpx;
}
</style>

View File

@ -203,7 +203,6 @@
<navbar :title="title" custom-class='!bg-[#F6F7F8]' :leftArrow="false"></navbar>
<view class="text-[#909399] text-26rpx leading-36rpx mb-40rpx">
<view class="text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Arrived || orderStatus == TeaSpecialistOrderStatus.Accepted">使用过程中有任何问题请联系客服</view>
<view class="flex items-center justify-center" v-if="(orderStatus == TeaSpecialistOrderStatus.Unpaid || orderStatus == TeaSpecialistOrderStatus.Pending) && order.timekeeping > 0">
<view class="flex items-center mr-6rpx">
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_time.png`"/>
@ -230,9 +229,19 @@
<view class="mx-30rpx coupon-bg" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
<view class="flex items-center px-30rpx pt-30rpx">
<view class="mr-30rpx">
<wd-img width="190rpx" height="190rpx" :src="order.image" mode="scaleToFill"></wd-img>
<wd-img width="190rpx" height="190rpx" :src="order.image" mode="scaleToFill" @click="OrderDetail.handlePreviewImage(order.image, order.image_arr)"></wd-img>
</view>
<view class="flex-1">
<view class="flex flex-col items-end shrink-0 text-[#FF5951]">
<text v-if="orderStatus === TeaSpecialistOrderStatus.Unpaid" class="text-28rpx mb-12rpx">待付款</text>
<text v-else-if="orderStatus === TeaSpecialistOrderStatus.Pending" class="text-28rpx mb-12rpx">待接单</text>
<text v-else-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund && orderStatus <= TeaSpecialistOrderStatus.CustomerRefundAfterArrive" class="text-28rpx mb-12rpx text-[#606266]">已退款</text>
<text v-else-if="orderStatus === TeaSpecialistOrderStatus.Accepted" class="text-28rpx mb-12rpx">已预约</text>
<text v-else-if="orderStatus === TeaSpecialistOrderStatus.Departed" class="text-28rpx mb-12rpx">已出发</text>
<text v-else-if="orderStatus === TeaSpecialistOrderStatus.Arrived" class="text-28rpx mb-12rpx">服务中</text>
<text v-else-if="orderStatus === TeaSpecialistOrderStatus.Completed" class="text-28rpx mb-12rpx">完成</text>
<text v-else-if="orderStatus === TeaSpecialistOrderStatus.Cancelled" class="text-28rpx mb-12rpx">订单取消</text>
</view>
<view class="flex justify-between items-center">
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-280rpx">
{{ order.title }}
@ -311,6 +320,14 @@
</view>
</view>
<!-- 联系官方客服 -->
<view class="px-30rpx mx-30rpx mt-20rpx rounded-16rpx h-90rpx flex justify-between items-center border-[2rpx] border-[#4C9F44] bg-[#F2FAF4]" @click="OrderDetail.handleContactService">
<view class="font-bold text-26rpx leading-48rpx text-[#4C9F44]">服务遇到问题或需要帮助?</view>
<view class="flex items-center bg-[#4C9F44] rounded-8rpx px-18rpx py-8rpx">
<view class="text-24rpx leading-34rpx text-[#fff] ml-6rpx">联系客服</view>
</view>
</view>
<!-- 茶艺服务 -->
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">茶艺服务</view>
@ -392,10 +409,10 @@
<view>
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
<view class="text-[#606266] mr-54rpx">服务方式</view>
<view class="text-[#303133]">{{ order.service_type == 1 ? '到店服务' : '上门服务'}}</view>
<view class="text-[#303133]">{{ order.server_type == 1 ? '到店服务' : '上门服务'}}</view>
</view>
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
<view class="text-[#606266] mr-54rpx">{{ order.service_type == 1 ? '服务门店' : '服务地址'}}</view>
<view class="text-[#606266] mr-54rpx">{{ order.server_type == 1 ? '服务门店' : '服务地址'}}</view>
<view class="text-[#303133] line-1 w-300rpx">{{ order.address }}</view>
</view>
</view>
@ -495,9 +512,9 @@
<script lang="ts" setup>
import { getTeaSpecialistOrderDetails } from '@/api/teaSpecialist-order'
import { useMessage, useToast } from 'wot-design-uni'
import { TeaSpecialistManageOrderStatusText, TeaSpecialistManageStatusTextValue, TeaSpecialistOrderStatus} from '@/utils/teaSpecialistOrder'
import { TeaSpecialistManageOrderStatusText, TeaSpecialistManageStatusTextValue, TeaSpecialistOrderStatus} from '@/utils/teaSpecialistOrder'
import { handleCancelOrderHooks, handleRefundTeaSpecialistOrderHooks } from '@/hooks/useTeaSpecialistOrder'
import { router, copy, toPlus } from '@/utils/tools'
import { router, copy, toPlus, previewImage } from '@/utils/tools'
import { OrderType } from '@/utils/order'
import { getTeaTypeList } from '@/api/tea'
import { getTeaSpecialistFeeDetails, createTeaSpecialistRenewOrder } from '@/api/tea-specialist'
@ -572,7 +589,7 @@
day_time: '', // 预约日期
start_time: '', // 开始日期
end_time: '', // 结束日期0
service_type: 1, // 服务方式 1到店服务 2上门服务
server_type: 1, // 服务方式 1到店服务 2上门服务
address: '', // 服务地址
longitude: 0, // 经度
latitude: 0, // 纬度
@ -593,6 +610,10 @@
renew_tea_price: 0, // 续订茶叶金额
tea_price: 0, // 茶叶费
teacup_price: 0, // 茶具费
is_mileage: 0, // 是否免费出行
both: 0, // 年龄
sex: 0, // 性别
image_arr: [] // 订单相关图片数组
})
onLoad(async (args) => {
@ -822,6 +843,27 @@
uni.makePhoneCall({
phoneNumber: res.mobile
})
},
/**
* 联系企业微信客服
*/
handleContactService: () => {
// @ts-ignore
wx.openCustomerServiceChat({
extInfo: {
url: 'https://work.weixin.qq.com/kfid/kfc723bd879ef30a161' //客服ID
},
corpId: 'wwe8c5c7cf7d2010e6',
success(res) {},
fail(res) {
toast.show('调起客服失败')
}
})
},
handlePreviewImage: (img: any, imageList: any) => {
previewImage(img, imageList)
}
}
</script>

View File

@ -256,7 +256,7 @@
<!-- 茶艺师信息 -->
<view class="flex items-center bg-white p-20rpx rounded-10rpx mb-20rpx mt-20rpx">
<view class="mr-28rpx relative">
<wd-img width="200rpx" height="200rpx" :src="info.image" radius="10rpx" @click="previewImage(info.image, [info.image])"></wd-img>
<wd-img width="200rpx" height="200rpx" :src="info.image" radius="10rpx" @click="previewImage(info.image, info.image_arr)"></wd-img>
</view>
<view class="">
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">
@ -427,7 +427,7 @@
</template>
<script lang="ts" setup>
import { useMessage, useToast } from 'wot-design-uni'
import { useToast } from 'wot-design-uni'
import { router, toPlus, previewImage } from '@/utils/tools'
import PriceFormat from '@/components/PriceFormat.vue'
import { OrderType } from '@/utils/order'
@ -440,16 +440,11 @@ import { CouponType } from '@/utils/coupon'
const OSS = inject('OSS')
const toast = useToast()
const message = useMessage('wd-message-box-slot')
// 防止重复提交
const isSubmitting = ref(false)
// 服务方式
const serviceType = ref<Array<any>>([
{ type: 1, name: '到店服务' },
{ type: 2, name: '上门服务' },
])
const serviceTypeValue = ref<number>(1)
// 选择茶馆
@ -604,7 +599,7 @@ const costParams = ref({
const teaPackage = ref<any>({})
const teaPackageId = ref<number>(0)
onLoad(async (args) => {
onLoad(async (args: any) => {
teaPackageId.value = Number(uni.getStorageSync('teaPackageId'))
if (teaPackageId.value === 0) {

View File

@ -119,7 +119,7 @@
<view class="flex justify-end">
<view class="flex items-center">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">
2.14.16
2.14.20
</view>
</view>
</view>

View File

@ -71,7 +71,6 @@
const goods = ref<Array<any>[]>([])
const showAction = ref<boolean>(false)
const sheetMenu = ref([])
const showServicePopup = ref<boolean>(false)
const storeType = ref<number>(1) // 1直营 2加盟
@ -130,7 +129,7 @@
const couponRoomId = ref<number>(0)
const couponRoomPrice = ref<number>(0)
onLoad((args) => {
onLoad((args: any) => {
groupCouponId.value = args.groupCouponId
groupCouponOrderId.value = args.groupCouponOrderId
teaRoomId.value = Number(args.teaRoomId)
@ -217,22 +216,6 @@
})
},
// 处理拨打电话逻辑
handleCallPhone: () => {
ChooseRoom.sheetMenuType = 'call'
showAction.value = true
sheetMenu.value = [
{
name: 15005837859,
value: ''
},
{
name: '呼叫',
value: 15005837859
}
]
},
// tab切换获取index
handleChangeTab: (item: { index: number }) => {
// tabIndexs.value = item.index

View File

@ -8,6 +8,55 @@
}</route>
<template>
<view>
<!-- 领取优惠券 -->
<wd-overlay :show="showCoupon" @click="Room.handleCloseCoupon('coupon1')">
<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_image10.png`" width="100%" height="100%"></wd-img>
<view class="absolute top-200rpx left-1/2 transform -translate-x-1/2 flex flex-col items-center">
<view class="mt-220rpx" @click.stop="Room.handleCloseCoupon('coupon1')">
<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="Room.handleToGetCoupon('coupon1')">立即领取</view>
</view>
</view>
</view>
</view>
<view class="mt-80rpx" @click.stop="Room.handleCloseCoupon('coupon1')">
<wd-img :src="`${OSS}icon/icon_close2.png`" width="72rpx" height="72rpx"></wd-img>
</view>
</view>
</wd-overlay>
<!-- 领取20张20元优惠券 -->
<wd-overlay :show="showCoupon2" @click="Room.handleCloseCoupon('coupon2')">
<view class="flex flex-col justify-center items-center h-100%">
<view class="w-572rpx h-518rpx relative" >
<wd-img :src="`${OSS}images/home/home_image_20.png`" width="100%" height="100%"></wd-img>
<view class="absolute top-50rpx left-1/2 transform -translate-x-1/2">
<view class="text-[#FF5643] font-bold text-32rpx leading-42rpx text-center">通用优惠券</view>
<view class="text-[#E64545] font-bold flex items-end mt-20rpx">
<view class="text-52rpx mb-20rpx"></view>
<view class="text-102rpx">400</view>
</view>
</view>
<view class="absolute top-200rpx left-1/2 transform -translate-x-1/2 flex flex-col items-center">
<view class="mt-160rpx" @click.stop="Room.handleCloseCoupon('coupon2')">
<view class="h-90rpx relative" @click.stop="Room.handleToGetCoupon('coupon2')">
<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">立即领取</view>
</view>
</view>
</view>
</view>
<view class="mt-80rpx" @click.stop="Room.handleCloseCoupon('coupon2')">
<wd-img :src="`${OSS}icon/icon_close2.png`" width="72rpx" height="72rpx"></wd-img>
</view>
</view>
</wd-overlay>
<view>
<navbar fixed layoutLeft hideLeftIcon>
<template #left>
@ -158,12 +207,12 @@
import RoomList from '@/components/reserve/RoomList.vue'
import {toast} from '@/utils/toast'
import { getTeaRoomDetail, collectTeaRoom, getStoreTeaRoomList, getTeaRoomPackage } from '@/api/tea-room'
import type { ITeaRoomDetailResult } from '@/api/types/tea-room'
import type {IUserInfoVo } from '@/api/types/login'
import { useUserStore } from '@/store'
import { router, previewImage, strToParams } from '@/utils/tools'
import { StoreType } from '@/utils/tea'
import DouYinExcharge from '@/bundle/components/DouYinExcharge.vue'
import { getHomeCouponPopup, claimIndexCoupon } from '@/api/home'
const rightPadding = inject('capsuleOffset')
const OSS = inject('OSS')
@ -176,7 +225,7 @@
const teaRoom = ref<any>({})
// 用户信息
const userInfo = ref<IUserInfoVo>(null)
const userInfo = ref<IUserInfoVo>({})
// tab
const tab = ref<number>(0)
@ -184,7 +233,7 @@
// 弹窗
const showAction = ref<boolean>(false)
const sheetMenu = ref([])
const sheetMenu = ref<any>([])
const showServicePopup = ref<boolean>(false)
const storeType = ref<number>(StoreType.Direct)
@ -204,13 +253,25 @@
// 随机颜色列表
const tagColors = ['#40AE36', '#F55726']
onLoad((args) => {
// 是否是扫码进入
const isScan = ref<boolean>(false)
// 优惠券状态
const couponStatus = ref<any>({})
// 显示优惠券弹窗
const showCoupon = ref<boolean>(false)
// 显示第2种优惠券弹窗
const showCoupon2 = ref<boolean>(false)
onLoad((args: any) => {
console.log("🚀 ~ args:", args)
// 处理小程序码扫码进入时的 scene 参数
if (!args.id && args.scene) {
const scene = decodeURIComponent(args.scene)
const params = strToParams(scene)
Object.assign(args, params)
isScan.value = true
}
if (args.id) {
@ -223,6 +284,7 @@
Room.handleInit()
}
console.log("🚀 ~ args2:", args)
// 如果是从分享进入的未登录的情况下
uni.$on('refreshShareTeaRoomLists', (params) => {
@ -251,6 +313,10 @@
}
})
onShow(() => {
Room.handleIsGetCoupon()
})
const Room = {
sheetMenuType: '', // 记录菜单类型
@ -258,7 +324,7 @@
* 获取茶室预定和团购套餐列表
* @param mescroll
*/
upCallback: (mescroll) => {
upCallback: (mescroll: any) => {
const filter = {
page: mescroll.num,
size: mescroll.size,
@ -295,14 +361,13 @@
handleInit: async () => {
const userStore = useUserStore()
userInfo.value = userStore.userInfo
console.log("🚀 ~ uni.getStorageSync('latitude'):", uni.getStorageSync('latitude'))
console.log("🚀 ~ uni.getStorageSync('longitude'):", uni.getStorageSync('longitude'))
const res = await getTeaRoomDetail({
id: teaRoomId.value,
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
user_id: userInfo.value.id || 0
user_id: userInfo.value.id || 0,
is_scan: isScan.value
})
if (res && res.status == 0) {
@ -429,7 +494,68 @@
*/
handlePreviewImage: (e: {index: number, item: any}) => {
previewImage(swiperList.value[e.index], swiperList.value)
}
},
/**
* 是否领取过优惠券
*/
handleIsGetCoupon: async () => {
// 如果是扫码进入,需要弹出优惠券
if (isScan.value) {
const userStore = useUserStore()
userInfo.value = userStore.userInfo
const userId = userStore.userInfo?.id
if (userId) {
// 获取首页优惠券弹窗
const res = await getHomeCouponPopup()
couponStatus.value = res
if (Number(res.status) === 0) {
showCoupon.value = true
} else {
showCoupon.value = false
}
// 如果第一张优惠券的弹窗没有被触发(可能是因为用户关闭了第一个优惠券的弹窗),但是接口返回还可以领第二张优惠券,就继续显示第二个优惠券的弹窗(如果一下子都弹出来,用户可能会觉得烦,所以分开两个弹窗)
if (Number(res.status) !== 0 && Number(res.general_status) === 0 ) {
showCoupon2.value = true
} else {
showCoupon2.value = false
}
}
}
},
/**
* 跳转领取优惠券页面
*/
handleToGetCoupon: async (type: string) => {
// 1是茶艺师优惠券2是茶馆优惠券
if (type === 'coupon1') {
await claimIndexCoupon(1)
showCoupon.value = false
// router.navigateTo('/bundle_b/pages/tea-specialist/list')
Room.handleIsGetCoupon()
} else if (type === 'coupon2') {
await claimIndexCoupon(6)
showCoupon2.value = false
}
},
/**
* 关闭优惠券
*/
handleCloseCoupon: (type: string) => {
if (type === 'coupon1') {
showCoupon.value = false
// 验证下,如果用户关闭了第一个优惠券的弹窗,如果还可以领第二个优惠券,就继续显示第二个优惠券的弹窗(如果一下子都弹出来,用户可能会觉得烦,所以分开两个弹窗)
if (Number(couponStatus.value.general_status) === 0 ) {
showCoupon2.value = true
}
} else if (type === 'coupon2') {
showCoupon2.value = false
}
}
}
</script>

View File

@ -70,7 +70,7 @@
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: #fff !important;">
<template #left>
<view class="flex items-center" @click="List.handleBack">
<view class="mt-4rpx">
<view class="mt-4rpx pr-10rpx">
<wd-icon name="thin-arrow-left" size="30rpx" color="#121212"></wd-icon>
</view>
<view class="text-[#303133] text-36rpx ml-24rpx leading-48rpx">预约茶艺师</view>
@ -78,8 +78,12 @@
</template>
</wd-navbar>
<view class="search-box px-30rpx pb-10rpx pt-20rpx bg-[#fff]">
<view class="w-full h-72rpx bg-[#F6F7F8] rounded-36rpx flex items-center pl-30rpx pr-6rpx">
<view class="search-box pl-30rpx pb-10rpx pt-10rpx bg-[#fff] flex items-center header-search-box">
<view class="flex items-center line-1 max-w-150rpx mr-20rpx" @click="List.handleToCity">
<view class="mr-10rpx font-400 leading-44rpx text-32rpx line-1">{{ city || LOCATION_DEFAULT_CITY }}</view>
<wd-icon name="arrow-down" size="24rpx" color="#333" custom-class="mt-4rpx"></wd-icon>
</view>
<view class="flex-1 h-72rpx bg-[#F6F7F8] rounded-36rpx flex items-center pl-30rpx pr-6rpx">
<wd-icon name="search" size="32rpx" color="#C0C4CC"></wd-icon>
<input type="text" class="flex-1 ml-16rpx text-28rpx h-full bg-transparent" placeholder="茶艺师名称"
placeholder-style="color: #C0C4CC" v-model="keywords" @confirm="List.handleSearch"
@ -145,7 +149,7 @@
:up="upOption" fixed>
<view class="flex items-center bg-white p-20rpx rounded-10rpx mx-30rpx mb-20rpx relative"
v-for="(item, index) in list" :key="index">
<view class="mr-28rpx relative z-2" @click="List.handlePreviewImage(item.image)">
<view class="mr-28rpx relative z-2" @click="List.handlePreviewImage(item.image, item.image_arr)">
<wd-img width="260rpx" height="320rpx" :src="item.image" mode="aspectFill"
radius="10rpx"></wd-img>
<view
@ -170,23 +174,29 @@
</view>
</view>
<view class="flex items-center mb-14rpx">
<view class="flex flex-wrap items-center mb-14rpx gap-y-12rpx">
<!-- 到店服务标签 -->
<view class="mr-12rpx" v-if="item.server_type == 1 || item.server_type == 3">
<view class="mr-12rpx shrink-0" v-if="item.server_type == 1 || item.server_type == 3">
<wd-tag color="#F55726" bg-color="#F55726" plain
custom-class="!rounded-4rpx">到店服务</wd-tag>
custom-class="!rounded-4rpx whitespace-nowrap">到店服务</wd-tag>
</view>
<!-- 上门服务标签 -->
<view class="mr-12rpx" v-if="item.server_type == 2 || item.server_type == 3">
<view class="mr-12rpx shrink-0" v-if="item.server_type == 2 || item.server_type == 3">
<wd-tag color="#40AE36" bg-color="#40AE36" plain
custom-class="!rounded-4rpx">上门服务</wd-tag>
custom-class="!rounded-4rpx whitespace-nowrap">上门服务</wd-tag>
</view>
<view class="mr-12rpx">
<wd-tag color="#818CA9" bg-color="#F3F3F3">{{ item.both }}岁</wd-tag>
<view class="mr-12rpx shrink-0" v-if="item.is_mileage == 1">
<!-- 醒目的红色实心标签 -->
<wd-tag color="#FFF" bg-color="#FF5951"
custom-class="!rounded-4rpx whitespace-nowrap border-none !px-12rpx">免费出行</wd-tag>
</view>
<view class="flex items-center mt-8rpx">
<view class="mr-12rpx shrink-0">
<wd-tag color="#818CA9" bg-color="#F3F3F3" custom-class="whitespace-nowrap">{{ item.both }}岁</wd-tag>
</view>
<view class="flex items-center shrink-0">
<wd-img :src="item.sex == 1 ? `${OSS}icon/icon_man.png` : `${OSS}icon/icon_woman.png`"
width="28rpx" height="28rpx"></wd-img>
</view>
@ -243,6 +253,8 @@ import { getTeaSpecialist } from '@/api/tea-specialist'
import TeaSpecialistLevel from '@/components/TeaSpecialistLevel.vue'
import type { ITeaSpecialistResult } from '@/api/types/tea-specialist'
import { TeaSpecialistLevelValue, TeaSpecialistLevels, GetTeaSpecialistLevelLabel } from '@/utils/teaSpecialist'
import { LOCATION_CITY_KEY, LOCATION_DEFAULT_CITY } from '@/hooks/useLocation'
import { getOpenCityList } from '@/api/tea-room'
const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight')
@ -254,26 +266,57 @@ const selectedLevel = ref<Array<any>>([]) // 当前选中的茶艺师等级
// mescroll
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
const downOption = {
auto: true
auto: false // 关闭自动请求,等城市加载完再请求
}
const upOption = {
empty: {
icon: OSS + 'icon/icon_reserver_empty.png',
tip: '暂无预约信息',
},
auto: true,
auto: false, // 关闭自动请求,等城市加载完再请求
textNoMore: '~ 已经到底啦 ~', //无更多数据的提示
}
const orderStatus = ref<string>('')
const list = ref<Array<any>>([]) // 茶室列表
const keywords = ref<string>('') // 搜索关键词
const city = ref<string>('') // 当前城市名称
const cityId = ref<number>(0)
onLoad(async () => {
console.log("🚀 ~ 213:", 213)
// 首页进来的cityId
const indexCity = ref<number>(0)
// 已开通的城市列表
const openCityList = ref<Array<any>>([])
onLoad(async (args: any) => {
indexCity.value = Number(args.cityId) || 0
console.log("🚀 ~ indexCity.value:", indexCity.value)
// 优先读取独立缓存,如果没有则读取系统默认定位
const listSavedCity = uni.getStorageSync('listCityName')
const listSavedCityId = uni.getStorageSync('listCityId')
if (listSavedCity && listSavedCityId !== '') {
city.value = listSavedCity
cityId.value = listSavedCityId
} else {
city.value = uni.getStorageSync(LOCATION_CITY_KEY) || LOCATION_DEFAULT_CITY
cityId.value = 0
}
uni.$on('refreshTeaSpecialist', () => {
list.value = []
getMescroll().resetUpScroll()
})
// 获取已开通城市列表
getOpenCityList().then(res => {
openCityList.value = res.list
// 获取完毕后再触发列表请求
setTimeout(() => {
getMescroll().resetUpScroll()
}, 100)
})
})
onUnload(() => {
@ -308,10 +351,39 @@ const List = {
return firstThreeStyles[index] || { backgroundColor: '#F3F3F3', color: '#818CA9' }
},
/**
* 跳转城市选择
*/
handleToCity: () => {
uni.$on('locationUpdate', params => {
console.log("🚀 ~ list -> params:", params)
uni.$off('locationUpdate')
city.value = params.city
cityId.value = params.id
uni.setStorageSync('listCityId', params.id)
uni.setStorageSync('listCityName', params.city)
List.handleSearch()
})
const storeLat = uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE
const storeLng = uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE
router.navigateTo(`/pages/city/city?lat=${storeLat}&lng=${storeLng}`)
},
/**
* 筛选表
*/
upCallback: (mescroll) => {
upCallback: (mescroll: any) => {
// 如果没有城市id就是初始化进入了系统这个时候需要获取到对应的城市id
if (cityId.value == 0) {
openCityList.value.forEach((item: any) => {
if (item.name === city.value) {
cityId.value = item.id
return
}
})
}
console.log("🚀 ~ cityId.value2:", cityId.value)
const filter = {
level: selectedLevel.value.join(',') || '',
page: mescroll.num,
@ -322,7 +394,7 @@ const List = {
server_type: serverType.value || '',
state: condition.value || 0,
gender: gender.value || '',
city_id: uni.getStorageSync('cityId') || 0,
city_id: cityId.value || 0,
}
getTeaSpecialist(filter).then((res: ITeaSpecialistResult) => {
@ -450,8 +522,8 @@ const List = {
/**
* 预览图片
*/
handlePreviewImage: (img: any) => {
previewImage(img, [img])
handlePreviewImage: (img: any, imageList: any) => {
previewImage(img, imageList)
}
}
</script>

View File

@ -142,9 +142,9 @@
</wd-popup>
<!-- 茶艺服务 -->
<wd-popup v-model="showTeaServicePopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
<wd-popup v-model="showTeaServicePopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom" @close="uni.hideKeyboard()">
<view class="relative">
<view class="absolute top-18rpx right-30rpx" @click="showTeaServicePopup = false">
<view class="absolute top-18rpx right-30rpx" @click="Reserve.handleCloseTeaServicePopup">
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
</view>
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">茶艺服务</view>
@ -247,7 +247,7 @@
<!-- 茶艺师信息 -->
<view class="flex items-center bg-white p-20rpx rounded-10rpx mb-20rpx mt-20rpx">
<view class="mr-28rpx relative">
<wd-img width="200rpx" height="200rpx" radius="10rpx" :src="info.image" @click="previewImage(info.image, [info.image])"></wd-img>
<wd-img width="200rpx" height="200rpx" radius="10rpx" :src="info.image" @click="previewImage(info.image, info.image_arr)"></wd-img>
</view>
<view class="">
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">
@ -467,9 +467,9 @@
const endTimeValue = ref<string>('') // 结束时间
const now = new Date()
const minTimestamp = Date.now() + 0.5 * 60 * 60 * 1000
// 允许选择今天及未来天的日期
// 允许选择今天及未来三十天的日期
const futureTimestamp = minTimestamp + 2 * 60 * 60 * 1000
const maxTimestamp = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 6, 23, 59, 59, 999).getTime()
const maxTimestamp = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 30, 23, 59, 59, 999).getTime()
const startTimeLayout = ref<string>('')
const endTimeLayout = ref<string>('')
const totalHour = ref<number>(0)
@ -585,7 +585,7 @@
team_user_id: 0, // 茶艺师id
})
onLoad(async (args) => {
onLoad(async (args: any) => {
if (args.id) {
id.value = Number(args.id)
costParams.value.team_user_id = Number(args.id)
@ -858,6 +858,14 @@
teaUsageValue.value = 0
},
/**
* 关闭茶艺服务弹窗
*/
handleCloseTeaServicePopup: () => {
uni.hideKeyboard()
showTeaServicePopup.value = false
},
/**
* 确认茶艺服务
*/
@ -866,6 +874,7 @@
toast.info('请选择预定茶叶')
return
}
uni.hideKeyboard()
showTeaServicePopup.value = false
// 计算费用明细

View File

@ -160,7 +160,7 @@
<view v-if="type === OrderSource.TeaSpecialist" class="bg-white rounded-10rpx p-28rpx">
<view class="flex items-center">
<view class="mr-28rpx">
<wd-img width="200rpx" height="200rpx" :src="order.image" radius="10rpx"></wd-img>
<wd-img width="200rpx" height="200rpx" :src="order.image" radius="10rpx" @click="ComboCard.handlePreviewImage(order.image, order.image_arr)"></wd-img>
</view>
<view class="flex-1" @click="ComboCard.handleToOrderDetail">
<view class="flex items-center relative">
@ -183,17 +183,20 @@
</view>
</view>
<view class="flex items-center">
<view class="mr-12rpx" v-if="order.server_type == 1 || order.server_type == 3">
<wd-tag color="#F55726" bg-color="#F55726" plain>到店服务</wd-tag>
<view class="flex flex-wrap items-center gap-y-12rpx">
<view class="mr-12rpx shrink-0" v-if="order.server_type == 1 || order.server_type == 3">
<wd-tag color="#F55726" bg-color="#F55726" plain custom-class="!rounded-4rpx whitespace-nowrap">到店服务</wd-tag>
</view>
<view class="mr-12rpx" v-if="order.server_type == 2 || order.server_type == 3">
<wd-tag color="#40AE36" bg-color="#40AE36" plain custom-class="!rounded-4rpx">上门服务</wd-tag>
<view class="mr-12rpx shrink-0" v-if="order.server_type == 2 || order.server_type == 3">
<wd-tag color="#40AE36" bg-color="#40AE36" plain custom-class="!rounded-4rpx whitespace-nowrap">上门服务</wd-tag>
</view>
<view class="mr-12rpx">
<wd-tag color="#818CA9" bg-color="#F3F3F3">{{ order.both }}</wd-tag>
<view class="mr-12rpx shrink-0" v-if="order.is_mileage == 1">
<wd-tag color="#FFF" bg-color="#FF5951" custom-class="!rounded-4rpx whitespace-nowrap border-none !px-12rpx">免费出行</wd-tag>
</view>
<view class="flex items-center mt-8rpx">
<view class="mr-12rpx shrink-0">
<wd-tag color="#818CA9" bg-color="#F3F3F3" custom-class="whitespace-nowrap">{{ order.both }}</wd-tag>
</view>
<view class="flex items-center mt-8rpx shrink-0">
<wd-img :src="order.sex == 1 ? `${OSS}icon/icon_man.png` : `${OSS}icon/icon_woman.png`" width="28rpx" height="28rpx"></wd-img>
</view>
</view>
@ -247,7 +250,7 @@
// import { toast } from '@/utils/toast'
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
import { StoreType } from '@/utils/tea'
import { router } from '@/utils/tools'
import { router, previewImage } from '@/utils/tools'
import { PayOrderType } from '@/utils/pay'
import { TeaSpecialistOrderStatus } from '@/utils/teaSpecialistOrder'
import { handleCancelOrderHooks, handleDeleteOrderHooks } from '@/hooks/useTeaSpecialistOrder'
@ -523,7 +526,14 @@
// TODO 确认订单接口
}
}).catch(() => {})
}
},
/**
* 预览图片
*/
handlePreviewImage: (img: any, imageList: any) => {
previewImage(img, imageList)
},
}
</script>

View File

@ -14,8 +14,6 @@ export const LOCATION_DEFAULT_CITY = '上海市' // 默认城市
export const LOCATION_DEFAULT_LNG = 121.473629 // 上海经度
export const LOCATION_DEFAULT_LAT = 31.230393 // 上海纬度
// 检查过期时间
export function handleCheckLocationCacheHooks() {
const expire = uni.getStorageSync(LOCATION_EXPIRE_KEY)

View File

@ -132,7 +132,7 @@ const teaPackageTitle = ref<string>('')
// 防止重复提交
const isSubmitting = ref(false)
onLoad(async (args) => {
onLoad(async (args: any) => {
// 订单
orderId.value = Number(args.orderId)
comboId.value = Number(args.cmoboId) || 0

View File

@ -57,7 +57,7 @@
// 已开通城市列表
const openCityList = ref<Array<any>>([])
onLoad((args) => {
onLoad((args: any) => {
if (args.lat && args.lng) {
latitude.value = Number(args.lat)
longitude.value = Number(args.lng)
@ -95,9 +95,10 @@
}
uni.$emit('locationUpdate', params)
// 取消全局城市缓存修改以实现功能页面之间的城市隔离
// uni.setStorageSync(LOCATION_LAT_KEY, item.latitude)
// uni.setStorageSync(LOCATION_LNG_KEY, item.longitude)
uni.setStorageSync(LOCATION_CITY_KEY, item.name)
// uni.setStorageSync(LOCATION_CITY_KEY, item.name)
router.navigateBack()
},

View File

@ -202,10 +202,10 @@
import { router, previewImage } from '@/utils/tools'
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 { LOCATION_DENY_TIME_KEY, handleEnsureLocationAuthHooks, LOCATION_DEFAULT_CITY, handleGetLocationCity } from '@/hooks/useLocation'
import { getHomeBannerList, getHomeCouponPopup, claimIndexCoupon, getTeaArtistEntrance } from '@/api/home'
import { getTeaPackageList } from '@/api/tea-package'
import { getHomeTeaStoreList } from '@/api/tea-room'
import { getHomeTeaStoreList, getOpenCityList } from '@/api/tea-room'
import { useUserStore } from '@/store'
import { useToast } from 'wot-design-uni'
import { getSetting } from '@/api/tea-specialist'
@ -260,6 +260,9 @@
// 茶艺师入口图
const teaArtistEntrance = ref<string>('')
// 已开通的城市列表
const openCityList = ref<Array<any>>([])
onShow(async () => {
// if (canLocation) {
// const location = await handleGetLocationCity(latitude.value, longitude.value)
@ -273,7 +276,9 @@
// 只有经纬度变化时才刷新
if (location.lat !== lastLocation.lat || location.lng !== lastLocation.lng) {
const loc = await handleGetLocationCity(location.lat, location.lng)
city.value = loc.city
if (!uni.getStorageSync('indexCityName')) {
city.value = loc.city
}
latitude.value = location.lat
longitude.value = location.lng
@ -306,7 +311,7 @@
}
})
onLoad(async(args) => {
onLoad(async() => {
// 获取小程序码注册来源
// getWxacode().then( res => {})
@ -318,14 +323,20 @@
latitude.value = lat
longitude.value = lng
// 根据经纬度获取城市信息再重新赋值经纬度和城市
const location = await handleGetLocationCity(lat, lng)
city.value = location.city
latitude.value = location.latitude
longitude.value = location.longitude
// 如果有首页独立的城市缓存,优先使用;否则使用定位城市
const indexSavedCity = uni.getStorageSync('indexCityName')
const indexSavedCityId = uni.getStorageSync('indexCityId')
// 删除city_id的缓存
uni.removeStorageSync('cityId')
if (indexSavedCity && indexSavedCityId !== '') {
city.value = indexSavedCity
city_id.value = indexSavedCityId
} else {
// 根据经纬度获取城市信息再重新赋值经纬度和城市
const location = await handleGetLocationCity(lat, lng)
city.value = location.city
latitude.value = location.latitude
longitude.value = location.longitude
}
Index.handleResetSearch()
})
@ -355,6 +366,16 @@
}
canLocation.value = true
// 如果没有城市id就是初始化进入了系统这个时候需要获取到对应的城市id
if (city_id.value == 0) {
openCityList.value.forEach((item: any) => {
if (item.name === city.value) {
city_id.value = item.id
return
}
})
}
const filter = {
page: mescroll.num,
size: mescroll.size,
@ -411,6 +432,10 @@
teaPackageList.value = res
})
// 获取已开通城市列表
getOpenCityList().then(res => {
openCityList.value = res.list
})
},
/**
@ -424,7 +449,8 @@
city_id.value = params.id
// latitude.value = params.latitude
// longitude.value = params.longitude
uni.setStorageSync('cityId', params.id)
uni.setStorageSync('indexCityId', params.id)
uni.setStorageSync('indexCityName', params.city)
Index.handleResetSearch()
})
router.navigateTo(`/pages/city/city?lat=${latitude.value}&lng=${longitude.value}`)
@ -447,7 +473,7 @@
* 跳转到预约茶室页面
*/
handleToReserveRoom: (id: number = 0, type: number = 1) => {
router.navigateTo( `/bundle/tea-room/room?id=${id}&type=${type}`)
router.navigateTo( `/bundle/tea-room/room?id=${id}&type=${type}` )
},
/**

View File

@ -444,8 +444,9 @@
// 选择菜单-拨打客服电话
handleSelectMenu: (item: any) => {
console.log("🚀 ~ item:", item)
uni.makePhoneCall({
phoneNumber: item.item.name
phoneNumber: String(item.item.name)
})
},

File diff suppressed because one or more lines are too long