修改代码

This commit is contained in:
wangxiaowei
2026-01-30 01:13:52 +08:00
parent 5e5cd66f21
commit 26834c36c0
12 changed files with 756 additions and 454 deletions

View File

@ -196,3 +196,71 @@ export function openLock(order_id: number, type: number) {
export function getStoreBalanceLog() {
return http.Post<any>('/api/user/userStoreMoneyList', {})
}
/**
* 获取验证码
*/
export interface IGetStoreVerificationCodeParams {
mobile: string
scene: string
}
export function getVerificationCode(data: IGetStoreVerificationCodeParams) {
return http.Post('/storeapi/sms/sendCode', data, {
meta: { ignoreAuth: true }
})
}
/**
* 添加申请茶艺师
*/
export interface IAddTeaSpecialistParams {
license_img: string // 营业执照
username: string // 茶艺师名字
gender: number // 茶艺师性别(1男 2女)
both: number | string // 出生年月
height: string // 身高
weight: string // 体重
hobby_introduce: string // 兴趣爱好介绍
city_id: number // 城市ID
avatar: string // 头像
certificate: string // 健康证、资格证书信息
mobile: string // 联系电话
code: string // 验证码
}
export function addTeaSpecialist(data: IAddTeaSpecialistParams) {
return http.Post('/api/submitForm/addTeamaster', data)
}
/**
* 查看申请茶艺师表单状态
*/
export function getTeaSpecialistStatus() {
return http.Post<any>('/api/submitForm/teamasterRealStatus')
}
/**
* 添加加盟合作
*/
export interface IAddJoinCooperationParams {
operation_type: number // 加盟类型
license_img: string // 营业执照
username: string // 联系人姓名
mobile: string // 联系电话
code: string // 验证码
city_id: number // 城市ID
address: string // 详细地址
suggest: string // 意见建议
}
export function addJoinCooperation(data: IAddJoinCooperationParams) {
return http.Post('/api/submitForm/addStore', data)
}
/**
* 查看加盟合作表单状态
*/
export function getJoinCooperationStatus() {
return http.Post<any>('/api/submitForm/StoreRealStatus')
}

View File

@ -135,11 +135,9 @@
// 发送验证码
handleCountDown: () => {
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
// 发送验证码请求
})
setTimeout(() => {
countDown.value.start()
}, 100)
},
// 验证码倒计时结束

View File

@ -186,11 +186,9 @@
// 发送验证码
handleCountDown: () => {
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
// 发送验证码请求
})
setTimeout(() => {
countDown.value.start()
}, 100)
},
// 验证码倒计时结束

View File

