Commit 9ca2b60c authored by wangxuelai's avatar wangxuelai

''

parent c8557c2c
......@@ -176,7 +176,12 @@ export default {
},
});
} else {
message.error('课表加载失败!', 1);
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: queryScheduleListData,
},
});
}
},
* changeDate({ payload }, { call, put, select }) {
......
......@@ -20,6 +20,7 @@ export default {
inviateHoldList: [],
inviateTeacherList: [],
stronghold: null,
datetime: '',
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -36,6 +37,7 @@ export default {
yield put({
type: 'updateState',
payload: {
datetime: schoolListData.datetime,
schoolList: [...schoolListData.data.list],
inviateHoldList: [...schoolListData.data.inviate_hold],
inviateTeacherList: [...schoolListData.data.inviate_teacher],
......@@ -46,6 +48,7 @@ export default {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
datetime: schoolListData.datetime,
data: schoolListData,
},
});
......
......@@ -724,6 +724,13 @@ export default {
},
});
} else if (data.code === 100001) { // 接口少了token
} else if (data.code === 40202) {
yield put({
type: 'updateState',
payload: {
globalErrorType: 4, // 校区到期
},
});
} else {
message.error(data.msg || '未知错误', 1);
}
......
......@@ -51,7 +51,7 @@ function mapStateToProps(state) {
} = state.webapp;
return {
locationPathname,
globalErrorType, // : -1, // 1: 401token失效 2 40200无权限 3 40201账号已关闭
globalErrorType, // : -1, // 1: 401token失效 2 40200无权限 3 40201账号已关闭 4 校区套餐到期
};
}
export default connect(mapStateToProps)(OuterPage);
......@@ -41,6 +41,9 @@ class SjdIndex extends React.Component {
type: 'webapp/goSchoollist',
});
}
gorecharge = () => {
window.open('http://website.clock.wp53.cn/?page=7');
}
render() {
const {
collapsed, locationPathname, screenIsBig, globalErrorType,
......@@ -131,6 +134,25 @@ class SjdIndex extends React.Component {
<span>账号已关闭</span>
</div>
</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>
);
const redirectLogin = (<Redirect to={{ pathname: '/login' }} />);
......
......@@ -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" />
}
<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.nickname}>
{clock.school_student.nickname}
......
......@@ -25,7 +25,32 @@ class JoinSchoolAddForm extends React.Component {
});
}
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({
type: 'schoollist/goSchoolSystem',
payload: {
......@@ -153,6 +178,10 @@ class JoinSchoolAddForm extends React.Component {
}
</Col>
</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 &&
<Row className={pageStyles.logintimebox} type="flex" justify="space-between" align="middle">
<Col span={12} className={pageStyles.timetitle}>上次登录时间:</Col>
......@@ -264,6 +293,7 @@ function mapStateToProps(state) {
inviateHoldList,
inviateTeacherList,
stronghold,
datetime,
} = state.schoollist;
const {
userInfo,
......@@ -276,6 +306,7 @@ function mapStateToProps(state) {
userInfo,
stronghold,
globalErrorType,
datetime,
};
}
export default connect(mapStateToProps)(JoinSchoolAdd);
......@@ -112,6 +112,9 @@
left: 0;
bottom: 45px;
width: 100%;
&.expiretimebox {
bottom: 20px;
}
}
.timetitle {
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