Commit 8928b3d7 authored by 前端-许佳敏's avatar 前端-许佳敏

静态渲染改为动态渲染注册页

parent 876024c3
......@@ -22,10 +22,6 @@ const serviceConfig = {
useType: {
url: '/member/menu/register/type',
method: 'get'
},
useDetail: {
url: '/member/menu/register/detail',
method: 'get'
}
}
}
......
......@@ -87,11 +87,7 @@ let timeChange: any; // 定时器
const actions = createFormActions()
const UserRegistry = () => {
const [identityForm1] = Form.useForm();
const [licenseForm] = Form.useForm();
const [current, setCurrent] = useState(0)
const [identityFormData, setIdentityFormData] = useState<IFormControllers[]>([])
const [licenseFormData, setLicenseFormData] = useState<IFormControllers[]>([])
const stepList = [
{ title: '填写信息', key: 'message', name: 'message' },
{ title: '完善资料', key: 'over', name: 'over' },
......@@ -99,6 +95,8 @@ const UserRegistry = () => {
{ title: '注册成功', key: 'success', name: 'success' },
]
const [registerDetail, setRegisterDetail] = useState<any>([])
const handleJumpLogin = () => {
history.push('/user/login')
}
......@@ -177,8 +175,6 @@ const UserRegistry = () => {
label: v.typeName
}
})
console.log(mapMemberType)
const mapServerType = GlobalConfig.userRegister.useType.businessType.map(v => {
return {
value: v.id,
......@@ -186,6 +182,23 @@ const UserRegistry = () => {
}
})
const nextStepAction = () => {
actions.submit().then(data => {
const { values } = data
formCache = values
const { businessTypeId, typeId } = values
PublicApi.getMemberMenuRegisterDetail({
businessTypeId,
memberTypeId: typeId
}).then(res => {
const { data } = res
// 动态渲染第三步
setRegisterDetail(data)
setCurrent(current + 1)
})
})
}
// @todo 注册成功后 交互功能未完成
const submitForm = () => {
actions.submit().then(data => {
......@@ -253,7 +266,7 @@ const UserRegistry = () => {
{/* 注册主体类型, 为多输入框 */}
<Field name='detail' type='object'>
{
GlobalConfig.userRegister.useDetail.map(v => {
registerDetail.map(v => {
return (
<FormBlock className={styles['mr_t-40']} visible={current === 2} key={v.groupName} title={<span className={styles.commonPanelTitle}>{v.groupName}</span>}>
<FormMegaLayout columns={2} grid autoRow size='large' className={styles['mr_t-24']}>
......@@ -308,13 +321,7 @@ const UserRegistry = () => {
}
{
current === 1 &&
<Button type='primary' className={styles.continueButton} onClick={() => {
actions.submit().then(data => {
const { values } = data
formCache = values
setCurrent(current + 1)
})
}}>下一步:继续完善</Button>
<Button type='primary' className={styles.continueButton} onClick={nextStepAction}>下一步:继续完善</Button>
}
{
current === 2 &&
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment