个人展示改为个人照片及改为非必填

This commit is contained in:
wangxiaowei
2026-04-13 14:16:32 +08:00
parent c0547289f8
commit 6262eb10a2

View File

@ -49,26 +49,24 @@
<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="flex items-center">
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">茶艺师资格证书</view>
<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">
<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>
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_upload.png`" mode="aspectFill" />
<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 class="font-400 text-26rpx leading-36rpx text-#303133">本人头像</view>
</view>
</wd-upload>
</view>
@ -170,16 +168,79 @@
</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="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 gap-16rpx">
<wd-upload
:header="{'token': token}"
v-model:file-list="frontCard"
: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>
<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>
<wd-upload
:header="{'token': token}"
v-model:file-list="backCard"
: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>
<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">
<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>
<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>
<view class="mt-32rpx">
<wd-upload :header="{ 'token': token }" v-model:file-list="fileList2" :limit="1"
<wd-upload :header="{ 'token': token }" v-model:file-list="fileList4" :limit="9" multiple
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">
@ -187,7 +248,9 @@
<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 class="flex items-center">
<view class="font-400 text-26rpx leading-36rpx text-#303133">个人照片</view>
</view>
</view>
</wd-upload>
</view>
@ -212,30 +275,6 @@
</view>
</wd-upload>
</view>
</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>
<view class="mt-32rpx">
<wd-upload :header="{ 'token': token }" v-model:file-list="fileList4" :limit="9" multiple
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="flex items-center">
<view class="font-400 text-26rpx leading-36rpx text-#303133">个人展示</view>
</view>
</view>
</wd-upload>
</view>
</view>
@ -325,6 +364,8 @@ const fileList = ref<any[]>([]) // 资格证
const fileList2 = ref<any[]>([]) // 照片信息
const fileList3 = ref<any[]>([]) // 个人展示
const fileList4 = ref<any[]>([]) // 健康证
const frontCard = ref<any[]>([]) // 身份证正面
const backCard = ref<any[]>([]) // 身份证反面
const action = import.meta.env.VITE_UPLOAD_BASEURL
// 验证码倒计时
@ -347,21 +388,27 @@ const form = ref<{
code: string // 验证码
health_certificate?: string // 健康证
information?: string // 个人展示
image?: string // 个人展示
front_card?: string // 身份证正面
back_card?: string // 身份证反面
broker_user_id?: number // 经纪人ID可选扫码绑定经纪人时携带
label_id?: string // 专属圈子标签ID逗号分隔
}>({
license_img: '',
username: '',
gender: 2,
both: '',
height: '',
weight: '',
city_id: 0,
avatar: '',
mobile: '',
code: '',
health_certificate: '',
information: '',
license_img: '', // 营业执照
username: '', // 茶艺师名字
gender: 2, // 茶艺师性别(1男 2女)
both: '', // 出生年月
height: '', // 身高
weight: '', // 体重
city_id: 0, // 城市ID
avatar: '', // 头像
mobile: '', // 联系电话
code: '', // 验证码
health_certificate: '', // 健康证
information: '', // 个人展示(2026-04-07暂时废弃)
image: '', // 本人照片
front_card: '', // 身份证正面
back_card: '', // 身份证反面
broker_user_id: 0, // 经纪人ID可选扫码绑定经纪人时携带
label_id: '' // 专属圈子标签ID逗号分隔
})
@ -472,8 +519,8 @@ const TeaSpecialist = {
* 提交申请
*/
handleSubmit: async () => {
if (fileList.value.length == 0) {
toast.show('请上传茶艺师资格证书')
if (fileList2.value.length == 0) {
toast.show('请上传本人头像')
return false
}
@ -513,16 +560,32 @@ const TeaSpecialist = {
return false
}
// 身份证正面和反面校验
if (frontCard.value.length === 0) {
toast.show('请上传身份证正面照片')
return false
}
if (!form.value.city_id) {
toast.show('请选择服务区域')
return false
}
if (fileList2.value.length == 0) {
toast.show('请上传本人头像')
if (backCard.value.length === 0) {
toast.show('请上传身份证反面照片')
return false
}
if (fileList.value.length == 0) {
toast.show('请上传茶艺师资格证书')
return false
}
// if (fileList4.value.length == 0) {
// toast.show('请至少上传一张个人展示照片')
// return false
// }
if (!mobile(form.value.mobile)) {
toast.show('请检查手机号码')
return false
@ -537,12 +600,16 @@ const TeaSpecialist = {
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.information = fileList4.value.length > 0 ? removeImageUrlPrefix(fileList4.value) : '' // 个人展示
form.value.information = Array.isArray(form.value.information) ? form.value.information.join(',') : form.value.information
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] : '' // 身份证正面
form.value.back_card = backCard.value.length > 0 ? removeImageUrlPrefix(backCard.value)[0] : '' // 身份证反面
let data = form.value
data.both = both.value
console.log("🚀 ~ form.value:", form.value)
return
toast.loading({
loadingType: 'ring',
loadingColor: '#4C9F44',
@ -550,7 +617,6 @@ const TeaSpecialist = {
})
try {
toast.close()
await addTeaSpecialist(data)
status.value = 0 // 提交成功,变更状态为待审核