茶艺师列表添加状态筛选

This commit is contained in:
wangxiaowei
2026-04-27 10:35:28 +08:00
parent 8e7c1ab6f6
commit 62a62932ea
6 changed files with 93 additions and 21 deletions

View File

@ -18,6 +18,7 @@ export interface ITeaSpecialistParams {
level?: string
search?: string
server_type?: number // 1到店服务 2上门服务
status?: number // 0可约 1已约 2已取消
}
export function getTeaSpecialist(data: ITeaSpecialistParams) {

View File

@ -103,7 +103,7 @@ export interface ICreateTeaSpecialistOrderParams {
is_teacup: number
tea_id: string
user_coupon_id: number
server_number: number
server_number: string
team_group_id?: number
}

View File

@ -194,6 +194,7 @@ const TeaSpecialist = {
longitude: storage.longitude || import.meta.env.VITE_DEFAULT_LONGITUDE,
level: uni.getStorageSync('teaPackageType'),
server_type: serviceType.value, // 1到店服务 2上门服务
state: 1, // 1可约 2不可约
}
try {
const res = await getTeaSpecialist(filter)

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.11
2.14.12
</view>
</view>
</view>

View File

@ -45,8 +45,9 @@
<!-- 茶艺师列表 -->
<view class="level-bg pt-28rpx">
<!-- 茶艺师等级筛选 -->
<view class="">
<view
class="flex items-center text-#303133 overflow-x-auto whitespace-nowrap ml-30rpx mb-30rpx tea-level-scrollbar">
class="flex items-center text-#303133 overflow-x-auto whitespace-nowrap ml-30rpx mb-20rpx tea-level-scrollbar">
<view v-for="(item, index) in TeaSpecialistLevels" :key="index"
class="h-64rpx rounded-12rpx px-24rpx py-12rpx flex items-center justify-center font-400 text-28rpx mr-20rpx"
:class="selectedLevel.includes(item.level) ? 'border-2rpx border-solid border-[#4C9F44] text-[#4C9F44] bg-[#fff]' : 'bg-[#FFF] text-[#606266]'"
@ -55,12 +56,25 @@
</view>
</view>
<view class="ml-30rpx mb-30rpx">
<view class="flex flex-wrap">
<view class="mr-20rpx">
<wd-checkbox v-model="condition1" shape="square" checked-color="#4C9F44" @change="List.handleRadioClick('condition1', 1)">可约</wd-checkbox>
</view>
<view>
<wd-checkbox v-model="condition2" shape="square" checked-color="#4C9F44" @change="List.handleRadioClick('condition2', 2)">不可约</wd-checkbox>
</view>
</view>
</view>
</view>
<mescroll-body @init="mescrollInit" @down="downCallback" :down="downOption" @up="List.upCallback"
: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)">
<wd-img width="260rpx" height="320rpx" :src="item.image" mode="aspectFill" radius="10rpx"></wd-img>
<wd-img width="260rpx" height="320rpx" :src="item.image" mode="aspectFill"
radius="10rpx"></wd-img>
<view
class="tea-specialist-time absolute z-3 top-26rpx left-0 bg-[#4C9F44] text-[#fff] font-400 text-18rpx flex items-center justify-center">
<text v-if="item.state == 0">可约</text>
@ -75,7 +89,8 @@
</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">{{ item.star }}</view>
<view class="font-400 text-24rpx text-[#FF5951] leading-34rpx ml-6rpx">{{ item.star }}
</view>
</view>
</view>
@ -102,10 +117,9 @@
</view>
<view class="flex flex-wrap items-center mt-14rpx mb-24rpx">
<view
class="mr-8rpx px-10rpx leading-34rpx font-400 text-24rpx rounded-4rpx mb-14rpx"
:style="List.handleGetLabelStyle(Number(index))"
v-for="(label, index) in item.label" :key="index">
<view class="mr-8rpx px-10rpx leading-34rpx font-400 text-24rpx rounded-4rpx mb-14rpx"
:style="List.handleGetLabelStyle(Number(index))" v-for="(label, index) in item.label"
:key="index">
{{ label.label_name }}
</view>
</view>
@ -117,7 +131,8 @@
<wd-img :src="`${OSS}icon/icon_store_cert2.png`" width="30rpx"
height="30rpx"></wd-img>
</view>
<text class="ml-8rpx font-400 text-24rpx leading-4rpx" :class="item.company_status ? 'text-#4C9F44' : 'text-#303133'">
<text class="ml-8rpx font-400 text-24rpx leading-4rpx"
:class="item.company_status ? 'text-#4C9F44' : 'text-#303133'">
{{ item.company_abv }}
</text>
</view>
@ -196,6 +211,11 @@ onShareAppMessage(() => {
}
})
// 筛选条件(单选)
const condition = ref<string>('') // 当前选中的筛选条件
const condition1 = ref<boolean>(false)
const condition2 = ref<boolean>(false)
const List = {
handleGetLabelStyle: (index: number) => {
const firstThreeStyles = [
@ -218,7 +238,8 @@ const List = {
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
search: keywords.value,
server_type: 0
server_type: 0,
state: condition.value || 0,
}
getTeaSpecialist(filter).then((res: ITeaSpecialistResult) => {
@ -257,6 +278,28 @@ const List = {
List.handleSearch()
},
/**
* 处理单选checkbox点击模拟单选行为
*/
handleRadioClick: (type: string, value: number) => {
if (type === 'condition1') {
if (condition1.value) {
condition.value = String(value)
condition2.value = false
} else {
condition.value = ''
}
} else if (type === 'condition2') {
if (condition2.value) {
condition.value = String(value)
condition1.value = false
} else {
condition.value = ''
}
}
List.handleSearch()
},
/**
* 搜索茶艺师列表
*/
@ -331,5 +374,9 @@ page {
background: linear-gradient(180deg, #E9FFF1 0%, #F6F7F8 100%) no-repeat;
background-size: 100% 220rpx;
border-radius: 20rpx 20rpx 0rpx 0rpx;
:deep(.wd-radio-group) {
background: transparent !important;
}
}
</style>

View File

@ -151,7 +151,7 @@
<scroll-view scroll-y class="h-900rpx">
<view class="">
<!-- 服务人数 -->
<view class="mx-60rpx mb-56rpx">
<!-- <view class="mx-60rpx mb-56rpx">
<view class="text-32rpx leading-44rpx text-#303133">服务人数</view>
<view class="flex items-center justify-between mt-28rpx">
<view class="text-28rpx leading-40rpx text-#303133">服务人数</view>
@ -159,6 +159,21 @@
<wd-input-number v-model="servicePeople"/>
</view>
</view>
</view> -->
<view class="mx-60rpx mb-56rpx">
<view class="text-32rpx leading-44rpx text-#303133">服务人数</view>
<view class="flex items-center mt-28rpx">
<view class="h-60rpx w-178rpx rounded-30rpx flex items-center justify-center mr-20rpx"
:class="servicePeople === '1-3' ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F6F7F8] text-[#606266]'"
@click="Reserve.servicePeopleChange('1-3')">
<text class="text-26rpx leading-36rpx">1人~3人</text>
</view>
<view class="h-60rpx w-178rpx rounded-30rpx flex items-center justify-center"
:class="servicePeople === '4-6' ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F6F7F8] text-[#606266]'"
@click="Reserve.servicePeopleChange('4-6')">
<text class="text-26rpx leading-36rpx">4人~6人</text>
</view>
</view>
</view>
<!-- 茶具使用 -->
@ -471,7 +486,7 @@
// 茶艺服务
const showTeaServicePopup = ref<boolean>(false) // 显示门店列表弹窗
const servicePeople = ref<number>(1) // 服务人数
const servicePeople = ref<string>('1-3') // 服务人数
const teaList = ref<ITeaTypeListResult[]>([]) // 茶叶列表
const selectedTea = ref<Array<any>>([]) // 选择的茶叶
const selectedTeaTxt = ref<Array<any>>([]) // 选择的茶叶文本
@ -603,6 +618,14 @@
})
const Reserve = {
/**
* 选择服务人数
* @param type 人数范围 '1-3' 或 '4-6'
*/
servicePeopleChange: (type: string) => {
servicePeople.value = type
},
/**
* 初始化-获取茶叶列表
*/
@ -829,7 +852,7 @@
* 重置差茶艺服务
*/
handleResetTeaService: () => {
servicePeople.value = 1
servicePeople.value = '1-3'
selectedTea.value = []
teaUsageValue.value = 0
},