Commit cbade5a1 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/bww-v1' into wxl-guide

parents ffeaa2a4 d18f0268
......@@ -207,4 +207,5 @@ export default {
send_code: `${dakaapi}common/sms`,
},
deployschool: `${dakaapi}member/one_key_deploy`,
selectdeployschool: `${dakaapi}member/one_key_deploy_status`,
};
......@@ -18,6 +18,7 @@ export default {
deployType: 3, // 类型 1-口才 2-美术 3-书法 4-跆拳道 5-通用
sid: 0,
schoolUserInfo: {},
schoolStatus: '', // 1-部署中 2-部署结束
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -35,6 +36,9 @@ export default {
yield put({
type: 'querymemberinfo',
});
yield put({
type: 'selectStatus',
});
},
* querymemberinfo({ payload }, { call, put, select }) { // 释放该页面存储的所有状态
const { sid } = yield select(state => state.deployschool);
......@@ -50,6 +54,20 @@ export default {
});
}
},
* selectStatus({ payload }, { call, put, select }) { // 释放该页面存储的所有状态
const { sid } = yield select(state => state.deployschool);
const data = yield call(newregister.selectDeploySchool, {
school_id: sid,
});
if (data.code == 200) {
yield put({
type: 'updateState',
payload: {
schoolStatus: data.data.status,
},
});
}
},
* developSchool({ payload }, { call, put, select }) {
const { deployType, sid } = yield select(state => state.deployschool);
const data = yield call(newregister.deploySchool, {
......@@ -61,6 +79,7 @@ export default {
type: 'updateState',
payload: {
deployType: 3,
schoolStatus: 2,
},
});
} else {
......@@ -150,6 +169,7 @@ export default {
type: 'updateState',
payload: {
deployType: 3,
schoolStatus: '',
},
});
},
......
......@@ -26,6 +26,11 @@ class DeploySchoolForm extends React.Component {
handleClick = () => {
const { curStep, numberPercent } = this.state;
const { dispatch } = this.props;
dispatch({
type: 'deployschool/developSchool',
payload: {
},
});
this.setState({
deployVisible: true,
});
......@@ -55,11 +60,6 @@ class DeploySchoolForm extends React.Component {
numberPercent: this.state.numberPercent += 1,
});
}, 45);
dispatch({
type: 'deployschool/developSchool',
payload: {
},
});
}
handleCancelDeploy = () => {
this.setState({
......@@ -91,10 +91,20 @@ class DeploySchoolForm extends React.Component {
},
});
}
handleGoIndex = () => {
const { dispatch } = this.props;
dispatch({
type: 'deployschool/goHome',
payload: {
},
});
}
render() {
const {
deployType,
schoolStatus,
} = this.props;
console.log(schoolStatus, 'schoolStatus');
const { deployVisible, curStep, numberPercent } = this.state;
const typeList = [
{ id: 3, title: '书法练字', img: '/developschool/type_icon1.png' },
......@@ -116,7 +126,7 @@ class DeploySchoolForm extends React.Component {
{
typeList.map((item, index) => {
return (
<div className={pageStyle.typeItem} onClick={() => this.handleChooseType(item.id)}>
<div key={index} className={pageStyle.typeItem} onClick={() => this.handleChooseType(item.id)}>
<div className={pageStyle.typeImg}>
<img className={pageStyle.img} src={`${__IMGCDN__}${item.img}`} alt="" />
{
......@@ -130,7 +140,11 @@ class DeploySchoolForm extends React.Component {
})
}
</div>
<Button type="primary" className={pageStyle.createBtn} onClick={this.handleClick}>一键部署(30899位校长已部署)</Button>
{
schoolStatus === 2 ?
<div><Button type="primary" className={pageStyle.createBtn} onClick={this.handleGoIndex}>您已部署成功,请直接进入体验</Button></div> :
<div><Button type="primary" className={pageStyle.createBtn} onClick={this.handleClick}>一键部署(30899位校长已部署)</Button></div>
}
<div className={pageStyle.skip} onClick={this.handleSkip}>跳过</div>
<Modal
visible={deployVisible}
......@@ -260,11 +274,13 @@ DeploySchool.propTypes = {
function mapStateToProps(state) {
const {
deployType,
schoolStatus,
} = state.deployschool;
const { locationQuery } = state.webapp;
return {
locationQuery,
deployType,
schoolStatus,
};
}
export default connect(mapStateToProps)(DeploySchool);
......@@ -36,7 +36,7 @@
display: flex;
align-items: center;
justify-content: center;
margin-top: 40px;
margin-top: 70px;
.typeItem {
.typeImg {
width: 115px;
......@@ -72,7 +72,7 @@
line-height: 60px;
font-size: 16px;
color: #fff;
margin-top: 110px;
margin-top: 130px;
width: 390px;
}
.modalWrap {
......
......@@ -185,7 +185,7 @@ class QxLoginForm extends React.Component {
</Form>
<div className={LoginStyles.registerbox}>
<div className={LoginStyles.noaccount}>还没有账号?</div>
<Link className={LoginStyles.goregister} to="/register">去注册</Link>
<Link className={LoginStyles.goregister} to="/register" target="_blank">去注册</Link>
</div>
</div>
</div>
......
......@@ -36,3 +36,12 @@ export function forgetPassword(params) {
needAuth: false,
});
}
export function selectDeploySchool(params) {
const data = qs.stringify(params);
return request({
url: `${api.selectdeployschool}?${data}`,
method: 'GET',
data,
});
}
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