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
1fb6838a
Commit
1fb6838a
authored
Mar 12, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册添加用户code
parent
dc648dca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
30 deletions
+45
-30
customer.ts
src/api/customer.ts
+10
-1
Register.tsx
src/pages/Register/Register.tsx
+35
-29
No files found.
src/api/customer.ts
View file @
1fb6838a
...
@@ -35,7 +35,16 @@ export const changePwdByCellphone = (data: PwdParams) =>
...
@@ -35,7 +35,16 @@ export const changePwdByCellphone = (data: PwdParams) =>
data
:
data
,
data
:
data
,
});
});
type
RegisiterPramas
=
{};
type
RegisiterPramas
=
{
code
:
string
;
areaId
:
number
;
areaName
:
string
;
customerName
:
string
;
customerPhone
:
string
;
customerSex
:
string
;
password
:
string
;
verificationCode
:
string
;
};
// type RegisiterReponseData = {};
// type RegisiterReponseData = {};
export
const
wxUserRegister
=
(
entity
:
RegisiterPramas
)
=>
export
const
wxUserRegister
=
(
entity
:
RegisiterPramas
)
=>
...
...
src/pages/Register/Register.tsx
View file @
1fb6838a
...
@@ -160,37 +160,43 @@ class Register extends Component {
...
@@ -160,37 +160,43 @@ class Register extends Component {
userinfo
:
{
areaId
,
areaName
},
userinfo
:
{
areaId
,
areaName
},
updateUserInfo
,
updateUserInfo
,
}
=
this
.
props
;
}
=
this
.
props
;
wxUserRegister
({
Taro
.
login
()
areaId
:
areaId
,
.
then
(
res
=>
res
.
code
)
areaName
:
areaName
,
.
then
(
code
=>
{
customerName
:
name
,
wxUserRegister
({
customerPhone
:
cellphone
,
code
:
code
,
customerSex
:
sex
,
areaId
:
areaId
,
password
:
pwd
,
areaName
:
areaName
,
verificationCode
:
vcode
,
customerName
:
name
,
})
customerPhone
:
cellphone
,
.
then
(
res
=>
{
customerSex
:
sex
,
const
{
register
,
wxToken
,
...
userInfo
}
=
res
.
data
;
password
:
pwd
,
console
.
log
(
userInfo
);
verificationCode
:
vcode
,
updateUserInfo
({
})
...
userInfo
,
.
then
(
res
=>
{
token
:
wxToken
,
const
{
register
,
wxToken
,
...
userInfo
}
=
res
.
data
;
});
console
.
log
(
userInfo
);
Taro
.
showToast
({
updateUserInfo
({
title
:
'注册成功'
,
...
userInfo
,
});
token
:
wxToken
,
setTimeout
(()
=>
{
});
Taro
.
reLaunch
({
Taro
.
showToast
({
url
:
'/pages/Home/Home'
,
title
:
'注册成功'
,
});
setTimeout
(()
=>
{
Taro
.
reLaunch
({
url
:
'/pages/Home/Home'
,
});
},
2000
);
})
.
catch
(
err
=>
{
console
.
log
(
err
);
this
.
setState
({
fetching
:
false
,
});
});
});
},
2000
);
})
})
.
catch
(
err
=>
{
.
catch
(
console
.
log
);
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