Commit bf2809d3 authored by baixian's avatar baixian

tuisong1

parent 265ab61b
......@@ -12,11 +12,11 @@
<![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/lib/vendor.dll.js?20191012222" charset="utf-8"></script>
<script src="js/console-polyfill.js?20191012222" charset="utf-8"></script><script src="js/es6-shim.min.js?20191012222" charset="utf-8"></script><script src="js/es5-shim.js?20191012222" charset="utf-8"></script><script src="js/es5-sham.min.js?20191012222" charset="utf-8"></script><script src="js/json3.min.js?20191012222" charset="utf-8"></script><script src="js/html5shiv.min.js?20191012222" charset="utf-8"></script><script src="js/polyfill.js?20191012222" charset="utf-8"></script><script src="lib/vendor.dll.js?20191012222" charset="utf-8"></script>
</head>
</head>
<body>
<div id="root"></div>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.js?1572591383487" charset="utf-8"></script>
<script src="dist/main.js?1573024267747" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -125,8 +125,9 @@ export default {
wxConfig: {
1: {
schedule_remind_on_off: 1,
schedule_remind_student_before: 0,
schedule_remind_teacher_before: 0,
schedule_remind_student_before: 60,
schedule_remind_teacher_before: 120,
schedule_remind_unit_of_time: 1,
},
2: {
renew_remind_on_off: 1,
......@@ -135,6 +136,7 @@ export default {
renew_remind_teacher_less_than: 3,
},
},
wxTimeKey: 1,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -416,9 +418,11 @@ export default {
teacher_min_times,
parent_min_times,
callBack,
unit_type,
schedule_remind_unit_of_time,
teacher_day,
parent_day,
} = payload;
const { wxSubmitting } = yield select(state => state.classmgt);
const { wxSubmitting, wxTimeKey } = yield select(state => state.classmgt);
if (wxSubmitting) {
return;
}
......@@ -432,13 +436,14 @@ export default {
const data = yield call(classMgtAjax.wxConfig, {
school_id: sid,
schedule_remind,
teacher_minutes: unit_type === 2 ? teacher_minutes * 60 * 24 : teacher_minutes,
parent_minutes: unit_type === 2 ? parent_minutes * 60 * 24 : parent_minutes,
teacher_minutes: Number(wxTimeKey) === 2 ? teacher_day * 60 * 24 : teacher_minutes,
parent_minutes: Number(wxTimeKey) === 2 ? parent_day * 60 * 24 : parent_minutes,
type: [1, 2].join(','),
push_type,
renew_remind,
teacher_min_times,
parent_min_times,
schedule_remind_unit_of_time: wxTimeKey,
});
yield put({
type: 'updateState',
......@@ -478,6 +483,7 @@ export default {
type: 'updateState',
payload: {
wxConfig: data.data,
wxTimeKey: data.data[1].schedule_remind_unit_of_time,
},
});
} else {
......@@ -489,6 +495,15 @@ export default {
});
}
},
* updateWxTimeKey({ payload }, { call, put, select }) {
const { timeKey } = payload;
yield put({
type: 'updateState',
payload: {
wxTimeKey: timeKey,
},
});
},
* goback({ payload }, { call, put, select }) {
yield put(routerRedux.goBack());
},
......@@ -952,11 +967,13 @@ export default {
statusChangeSubmitting: false,
wxVisible: false,
wxSubmitting: false,
wxTimeKey: 1,
wxConfig: {
1: {
schedule_remind_on_off: 1,
schedule_remind_student_before: 0,
schedule_remind_teacher_before: 0,
schedule_remind_student_before: 60,
schedule_remind_teacher_before: 120,
schedule_remind_unit_of_time: 1,
},
2: {
renew_remind_on_off: 1,
......
import { connect } from 'dva';
import React from 'react';
import PropTypes from 'prop-types';
import { message, Row, Col, Input, Select, Modal, Form, InputNumber, Checkbox, Radio } from 'antd';
import { message, Row, Col, Input, Select, Modal, Form, InputNumber, Checkbox, Radio, Tabs } from 'antd';
import { imagify, pageIn } from '../../utils/index';
import pageStyle from './WxPushTimeModal.less';
const FormItem = Form.Item;
const { TabPane } = Tabs;
class WxPushTimeModal extends React.Component {
componentWillMount() {
}
......@@ -31,7 +32,8 @@ class WxPushTimeModal extends React.Component {
renew_remind,
teacher_min_times,
parent_min_times,
unit_type,
teacher_day,
parent_day,
} = values;
save({
schedule_remind: schedule_remind ? 1 : 2,
......@@ -41,7 +43,8 @@ class WxPushTimeModal extends React.Component {
renew_remind: renew_remind ? 1 : 2,
teacher_min_times,
parent_min_times,
unit_type,
teacher_day,
parent_day,
callBack: () => {
form.resetFields();
},
......@@ -54,12 +57,20 @@ class WxPushTimeModal extends React.Component {
form.resetFields();
close();
}
wxSwitchTime = (key) => {
const { wxSwitchTime } = this.props;
const timeKey = Number(key);
wxSwitchTime({
timeKey,
});
}
render() {
const {
visible,
wxSubmitting,
form: { getFieldDecorator, getFieldValue },
wxConfig,
wxTimeKey,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -82,7 +93,7 @@ class WxPushTimeModal extends React.Component {
className="modifyclassModal"
maskClosable={false}
zIndex={110}
width={650}
width={550}
>
<Form hideRequiredMark className={pageStyle.modalform} labelAlign="left">
<FormItem>
......@@ -91,23 +102,13 @@ class WxPushTimeModal extends React.Component {
initialValue: Number(wxConfig[1].schedule_remind_on_off) == 1,
})(<Checkbox><span className={pageStyle.tip}>上课提醒</span></Checkbox>)}
</FormItem>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
{getFieldDecorator('unit_type', {
initialValue: '1',
})(
<Radio.Group>
<Radio value="1">以分钟为单位</Radio>
<Radio value="2">以天为单位</Radio>
</Radio.Group>,
)}
</FormItem>
{
Number(getFieldValue('unit_type')) === 1 ?
<Tabs activeKey={`${wxTimeKey}`} onChange={this.wxSwitchTime}>
<TabPane tab="以分钟为单位" key="1">
<div>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
<div className={pageStyle.formText}><span className={pageStyle.parentTip}>家长</span>上课前</div>
{getFieldDecorator('parent_minutes', {
initialValue: wxConfig[1].schedule_remind_student_before,
initialValue: Number(wxConfig[1].schedule_remind_unit_of_time) === 1 ? wxConfig[1].schedule_remind_student_before : 60,
rules: [
{
required: true,
......@@ -115,13 +116,13 @@ class WxPushTimeModal extends React.Component {
pattern: new RegExp(/^[1-9]\d*$/, 'g'),
},
],
})(<InputNumber disabled={!getFieldValue('schedule_remind')} min={0} max={120} />)}
})(<InputNumber disabled={!getFieldValue('schedule_remind')} min={0} max={2880} />)}
<span className="ant-form-text"> 分钟推送上课提醒</span>
</FormItem>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
<div className={pageStyle.formText}><span className={pageStyle.teacherTip}>老师</span>上课前</div>
{getFieldDecorator('teacher_minutes', {
initialValue: wxConfig[1].schedule_remind_teacher_before,
initialValue: Number(wxConfig[1].schedule_remind_unit_of_time) === 1 ? wxConfig[1].schedule_remind_teacher_before : 120,
rules: [
{
required: true,
......@@ -129,14 +130,16 @@ class WxPushTimeModal extends React.Component {
pattern: new RegExp(/^[1-9]\d*$/, 'g'),
},
],
})(<InputNumber disabled={!getFieldValue('schedule_remind')} min={0} max={120} />)}
})(<InputNumber disabled={!getFieldValue('schedule_remind')} min={0} max={2880} />)}
<span className="ant-form-text"> 分钟推送上课提醒</span>
</FormItem>
</div> :
</div>
</TabPane>
<TabPane tab="以天为单位" key="2">
<div>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
<div className={pageStyle.formText}><span className={pageStyle.parentTip}>家长</span>上课前</div>
{getFieldDecorator('parent_minutes', {
{getFieldDecorator('parent_day', {
initialValue: (wxConfig[1].schedule_remind_student_before / 60 / 24) > 1 ? (wxConfig[1].schedule_remind_student_before / 60 / 24) : 1,
rules: [
{
......@@ -150,7 +153,7 @@ class WxPushTimeModal extends React.Component {
</FormItem>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
<div className={pageStyle.formText}><span className={pageStyle.teacherTip}>老师</span>上课前</div>
{getFieldDecorator('teacher_minutes', {
{getFieldDecorator('teacher_day', {
initialValue: (wxConfig[1].schedule_remind_teacher_before / 60 / 24) > 1 ? (wxConfig[1].schedule_remind_teacher_before / 60 / 24) : 1,
rules: [
{
......@@ -163,7 +166,8 @@ class WxPushTimeModal extends React.Component {
<span className="ant-form-text">天推送上课提醒</span>
</FormItem>
</div>
}
</TabPane>
</Tabs>
<FormItem>
{getFieldDecorator('renew_remind', {
valuePropName: 'checked',
......@@ -187,7 +191,7 @@ class WxPushTimeModal extends React.Component {
)}
</FormItem>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
<div className={pageStyle.formText}><span className={pageStyle.parentTip}>家长</span>课时数小于</div>
<div className={pageStyle.formText}><span className={pageStyle.parentTip}>家长</span>课时数小于等于</div>
{getFieldDecorator('parent_min_times', {
initialValue: wxConfig[2].renew_remind_student_less_than,
rules: [
......@@ -197,11 +201,11 @@ class WxPushTimeModal extends React.Component {
pattern: new RegExp(/^[1-9]\d*$/, 'g'),
},
],
})(<InputNumber disabled={!getFieldValue('renew_remind')} min={0} />)}
})(<InputNumber disabled={!getFieldValue('renew_remind')} min={0} max={99} />)}
<span className="ant-form-text">时,推送续费通知</span>
</FormItem>
<FormItem className={pageStyle.firstItem} {...formItemModalLineLayout}>
<div className={pageStyle.formText}><span className={pageStyle.teacherTip}>老师</span>课时数小于</div>
<div className={pageStyle.formText}><span className={pageStyle.teacherTip}>老师</span>课时数小于等于</div>
{getFieldDecorator('teacher_min_times', {
initialValue: wxConfig[2].renew_remind_teacher_less_than,
rules: [
......@@ -211,7 +215,7 @@ class WxPushTimeModal extends React.Component {
pattern: new RegExp(/^[1-9]\d*$/, 'g'),
},
],
})(<InputNumber disabled={!getFieldValue('renew_remind')} min={0} />)}
})(<InputNumber disabled={!getFieldValue('renew_remind')} min={0} max={99} />)}
<span className="ant-form-text">时,推送续费通知</span>
</FormItem>
</Form>
......
......@@ -15,7 +15,13 @@
content: '';
}
.ant-form-item {
margin-bottom: 10px;
margin-bottom: 5px;
}
.ant-tabs-nav-wrap {
margin-left: 20px;
}
.ant-tabs-bar {
border-bottom: none;
}
}
.formText {
......
......@@ -438,6 +438,13 @@ class ClassMgtForm extends React.Component {
payload: value,
});
}
wxSwitchTime = (timeKey) => {
const { dispatch } = this.props;
dispatch({
type: 'classmgt/updateWxTimeKey',
payload: timeKey,
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
......@@ -462,6 +469,7 @@ class ClassMgtForm extends React.Component {
wxVisible,
wxSubmitting,
wxConfig,
wxTimeKey,
} = this.props;
const visible = false;
const columns = [
......@@ -712,6 +720,8 @@ class ClassMgtForm extends React.Component {
save={this.handleSaveWx}
wxSubmitting={wxSubmitting}
wxConfig={wxConfig}
wxSwitchTime={this.wxSwitchTime}
wxTimeKey={wxTimeKey}
/>
</div>
);
......@@ -751,6 +761,7 @@ function mapStateToProps(state) {
wxVisible,
wxSubmitting,
wxConfig,
wxTimeKey,
} = state.classmgt;
return {
classList,
......@@ -780,6 +791,7 @@ function mapStateToProps(state) {
wxVisible,
wxSubmitting,
wxConfig,
wxTimeKey,
};
}
export default connect(mapStateToProps)(ClassMgt);
......
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