Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
XiTianSenMall
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
leiqingsong
XiTianSenMall
Commits
acd381eb
Commit
acd381eb
authored
Mar 09, 2021
by
xulili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册
parent
3c605ad5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
10 deletions
+67
-10
grade.js
H5/src/api/grade.js
+3
-3
register.vue
H5/src/views/register.vue
+64
-7
No files found.
H5/src/api/grade.js
View file @
acd381eb
...
@@ -13,11 +13,11 @@ export function getMyTeam(userId) {
...
@@ -13,11 +13,11 @@ export function getMyTeam(userId) {
/**
/**
* 森林状态
* 森林状态
* @param {*}
* @param {*}
*/
*/
export
function
getForestStatus
(
userId
){
export
function
getForestStatus
(
userId
)
{
return
request
({
return
request
({
url
:
`/user/forestStatus?userId=
${
userId
}
`
,
url
:
`/user/forestStatus?userId=
${
userId
}
`
,
method
:
"get"
method
:
"get"
});
});
}
}
\ No newline at end of file
H5/src/views/register.vue
View file @
acd381eb
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<div
class=
"form-content"
>
<div
class=
"form-content"
>
<van-cell-group>
<van-cell-group>
<van-field
<van-field
:value=
"
value
"
:value=
"
form.userId
"
placeholder=
"请输入用户名"
placeholder=
"请输入用户名"
:border=
"hasBorder"
:border=
"hasBorder"
bind:change=
"onChange"
bind:change=
"onChange"
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
/>
/>
</van-field>
</van-field>
<van-field
<van-field
:value=
"
value
"
:value=
"
form.sms
"
placeholder=
"请输入验证码"
placeholder=
"请输入验证码"
:border=
"hasBorder"
:border=
"hasBorder"
bind:change=
"onChange"
bind:change=
"onChange"
...
@@ -34,11 +34,15 @@
...
@@ -34,11 +34,15 @@
size=
"small"
size=
"small"
type=
"primary"
type=
"primary"
class=
"verify-code"
class=
"verify-code"
>
发送验证码
</van-button
:disabled=
"disabled"
@
click=
"sendSms"
>
>
<span
v-if=
"!disabled"
>
发送验证码
</span>
<span
v-else
>
{{
time
}}
秒后重新发送
</span>
</van-button>
</van-field>
</van-field>
<van-field
<van-field
:value=
"
valu
e"
:value=
"
form.beInvitedCod
e"
placeholder=
"请输入推荐人邀请码(非必填)"
placeholder=
"请输入推荐人邀请码(非必填)"
:border=
"hasBorder"
:border=
"hasBorder"
bind:change=
"onChange"
bind:change=
"onChange"
...
@@ -64,23 +68,76 @@
...
@@ -64,23 +68,76 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
smsCode
}
from
"@/api/base"
;
export
default
{
export
default
{
name
:
"register"
,
name
:
"register"
,
data
()
{
data
()
{
return
{
return
{
form
:
{
userId
:
""
,
sms
:
""
,
beInvitedCode
:
""
},
disabled
:
false
,
sendMsg
:
"发送验证码"
,
value
:
""
,
value
:
""
,
hasBorder
:
false
,
hasBorder
:
false
,
show
:
tru
e
,
show
:
fals
e
,
title
:
"注册失败"
,
title
:
"注册失败"
,
tip
:
"该推荐人邀请码不存在,请重新填写"
tip
:
"该推荐人邀请码不存在,请重新填写"
,
time
:
60
,
timer
:
null
};
};
},
},
mounted
()
{
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
);
}
},
methods
:
{
methods
:
{
register
()
{
register
()
{
// this.show = true
// this.show = true
},
},
onClickHide
()
{
onClickHide
()
{
this
.
show
=
false
;
this
.
show
=
false
;
},
sendSms
()
{
const
_this
=
this
;
if
(
_this
.
timer
)
{
return
false
;
}
// 校验手机号
let
phoneReg
=
/^
(
0|86|17951
)?(
13
[
0-9
]
|15
[
012356789
]
|17
[
0-9
]
|18
[
0-9
]
|14
[
57
])[
0-9
]{8}
$/
;
//如果手机号码输入为空
if
(
!
_this
.
form
.
userId
)
{
// _this.$toast('请输入手机号')
return
false
;
}
//验证输入的电话号码是否是11位数字
if
(
!
phoneReg
.
test
(
_this
.
form
.
userId
))
{
// _this.$toast('请输入手机号');
return
false
;
}
_this
.
time
=
60
;
_this
.
disabled
=
true
;
_this
.
handelSendSmsApi
();
_this
.
timer
=
setInterval
(()
=>
{
if
(
_this
.
time
===
0
)
{
clearInterval
(
_this
.
timer
);
_this
.
disabled
=
false
;
}
_this
.
time
--
;
},
1000
);
},
handelSendSmsApi
()
{
// 检验手机号
const
params
=
{
codeType
:
0
,
phone
:
this
.
form
.
userId
};
smsCode
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
});
}
}
}
}
};
};
...
@@ -109,7 +166,7 @@ export default {
...
@@ -109,7 +166,7 @@ export default {
}
}
.form-content
{
.form-content
{
padding
:
0
15px
;
padding
:
0
15px
;
.van-field__left-icon
{
::v-deep
.van-field__left-icon
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
}
}
...
...
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