|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<view class="ss-p-30 head-box">
|
|
<view class="ss-p-30 head-box">
|
|
- <view class="head-title">欢迎来到门墩儿,登录/注册领积分</view>
|
|
|
|
|
|
+ <view class="head-title">欢迎来到门墩儿,新用户注册领积分</view>
|
|
<view class="head-subtitle ss-m-t-30 justify-center">未注册的手机号,验证后自动注册账号</view>
|
|
<view class="head-subtitle ss-m-t-30 justify-center">未注册的手机号,验证后自动注册账号</view>
|
|
|
|
|
|
<view class="ss-m-t-60">
|
|
<view class="ss-m-t-60">
|
|
@@ -32,7 +32,7 @@
|
|
<button v-else class="wxLogon" type="text" :plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信一键登录</button>
|
|
<button v-else class="wxLogon" type="text" :plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信一键登录</button>
|
|
</view> -->
|
|
</view> -->
|
|
|
|
|
|
- <button class="send-button" @tap="handleLogin"> 登录/注册 </button>
|
|
|
|
|
|
+ <button class="send-button" @tap="handleLogin"> 注册 </button>
|
|
<view class="agreement-box ss-flex ss-row-center">
|
|
<view class="agreement-box ss-flex ss-row-center">
|
|
<uni-icons size="20" :type="protocol ? 'checkbox-filled' : 'circle'" :color="protocol ? '#00897B' : '#ccc'" @tap="protocol = !protocol"></uni-icons>
|
|
<uni-icons size="20" :type="protocol ? 'checkbox-filled' : 'circle'" :color="protocol ? '#00897B' : '#ccc'" @tap="protocol = !protocol"></uni-icons>
|
|
<view class="color-999 ss-flex ss-col-center ss-m-l-8 font-size-13">
|
|
<view class="color-999 ss-flex ss-col-center ss-m-l-8 font-size-13">
|
|
@@ -49,6 +49,42 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<AdvertisePop></AdvertisePop>
|
|
<AdvertisePop></AdvertisePop>
|
|
|
|
+
|
|
|
|
+ <uni-popup ref="popup" background-color="#fff" type="bottom" :is-mask-click="false">
|
|
|
|
+ <view style="padding: 20px;">
|
|
|
|
+ <view class="text-center ss-m-b-50 font-size-20 color-primary">请完善您的基本信息</view>
|
|
|
|
+ <uni-forms
|
|
|
|
+ ref="baseInfoRef"
|
|
|
|
+ v-model="formData"
|
|
|
|
+ :rules="formRules"
|
|
|
|
+ validateTrigger="bind"
|
|
|
|
+ label-width="75px"
|
|
|
|
+ labelAlign="center"
|
|
|
|
+ >
|
|
|
|
+ <uni-forms-item name="name" label="姓名" required>
|
|
|
|
+ <uni-easyinput placeholder="请输入姓名" v-model="formData.name" :inputBorder="false" type="text"></uni-easyinput>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item name="phone" label="联系电话" required>
|
|
|
|
+ <uni-easyinput placeholder="请输入联系电话" v-model="formData.phone" :inputBorder="false" type="number"></uni-easyinput>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item name="sex" label="性别" required>
|
|
|
|
+ <uni-data-picker v-model="formData.sex" :localdata="dictObj.sex" :clear-icon="false" popup-title="请选择性别" :map="{ text: 'label', value: 'value' }"></uni-data-picker>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <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-forms-item>
|
|
|
|
+ <uni-forms-item name="expType" label="工作经验" required>
|
|
|
|
+ <uni-data-picker v-model="formData.expType" :localdata="dictObj.exp" :clear-icon="false" popup-title="请选择工作经验" :clear="false" :map="{ text: 'label', value: 'value' }"></uni-data-picker>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item name="eduType" label="最高学历" required>
|
|
|
|
+ <uni-data-picker v-model="formData.eduType" :localdata="dictObj.edu" :clear-icon="false" popup-title="请选择最高学历" :clear="false" :map="{ text: 'label', value: 'value' }"></uni-data-picker>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ </uni-forms>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="f-horizon-center">
|
|
|
|
+ <button type="primary" size="default" class="send-button" @click="submit">提 交</button>
|
|
|
|
+ </view>
|
|
|
|
+ </uni-popup>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -62,10 +98,15 @@ import { onLoad } from '@dcloudio/uni-app'
|
|
import { useIM } from '@/hooks/useIM'
|
|
import { useIM } from '@/hooks/useIM'
|
|
import { watch } from 'vue'
|
|
import { watch } from 'vue'
|
|
import AdvertisePop from '@/components/Advertisement'
|
|
import AdvertisePop from '@/components/Advertisement'
|
|
|
|
+import { dictObj } from '@/utils/position.js'
|
|
|
|
+import { savePersonSimpleInfo } from '@/api/user'
|
|
|
|
|
|
const useUserStore = userStore()
|
|
const useUserStore = userStore()
|
|
const smsLoginRef = ref()
|
|
const smsLoginRef = ref()
|
|
const protocol = ref(false)
|
|
const protocol = ref(false)
|
|
|
|
+const popup = ref()
|
|
|
|
+const baseInfoRef = ref()
|
|
|
|
+const formData = ref({})
|
|
const state = ref({
|
|
const state = ref({
|
|
isMobileEnd: false, // 手机号输入完毕
|
|
isMobileEnd: false, // 手机号输入完毕
|
|
codeText: '获取验证码',
|
|
codeText: '获取验证码',
|
|
@@ -79,6 +120,26 @@ const state = ref({
|
|
phone: mobile
|
|
phone: mobile
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+const formRules = {
|
|
|
|
+ name:{
|
|
|
|
+ rules: [{required: true, errorMessage: '请输入姓名' }]
|
|
|
|
+ },
|
|
|
|
+ phone:{
|
|
|
|
+ rules: [{required: true, errorMessage: '请输入联系电话' }]
|
|
|
|
+ },
|
|
|
|
+ sex : {
|
|
|
|
+ rules: [{required: true, errorMessage: '请选择您的性别' }]
|
|
|
|
+ },
|
|
|
|
+ expType: {
|
|
|
|
+ rules: [{required: true, errorMessage: '请选择您的工作年限' }]
|
|
|
|
+ },
|
|
|
|
+ eduType: {
|
|
|
|
+ rules: [{required: true, errorMessage: '请选择您的最高学历' }]
|
|
|
|
+ },
|
|
|
|
+ jobStatus: {
|
|
|
|
+ rules: [{required: true, errorMessage: '请选择您的求职状态' }]
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
const { resetConfig } = useIM()
|
|
const { resetConfig } = useIM()
|
|
watch(() => useUserStore?.accountInfo?.userId, (newVal, oldVal) => {
|
|
watch(() => useUserStore?.accountInfo?.userId, (newVal, oldVal) => {
|
|
@@ -132,7 +193,28 @@ const handleLogin = async () => {
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- await useUserStore.handleShareUserRegister(state.value.sms)
|
|
|
|
|
|
+ const result = await useUserStore.handleShareUserRegister(state.value.sms)
|
|
|
|
+ if (!result || !Object.keys(result).length) return
|
|
|
|
+
|
|
|
|
+ uni.showToast({ icon: 'none', title: '请先完善信息' })
|
|
|
|
+ formData.value.phone = state.value.sms.phone
|
|
|
|
+ popup.value.open()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const submit = async () => {
|
|
|
|
+ const validate = await unref(baseInfoRef).validate()
|
|
|
|
+ if (!validate) return uni.showToast({ title: '请将信息补充完整', icon: 'none' })
|
|
|
|
+ try {
|
|
|
|
+ await savePersonSimpleInfo(formData.value)
|
|
|
|
+ uni.showToast({ title: '保存成功', icon: 'none' })
|
|
|
|
+ await useUserStore.getInfo()
|
|
|
|
+ await useUserStore.getUserInfo()
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/position'
|
|
|
|
+ })
|
|
|
|
+ } catch (err) {
|
|
|
|
+ uni.showToast({ title: err.msg || '保存失败', icon: 'none' })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -140,7 +222,7 @@ const handleLogin = async () => {
|
|
// uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
|
|
// uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
|
|
// }
|
|
// }
|
|
|
|
|
|
-// 微信登录
|
|
|
|
|
|
+// // 微信登录
|
|
// const getPhoneNumber = async (e) => {
|
|
// const getPhoneNumber = async (e) => {
|
|
// if (e?.detail?.errMsg !== 'getPhoneNumber:ok') {
|
|
// if (e?.detail?.errMsg !== 'getPhoneNumber:ok') {
|
|
// uni.showToast({ title: '微信登录失败', icon: 'none' })
|
|
// uni.showToast({ title: '微信登录失败', icon: 'none' })
|