Commit 9ca2b60c authored by wangxuelai's avatar wangxuelai

''

parent c8557c2c
...@@ -176,7 +176,12 @@ export default { ...@@ -176,7 +176,12 @@ export default {
}, },
}); });
} else { } else {
message.error('课表加载失败!', 1); yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: queryScheduleListData,
},
});
} }
}, },
* changeDate({ payload }, { call, put, select }) { * changeDate({ payload }, { call, put, select }) {
......
...@@ -20,6 +20,7 @@ export default { ...@@ -20,6 +20,7 @@ export default {
inviateHoldList: [], inviateHoldList: [],
inviateTeacherList: [], inviateTeacherList: [],
stronghold: null, stronghold: null,
datetime: '',
}, },
subscriptions: { subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line setup({ dispatch, history }) { // eslint-disable-line
...@@ -36,6 +37,7 @@ export default { ...@@ -36,6 +37,7 @@ export default {
yield put({ yield put({
type: 'updateState', type: 'updateState',
payload: { payload: {
datetime: schoolListData.datetime,
schoolList: [...schoolListData.data.list], schoolList: [...schoolListData.data.list],
inviateHoldList: [...schoolListData.data.inviate_hold], inviateHoldList: [...schoolListData.data.inviate_hold],
inviateTeacherList: [...schoolListData.data.inviate_teacher], inviateTeacherList: [...schoolListData.data.inviate_teacher],
...@@ -46,6 +48,7 @@ export default { ...@@ -46,6 +48,7 @@ export default {
yield put({ yield put({
type: 'webapp/errorrequestresolve', type: 'webapp/errorrequestresolve',
payload: { payload: {
datetime: schoolListData.datetime,
data: schoolListData, data: schoolListData,
}, },
}); });
......
...@@ -724,6 +724,13 @@ export default { ...@@ -724,6 +724,13 @@ export default {
}, },
}); });
} else if (data.code === 100001) { // 接口少了token } else if (data.code === 100001) { // 接口少了token
} else if (data.code === 40202) {
yield put({
type: 'updateState',
payload: {
globalErrorType: 4, // 校区到期
},
});
} else { } else {
message.error(data.msg || '未知错误', 1); message.error(data.msg || '未知错误', 1);
} }
......
...@@ -51,7 +51,7 @@ function mapStateToProps(state) { ...@@ -51,7 +51,7 @@ function mapStateToProps(state) {
} = state.webapp; } = state.webapp;
return { return {
locationPathname, locationPathname,
globalErrorType, // : -1, // 1: 401token失效 2 40200无权限 3 40201账号已关闭 globalErrorType, // : -1, // 1: 401token失效 2 40200无权限 3 40201账号已关闭 4 校区套餐到期
}; };
} }
export default connect(mapStateToProps)(OuterPage); export default connect(mapStateToProps)(OuterPage);
...@@ -41,6 +41,9 @@ class SjdIndex extends React.Component { ...@@ -41,6 +41,9 @@ class SjdIndex extends React.Component {
type: 'webapp/goSchoollist', type: 'webapp/goSchoollist',
}); });
} }
gorecharge = () => {
window.open('http://website.clock.wp53.cn/?page=7');
}
render() { render() {
const { const {
collapsed, locationPathname, screenIsBig, globalErrorType, collapsed, locationPathname, screenIsBig, globalErrorType,
...@@ -131,6 +134,25 @@ class SjdIndex extends React.Component { ...@@ -131,6 +134,25 @@ class SjdIndex extends React.Component {
<span>账号已关闭</span> <span>账号已关闭</span>
</div> </div>
</Modal> </Modal>
<Modal
title=""
style={{ top: 20 }}
visible={globalErrorType == 4}
maskStyle={{ zIndex: 1003 }}
zIndex={1004}
closable={false}
centered
footer={<div><Button onClick={this.goSchoollist} type="primary">校区列表</Button><Button onClick={this.gorecharge} type="danger">充 值</Button></div>}
>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '10px' }}>
<Icon type="info-circle" style={{ color: 'red', fontSize: '24px', marginRight: '10px' }} />
<span style={{ fontSize: '16px', fontWeight: 700, color: '#000' }}>您的账户已到期</span>
</div>
<div style={{ display: 'flex', alignItems: 'center' }}>
<Icon type="info-circle" style={{ fontSize: '24px', opacity: 0, marginRight: '10px' }} />
<span style={{ fontSize: '14px', color: 'rgba(0,0,0,0.65)' }}>请尽快联系客服充值</span>
</div>
</Modal>
</div> </div>
); );
const redirectLogin = (<Redirect to={{ pathname: '/login' }} />); const redirectLogin = (<Redirect to={{ pathname: '/login' }} />);
......
...@@ -37,7 +37,7 @@ class ClockItem extends React.Component { ...@@ -37,7 +37,7 @@ class ClockItem extends React.Component {
<img alt="" className={pageStyle.bestFlag} src="https://cdn.img.shangjiadao.cn/source/images/dakav4/2b/common/jinx.png" /> <img alt="" className={pageStyle.bestFlag} src="https://cdn.img.shangjiadao.cn/source/images/dakav4/2b/common/jinx.png" />
} }
<div className={pageStyle.userinfobox}> <div className={pageStyle.userinfobox}>
<img className={pageStyle.useravatar} src={imagify(clock.school_student.avatar, 'image/resize,w_160/format,jpg')} alt={clock.school_student.nickname} /> <img className={pageStyle.useravatar} src={imagify(clock.school_student.avatar)} alt={clock.school_student.nickname} />
<div className={pageStyle.usernamebox}> <div className={pageStyle.usernamebox}>
<div className={pageStyle.nickname}> <div className={pageStyle.nickname}>
{clock.school_student.nickname} {clock.school_student.nickname}
......
...@@ -25,7 +25,32 @@ class JoinSchoolAddForm extends React.Component { ...@@ -25,7 +25,32 @@ class JoinSchoolAddForm extends React.Component {
}); });
} }
goSchoolSystem = (school) => { goSchoolSystem = (school) => {
const { dispatch } = this.props; const { dispatch, datetime } = this.props;
if (new Date(datetime.replace(/\-/g, '/')).getTime() >= new Date(school.expire_time.replace(/\-/g, '/')).getTime()) {
Modal.error({
title: '您的账户已到期',
content: '请尽快联系客服充值',
okText: '确 定',
closable: false,
maskClosable: false,
centered: true,
okButtonProps: {
type: 'danger',
style: {
color: '#fff',
backgroundColor: '#ff4d4f',
borderColor: '#ff4d4f',
},
},
icon: <Icon type="exclamation-circle" style={{ color: 'red' }} />,
onOk: () => {
window.open('http://website.clock.wp53.cn/?page=7');
},
onCancel: () => {
},
});
return;
}
dispatch({ dispatch({
type: 'schoollist/goSchoolSystem', type: 'schoollist/goSchoolSystem',
payload: { payload: {
...@@ -153,6 +178,10 @@ class JoinSchoolAddForm extends React.Component { ...@@ -153,6 +178,10 @@ class JoinSchoolAddForm extends React.Component {
} }
</Col> </Col>
</Row> </Row>
<Row className={`${pageStyles.logintimebox} ${pageStyles.expiretimebox}`} type="flex" justify="space-between" align="middle">
<Col span={12} className={pageStyles.timetitle}>套餐到期时间:</Col>
<Col span={12} className={pageStyles.time}>{ele.expire_time}</Col>
</Row>
{ele.school_teacher && ele.school_teacher.last_login_time && {ele.school_teacher && ele.school_teacher.last_login_time &&
<Row className={pageStyles.logintimebox} type="flex" justify="space-between" align="middle"> <Row className={pageStyles.logintimebox} type="flex" justify="space-between" align="middle">
<Col span={12} className={pageStyles.timetitle}>上次登录时间:</Col> <Col span={12} className={pageStyles.timetitle}>上次登录时间:</Col>
...@@ -264,6 +293,7 @@ function mapStateToProps(state) { ...@@ -264,6 +293,7 @@ function mapStateToProps(state) {
inviateHoldList, inviateHoldList,
inviateTeacherList, inviateTeacherList,
stronghold, stronghold,
datetime,
} = state.schoollist; } = state.schoollist;
const { const {
userInfo, userInfo,
...@@ -276,6 +306,7 @@ function mapStateToProps(state) { ...@@ -276,6 +306,7 @@ function mapStateToProps(state) {
userInfo, userInfo,
stronghold, stronghold,
globalErrorType, globalErrorType,
datetime,
}; };
} }
export default connect(mapStateToProps)(JoinSchoolAdd); export default connect(mapStateToProps)(JoinSchoolAdd);
...@@ -112,6 +112,9 @@ ...@@ -112,6 +112,9 @@
left: 0; left: 0;
bottom: 45px; bottom: 45px;
width: 100%; width: 100%;
&.expiretimebox {
bottom: 20px;
}
} }
.timetitle { .timetitle {
color: rgba(0,0,0,0.45); color: rgba(0,0,0,0.45);
......
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