|
|
@ -24,16 +24,16 @@ |
|
|
|
> |
|
|
|
<view class="license-options"> |
|
|
|
<up-checkbox |
|
|
|
v-for="item in LICENSE_OPTIONS" |
|
|
|
:key="`license-${item.value}`" |
|
|
|
:label="item.label" |
|
|
|
:name="item.value" |
|
|
|
v-for="item in licenseOptions" |
|
|
|
:key="`license-${item.id}`" |
|
|
|
:label="item.title" |
|
|
|
:name="item.id" |
|
|
|
> |
|
|
|
</up-checkbox> |
|
|
|
</view> |
|
|
|
</up-checkbox-group> |
|
|
|
<view class="tips"> |
|
|
|
温馨提示:上传专业执照将大大增加通过概率,且会快速晋升为高级伴宠师获取更高报酬 |
|
|
|
{{ configList.pet_news.paramValueText }} |
|
|
|
</view> |
|
|
|
<up-upload |
|
|
|
:fileList="licenseData.fileList" |
|
|
@ -52,38 +52,15 @@ |
|
|
|
</view> |
|
|
|
<view class="flex-between wrap mt32"> |
|
|
|
|
|
|
|
<view class="type"> |
|
|
|
<image src="@/static/images/ydd/cat.png" mode="widthFix" @click="onSelectPetType('cat')"></image> |
|
|
|
<template v-if="petType === 'cat'"> |
|
|
|
<image class="active" src="@/static/images/ydd/cat-active.png" mode="widthFix"></image> |
|
|
|
<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"> |
|
|
|
<image class="active" :src="item.image" mode="widthFix"></image> |
|
|
|
<view class="active-icon"> |
|
|
|
<up-icon name="checkmark-circle" color="#FFBF60" size="32rpx"></up-icon> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="type"> |
|
|
|
<image src="@/static/images/ydd/dog.png" mode="widthFix" @click="onSelectPetType('dog')"></image> |
|
|
|
<template v-if="petType === 'dog'"> |
|
|
|
<image class="active" src="@/static/images/ydd/dog-active.png" mode="widthFix"></image> |
|
|
|
<view class="active-icon"> |
|
|
|
<up-icon name="checkmark-circle" color="#FFBF60" size="32rpx"></up-icon> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="type"> |
|
|
|
<image src="@/static/images/ydd/special-pet.png" mode="widthFix" @click="onSelectPetType('special-pet')"></image> |
|
|
|
<template v-if="petType === 'special-pet'"> |
|
|
|
<image class="active" src="@/static/images/ydd/special-pet-active.png" mode="widthFix"></image> |
|
|
|
<view class="active-icon"> |
|
|
|
<up-icon name="checkmark-circle" color="#FFBF60" size="32rpx"></up-icon> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -99,11 +76,17 @@ |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { ref, reactive } from "vue"; |
|
|
|
import { onShow } from '@dcloudio/uni-app' |
|
|
|
import { ossUpload } from '@/utils/oss-upload/oss/index.js' |
|
|
|
import { getLicenseList, getPetTypeList } from '@/api/examination' |
|
|
|
import { insertUser } from '@/api/userTeacher' |
|
|
|
import { store } from '@/store' |
|
|
|
|
|
|
|
import dForm from "@/components/dForm/index.vue" |
|
|
|
import stepProgress from '../components/stepProgress.vue'; |
|
|
|
|
|
|
|
const configList = store.state.system.configList |
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
list: [{ |
|
|
|
type: "input", |
|
|
@ -134,13 +117,13 @@ |
|
|
|
{ |
|
|
|
type: "input", |
|
|
|
label: "年龄", |
|
|
|
key: "gender", |
|
|
|
key: "age", |
|
|
|
placeholder: "请输入您的年龄", |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "input", |
|
|
|
label: "养宠经验", |
|
|
|
key: "shij", |
|
|
|
key: "experience", |
|
|
|
placeholder: "请输入您的养宠年限", |
|
|
|
unit: "年" |
|
|
|
}, |
|
|
@ -170,28 +153,14 @@ |
|
|
|
selected: [], |
|
|
|
fileList: [] |
|
|
|
}) |
|
|
|
const LICENSE_OPTIONS = [ |
|
|
|
{ |
|
|
|
label: '兽医职称专业执照', |
|
|
|
value: 0, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '宠物美容洗护专业执照', |
|
|
|
value: 1, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '宠物康复护理专业执照', |
|
|
|
value: 2, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '宠物膳食管理专业执照', |
|
|
|
value: 3, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '其他专业执照', |
|
|
|
value: 4, |
|
|
|
}, |
|
|
|
] |
|
|
|
const licenseOptions = ref([]) |
|
|
|
const fetchLicenseOptions = async () => { |
|
|
|
try { |
|
|
|
licenseOptions.value = await getLicenseList() |
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
const afterRead = (event) => { |
|
|
|
event.file.forEach(n => { |
|
|
|
ossUpload(n.url) |
|
|
@ -207,25 +176,61 @@ |
|
|
|
}; |
|
|
|
|
|
|
|
const petType = ref() |
|
|
|
const petTypeOptions = ref([]) |
|
|
|
const onSelectPetType = (type) => { |
|
|
|
petType.value = type |
|
|
|
} |
|
|
|
const fetchPetTypeOptions = async () => { |
|
|
|
try { |
|
|
|
petTypeOptions.value = await getPetTypeList() |
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
const toNext = () => { |
|
|
|
// todo: save data |
|
|
|
|
|
|
|
const data = { |
|
|
|
...form.value, |
|
|
|
...licenseData, |
|
|
|
petType: petType.value, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log('--data', data) |
|
|
|
const toNext = async () => { |
|
|
|
try { |
|
|
|
const { |
|
|
|
name, |
|
|
|
idCard, |
|
|
|
sex, |
|
|
|
age, |
|
|
|
experience, |
|
|
|
license, |
|
|
|
} = form.value |
|
|
|
|
|
|
|
const data = { |
|
|
|
name, |
|
|
|
idCard, |
|
|
|
sex, |
|
|
|
age, |
|
|
|
experience, |
|
|
|
petType: petType.value, |
|
|
|
} |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
url: "/otherPages/authentication/examination/start" |
|
|
|
}) |
|
|
|
if (license) { |
|
|
|
const { selected, fileList } = licenseData |
|
|
|
|
|
|
|
data.license = selected.join(';') |
|
|
|
data.images = fileList.join(';') |
|
|
|
} |
|
|
|
|
|
|
|
await insertUser(data) |
|
|
|
|
|
|
|
uni.setStorageSync('petTypeData', petTypeOptions.value.find(item => item.id === petType.value)) |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
url: "/otherPages/authentication/examination/start" |
|
|
|
}) |
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
onShow(() => { |
|
|
|
fetchPetTypeOptions() |
|
|
|
fetchLicenseOptions() |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|