Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-school-app
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
wx-school-app
Commits
c4a8963b
Commit
c4a8963b
authored
Mar 12, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录注册环节多次点击问题
parent
bf7ee6c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
BarCode.tsx
src/pages/BarCode/BarCode.tsx
+1
-1
Login.tsx
src/pages/Login/Login.tsx
+16
-2
Register.tsx
src/pages/Register/Register.tsx
+12
-1
No files found.
src/pages/BarCode/BarCode.tsx
View file @
c4a8963b
...
...
@@ -133,7 +133,7 @@ class BarCode extends Component {
this
.
fetchOrder
(
res
.
data
[
0
].
id
);
this
.
setState
({
showPayOrder
:
true
});
}
else
{
this
.
drawBarCode
(
false
);
this
.
drawBarCode
();
}
})
.
catch
(
err
=>
{
...
...
src/pages/Login/Login.tsx
View file @
c4a8963b
...
...
@@ -66,7 +66,11 @@ class Login extends Component {
}
loginHandle
():
void
{
if
(
this
.
state
.
fetching
)
return
;
if
(
this
.
validataLoginData
())
{
this
.
setState
({
fetching
:
true
,
});
const
{
updateUserInfo
,
userinfo
}
=
this
.
props
;
const
{
account
,
pwd
}
=
this
.
state
;
console
.
log
(
'in loginHandle'
);
...
...
@@ -85,12 +89,22 @@ class Login extends Component {
})
.
catch
(
err
=>
{
console
.
log
(
err
);
if
(
err
.
code
&&
err
.
code
===
NotRegisterCode
)
{
updateUserInfo
({
customerPhone
:
account
,
});
Taro
.
navigateTo
({
url
:
'/pages/Register/Register'
,
setTimeout
(()
=>
{
this
.
setState
({
fetching
:
false
,
});
Taro
.
navigateTo
({
url
:
'/pages/Register/Register'
,
});
},
2000
);
}
else
{
this
.
setState
({
fetching
:
false
,
});
}
});
...
...
src/pages/Register/Register.tsx
View file @
c4a8963b
...
...
@@ -28,6 +28,7 @@ type PageDispatchProps = {
};
type
PageState
=
{
fetching
:
boolean
;
name
:
string
;
cellphone
:
string
;
vcode
:
string
;
...
...
@@ -64,6 +65,7 @@ class Register extends Component {
super
(
props
);
const
{
customerPhone
}
=
props
.
userinfo
;
this
.
state
=
{
fetching
:
false
,
name
:
''
,
cellphone
:
customerPhone
,
vcode
:
''
,
...
...
@@ -148,7 +150,11 @@ class Register extends Component {
}
getRegister
()
{
if
(
this
.
state
.
fetching
)
return
;
if
(
this
.
validateRegisterEntity
())
{
this
.
setState
({
fetching
:
true
,
});
const
{
name
,
cellphone
,
pwd
,
sex
,
vcode
}
=
this
.
state
;
const
{
userinfo
:
{
areaId
,
areaName
},
...
...
@@ -179,7 +185,12 @@ class Register extends Component {
});
},
2000
);
})
.
catch
(
console
.
log
);
.
catch
(
err
=>
{
console
.
log
(
err
);
this
.
setState
({
fetching
:
false
,
});
});
}
}
...
...
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