完善功能

This commit is contained in:
wangxiaowei
2026-05-04 16:54:47 +08:00
parent dcbba2c79d
commit 97759cdbad
9 changed files with 390 additions and 143 deletions

View File

@ -169,7 +169,7 @@
</view>
<!-- 茶艺师资格证书 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<!-- <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">
@ -191,7 +191,7 @@
</view>
</wd-upload>
</view>
</view>
</view> -->
<!-- 身份证 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
@ -253,7 +253,7 @@
</view>
<!-- 健康证书信息 -->
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
<!-- <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>
@ -272,7 +272,7 @@
</wd-upload>
</view>
</view>
</view>
</view> -->
<!-- 联系方式 -->
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
@ -327,8 +327,12 @@
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 class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff flex items-center justify-center"
:class="{ 'bg-[#C9C9C9]': isSubmitting }"
@click="TeaSpecialist.handleSubmit">
<text v-if="!isSubmitting">提交申请</text>
<text v-else>提交中...</text>
</view>
</view>
</template>
@ -369,10 +373,13 @@ const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
const startCountDown = ref<boolean>(false) // 是否开始倒计时
const countDown = ref<any>(null) // 倒计时组件
// 防重复提交
const isSubmitting = ref<boolean>(false) // 是否正在提交
// 表单
const form = ref<{
license_img: string // 营业执照
// license_img: string // 营业执照
username: string // 茶艺师名字
gender: number // 茶艺师性别(1男 2女)
both: number | string // 出生年月
@ -382,7 +389,7 @@ const form = ref<{
avatar: string // 头像
mobile: string // 联系电话
code: string // 验证码
health_certificate?: string // 健康证
// health_certificate?: string // 健康证
information?: string // 个人展示
image?: string // 个人展示
front_card?: string // 身份证正面
@ -390,7 +397,7 @@ const form = ref<{
broker_user_id?: number // 经纪人ID可选扫码绑定经纪人时携带
label_id?: string // 专属圈子标签ID逗号分隔
}>({
license_img: '', // 营业执照
// license_img: '', // 营业执照
username: '', // 茶艺师名字
gender: 2, // 茶艺师性别(1男 2女)
both: '', // 出生年月
@ -400,7 +407,7 @@ const form = ref<{
avatar: '', // 头像
mobile: '', // 联系电话
code: '', // 验证码
health_certificate: '', // 健康证
// health_certificate: '', // 健康证
information: '', // 个人展示(2026-04-07暂时废弃)
image: '', // 本人照片
front_card: '', // 身份证正面
@ -572,10 +579,10 @@ const TeaSpecialist = {
// return false
// }
if (fileList.value.length == 0) {
toast.show('请上传茶艺师资格证书')
return false
}
// if (fileList.value.length == 0) {
// toast.show('请上传茶艺师资格证书')
// return false
// }
// if (fileList4.value.length == 0) {
// toast.show('请至少上传一张个人展示照片')
@ -593,9 +600,9 @@ const TeaSpecialist = {
}
form.value.label_id = selectedTags.value.join(',') // 专属圈子标签ID逗号分隔
form.value.license_img = fileList.value.length > 0 ? removeImageUrlPrefix(fileList.value)[0] : '' // 茶艺师资格证书
// form.value.license_img = fileList.value.length > 0 ? removeImageUrlPrefix(fileList.value)[0] : '' // 茶艺师资格证书
form.value.avatar = fileList2.value.length > 0 ? removeImageUrlPrefix(fileList2.value)[0] : '' // 个人照片
form.value.health_certificate = fileList3.value.length > 0 ? removeImageUrlPrefix(fileList3.value)[0] : '' // 健康证
// form.value.health_certificate = fileList3.value.length > 0 ? removeImageUrlPrefix(fileList3.value)[0] : '' // 健康证
form.value.image = fileList4.value.length > 0 ? removeImageUrlPrefix(fileList4.value) : '' // 个人展示
form.value.image = Array.isArray(form.value.image) ? form.value.image.join(',') : form.value.image
form.value.front_card = frontCard.value.length > 0 ? removeImageUrlPrefix(frontCard.value)[0] : '' // 身份证正面
@ -604,6 +611,12 @@ const TeaSpecialist = {
let data = form.value
data.both = both.value
// 防重复提交
if (isSubmitting.value) {
return
}
isSubmitting.value = true
toast.loading({
loadingType: 'ring',
loadingColor: '#4C9F44',
@ -619,7 +632,8 @@ const TeaSpecialist = {
}, 100)
} catch (e) {
toast.close()
return
} finally {
isSubmitting.value = false // 无论成功失败都要重置状态
}
}
}