@ -9,7 +9,22 @@
</route>
<template>
<view class="">
<view>
<view>
<navbar title="加盟合作" custom-class='!bg-[#F6F7F8]'></navbar>
</view>
<!-- 待审核 -->
<view class="mt-84rpx" v-if="status === 0">
<view class="flex justify-center items-center">
<wd-img width="300rpx" height="278rpx" :src="`${OSS}images/settle_in/settle_in_image2.png`"/>
</view>
<view class="mt-60rpx text-center">
<view class="text-36rpx leading-50rpx text-#303133">您的信息已成功提交</view>
<view class="font-400 text-26rpx leading-42rpx text-#9CA3AF mt-20rpx mx-102rpx">目前正在审核中,请您耐心等待</view>
</view>
</view>
<!-- 申请成功提示 -->
<view class="mt-84rpx" v-if="tips">
<view v-if="isSuccess">
@ -22,7 +37,7 @@
<view class="font-400 text-26rpx leading-42rpx text-#9CA3AF mt-28rpx mx-102rpx">如您遇到任何问题,可随时联系客服热线 400-6245-123我们将竭诚为您服务</view>
</view>
</view>
<view class="" v-else>
<view v-else>
<view class="flex justify-center items-center">
<wd-img width="300rpx" height="278rpx" :src="`${OSS}images/settle_in/settle_in_image2.png`"/>
</view>
@ -33,181 +48,168 @@
</view>
</view>
<view class="">
<navbar title="加盟合作" custom-class='!bg-[#F6F7F8]'></navbar>
</view>
<view class="mx-30rpx mt-38rpx">
<!-- 加盟类型 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx">
<view class="flex justify-between items-center">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">加盟类型</view>
<template v-if="status >= 2">
<view class="mx-30rpx mt-38rpx">
<!-- 加盟类型 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx">
<view class="flex justify-between items-center">
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="flex items-center">
<wd-radio-group v-model="form.settleIn" size="large" shape="dot" checked-color="#4C9F44" inline>
<wd-radio :value="1" border>
<view class="leading-36rpx font-400 text-30rpx ml-12rpx mr-60rpx">加盟</view>
</wd-radio>
<wd-radio :value="2" border>
<view class="leading-36rpx font-400 text-30rpx ml-12rpx">入驻</view>
</wd-radio>
</wd-radio-group>
</view>
</view>
<view class="flex items-center mt-46rpx" v-if="form.settleIn === 2">
<view class="text-32rpx leading-44rpx text-#303133 mr-66rpx">门店名称</view>
<view class="flex-1">
<wd-input no-border placeholder="请填写门店名称" custom-class="!bg-[#F6F7F8] !rounded-16rpx !px-28rpx !py-20rpx"></wd-input>
</view>
</view>
</view>
<!-- 营业执照 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx">营业执照</view>
<view class="">
<wd-upload
:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action"
@change="TeaRoom.handleUploadFile">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">加盟类型</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">营业执照</view>
</view>
</wd-upload>
</view>
</view>
<!-- 联系方式 -->
<view class="bg-white rounded-16rpx px-30rpx pt-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
<view class="mr-10rpx">联系方式</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
<view class="flex items-center">
<wd-radio-group v-model="form.operation_type" size="large" shape="dot" checked-color="#4C9F44" inline>
<wd-radio :value="1" border>
<view class="leading-36rpx font-400 text-30rpx ml-12rpx mr-60rpx">加盟</view>
</wd-radio>
<wd-radio :value="2" border>
<view class="leading-36rpx font-400 text-30rpx ml-12rpx">入驻</view>
</wd-radio>
</wd-radio-group>
</view>
</view>
<!-- <view class="flex items-center mt-46rpx" v-if="form.settleIn === 2">
<view class="text-32rpx leading-44rpx text-#303133 mr-66rpx">门店名称</view>
<view class="flex-1">
<wd-input no-border placeholder="请填写门店名称" custom-class="!bg-[#F6F7F8] !rounded-16rpx !px-28rpx !py-20rpx"></wd-input>
</view>
</view> -->
</view>
<!-- 营业执照 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx">营业执照</view>
<view class="">
<wd-upload
:header="{'token': token}"
v-model:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">营业执照</view>
</view>
</wd-upload>
</view>
</view>
<view>
<!-- 联系方式 -->
<view class="bg-white rounded-16rpx px-30rpx pt-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
<view class="mr-10rpx">联系方式</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`" ></wd-img>
</view>
</view>
<view>
<view class="text-26rpx leading-32rpx text-#606266">联系人</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写联系人" ></wd-input>
<view>
<view class="text-26rpx leading-32rpx text-#606266">联系人</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写联系人" v-model="form.username"></wd-input>
</view>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">手机号</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写手机号"></wd-input>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">手机号</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写手机号" v-model="form.mobile"></wd-input>
</view>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">验证码</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input type="text" placeholder="请填写手机验证码" v-model="form.code" inputmode="numeric" no-border>
<template #suffix>
<view class="flex items-center mr-34rpx">
<view class="flex items-center">
<view class="text-[#4C9F44] text-28rpx font-400 leading-40rpx" v-if="!startCountDown" @click="TeaRoom.handleCountDown">发送验证码</view>
<view class="!text-[#C9C9C9] text-28rpx font-400 leading-40rpx flex items-center" v-if="startCountDown">
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="TeaRoom.handleFinishCountDown"></wd-count-down>
<view> S后重发</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">验证码</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input type="text" placeholder="请填写手机验证码" v-model="form.code" inputmode="numeric" no-border>
<template #suffix>
<view class="flex items-center mr-34rpx">
<view class="flex items-center">
<view class="text-[#4C9F44] text-28rpx font-400 leading-40rpx" v-if="!startCountDown" @click="TeaRoom.handleCountDown">发送验证码</view>
<view class="!text-[#C9C9C9] text-28rpx font-400 leading-40rpx flex items-center" v-if="startCountDown">
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="TeaRoom.handleFinishCountDown"></wd-count-down>
<view> S后重发</view>
</view>
</view>
</view>
</template>
</wd-input>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">选择地区</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx tea-room-address">
<wd-picker :columns="openCityList" label-key="name" value-key="id" v-model="form.city_id" use-default-slot @confirm="TeaRoom.handleConfirmAddress">
<view class="flex items-center">
<wd-input readonly v-model="city" placeholder="请选择地区" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;" custom-input-class="!p-0"></wd-input>
<wd-icon name="chevron-down" size="32rpx" color="#909399"></wd-icon>
</view>
</template>
</wd-input>
</wd-picker>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">详细地址</view>
<view class="mt-20rpx pb-20rpx">
<wd-input no-border placeholder="请输入小区/写字楼" v-model="form.address" ></wd-input>
</view>
</view>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">省市区</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx tea-room-address">
<wd-col-picker v-model="value" :columns="area" :column-change="columnChange" @confirm="TeaRoom.handleConfirmAddress" placeholder="请选择省市区"></wd-col-picker>
</view>
<!-- 留言建议 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
留言建议
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">详细地址</view>
<view class="mt-20rpx pb-20rpx">
<wd-input no-border placeholder="请输入小区/写字楼"></wd-input>
</view>
<view class="">
<wd-textarea placeholder="有想说的可以在这里写哦!" v-model="form.suggest" custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]' custom-textarea-class='!bg-[#F8F9FA]' />
</view>
</view>
</view>
<!-- 留言建议 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
留言建议
</view>
<view class="">
<wd-textarea placeholder="有想说的可以在这里写哦!" v-model="form.message" custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]' custom-textarea-class='!bg-[#F8F9FA]' />
</view>
<view class="text-26rpx leading-32rpx text-#606266 mt-24rpx mx-60rpx">
*提交表单申请工作人员将在3个工作日内与您电话联系如需及时了解请直接电话咨询我们将在第一时间解答
</view>
</view>
<view class="text-26rpx leading-32rpx text-#606266 mt-24rpx mx-60rpx">
*提交表单申请工作人员将在3个工作日内与您电话联系如需及时了解请直接电话咨询我们将在第一时间解答
</view>
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] mt-112rpx pb-66rpx">
<view class="w-330rpx h-90rpx bg-[#FFFFFF] rounded-8rpx mr-30rpx" @click="router.navigateTo('/bundle/contact/contact')">联系我们</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff">提交申请</view>
</view>
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] mt-112rpx pb-66rpx">
<view class="w-330rpx h-90rpx bg-[#FFFFFF] rounded-8rpx mr-30rpx" @click="router.navigateTo('/bundle/contact/contact')">联系我们</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff" @click="TeaRoom.handleSubmit">提交申请</view>
</view>
</template>
</view>
</template>
<script lang="ts" setup>
import { useColPickerData } from '@/hooks/useColPickerData'
import { router } from '@/utils/tools'
import { router, removeImageUrlPrefix } from '@/utils/tools'
import { SMS_ENUM } from '@/enum/sms'
import { mobile } from '@/utils/test'
import { getVerificationCode, addJoinCooperation, getJoinCooperationStatus } from '@/api/user'
import { getOpenCityList } from '@/api/tea-room'
import { useToast } from 'wot-design-uni'
const OSS = inject('OSS')
const token = ref<string>('') // 用户token
const toast = useToast()
// 审核提示
const tips = ref<boolean>(false)
const isSuccess = ref<boolean>(false)
// 省市区数据
const { colPickerData, findChildrenByCode } = useColPickerData()
const value = ref<string[]>([])
const area = ref<any[]>([
colPickerData.map((item) => {
return {
value: item.value,
label: item.text
}
})
])
const columnChange = ({ selectedItem, resolve, finish }) => {
const areaData = findChildrenByCode(colPickerData, selectedItem.value)
if (areaData && areaData.length) {
resolve(
areaData.map((item) => {
return {
value: item.value,
label: item.text
}
})
)
} else {
finish()
}
}
// 已开通城市列表
const openCityList = ref<Array<any>>([])
const city = ref<string>('')
// 上传文件
const fileList = ref<any[]>([])
const action = 'https://www.mocky.io/v2/5cc8019d300000980a055e76' // 仅做测试使用,实际请换成真实上传接口
const action = import.meta.env.VITE_UPLOAD_BASEURL // 仅做测试使用,实际请换成真实上传接口
// 验证码倒计时
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
@ -215,40 +217,126 @@
const countDown = ref<any>(null) // 倒计时组件
// 表单
const form = reactive<{
settleIn: number,
code: string,
message: string
const form = ref<{
operation_type: number // 加盟类型
license_img: string // 营业执照
username: string // 联系人姓名
mobile: string // 联系电话
code: string // 验证码
city_id: number // 城市ID
address: string // 详细地址
suggest: string // 意见建议
}>({
settleIn: 1,
operation_type: 1,
license_img: '',
username: '',
mobile: '',
code: '',
message: ''
city_id: 0,
address: '',
suggest: ''
})
// 审核状态
const status = ref<number>(-1) // 0待审核 1审核成功 2审核失败 3未提交数据
onLoad(async () => {
const res = await getJoinCooperationStatus()
status.value = res.status
token.value = uni.getStorageSync('token')
TeaRoom.handleInit()
})
const TeaRoom = {
// 图片选择/删除
handleUploadFile: (event: any) => {
fileList.value = event.fileList
/**
* 初始化
*/
handleInit: async () => {
const res = await getOpenCityList()
openCityList.value = res.list
},
// 发送验证码
handleCountDown: () => {
/**
* 发送验证码
*/
handleCountDown: async () => {
if (!mobile(form.value.mobile)) {
toast.show('请检查手机号码')
return false
}
await getVerificationCode({ scene: SMS_ENUM.BANK, mobile: String(form.value.mobile) })
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
// 发送验证码请求
})
setTimeout(() => {
countDown.value.start()
}, 100)
},
// 验证码倒计时结束
/**
* 验证码倒计时结束
*/
handleFinishCountDown: () => {
startCountDown.value = false
},
// 确认选择地址
handleConfirmAddress: (selected) => {
console.log("🚀 ~ selected:", selected)
/**
* 确认选择地址
*/
handleConfirmAddress: (item) => {
city.value = item.selectedItems.name
},
/**
* 提交申请
*/
handleSubmit: async () => {
if (!form.value.username) {
toast.show('请输入联系人')
return false
}
if (!mobile(form.value.mobile)) {
toast.show('请检查手机号码')
return false
}
if (!form.value.code) {
toast.show('请输入验证码')
return false
}
if (!form.value.city_id) {
toast.show('请选择地区')
return false
}
if (!form.value.address) {
toast.show('请输入详细地址')
return false
}
form.value.license_img = fileList.value.length > 0 ? removeImageUrlPrefix(fileList.value)[0] : ''
toast.loading({
loadingType: 'ring',
loadingColor: '#4C9F44',
msg: '提交中...'
})
try {
toast.close()
await addJoinCooperation(form.value)
status.value = 0 // 提交成功,变更状态为待审核
setTimeout(() => {
toast.success('提交成功')
}, 100)
} catch(e) {
toast.close()
return
}
}
}
</script>

View File

@ -10,282 +10,286 @@
<template>
<view class="">
<view class="">
<navbar title="申请茶艺师" custom-class='!bg-[#F6F7F8]'></navbar>
</view>
<!-- 待审核 -->
<view class="mt-84rpx" v-if="status === 0">
<view class="flex justify-center items-center">
<wd-img width="300rpx" height="278rpx" :src="`${OSS}images/settle_in/settle_in_image2.png`"/>
</view>
<view class="mt-60rpx text-center">
<view class="text-36rpx leading-50rpx text-#303133">您的信息已成功提交</view>
<view class="font-400 text-26rpx leading-42rpx text-#9CA3AF mt-20rpx mx-102rpx">目前正在审核中,请您耐心等待</view>
</view>
</view>
<!-- 申请成功提示 -->
<view class="mt-84rpx" v-if="tips">
<view class="mt-84rpx" v-if="status === 1">
<view class="flex justify-center items-center">
<wd-img width="300rpx" height="278rpx" :src="`${OSS}images/settle_in/settle_in_image1.png`"/>
</view>
<view class="mt-60rpx text-center">
<view class="text-36rpx leading-50rpx text-#303133">申请茶艺师成功</view>
<view class="font-400 text-26rpx leading-42rpx text-#9CA3AF mt-28rpx mx-102rpx">请登录茶艺师端查看信息根据步骤进行操作如有疑问请联系客服400-6245-123</view>
<view class="font-400 text-26rpx leading-42rpx text-#9CA3AF mt-28rpx mx-102rpx">请登录【茶址茶艺师】小程序查看信息进行操作,如有疑问请联系平台</view>
</view>
<view class="bg-white rounded-16rpx px-34rpx py-28rpx mx-78rpx mt-24rpx">
<!-- <view class="bg-white rounded-16rpx px-34rpx py-28rpx mx-78rpx mt-24rpx">
<view class="font-bold text-28rpx leading-40rpx text-#303133">操作步骤</view>
<view class="font-400 text-28rpx leading-42rpx text-#303133 mt-20rpx">
<view>1.关注茶址公众号</view>
<view>1.关注【茶址茶艺师】小程序</view>
<view>2.在左下角【茶址】 → 选择【茶艺师端】</view>
<view>3.用注册手机号+密码 登录</view>
</view>
</view>
</view> -->
</view>
<view class="">
<navbar title="申请茶艺师" custom-class='!bg-[#F6F7F8]'></navbar>
</view>
<view class="mx-30rpx mt-38rpx">
<!-- 营业执照 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx">营业执照</view>
<view class="">
<wd-upload
:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action"
@change="TeaSpecialist.handleUploadFile">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
<template v-if="status >= 2">
<view class="mx-30rpx mt-38rpx">
<!-- 营业执照 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx">营业执照</view>
<view class="">
<wd-upload
:header="{'token': token}"
v-model:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">营业执照</view>
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">营业执照</view>
</view>
</wd-upload>
</view>
</view>
<!-- 基本信息 -->
<view class="bg-white rounded-16rpx px-30rpx pt-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
<view class="mr-10rpx">基本信息</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</wd-upload>
</view>
</view>
<view>
<!-- 基本信息 -->
<view class="bg-white rounded-16rpx px-30rpx pt-28rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
<view class="mr-10rpx">基本信息</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view>
<view class="text-26rpx leading-32rpx text-#606266">姓名</view>
<view>
<view class="text-26rpx leading-32rpx text-#606266">姓名</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写姓名" v-model="form.username"></wd-input>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">性别</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx tea-specialist-cell">
<wd-picker placeholder="请选择性别" :columns="genderColumns" v-model="form.gender" @confirm="TeaSpecialist.handleConfirmGender" />
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">出生年月</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx tea-specialist-cell">
<wd-datetime-picker placeholder="请选择出生年月" v-model="form.both" :minDate="new Date(1970, 0, 1).getTime()" :maxDate="new Date().getTime()" type="date" @confirm="TeaSpecialist.handleConfirmBoth"></wd-datetime-picker>
</view>
</view>
<view class="mt-22rpx flex items-center justify-between border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<view class="mr-166rpx">
<view class="text-26rpx leading-32rpx text-#606266">身高</view>
<view class="mt-20rpx flex items-center">
<wd-input no-border placeholder="请填写身高" v-model="form.height"></wd-input>
<view class="text-30rpx leading-32rpx text-#606266">cm</view>
</view>
</view>
<view class="">
<view class="text-26rpx leading-32rpx text-#606266">体重</view>
<view class="mt-20rpx flex items-center">
<wd-input no-border placeholder="请填写体重" v-model="form.weight"></wd-input>
<view class="text-30rpx leading-32rpx text-#606266">kg</view>
</view>
</view>
</view>
</view>
</view>
<!-- 兴趣爱好 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
兴趣爱好
</view>
<view>
<wd-textarea placeholder="你的茶艺兴趣爱好是什么?比如茶艺研究、品鉴、茶道美学……快来分享一下吧!" v-model="form.hobby_introduce" custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]' custom-textarea-class='!bg-[#F8F9FA]' />
</view>
</view>
<!-- 服务区域 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx flex items-center">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">服务区域</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="flex-1 ml-80rpx">
<wd-picker :columns="openCityList" label-key="name" value-key="id" v-model="form.city_id" use-default-slot @confirm="TeaSpecialist.handleConfirmAddress">
<view class="flex items-center">
<wd-input readonly v-model="city" size="large" placeholder="请选择地区" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;"></wd-input>
<wd-icon name="chevron-right" size="32rpx" color="#909399"></wd-icon>
</view>
</wd-picker>
<!-- <wd-col-picker v-model="value" :columns="area" :column-change="columnChange" @confirm="TeaSpecialist.handleConfirmAddress" placeholder="请选择省市区"></wd-col-picker> -->
</view>
</view>
<!-- 照片信息 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">照片信息</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="mt-32rpx">
<wd-upload
:header="{'token': token}"
v-model:file-list="fileList2"
:limit="1"
image-mode="scaleToFill"
:action="action">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">本人照片</view>
</view>
</wd-upload>
</view>
</view>
<!-- 健康证、资格证书信息 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">健康证、资格证书信息</view>
<!-- <view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view> -->
</view>
<view class="mt-32rpx flex items-center">
<view class="mr-16rpx">
<wd-upload
:header="{'token': token}"
v-model:file-list="fileList3"
:limit="1"
image-mode="scaleToFill"
:action="action">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">健康证</view>
</view>
</wd-upload>
</view>
<view>
<wd-upload
:header="{'token': token}"
v-model:file-list="fileList4"
:limit="1"
image-mode="scaleToFill"
:action="action">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">茶艺师资格证</view>
</view>
</wd-upload>
</view>
</view>
</view>
<!-- 联系方式 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">联系方式</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">手机号</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写姓名" ></wd-input>
<wd-input no-border placeholder="请填写手机号" v-model="form.mobile"></wd-input>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">性别</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx tea-specialist-cell">
<wd-picker placeholder="请选择性别" :columns="genderColumns" v-model="form.gender" @confirm="TeaSpecialist.handleConfirmGender" />
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">出生年月</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx tea-specialist-cell">
<wd-datetime-picker placeholder="请选择出生年月" v-model="form.born" :maxDate="Date.now()" :minDate="0" type="year-month" @confirm="TeaSpecialist.handleConfirmBornData"></wd-datetime-picker>
</view>
</view>
<view class="mt-22rpx flex items-center justify-between border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<view class="mr-166rpx">
<view class="text-26rpx leading-32rpx text-#606266">身高</view>
<view class="mt-20rpx flex items-center">
<wd-input no-border placeholder="请填写姓名"></wd-input>
<view class="text-30rpx leading-32rpx text-#606266">cm</view>
</view>
</view>
<view class="">
<view class="text-26rpx leading-32rpx text-#606266">体重</view>
<view class="mt-20rpx flex items-center">
<wd-input no-border placeholder="请填写姓名"></wd-input>
<view class="text-30rpx leading-32rpx text-#606266">kg</view>
</view>
</view>
</view>
</view>
</view>
<!-- 兴趣爱好 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
<view class="text-32rpx leading-44rpx text-#303133 mb-32rpx flex items-center">
兴趣爱好
</view>
<view>
<wd-textarea placeholder="你的茶艺兴趣爱好是什么?比如茶艺研究、品鉴、茶道美学……快来分享一下吧!" v-model="form.message" custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]' custom-textarea-class='!bg-[#F8F9FA]' />
</view>
</view>
<!-- 服务区域 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx flex items-center">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">服务区域</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="flex-1 ml-80rpx">
<wd-col-picker v-model="value" :columns="area" :column-change="columnChange" @confirm="TeaSpecialist.handleConfirmAddress" placeholder="请选择省市区"></wd-col-picker>
</view>
</view>
<!-- 照片信息 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">照片信息</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="mt-32rpx">
<wd-upload
:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action"
@change="TeaSpecialist.handleUploadFile">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">本人照片</view>
</view>
</wd-upload>
</view>
</view>
<!-- 健康证资格证书信息 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">健康证资格证书信息</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="mt-32rpx flex items-center">
<view class="mr-16rpx">
<wd-upload
:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action"
@change="TeaSpecialist.handleUploadFile2">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">健康证</view>
</view>
</wd-upload>
</view>
<view>
<wd-upload
:file-list="fileList"
:limit="1"
image-mode="scaleToFill"
:action="action"
@change="TeaSpecialist.handleUploadFile3">
<view class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class="">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
</view>
<view class="font-400 text-26rpx leading-36rpx text-#303133">茶艺师资格证</view>
</view>
</wd-upload>
</view>
</view>
</view>
<!-- 联系方式 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
<view class="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">联系方式</view>
<view class="flex items-center">
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">手机号</view>
<view class="mt-20rpx border-b border-b-solid border-b-[#F6F7F8] pb-20rpx">
<wd-input no-border placeholder="请填写手机号"></wd-input>
</view>
</view>
<view class="mt-22rpx">
<view class="text-26rpx leading-32rpx text-#606266">验证码</view>
<view class="mt-20rpx pb-20rpx">
<wd-input type="text" placeholder="请填写手机验证码" v-model="form.code" inputmode="numeric" no-border>
<template #suffix>
<view class="flex items-center mr-34rpx">
<view class="flex items-center">
<view class="text-[#4C9F44] text-28rpx font-400 leading-40rpx" v-if="!startCountDown" @click="TeaSpecialist.handleCountDown">发送验证码</view>
<view class="!text-[#C9C9C9] text-28rpx font-400 leading-40rpx flex items-center" v-if="startCountDown">
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="TeaSpecialist.handleFinishCountDown"></wd-count-down>
<view> S后重发</view>
<view class="text-26rpx leading-32rpx text-#606266">验证码</view>
<view class="mt-20rpx pb-20rpx">
<wd-input type="text" placeholder="请填写手机验证码" v-model="form.code" inputmode="numeric" no-border>
<template #suffix>
<view class="flex items-center mr-34rpx">
<view class="flex items-center">
<view class="text-[#4C9F44] text-28rpx font-400 leading-40rpx" v-if="!startCountDown" @click="TeaSpecialist.handleCountDown">发送验证码</view>
<view class="!text-[#C9C9C9] text-28rpx font-400 leading-40rpx flex items-center" v-if="startCountDown">
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="TeaSpecialist.handleFinishCountDown"></wd-count-down>
<view> S后重发</view>
</view>
</view>
</view>
</view>
</template>
</wd-input>
</template>
</wd-input>
</view>
</view>
</view>
</view>
</view>
<view class="text-26rpx leading-32rpx text-#606266 mt-24rpx mx-60rpx">
*提交表单申请工作人员将在3个工作日内与您电话联系如需及时了解请直接电话咨询我们将在第一时间解答
</view>
<view class="text-26rpx leading-32rpx text-#606266 mt-24rpx mx-60rpx">
*提交表单申请工作人员将在3个工作日内与您电话联系如需及时了解请直接电话咨询我们将在第一时间解答
</view>
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] mt-112rpx pb-66rpx">
<view class="w-330rpx h-90rpx bg-[#FFFFFF] rounded-8rpx mr-30rpx" @click="router.navigateTo('/bundle/contact/contact')">联系我们</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff" @click="TeaSpecialist.handleSubmit">提交申请</view>
</view>
</template>
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] mt-112rpx pb-66rpx">
<view class="w-330rpx h-90rpx bg-[#FFFFFF] rounded-8rpx mr-30rpx" @click="router.navigateTo('/bundle/contact/contact')">联系我们</view>
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff">提交申请</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { useColPickerData } from '@/hooks/useColPickerData'
import { router } from '@/utils/tools'
import { router, removeImageUrlPrefix } from '@/utils/tools'
import { getOpenCityList } from '@/api/tea-room'
import { useToast } from 'wot-design-uni'
import { getVerificationCode, addTeaSpecialist, getTeaSpecialistStatus } from '@/api/user'
import { SMS_ENUM } from '@/enum/sms'
import { mobile } from '@/utils/test'
const OSS = inject('OSS')
const token = ref<string>('') // 用户token
const toast = useToast()
// 已开通城市列表
const openCityList = ref<Array<any>>([])
const city = ref<string>('')
// 审核提示
const tips = ref<boolean>(false)
// 省市区数据
const { colPickerData, findChildrenByCode } = useColPickerData()
const value = ref<string[]>([])
const area = ref<any[]>([
colPickerData.map((item) => {
return {
value: item.value,
label: item.text
}
})
])
const columnChange = ({ selectedItem, resolve, finish }) => {
const areaData = findChildrenByCode(colPickerData, selectedItem.value)
if (areaData && areaData.length) {
resolve(
areaData.map((item) => {
return {
value: item.value,
label: item.text
}
})
)
} else {
finish()
}
}
// 性别
const genderColumns = ['女', '男']
// 上传文件
const fileList = ref<any[]>([]) // 本人照片
const fileList2 = ref<any[]>([]) // 健康证
const fileList3 = ref<any[]>([]) // 茶艺师资格
const action = 'https://www.mocky.io/v2/5cc8019d300000980a055e76' // 仅做测试使用,实际请换成真实上传接口
const fileList = ref<any[]>([]) // 营业执照
const fileList2 = ref<any[]>([]) // 照片信息
const fileList3 = ref<any[]>([]) // 健康
const fileList4 = ref<any[]>([]) // 资格证
const action = import.meta.env.VITE_UPLOAD_BASEURL
// 验证码倒计时
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
@ -293,58 +297,74 @@
const countDown = ref<any>(null) // 倒计时组件
// 表单
const form = reactive<{
settleIn: number,
code: string,
message: string,
gender: string,
born: string
}>({
settleIn: 1,
code: '',
message: '',
gender: '',
born: ''
const form = ref<{
license_img: string // 营业执照
username: string // 茶艺师名字
gender: number // 茶艺师性别(1男 2女)
both: number | string // 出生年月
height: string // 身高
weight: string // 体重
hobby_introduce: string // 兴趣爱好介绍
city_id: number // 城市ID
avatar: string // 头像
certificate: string // 健康证、资格证书信息
mobile: string // 联系电话
code: string // 验证码
}>({
license_img: '',
username: '',
gender: 2,
both: '',
height: '',
weight: '',
hobby_introduce: '',
city_id: 0,
avatar: '',
certificate: '',
mobile: '',
code: ''
})
// 审核状态
const status = ref<number>(-1) // 0待审核 1审核成功 2审核失败 3未提交数据
onLoad(async () => {
const res = await getTeaSpecialistStatus()
status.value = res.status
token.value = uni.getStorageSync('token')
TeaSpecialist.handleInit()
form.value.both = new Date(1998, 11, 21).getTime()
})
const TeaSpecialist = {
/**
* 初始化
*/
handleInit: async () => {
const res = await getOpenCityList()
console.log("🚀 ~ res:", res)
openCityList.value = res.list
},
// 选择性别
handleConfirmGender: (gender: string) => {
console.log("🚀 ~ gender:", gender)
},
// 选择年月日
handleConfirmBornData: (date: {value: number}) => {
const d = new Date(date.value)
console.log("🚀 ~ d:", d)
const year = d.getFullYear()
const month = d.getMonth() + 1
console.log(`${year}${month}`);
},
// 上传本人照片
handleUploadFile: (event: any) => {
fileList.value = event.fileList
},
// 上传健康证
handleUploadFile2: (event: any) => {
fileList2.value = event.fileList
},
// 上传茶艺师资格证
handleUploadFile3: (event: any) => {
fileList3.value = event.fileList
},
// 发送验证码
handleCountDown: () => {
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
handleCountDown: async () => {
if (!mobile(form.value.mobile)) {
toast.show('请检查手机号码')
return false
}
// 发送验证码请求
})
await getVerificationCode({ scene: SMS_ENUM.BANK, mobile: String(form.value.mobile) })
startCountDown.value = true
setTimeout(() => {
countDown.value.start()
}, 100)
},
// 验证码倒计时结束
@ -352,9 +372,86 @@
startCountDown.value = false
},
// 确认选择地址
handleConfirmAddress: (selected) => {
console.log("🚀 ~ selected:", selected)
/**
* 确认选择地址
*/
handleConfirmAddress: (item) => {
city.value = item.selectedItems.name
},
/**
* 提交申请
*/
handleSubmit: async () => {
if (!form.value.username) {
toast.show('请输入姓名')
return false
}
if (!form.value.both) {
toast.show('请选择出生年月')
return false
}
if (!form.value.height) {
toast.show('请输入身高')
return false
}
if (!form.value.weight) {
toast.show('请输入体重')
return false
}
if (!form.value.city_id) {
toast.show('请选择服务区域')
return false
}
if (fileList2.value.length == 0) {
toast.show('请上传本人照片')
return false
}
if (!mobile(form.value.mobile)) {
toast.show('请检查手机号码')
return false
}
if (!form.value.code) {
toast.show('请输入验证码')
return false
}
form.value.license_img = fileList.value.length > 0 ? removeImageUrlPrefix(fileList.value)[0] : ''
form.value.avatar = fileList2.value.length > 0 ? removeImageUrlPrefix(fileList2.value)[0] : ''
if (fileList3.value.length > 0 && fileList4.value.length > 0) {
form.value.certificate = removeImageUrlPrefix(fileList3.value)[0] + ',' + removeImageUrlPrefix(fileList4.value)[0]
} else if (fileList3.value.length > 0) {
form.value.certificate = removeImageUrlPrefix(fileList3.value)[0] + "," + ""
} else if (fileList4.value.length > 0) {
form.value.certificate = "" + "," +removeImageUrlPrefix(fileList4.value)[0]
}
toast.loading({
loadingType: 'ring',
loadingColor: '#4C9F44',
msg: '提交中...'
})
try {
toast.close()
await addTeaSpecialist(form.value)
status.value = 0 // 提交成功,变更状态为待审核
setTimeout(() => {
toast.success('提交成功')
}, 100)
} catch(e) {
toast.close()
return
}
}
}
</script>

View File

@ -116,13 +116,6 @@
</view>
<view v-if="!isGroupBuying">
<!-- 其他说明 -->
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx">
<view class="text-[#303133] text-32rpx leading-44rpx font-bold mb-24rpx">其他说明</view>
<view class="">
<rich-text :nodes="teaRoom.room.other_describe"></rich-text>
</view>
</view>
<!-- 预定时间 -->
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx" @click="showBookTimePopup = true">
@ -187,6 +180,13 @@
</view>
</view>
<!-- 使用说明 -->
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx">
<view class="text-[#303133] text-32rpx leading-44rpx font-bold mb-24rpx">使用说明</view>
<view class="">
<rich-text :nodes="teaRoom.room.other_describe"></rich-text>
</view>
</view>
</view>
<view v-if="isGroupBuying">
@ -285,7 +285,7 @@
import type { ITeaSpecialistFuture7DaysResult } from '@/api/types/tea'
import { getNext7Days, getTeaRoomBalance, createTeaRoomOrder } from '@/api/tea-room'
import { CouponType } from '@/utils/coupon'
import { router, randomLabelColor, previewImage } from '@/utils/tools'
import { router, randomLabelColor, previewImage, replaceNewLine } from '@/utils/tools'
import type { IUserInfoVo } from '@/api/types/login'
import { useUserStore } from '@/store'
import { getTeaRoomDetail, createTeaRoomPackageOrder, getTeaRoomPackageDetail, calculateTeaRoomPrice } from '@/api/tea-room'
@ -422,6 +422,12 @@
room_id: id.value
})
teaRoom.value = res.details
// 处理使用说明的换行问题
if (teaRoom.value.room.other_describe) {
teaRoom.value.room.other_describe = replaceNewLine(teaRoom.value.room.other_describe)
}
if (pageType.value == ReserveServiceCategory.ReserveRoom) {
swiperList.value = teaRoom.value.room.room_arr
@ -447,6 +453,24 @@
handleInitGroupBuying: async () => {
const res = await getTeaRoomPackageDetail({ id: id.value })
teaRoomPackage.value = res.details
// 处理使用说明的换行问题
if (teaRoomPackage.value.introduce) {
teaRoom.value.introduce = replaceNewLine(teaRoom.value.introduce)
}
if (teaRoomPackage.value.rests_introduce) {
teaRoom.value.rests_introduce = replaceNewLine(teaRoom.value.rests_introduce)
}
if (teaRoomPackage.value.room_name) {
teaRoom.value.room_name = replaceNewLine(teaRoom.value.room_name)
}
if (teaRoomPackage.value.returd_details) {
teaRoom.value.returd_details = replaceNewLine(teaRoom.value.returd_details)
}
if (pageType.value == ReserveServiceCategory.GroupBuying) {
swiperList.value = teaRoomPackage.value.img
}

View File

@ -85,15 +85,14 @@
<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"
@click="List.handleReserveTeaSpecialist(item.team_user_id, item.state)">
v-for="(item, index) in list" :key="index" >
<view class="tea-specialist-time absolute z-3 top-6rpx left-0 bg-[#4C9F44] text-[#fff] font-400 text-18rpx flex items-center justify-center">
{{ item.state == 0 ? '可约' : '工作中' }}
</view>
<view class="mr-28rpx relative z-2">
<view class="mr-28rpx relative z-2" @click="List.handlePreviewImage(item.image)">
<wd-img width="200rpx" height="200rpx" :src="item.image" mode="aspectFill"></wd-img>
</view>
<view class="flex-1">
<view class="flex-1" @click="List.handleReserveTeaSpecialist(item.team_user_id, item.state)">
<view class="flex items-center">
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">
{{ item.name }}
@ -153,7 +152,7 @@
import { useToast } from 'wot-design-uni'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
import { router } from '@/utils/tools'
import { router, previewImage } from '@/utils/tools'
import { getTeaSpecialist } from '@/api/tea-specialist'
import TeaSpecialistLevel from '@/components/TeaSpecialistLevel.vue'
import type { ITeaSpecialistResult } from '@/api/types/tea-specialist'
@ -267,6 +266,13 @@
router.navigateBack().catch(err => {
router.switchTab('/pages/index/index')
})
},
/**
* 预览图片
*/
handlePreviewImage: (img: any) => {
previewImage(img, [img])
}
}
</script>

View File

@ -147,7 +147,7 @@
<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>
<scroll-view scroll-y class="h-800rpx">
<scroll-view scroll-y class="h-900rpx">
<view class="">
<!-- 服务人数 -->
<view class="mx-60rpx mb-56rpx">

View File

@ -214,7 +214,6 @@
})
onLoad(async(args) => {
// 获取小程序码注册来源
// getWxacode().then( res => {})

View File

@ -146,13 +146,10 @@
})
return
}
startCountDown.value = true
nextTick(() => {
countDown.value?.start()
// 发送验证码请求
})
setTimeout(() => {
countDown.value.start()
}, 100)
},
// 验证码倒计时结束

View File

@ -324,7 +324,7 @@
const serviceMenuList = reactive([
{ id: 1, title: '茶馆入驻', icon: `${OSS}icon/icon_service_teahouse.png`, badge: '', url: '/bundle/settle-in/tea-room' },
{ id: 2, title: '申请茶艺师', icon: `${OSS}icon/icon_service_tea.png`, badge: '', url: '/bundle/settle-in/tea-specialist' },
{ id: 3, title: '合创合伙人', icon: `${OSS}icon/icon_service_partner.png`, badge: '赚佣金', url: '/bundle/settle-in/parten' },
// { id: 3, title: '合创合伙人', icon: `${OSS}icon/icon_service_partner.png`, badge: '赚佣金', url: '/bundle/settle-in/parten' },
])
// 推广码弹窗

View File

@ -189,3 +189,30 @@ export function strToParams(uri: string) :any {
}
return newparams
}
/**
* 格式化上传图片的URL去除前缀
* @param file 上传图片文件列表
* @returns 去除前缀后的图片URL列表
*/
export function removeImageUrlPrefix(file: any) {
const fileList = file.map(item => {
if (item.response) {
const response = JSON.parse(item.response)
if (response.code) {
return response.data.uri.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '')
}
}
return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '')
})
return fileList
}
/**
* 替换字符串中的回车换行符
*/
export function replaceNewLine(str: string) :string {
if (!str) return ''
let content = str.replace(/\n/g, "<br/>")
return content.replace(/\r\n/g, "<br/>")
}