Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
前端-黄佳鑫
jinfa-platform
Commits
9b17346a
Commit
9b17346a
authored
Aug 29, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化按钮loading
parent
fb9a0460
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
register.tsx
src/pages/user/register.tsx
+9
-2
No files found.
src/pages/user/register.tsx
View file @
9b17346a
...
...
@@ -65,6 +65,7 @@ const actions = createFormActions()
const
UserRegistry
=
()
=>
{
const
[
current
,
setCurrent
]
=
useState
(
0
)
const
[
subStep
,
setSubStep
]
=
useState
(
false
)
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
)
const
stepList
=
[
{
title
:
'填写信息'
,
key
:
'message'
,
name
:
'message'
},
{
title
:
'完善资料'
,
key
:
'over'
,
name
:
'over'
},
...
...
@@ -151,6 +152,7 @@ const UserRegistry = () => {
const
{
values
}
=
data
formCache
=
Object
.
assign
({},
formCache
,
filterUndef
(
values
))
const
{
businessTypeId
,
typeId
}
=
values
setSubmitLoading
(
true
)
PublicApi
.
getMemberMenuRegisterDetail
({
businessTypeId
,
memberTypeId
:
typeId
...
...
@@ -163,6 +165,8 @@ const UserRegistry = () => {
}
}).
catch
(()
=>
{
}).
finally
(()
=>
{
setSubmitLoading
(
false
)
})
})
}
...
...
@@ -175,6 +179,7 @@ const UserRegistry = () => {
// 写死传入的区号
formCache
.
countryCode
=
'+86'
const
params
=
omit
(
formCache
,
[
'isRead'
,
'confirmPassword'
])
setSubmitLoading
(
true
)
PublicApi
.
postMemberRegister
(
params
).
then
(({
code
})
=>
{
if
(
code
===
1000
)
{
actions
.
dispatch
(
'onFormStepNext'
,
{})
...
...
@@ -184,6 +189,8 @@ const UserRegistry = () => {
}).
catch
(()
=>
{
// 调用接口后 失败需清空缓存的数据
formCache
=
{}
}).
finally
(()
=>
{
setSubmitLoading
(
false
)
})
})
}
...
...
@@ -221,11 +228,11 @@ const UserRegistry = () => {
}
{
current
===
1
&&
!
subStep
&&
<
Button
type=
'primary'
className=
{
'continueButton'
}
onClick=
{
nextStepAction
}
>
下一步:继续完善
</
Button
>
<
Button
type=
'primary'
className=
{
'continueButton'
}
onClick=
{
nextStepAction
}
loading=
{
submitLoading
}
>
下一步:继续完善
</
Button
>
}
{
current
===
1
&&
subStep
&&
<
Button
type=
'primary'
className=
{
'continueButton'
}
onClick=
{
submitForm
}
>
提交注册资料
</
Button
>
<
Button
type=
'primary'
className=
{
'continueButton'
}
onClick=
{
submitForm
}
loading=
{
submitLoading
}
>
提交注册资料
</
Button
>
}
</
div
>
{
...
...
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