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

add

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