From d00bec8c2a507749df0803994459f780e6ba9d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 12 Jul 2018 10:32:49 +0800 Subject: [PATCH] bigfix: fix step from page --- src/models/form.js | 2 +- src/pages/Forms/StepForm/Step1.js | 2 +- src/pages/Forms/StepForm/Step2.js | 2 +- src/pages/Forms/StepForm/Step3.js | 2 +- src/pages/Forms/StepForm/index.js | 18 +++--------------- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/models/form.js b/src/models/form.js index d849f802..64a1d497 100644 --- a/src/models/form.js +++ b/src/models/form.js @@ -25,7 +25,7 @@ export default { type: 'saveStepFormData', payload, }); - yield put(routerRedux.push('/Forms/StepForm/Step3')); + yield put(routerRedux.push('/form/step-form/result')); }, *submitAdvancedForm({ payload }, { call }) { yield call(fakeSubmitForm, payload); diff --git a/src/pages/Forms/StepForm/Step1.js b/src/pages/Forms/StepForm/Step1.js index 0f572396..5082c1a3 100644 --- a/src/pages/Forms/StepForm/Step1.js +++ b/src/pages/Forms/StepForm/Step1.js @@ -27,7 +27,7 @@ class Step1 extends React.PureComponent { type: 'form/saveStepFormData', payload: values, }); - dispatch(routerRedux.push('/Forms/StepForm/Step2')); + dispatch(routerRedux.push('/form/step-form/confirm')); } }); }; diff --git a/src/pages/Forms/StepForm/Step2.js b/src/pages/Forms/StepForm/Step2.js index 9daa3fe0..54fe43c1 100644 --- a/src/pages/Forms/StepForm/Step2.js +++ b/src/pages/Forms/StepForm/Step2.js @@ -20,7 +20,7 @@ class Step2 extends React.PureComponent { const { form, data, dispatch, submitting } = this.props; const { getFieldDecorator, validateFields } = form; const onPrev = () => { - dispatch(routerRedux.push('/Forms/StepForm')); + dispatch(routerRedux.push('/form/step-form/info')); }; const onValidateForm = e => { e.preventDefault(); diff --git a/src/pages/Forms/StepForm/Step3.js b/src/pages/Forms/StepForm/Step3.js index eb8afeac..b529d6a4 100644 --- a/src/pages/Forms/StepForm/Step3.js +++ b/src/pages/Forms/StepForm/Step3.js @@ -9,7 +9,7 @@ class Step3 extends React.PureComponent { render() { const { dispatch, data } = this.props; const onFinish = () => { - dispatch(routerRedux.push('/Forms/StepForm')); + dispatch(routerRedux.push('/form/step-form/info')); }; const information = (
diff --git a/src/pages/Forms/StepForm/index.js b/src/pages/Forms/StepForm/index.js index d67be97a..536171e7 100644 --- a/src/pages/Forms/StepForm/index.js +++ b/src/pages/Forms/StepForm/index.js @@ -14,11 +14,11 @@ export default class StepForm extends PureComponent { const { pathname } = location; const pathList = pathname.split('/'); switch (pathList[pathList.length - 1]) { - case 'Step1': + case 'info': return 0; - case 'Step2': + case 'confirm': return 1; - case 'Step3': + case 'result': return 2; default: return 0; @@ -41,18 +41,6 @@ export default class StepForm extends PureComponent { {children} - {/* - {getRoutes(match.path, routerData).map(item => ( - - ))} - - - */} -- GitLab