|
@@ -20,20 +20,20 @@
|
|
<uni-forms-item name="phone" label="联系电话" required>
|
|
<uni-forms-item name="phone" label="联系电话" required>
|
|
<uni-easyinput placeholder="请输入联系电话" v-model="formData.phone" :inputBorder="false" type="number"></uni-easyinput>
|
|
<uni-easyinput placeholder="请输入联系电话" v-model="formData.phone" :inputBorder="false" type="number"></uni-easyinput>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
- <uni-forms-item name="email" label="联系邮箱" required>
|
|
|
|
- <uni-easyinput v-model="formData.email" placeholder="请输入联系邮箱" />
|
|
|
|
|
|
+ <uni-forms-item name="email" label="常用邮箱" required>
|
|
|
|
+ <uni-easyinput v-model="formData.email" placeholder="请输入常用邮箱" />
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item required label="出生日期" name="birthday">
|
|
<uni-forms-item required label="出生日期" name="birthday">
|
|
<uni-datetime-picker type="date" return-type="timestamp" v-model="formData.birthday" />
|
|
<uni-datetime-picker type="date" return-type="timestamp" v-model="formData.birthday" />
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item name="enterpriseName" label="任职企业名称" required>
|
|
<uni-forms-item name="enterpriseName" label="任职企业名称" required>
|
|
- <uni-easyinput placeholder="请填写任职企业名称(可填暂无)" v-model="formData.enterpriseName" :clear-icon="true" :inputBorder="false" type="text"></uni-easyinput>
|
|
|
|
|
|
+ <uni-easyinput placeholder="请填写任职企业名称(可填暂无)" v-model="formData.enterpriseName" :clear-icon="true" type="text"></uni-easyinput>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item name="positionName" label="任职职位名称" required>
|
|
<uni-forms-item name="positionName" label="任职职位名称" required>
|
|
- <uni-easyinput placeholder="请填写任职职位名称(可填暂无)" v-model="formData.positionName" :clear-icon="true" :inputBorder="false" type="text"></uni-easyinput>
|
|
|
|
|
|
+ <uni-easyinput placeholder="请填写任职职位名称(可填暂无)" v-model="formData.positionName" :clear-icon="true" type="text"></uni-easyinput>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
- <uni-forms-item name="interestedPositionList" label="意向职位" required>
|
|
|
|
- <uni-data-picker v-model="formData.interestedPositionList" :localdata="dictObj.positionSecondData" :clear-icon="false" popup-title="请选择意向职位" :map="{ text: 'nameCn', value: 'id' }"></uni-data-picker>
|
|
|
|
|
|
+ <uni-forms-item name="interestedPositionId" label="意向职位" required>
|
|
|
|
+ <uni-data-picker v-model="formData.interestedPositionId" :localdata="dictObj.positionSecondData" :clear-icon="false" popup-title="请选择意向职位" :map="{ text: 'nameCn', value: 'id' }"></uni-data-picker>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item name="jobStatus" label="求职状态" required>
|
|
<uni-forms-item name="jobStatus" label="求职状态" required>
|
|
<uni-data-picker v-model="formData.jobStatus" :localdata="dictObj.jobStatus" :clear-icon="false" popup-title="请选择求职状态" :map="{ text: 'label', value: 'value' }"></uni-data-picker>
|
|
<uni-data-picker v-model="formData.jobStatus" :localdata="dictObj.jobStatus" :clear-icon="false" popup-title="请选择求职状态" :map="{ text: 'label', value: 'value' }"></uni-data-picker>
|
|
@@ -59,7 +59,7 @@
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, unref, watch } from 'vue'
|
|
|
|
|
|
+import { ref, unref, onMounted, nextTick } from 'vue'
|
|
import { mobile, emailRequired } from '@/utils/validate'
|
|
import { mobile, emailRequired } from '@/utils/validate'
|
|
import { dictObj } from '@/utils/position.js'
|
|
import { dictObj } from '@/utils/position.js'
|
|
import { savePersonSimpleInfo } from '@/api/user'
|
|
import { savePersonSimpleInfo } from '@/api/user'
|
|
@@ -75,20 +75,23 @@ const formData = ref({ // 必填项目
|
|
birthday: '1990-01-01',
|
|
birthday: '1990-01-01',
|
|
enterpriseName: null,
|
|
enterpriseName: null,
|
|
positionName: null,
|
|
positionName: null,
|
|
- interestedPositionList: null,
|
|
|
|
|
|
+ interestedPositionId: null,
|
|
jobStatus: null,
|
|
jobStatus: null,
|
|
expType: null,
|
|
expType: null,
|
|
eduType: null,
|
|
eduType: null,
|
|
})
|
|
})
|
|
|
|
|
|
-// 监听登录状态
|
|
|
|
-watch(() => useUserStore?.baseInfo, (newVal) => {
|
|
|
|
- if (newVal && Object.keys(newVal).length) {
|
|
|
|
- Object.keys(formData.value).forEach(key => {
|
|
|
|
- formData.value[key] = newVal[key] || newVal[key] === 0 ? newVal[key] : null
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-}, { deep: true, immediate: true })
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ const baseInfo = useUserStore?.baseInfo || null
|
|
|
|
+ console.log('baseInfo:', baseInfo)
|
|
|
|
+ if (baseInfo && Object.keys(baseInfo).length) {
|
|
|
|
+ Object.keys(formData.value).forEach(key => {
|
|
|
|
+ formData.value[key] = baseInfo[key] || baseInfo[key] === 0 ? baseInfo[key] : formData.value[key] ? formData.value[key] : null
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+})
|
|
|
|
|
|
const formRules = {
|
|
const formRules = {
|
|
name:{
|
|
name:{
|
|
@@ -129,22 +132,29 @@ const handleLogoutClose = () => {
|
|
}
|
|
}
|
|
const handleLogoutConfirm = async () => {
|
|
const handleLogoutConfirm = async () => {
|
|
await useUserStore.handleLogout()
|
|
await useUserStore.handleLogout()
|
|
- // necessaryInfoPopup.value.close()
|
|
|
|
showAuthModal()
|
|
showAuthModal()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const dealQuery = () => {
|
|
|
|
+ const interestedList = [{ positionId: formData.value.interestedPositionId || null }]
|
|
|
|
+ const workExpList = [{
|
|
|
|
+ enterpriseName: formData.value.enterpriseName || null,
|
|
|
|
+ positionName: formData.value.positionName || null,
|
|
|
|
+ }]
|
|
|
|
+ return { ...formData.value, interestedList, workExpList }
|
|
|
|
+}
|
|
const submit = async () => {
|
|
const submit = async () => {
|
|
const validate = await unref(baseInfoRef).validate()
|
|
const validate = await unref(baseInfoRef).validate()
|
|
if (!validate) return uni.showToast({ title: '请将信息补充完整', icon: 'none' })
|
|
if (!validate) return uni.showToast({ title: '请将信息补充完整', icon: 'none' })
|
|
- if (!formData.value.email) return uni.showToast({ title: '请输入邮箱', icon: 'none' })
|
|
|
|
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.value.email)) return uni.showToast({ title: '邮箱格式不正确', icon: 'none' })
|
|
|
|
|
|
+
|
|
try {
|
|
try {
|
|
- // console.log(1, '23456', formData.value)
|
|
|
|
- await savePersonSimpleInfo(formData.value)
|
|
|
|
|
|
+ const query = dealQuery()
|
|
|
|
+ await savePersonSimpleInfo(query)
|
|
uni.showToast({ title: '保存成功', icon: 'none' })
|
|
uni.showToast({ title: '保存成功', icon: 'none' })
|
|
await useUserStore.getInfo()
|
|
await useUserStore.getInfo()
|
|
// await useUserStore.getUserInfo()
|
|
// await useUserStore.getUserInfo()
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
|
+ console.log('err:', err)
|
|
uni.showToast({ title: err.msg || '保存失败', icon: 'none' })
|
|
uni.showToast({ title: err.msg || '保存失败', icon: 'none' })
|
|
}
|
|
}
|
|
}
|
|
}
|