Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
front-end-dev
techbook
Commits
21c6ef36
Commit
21c6ef36
authored
Aug 17, 2019
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册
parent
36fbc288
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
52 deletions
+78
-52
emailRegisterCmpt.vue
src/views/loginregister/pages/emailRegisterCmpt.vue
+40
-27
mobileRegisterCmpt.vue
src/views/loginregister/pages/mobileRegisterCmpt.vue
+38
-25
No files found.
src/views/loginregister/pages/emailRegisterCmpt.vue
View file @
21c6ef36
...
...
@@ -28,7 +28,7 @@
<el-checkbox
name=
"type"
v-model
.
trim=
"checked"
>
我已阅读并同意《
</el-checkbox><span
@
click=
"handleToProtocol"
class=
"protocol"
>
Techbook服务协议
</span>
》
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
class=
"loginButton"
@
click=
"handleRegister('registerForm')"
>
注册
<el-button
type=
"primary"
class=
"loginButton"
:disabled=
"flag>0"
@
click=
"handleRegister('registerForm')"
>
注册
</el-button>
</el-form-item>
<el-form-item
class=
"registerButton"
>
...
...
@@ -77,7 +77,8 @@
sliderSuccess
:
false
,
timer
:
null
,
showCount
:
true
,
count
:
''
count
:
''
,
flag
:
0
}
},
methods
:
{
...
...
@@ -107,30 +108,54 @@
let
that
=
this
;
api
.
postEmailRegisterAxios
(
this
.
registerForm
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
// that.$router.replace({path:"/completeInfoCmpt",query:{}});
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
})
that
.
$router
.
replace
({
path
:
"/completeInfoCmpt"
});
}
else
{
that
.
$message
.
error
(
res
.
msg
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
})
}
}).
catch
((
err
)
=>
{
that
.
$message
.
error
(
err
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
})
})
},
//注册
handleRegister
(
formName
)
{
const
that
=
this
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
checked
){
that
.
submitRegisterFormFunc
();
}
else
{
this
.
$message
.
warning
(
"请先同意服务协议"
);
}
if
(
this
.
flag
==
0
){
this
.
flag
++
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
checked
){
that
.
submitRegisterFormFunc
();
}
else
{
this
.
$message
.
warning
(
"请先同意服务协议"
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
})
}
}
else
{
}
else
{
return
false
;
}
});
}
else
{
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
}
}
);
}
)
}
},
...
...
@@ -159,20 +184,8 @@
this
.
errorInfo
=
"请先输入邮箱"
;
this
.
bool
=
false
;
}
if
(
this
.
flag
==
0
){
this
.
flag
++
;
if
(
this
.
bool
)
this
.
isShowSlider
=
true
;
else
this
.
$message
.
error
(
that
.
errorInfo
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
else
{
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
if
(
this
.
bool
)
this
.
isShowSlider
=
true
;
else
this
.
$message
.
error
(
that
.
errorInfo
);
},
//获取验证码掉接口
...
...
src/views/loginregister/pages/mobileRegisterCmpt.vue
View file @
21c6ef36
...
...
@@ -32,7 +32,7 @@
<el-checkbox
name=
"type"
v-model
.
trim=
"checked"
>
我已阅读并同意《
<span
@
click=
"handleToProtocol"
class=
"protocol"
>
Techbook服务协议
</span>
》
</el-checkbox>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
class=
"loginButton"
@
click=
"handleRegister('registerForm')"
>
注册
<el-button
type=
"primary"
class=
"loginButton"
:disabled=
"flag>0"
@
click=
"handleRegister('registerForm')"
>
注册
</el-button>
</el-form-item>
<el-form-item
class=
"registerButton"
>
...
...
@@ -116,29 +116,54 @@
api
.
postPhoneRegisterAxios
(
this
.
registerForm
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
that
.
$router
.
replace
(
"/completeInfoCmpt"
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
else
{
that
.
$message
.
error
(
res
.
msg
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
}).
catch
((
err
)
=>
{
that
.
$message
.
error
(
err
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
})
},
//注册
handleRegister
(
formName
)
{
const
that
=
this
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
checked
){
that
.
submitRegisterFormFunc
();
}
else
{
that
.
$message
.
warning
(
"请先同意服务协议"
);
}
if
(
this
.
flag
==
0
){
this
.
flag
++
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
checked
){
that
.
submitRegisterFormFunc
();
}
else
{
that
.
$message
.
warning
(
"请先同意服务协议"
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
}
else
{
}
else
{
return
false
;
}
});
}
else
{
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
}
});
},
500
)
}
},
//查看协议
...
...
@@ -159,20 +184,8 @@
this
.
errorInfo
=
"请先输入手机号"
;
this
.
bool
=
false
;
}
if
(
this
.
flag
==
0
){
this
.
flag
++
;
if
(
this
.
bool
)
this
.
isShowSlider
=
true
;
else
this
.
$message
.
error
(
that
.
errorInfo
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
else
{
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
if
(
this
.
bool
)
this
.
isShowSlider
=
true
;
else
this
.
$message
.
error
(
that
.
errorInfo
);
},
//获取验证码掉接口
...
...
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