Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
aefc1529
Commit
aefc1529
authored
Feb 09, 2020
by
高浩杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改协议 密码错误提示 注册页面
parent
ea8362c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
20 deletions
+47
-20
components/pc/loginCard/loginButton.vue
+17
-8
pages/users/login.vue
+5
-1
pages/users/register.vue
+25
-11
No files found.
components/pc/loginCard/loginButton.vue
View file @
aefc1529
...
...
@@ -2,13 +2,13 @@
<div
class=
"main-footer__container"
>
<button
@
click=
"handel"
>
{{
button
}}
</button>
<div
class=
"main-footer"
>
<div
class=
"input-box"
>
<input
id=
"automatic"
type=
"checkbox"
>
<div
class=
"input-box"
v-if=
"button !== '重置账号'"
>
<input
id=
"automatic"
type=
"checkbox"
v-model=
"isSelect"
>
<label
for=
"automatic"
></label>
<p
v-if=
"button === '登录'"
>
下次自动登录
</p>
<p
v-if=
"button !== '登录'"
>
我已阅读并同意
<span>
用户协议
</span>
和
<span>
隐私政策
</span></p>
</div>
<div>
<div
class=
"switch-box"
>
<span
@
click=
"handleReset"
>
忘记密码
</span>
<span>
·
</span>
<span
v-if=
"button === '注册'"
@
click=
"handleLogin"
>
登录
</span>
...
...
@@ -23,10 +23,15 @@ export default {
props
:
{
button
:
String
},
data
()
{
return
{
isSelect
:
''
}
},
methods
:
{
// 按钮点击
handel
()
{
this
.
$emit
(
'handle'
);
this
.
$emit
(
'handle'
,
this
.
isSelect
);
},
// 跳转忘记密码
handleReset
()
{
...
...
@@ -61,17 +66,18 @@ export default {
.main-footer
{
width
:
100%
;
margin
:
16
*$
length
auto
;
@extend
%
flex-row-spb
;
@extend
%
clearFix
;
@extend
%cursorPointer;
@include
fontStyle(12,
17,
500,
#999,
left);
.input-box
{
float
:
left
;
text-align
:
left
;
@extend
%flex-row-spb;
/*label标签的大小、位置、背景颜色更改,在css选择时,“+”代表相邻元素,即当前元素的下一元素*/
#automatic
+
label
{
display
:
block
;
display
:
inline-
block
;
width
:
12
*$
length
;
height
:
12
*$
length
;
margin-top
:
1
*$
length
;
cursor
:
pointer
;
background-color
:
#fff
;
@include
border-radius(2*$length);
...
...
@@ -96,14 +102,17 @@ export default {
input
[
type
=
checkbox
]
{
display
:
none
;
}
@extend
%
flex-row-spb
;
>
p
{
display
:
inline-block
;
padding-left
:
8
*$
length
;
>
span
{
color
:
#666
;
}
}
}
.switch-box
{
float
:
right
;
}
}
}
</
style
>
pages/users/login.vue
View file @
aefc1529
...
...
@@ -103,7 +103,11 @@ export default {
},
// 检测account 手机 邮箱
checkAccount
()
{
this
.
accountErrMsg
=
checkAccount
(
this
.
account
);
if
(
this
.
isPassword
)
{
this
.
accountErrMsg
=
checkAccount
(
this
.
account
)
===
''
?
''
:
'账号格式错误'
;
}
else
{
this
.
accountErrMsg
=
checkPhone
(
this
.
account
);
}
},
// 检测 密码
checkPassword
()
{
...
...
pages/users/register.vue
View file @
aefc1529
...
...
@@ -150,7 +150,17 @@ export default {
});
}
},
async
handleRegister
()
{
// 判断是否同意协议
checkAgreement
(
isAgreement
)
{
if
(
isAgreement
)
return
true
;
else
{
this
.
$message
({
type
:
'info'
,
message
:
'请同意用户协议和隐私政策'
})
}
},
async
handleRegister
(
isAgree
)
{
this
.
checkAccount
();
this
.
checkPassword
();
this
.
verifyErrMsg
=
checkVerification
(
this
.
verifyCode
);
...
...
@@ -158,16 +168,20 @@ export default {
let
registerResponse
;
if
(
!
this
.
isEmail
&&
this
.
passwordErrMsg
===
''
&&
this
.
accountErrMsg
===
''
&&
this
.
verifyErrMsg
===
''
)
{
registerResponse
=
await
this
.
$axios
.
$post
(
config
.
api
.
post
.
User
.
registerPhone
,
{
mobile
:
this
.
account
,
password
:
this
.
password
,
verifyCode
:
this
.
verifyCode
})
if
(
this
.
checkAgreement
(
isAgree
))
{
registerResponse
=
await
this
.
$axios
.
$post
(
config
.
api
.
post
.
User
.
registerPhone
,
{
mobile
:
this
.
account
,
password
:
this
.
password
,
verifyCode
:
this
.
verifyCode
})
}
}
else
if
(
this
.
isEmail
&&
this
.
passwordErrMsg
===
''
&&
this
.
accountErrMsg
===
''
)
{
registerResponse
=
await
this
.
$axios
.
$post
(
config
.
api
.
post
.
User
.
registerEmail
,
{
email
:
this
.
account
,
password
:
this
.
password
})
if
(
this
.
checkAgreement
(
isAgree
))
{
registerResponse
=
await
this
.
$axios
.
$post
(
config
.
api
.
post
.
User
.
registerEmail
,
{
email
:
this
.
account
,
password
:
this
.
password
})
}
// 邮箱注册
}
console
.
log
(
registerResponse
);
...
...
@@ -208,7 +222,7 @@ export default {
.register-container{
width
:
514
*$
length
;
margin
:
0
auto
;
padding
:
136
*$
length
0
;
padding
:
40
*$
length
0
;
}
.register-success
{
width
:
408
*$
length
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment