|
@ -52,9 +52,9 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex-between wrap mt32"> |
|
|
<view class="flex-between wrap mt32"> |
|
|
|
|
|
|
|
|
<view class="type" v-for="item in petTypeOptions" :key="`petType-${item.id}`"> |
|
|
|
|
|
<image :src="item.imageNo" mode="widthFix" @click="onSelectPetType(item.id)"></image> |
|
|
|
|
|
<template v-if="petType === item.id"> |
|
|
|
|
|
|
|
|
<view class="type" v-for="item in petTypeOptions" :key="`petType-${item.id}`" @click="onSelectPetType(item.id)"> |
|
|
|
|
|
<image :src="item.imageNo" mode="widthFix"></image> |
|
|
|
|
|
<template v-if="petType.includes(item.id)"> |
|
|
<image class="active" :src="item.image" mode="widthFix"></image> |
|
|
<image class="active" :src="item.image" mode="widthFix"></image> |
|
|
<view class="active-icon"> |
|
|
<view class="active-icon"> |
|
|
<up-icon name="checkmark-circle" color="#FFBF60" size="32rpx"></up-icon> |
|
|
<up-icon name="checkmark-circle" color="#FFBF60" size="32rpx"></up-icon> |
|
@ -71,6 +71,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<configPopup ref="configPopupRef" /> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -84,6 +86,7 @@ |
|
|
|
|
|
|
|
|
import dForm from "@/components/dForm/index.vue" |
|
|
import dForm from "@/components/dForm/index.vue" |
|
|
import stepProgress from '../components/stepProgress.vue'; |
|
|
import stepProgress from '../components/stepProgress.vue'; |
|
|
|
|
|
import configPopup from '@/components/configPopup.vue' |
|
|
|
|
|
|
|
|
const store = useStore() |
|
|
const store = useStore() |
|
|
|
|
|
|
|
@ -209,7 +212,7 @@ |
|
|
licenseData.selected = license?.split?.(';').map(str => parseInt(str)) || [] |
|
|
licenseData.selected = license?.split?.(';').map(str => parseInt(str)) || [] |
|
|
licenseData.fileList = images?.split?.(';').map(url => ({ url })) || [] |
|
|
licenseData.fileList = images?.split?.(';').map(url => ({ url })) || [] |
|
|
|
|
|
|
|
|
petType.value = _petType |
|
|
|
|
|
|
|
|
petType.value = _petType.split(',').map(n => parseInt(n)) |
|
|
} else { |
|
|
} else { |
|
|
formRef.value.setData({ |
|
|
formRef.value.setData({ |
|
|
phone: userTelephone, |
|
|
phone: userTelephone, |
|
@ -251,12 +254,12 @@ |
|
|
licenseData.fileList.splice(event.index, 1); |
|
|
licenseData.fileList.splice(event.index, 1); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const petType = ref() |
|
|
|
|
|
|
|
|
const petType = ref([]) |
|
|
const petTypeOptions = computed(() => { |
|
|
const petTypeOptions = computed(() => { |
|
|
return store.getters.petTypeOptions |
|
|
return store.getters.petTypeOptions |
|
|
}) |
|
|
}) |
|
|
const onSelectPetType = (type) => { |
|
|
const onSelectPetType = (type) => { |
|
|
petType.value = type |
|
|
|
|
|
|
|
|
petType.value = petType.value.includes(type) ? petType.value.filter(n => n !== type) : [...petType.value, type] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const toNext = async () => { |
|
|
const toNext = async () => { |
|
@ -280,7 +283,7 @@ |
|
|
phone, |
|
|
phone, |
|
|
experience, |
|
|
experience, |
|
|
isHave, |
|
|
isHave, |
|
|
petType: petType.value, |
|
|
|
|
|
|
|
|
petType: petType.value.join(','), |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isHave) { |
|
|
if (isHave) { |
|
@ -290,6 +293,60 @@ |
|
|
data.images = fileList.map(item => item.url).join(';') |
|
|
data.images = fileList.map(item => item.url).join(';') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 效验字段必填 |
|
|
|
|
|
const requiredFields = { |
|
|
|
|
|
name: '姓名', |
|
|
|
|
|
idCard: '身份证号', |
|
|
|
|
|
age: '年龄', |
|
|
|
|
|
phone: '手机号', |
|
|
|
|
|
experience: '养宠经验' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (const [field, label] of Object.entries(requiredFields)) { |
|
|
|
|
|
if (!data[field]) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: `请填写${label}`, |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 性别需要单独判断,因为0是有效值(男性) |
|
|
|
|
|
if (data.sex != 0 && data.sex != 1) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '请选择性别', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (petType.value.length === 0) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '请选择宠物类型', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (data.isHave === 1) { |
|
|
|
|
|
if (licenseData.selected.length === 0) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '请选择专业执照类型', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (licenseData.fileList.length === 0) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '请上传执照图片', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (id.value) { |
|
|
if (id.value) { |
|
|
data.id = id.value |
|
|
data.id = id.value |
|
|
await udpateUser(data) |
|
|
await udpateUser(data) |
|
@ -298,13 +355,15 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: `/otherPages/authentication/examination/start?petType=${petType.value}` |
|
|
|
|
|
|
|
|
url: `/otherPages/authentication/examination/start?petType=${petType.value.join(',')}` |
|
|
}) |
|
|
}) |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const configPopupRef = ref(null) |
|
|
|
|
|
|
|
|
onLoad(() => { |
|
|
onLoad(() => { |
|
|
fetchUserInfo() |
|
|
fetchUserInfo() |
|
|
store.dispatch('fetchPetTypeOptions') |
|
|
store.dispatch('fetchPetTypeOptions') |
|
|