提交 292f12bc 编写于 作者: 张敬贤's avatar 张敬贤

add

上级 c4af74a4
<template> <template>
<div class="insurance-login"> <div class="insurance-login">
<van-form <van-form
ref="loginForm"
class="insurance-login-form" class="insurance-login-form"
> >
<!-- 控制补全信息显示隐藏 -->
<template v-if="!need"> <template v-if="!need">
<div> <div>
<div class="login-form-label"> <div class="login-form-label">
...@@ -17,7 +19,7 @@ ...@@ -17,7 +19,7 @@
name="手机号" name="手机号"
clearable clearable
placeholder="手机号" placeholder="手机号"
:rules="[{ required: true, message: '请输入手机号' }]" :rules="[{ required: true, message: '请输入手机号' },{ validator:validatorPhoneNum, message: '手机号格式填写有误' }]"
/> />
<div <div
class="login-form-message" class="login-form-message"
...@@ -53,7 +55,8 @@ ...@@ -53,7 +55,8 @@
clearable clearable
name="领取人姓名" name="领取人姓名"
placeholder="请输入领取人姓名" placeholder="请输入领取人姓名"
:rules="[{ required: true, message: '请输入领取人姓名' }]" :rules="[{ required: true, message: '请输入领取人姓名' },
{ validator:validatorName, message: '请输入正确姓名,不少于两个字' }]"
/> />
<div class="login-form-label"> <div class="login-form-label">
<span>*</span>领取人身份 <span>*</span>领取人身份
...@@ -64,7 +67,7 @@ ...@@ -64,7 +67,7 @@
clearable clearable
name="领取人身份证" name="领取人身份证"
placeholder="请输入领取人身份证" placeholder="请输入领取人身份证"
:rules="[{ required: true, message: '请输入领取人身份证' }]" :rules="[{ required: true, message: '请输入领取人身份证' },{ validator:validatorIdCard, message: '身份证号码格式填写有误' }]"
/> />
</div> </div>
</template> </template>
...@@ -73,15 +76,17 @@ ...@@ -73,15 +76,17 @@
class="login-form-submit" class="login-form-submit"
@click="submit" @click="submit"
> >
领取/查看权益 {{ need ? '领取权益':'领取/查看权益' }}
</div> </div>
</van-form> </van-form>
<!-- 滑块验证 -->
<slideToCheck <slideToCheck
v-if="showCheckDialog" v-if="showCheckDialog"
:mobile="formData.mobilePhone" :mobile="formData.mobilePhone"
@closeSlideCheckpageDialog="closeSlideCheckpageDialog" @closeSlideCheckpageDialog="closeSlideCheckpageDialog"
@refreshGetMsg="refreshGetMsg" @refreshGetMsg="refreshGetMsg"
/> />
<!-- 用户协议 -->
<div <div
v-if="need" v-if="need"
class="insurance-login-agreement" class="insurance-login-agreement"
...@@ -89,7 +94,7 @@ ...@@ -89,7 +94,7 @@
<van-checkbox <van-checkbox
v-model="checked" v-model="checked"
> >
我已阅读并同意 <span @click="goProtocol(42)">《云鹊健康用户协议》</span> 和 <span @click="goProtocol(5)">《云鹊隐私声明》</span> 我已阅读并同意 <span @click="goProtocol(prototypes.yqjkyhxy)">《云鹊健康用户协议》</span> 和 <span @click="goProtocol(prototypes.yhzqtys)">《云鹊隐私声明》</span>
</van-checkbox> </van-checkbox>
</div> </div>
</div> </div>
...@@ -110,7 +115,7 @@ export default { ...@@ -110,7 +115,7 @@ export default {
return { return {
formData: { formData: {
patientName: '', patientName: '',
mobilePhone: '13783339933', mobilePhone: '13783339943',
idCard: '', idCard: '',
checkCode:'' checkCode:''
}, },
...@@ -122,7 +127,10 @@ export default { ...@@ -122,7 +127,10 @@ export default {
sixThen: 60, sixThen: 60,
showCheckDialog: false, showCheckDialog: false,
prototypeId:'', prototypeId:'',
prototypeLogId:'', prototypeLogId: '',
prototypes: {},
token: '',
patientId:''
}; };
}, },
computed: { computed: {
...@@ -135,17 +143,48 @@ export default { ...@@ -135,17 +143,48 @@ export default {
}, },
methods: { methods: {
...mapActions('home', ['setImgCodeData', 'setNeedTimer']), ...mapActions('home', ['setImgCodeData', 'setNeedTimer']),
// 验证姓名
validatorName(val) {
console.log(val);
if (val === '') {
return true;
}
return /^[\u4E00-\u9FA5A-Za-z\s]+(·[\u4E00-\u9FA5A-Za-z]+)*$/.test(val);
},
// 验证手机号码
validatorPhoneNum(val) {
console.log(val);
if (val === '') {
return true;
}
return /^([1][3,4,5,6,7,8,9])\d{9}$/.test(val);
},
// 验证身份证
validatorIdCard(val) {
console.log(val);
if (val === '') {
return true;
}
return /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(val);
},
// 关闭 滑块
closeSlideCheckpageDialog() { closeSlideCheckpageDialog() {
this.showCheckDialog = false; this.showCheckDialog = false;
}, },
// 获取协议id
getPrototypes(projectEquityNo) { getPrototypes(projectEquityNo) {
getPrototypes(projectEquityNo).then(res => { getPrototypes(projectEquityNo).then(res => {
console.log(res); console.log(res);
this.prototypes = res.data;
}); });
}, },
// 获取验证码
getCode() { getCode() {
this.checkControlStatus(); this.checkControlStatus();
}, },
// 发送验证码
refreshGetMsg() { refreshGetMsg() {
this.$toast({ this.$toast({
message: '验证码已发送', message: '验证码已发送',
...@@ -195,44 +234,54 @@ export default { ...@@ -195,44 +234,54 @@ export default {
}); });
}); });
}, },
// 提交事件
submit() { submit() {
this.$refs.loginForm.validate().then(res => {
console.log(res);
if (this.formData.checkCode == '') {
this.$toast('请输入验证码');
return;
}
if (this.need && !this.checked) { if (this.need && !this.checked) {
this.$toast('请勾选同意底部协议后进行登录'); this.$toast('请勾选同意底部协议后进行登录');
return; return;
} }
// {
// "checkCode": "string",
// "idCard": "string",
// "mobilePhone": "string",
// "patientName": "string",
// "projectEquityNo": "string",
// "prototypeId": 0,
// "prototypeLogId": 0
// }
const data = { const data = {
checkCode: this.formData.checkCode, checkCode: this.formData.checkCode,
idCard: this.formData.checkCidCardode, idCard: this.formData.idCard,
mobilePhone: this.formData.mobilePhone, mobilePhone: this.formData.mobilePhone,
patientName: this.formData.patientName, patientName: this.formData.patientName,
projectEquityNo:this.projectEquityNo, projectEquityNo:this.projectEquityNo,
}; };
if (this.need) {
data.checkCode = '';
data.token = this.token;
}
insuranceLogin(data).then(res => { insuranceLogin(data).then(res => {
console.log(res.code);
if (res.code == '000000') { if (res.code == '000000') {
this.patientId = res.data.patientId;
if (res.data.status == '0') { if (res.data.status == '0') {
this.need = true; this.need = true;
this.token = res.data.token;
this.$dialog.alert({ this.$dialog.alert({
title: '温馨提示', title: '温馨提示',
message: '您尚未领取过本权益,需要完善相关信息', message: '您尚未领取过本权益,需要完善相关信息',
theme: 'round-button', theme: 'round-button',
confirmButtonColor:'#00bda5' confirmButtonColor:'#00bda5'
}); });
} else {
window.location.href = res.data.questionnaireUrl;
} }
}else {
this.$toast(res.message);
} }
}); });
});
}, },
phoneFun() { // 页面跳转
},
goProtocol(type) { goProtocol(type) {
this.$router.push({ this.$router.push({
path: '/protocol', path: '/protocol',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册