Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-insurance
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.frontend
pica-insurance
提交
292f12bc
提交
292f12bc
编写于
5月 10, 2023
作者:
张敬贤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
上级
c4af74a4
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
91 行增加
和
42 行删除
+91
-42
index.vue
src/views/login/index.vue
+91
-42
未找到文件。
src/views/login/index.vue
浏览文件 @
292f12bc
<
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
:
'137833399
3
3'
,
mobilePhone
:
'137833399
4
3'
,
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
/^
[\u
4E00-
\u
9FA5A-Za-z
\s]
+
(
·
[\u
4E00-
\u
9FA5A-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
}
[\d
Xx
]
$/
.
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
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录