Commit ab321e6b authored by wangxuelai's avatar wangxuelai

Merge branch 'master' into wxl-develop

parents c2fcef72 c90532ec
......@@ -17,6 +17,6 @@
</head>
<body>
<div id="root"></div>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.js?1575470194049" charset="utf-8"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.js?1575613527689" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -199,4 +199,13 @@ export default {
index: `${dakaapi}member/materials`,
uploadcourseware: `${dakaapi}member/online_courses/upload_content`,
},
// 新版注册接口
newRegister: {
register: `${dakaapi}common/qx_login/register`,
forget_password: `${dakaapi}common/qx_login/forget_password`,
change_password: `${dakaapi}member/erp/account/change_password`,
send_code: `${dakaapi}common/sms`,
},
deployschool: `${dakaapi}member/one_key_deploy`,
selectdeployschool: `${dakaapi}member/one_key_deploy_status`,
};
......@@ -213,6 +213,7 @@ class classRoomMgt extends React.Component {
timeArr,
edittype,
manageCourseTime,
schoolUserInfo,
} = this.props;
const { errorMsg } = this.state;
const { getFieldDecorator } = this.props.form;
......@@ -286,7 +287,7 @@ class classRoomMgt extends React.Component {
>
{getFieldDecorator('end_date', {
rules: [{ required: true, message: '结束时间不能为空' }],
initialValue: rulePlanDetail.end_date ? moment(rulePlanDetail.end_date, 'YYYY-MM-DD') : moment(new Date(), 'YYYY-MM-DD'),
initialValue: rulePlanDetail.end_date ? moment(rulePlanDetail.end_date, 'YYYY-MM-DD') : moment(moment().add(1, 'y').format('YYYY-MM-DD'), 'YYYY-MM-DD'),
})(<DatePicker style={{ width: '100%' }} placeholder="请选择结束时间" disabledDate={this.endDisabledDate} />)}
</Form.Item>
<Form.Item
......@@ -344,7 +345,7 @@ class classRoomMgt extends React.Component {
<Col span={13}>
{getFieldDecorator('times', {
rules: [{ required: true, message: '上课时间不能为空' }],
initialValue: rulePlanDetail.times,
initialValue: datePlanDetail.times.length > 0 ? datePlanDetail.times : ['10:00-11:00'],
})(
<Select mode="multiple" placeholder="请选择上课时间">
{timeArr.map(ele => <Option key={ele.id} value={`${ele.start_time}-${ele.end_time}`}>{`${ele.start_time}-${ele.end_time}`}</Option>)}
......@@ -381,7 +382,7 @@ class classRoomMgt extends React.Component {
<Row gutter={4}>
<Col span={13}>
{getFieldDecorator('teacher_id', {
initialValue: rulePlanDetail.teacher_id,
initialValue: rulePlanDetail.teacher_id.length > 0 ? rulePlanDetail.teacher_id : schoolUserInfo.id,
rules: [{ required: true, message: '请选择上课老师' }],
})(
<Select style={{ width: '100%' }} placeholder="请选择上课老师">
......@@ -647,6 +648,9 @@ function mapStateToProps(state) {
classList,
widthClassSelect,
} = state.plancourse;
const {
schoolUserInfo,
} = state.webapp;
return {
tabType,
selectWeekDays,
......@@ -660,6 +664,7 @@ function mapStateToProps(state) {
// teacherList,
classList,
widthClassSelect,
schoolUserInfo,
};
}
export default connect(mapStateToProps)(classRoomMgtForm);
......
......@@ -3,6 +3,7 @@ import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { Menu, Icon, Layout } from 'antd';
import SjdMenuStyle from './SjdMenu.less';
import UserGuide from '../components/UserGuide';
import {
pageIn,
LocalStorage,
......@@ -29,7 +30,10 @@ class SjdMenu extends React.Component {
componentWillUnmount() {
}
selectedMenu = (id, fatherId) => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'webapp/menuselected',
payload: {
......@@ -66,7 +70,9 @@ class SjdMenu extends React.Component {
});
}
render() {
const { menus, defaultMenu, collapsed } = this.props;
const {
menus, defaultMenu, collapsed, guideStep, guideShow,
} = this.props;
const menuItemStyle = {
fontSize: '13px',
height: '40px',
......@@ -94,6 +100,7 @@ class SjdMenu extends React.Component {
}}
className={`${SjdMenuStyle.menusider} menusider`}
>
<UserGuide />
<div>
{/* <div className={collapsed ? SjdMenuStyle.collapsedlogo : SjdMenuStyle.uncollapsedlogo} onClick={this.goHome} /> */}
<div className={SjdMenuStyle.uncollapsedlogo} onClick={this.goHome} />
......@@ -106,13 +113,14 @@ class SjdMenu extends React.Component {
{
menus.map(ele => (
!ele.isFather ?
<Menu.Item key={ele.id} style={menuItemStyle} onClick={() => this.selectedMenu(ele.id, null)}>
<Menu.Item id={`menu_${ele.id}`} key={ele.id} style={menuItemStyle} onClick={() => this.selectedMenu(ele.id, null)}>
<div className={SjdMenuStyle.menuicon} style={defaultMenu == ele.id ? { width: ele.style.width, height: ele.style.height, backgroundImage: `url(${ele.activeurl})` } : { width: ele.style.width, height: ele.style.height, backgroundImage: `url(${ele.notactiveurl})` }} />
<Icon type="right" style={{ width: 0, minWidth: 'initial', visibility: 'hidden' }} />
<span>{ele.name}</span>
</Menu.Item> :
<SubMenu
key="sub1"
id={`menu_${ele.id}`}
title={
<span style={padding}>
<div className={SjdMenuStyle.menuicon} style={defaultMenu == ele.id ? { width: ele.style.width, height: ele.style.height, backgroundImage: `url(${ele.activeurl})` } : { width: ele.style.width, height: ele.style.height, backgroundImage: `url(${ele.notactiveurl})` }} />
......@@ -122,7 +130,7 @@ class SjdMenu extends React.Component {
}
>
{ele.subMenues.map(submenu => (
<Menu.Item key={submenu.id} style={menuItemStyle} onClick={() => this.selectedMenu(submenu.id, submenu.fatherId)}>
<Menu.Item key={submenu.id} id={`menu_${submenu.id}`} style={menuItemStyle} onClick={() => this.selectedMenu(submenu.id, submenu.fatherId)}>
<div className={SjdMenuStyle.menuicon} style={defaultMenu == submenu.id ? { width: submenu.style.width, height: submenu.style.height, backgroundImage: `url(${submenu.activeurl})` } : { width: submenu.style.width, height: submenu.style.height, backgroundImage: `url(${submenu.notactiveurl})` }} />
<Icon type="right" style={{ width: 0, minWidth: 'initial', visibility: 'hidden' }} />
<span>{submenu.name}</span>
......@@ -145,11 +153,15 @@ function mapStateToProps(state) {
const {
menus, defaultMenu, collapsed, sid,
} = state.webapp;
const {
guideShow,
} = state.userguide;
return {
menus,
defaultMenu,
collapsed,
sid,
guideShow,
};
}
export default connect(mapStateToProps)(SjdMenu);
......@@ -841,6 +841,7 @@ export default {
},
* tabChange({ payload }, { call, put, select }) {
const { tab } = payload;
console.log(tab, 'tabtabtabtabtab');
yield put({
type: 'updateState',
payload: {
......
......@@ -45,6 +45,9 @@ import coursemateria from './coursemateria';
import coursegatherdetail from './coursegatherdetail';
import uploadcourseware from './uploadcourseware';
import classrecord from './classrecord';
import newregister from './newregister';
import userguide from './userguide';
import deployschool from './deployschool';
export default {
loginModel,
indexstaicModel,
......@@ -84,4 +87,7 @@ export default {
coursegatherdetail,
uploadcourseware,
classrecord,
newregister,
userguide,
deployschool,
};
......@@ -12,6 +12,7 @@ import errorcode from '../common/errorcode';
import * as login from '../services/login';
import * as users from '../services/users';
import * as commonAjax from '../services/common';
import * as newregister from '../services/newregister';
export default {
namespace: 'login',
......@@ -22,6 +23,7 @@ export default {
teacherLoginQrcode: '',
generateSuccess: true,
randomString: '',
qxLoading: false,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -39,13 +41,14 @@ export default {
teacherLoginQrcode: '',
generateSuccess: true,
randomString: '',
qxLoading: false,
},
});
},
*fetch({ payload }, { call, put }) { // eslint-disable-line
yield put({ type: 'save' });
},
* login({ payload }, { call, put }) {
* sjdLogin({ payload }, { call, put }) {
const {
needlogin, mobile, password, type, verifycode,
} = payload;
......@@ -135,6 +138,72 @@ export default {
}
setTimeout(loadmessage);
},
* qxLogin({ payload }, { call, put }) {
const {
needlogin, mobile, password, type, code,
} = payload;
yield put({
type: 'updateState',
payload: {
qxLoading: true,
},
});
const loadmessage = message.loading('登录中...', 0);
let params = {};
if (type == 'verify') {
params = {
type: 3,
mobile,
code,
};
} else {
params = {
type: 4,
mobile,
password,
};
}
const data = yield call(login.newLogin, params);
if (data.code === 200) {
if (data.data && data.data.token) {
LocalStorage.setItem('user', {
expiresIn: data.data.expiresIn,
token: data.data.token,
tokenType: data.data.tokenType,
avatar: (data.data.business && data.data.business.avatar) || '',
consumerId: (data.data.business && data.data.business.consumer_id) || 0,
createdAt: (data.data.business && data.data.business.created_at) || '',
deletedAt: (data.data.business && data.data.business.deleted_at) || '',
id: (data.data.business && data.data.business.id) || 0,
memberId: (data.data.business && data.data.business.member_id) || 0,
mobile: (data.data.business && data.data.business.mobile) || '',
expiresDateTime: data.data.expiresDateTime || '',
nickname: (data.data.business && data.data.business.nickname) || '',
});
message.success('登录成功!', 1);
yield put({
type: 'webapp/updateState',
payload: {
userInfo: LocalStorage.getItem('user'),
},
});
yield put(routerRedux.push({
pathname: '/erp/schoollist',
}));
} else {
message.error('登录失败,请重试', 1.5);
}
} else {
yield put({
type: 'updateState',
payload: {
qxLoading: false,
},
});
message.error(data.msg, 1);
}
setTimeout(loadmessage);
},
* goregister({ payload }, { put }) {
yield put(routerRedux.push({
pathname: '/register',
......
......@@ -224,8 +224,8 @@ export default {
message.error('开始时间不能大于结束时间', 1);
return;
}
if ((endDateTimestamp - startDateTimestamp) > 1000 * 60 * 60 * 24 * 365) {
message.error('排课周期不能超过年', 1);
if ((endDateTimestamp - startDateTimestamp) > 1000 * 60 * 60 * 24 * 365 * 2) {
message.error('排课周期不能超过年', 1);
return;
}
if (selectWeekDays.length == 0) {
......
......@@ -6,7 +6,7 @@ import {
SessionStorage,
isExpired,
} from '../utils/index';
import * as register from '../services/register';
import * as newregister from '../services/newregister';
import errorcode from '../common/errorcode';
export default {
namespace: 'resetpsd',
......@@ -27,16 +27,20 @@ export default {
});
},
* resetpsd({ payload }, { call, put }) {
const { info } = payload;
const { mobile, password, code } = payload;
const resethide = message.loading('正在重置密码...');
const data = yield call(register.resetPsd, { info });
if (!data.code) {
const params = {
mobile, password, code,
};
const data = yield call(newregister.forgetPassword, params);
console.log(data, 'data');
if (data.code === 200) {
setTimeout(resethide);
message.success('密码重置成功', 1);
yield put({
type: 'register/gologin',
type: 'newregister/gologin',
payload: {
mobile: info.mobile,
mobile,
},
});
} else {
......
......@@ -12,6 +12,7 @@ import {
import * as usersettingajax from '../services/usersetting';
import * as commonAjax from '../services/common';
import * as register from '../services/register';
import * as newregister from '../services/newregister';
import errorcode from '../common/errorcode';
export default {
namespace: 'usersetting',
......@@ -68,9 +69,9 @@ export default {
}
},
* getverifycode({ payload }, { call, put, select }) {
const { countdown, counting, gettingVerifyCoding } = yield select(state => state.register);
const { countdown, counting, gettingVerifyCoding } = yield select(state => state.newregister);
const { timer } = yield select(state => state.usersetting);
const { mobile, type } = payload;
const { mobile, sms_type } = payload;
let newCountdowm = countdown;
let newCounting = counting;
yield put({
......@@ -81,8 +82,8 @@ export default {
},
});
const verifycodehide = message.loading('正在获取验证码....', 0);
const data = yield call(register.getVerifyCode, { mobile, type });
if (!data.code) {
const data = yield call(newregister.getVerifyCode, { mobile, sms_type });
if (data.code === 200) {
setTimeout(verifycodehide);
message.success('验证码获取成功', 1);
yield put({
......@@ -124,11 +125,16 @@ export default {
countdown: 60,
},
});
message.error(errorcode[data.code] && errorcode[data.code].cn, 1);
message.error(data.msg, 1);
}
},
* resetpsd({ payload }, { call, put, select }) {
const { values, callBack } = payload;
const {
mobile,
password,
code,
callBack,
} = payload;
const { resetPsdSubmitting } = yield select(state => state.usersetting);
if (resetPsdSubmitting) {
return;
......@@ -140,16 +146,21 @@ export default {
},
});
const resethide = message.loading('正在重置密码...');
const data = yield call(register.resetPsd, { info: values });
const data = yield call(newregister.forgetPassword, {
mobile,
password,
code,
});
yield put({
type: 'updateState',
payload: {
resetPsdSubmitting: false,
},
});
if (!data.code) {
if (data.code === 200) {
setTimeout(resethide);
message.success('密码重置成功,下次登录请用新的密码登录', 1);
yield delay(200);
yield put({
type: 'updateState',
payload: {
......@@ -167,7 +178,7 @@ export default {
}
} else {
setTimeout(resethide);
message.error(errorcode[data.code].cn, 1);
message.error(data.msg, 1);
}
},
* updateNickname({ payload }, { call, put, select }) {
......
......@@ -36,6 +36,8 @@ export default {
role: LocalStorage.getItem('role') || '',
isDepartment: false,
globalErrorType: -1, // 1: 401token失效 2 40200无权限 3 40201账号已关闭
guideShow: true, // 引导是否开启
guideStep: 1, // 引导步骤
},
subscriptions: {
setup({ dispatch, history }) {
......@@ -56,6 +58,36 @@ export default {
return history.listen(({
pathname, search, query,
}) => {
if (queryString.parse(search).adminrootMap) {
LocalStorage.setItem('rootMap', JSON.parse(queryString.parse(search).adminrootMap));
}
if (queryString.parse(search).adminsid) {
LocalStorage.setItem('sid', JSON.parse(queryString.parse(search).adminsid));
dispatch({
type: 'updateState',
payload: {
sid: JSON.parse(queryString.parse(search).adminsid),
},
});
}
if (queryString.parse(search).adminuser) {
LocalStorage.setItem('user', JSON.parse(queryString.parse(search).adminuser));
dispatch({
type: 'updateState',
payload: {
userInfo: JSON.parse(queryString.parse(search).adminuser),
},
});
}
if (queryString.parse(search).admminrole) {
LocalStorage.setItem('role', JSON.parse(queryString.parse(search).admminrole));
dispatch({
type: 'updateState',
payload: {
userInfo: JSON.parse(queryString.parse(search).admminrole),
},
});
}
dispatch({
type: 'updateState',
payload: {
......@@ -942,6 +974,15 @@ export default {
},
});
}
const deploySchoolMath = pathToRegexp('/deploySchool/:id').exec(pathname);
if (deploySchoolMath) {
dispatch({
type: 'deployschool/queryinfo',
payload: {
id: deploySchoolMath[1],
},
});
}
});
},
},
......
......@@ -53,7 +53,7 @@ class SjdIndex extends React.Component {
}
render() {
const {
collapsed, locationPathname, screenIsBig, globalErrorType,
collapsed, locationPathname, screenIsBig, globalErrorType, guideShow, guideStep,
} = this.props;
let contentMarginLeft = 0;
let paddingRight = 20;
......@@ -194,7 +194,7 @@ SjdIndex.propTypes = {
};
function mapStateToProps(state) {
const {
collapsed, userInfo, showExpired, menuDrawerShow, screenIsBig, globalErrorType, locationPathname,
collapsed, userInfo, showExpired, menuDrawerShow, screenIsBig, globalErrorType, locationPathname, guideShow, guideStep,
} = state.webapp;
return {
collapsed,
......@@ -203,6 +203,8 @@ function mapStateToProps(state) {
screenIsBig,
globalErrorType, // : -1, // 1: 401token失效 2 40200无权限 3 40201账号已关闭
locationPathname,
guideShow,
guideStep,
};
}
export default connect(mapStateToProps)(SjdIndex);
......@@ -27,9 +27,21 @@ class ClassDetailForm extends React.Component {
};
}
componentDidMount() { // 挂载
pageIn('班级管理');
// 初始化地图函数 自定义函数名init
// 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
pageIn('班级管理 ');
const { dispatch } = this.props;
const addClassStudentbtn = document.getElementById('classdetail_addStudent');
if (addClassStudentbtn) {
dispatch({
type: 'userguide/getposition',
payload: {
page: 'classdetailtab2',
doms: {
addClassStudentbtn,
menuBtn: document.getElementById('menu_3'),
},
},
});
}
}
componentWillUnmount() { // 卸载
}
......@@ -68,7 +80,10 @@ class ClassDetailForm extends React.Component {
});
}
tabChange = (value) => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'classdetail/tabChange',
payload: {
......@@ -381,7 +396,10 @@ class ClassDetailForm extends React.Component {
});
}
toAddClassStudent = () => {
const { dispatch, classDetail } = this.props;
const { dispatch, classDetail, guideShow } = this.props;
if (guideShow) {
return;
}
if (classDetail.graduation_status == 2) {
message.warn('班级已结业,不能添加班级!', 0.5);
return;
......@@ -836,7 +854,12 @@ class ClassDetailForm extends React.Component {
});
}
goPlanCourse = () => {
const { dispatch, classDetail, classId } = this.props;
const {
dispatch, classDetail, classId, guideShow,
} = this.props;
if (guideShow) {
return;
}
if (classDetail.graduation_status == 2) {
message.error('已结业班级不能排课');
return;
......@@ -1151,6 +1174,22 @@ class ClassDetailForm extends React.Component {
);
},
},
{
title: '老师',
dataIndex: 'school_teachers',
key: 'school_teachers',
render: (text, record, index) => {
return (
<div>
{
text.map((item, index) => {
return <span>{item.nickname} <br /></span>;
})
}
</div>
);
},
},
{
title: '操作',
dataIndex: 'operate',
......@@ -1525,7 +1564,7 @@ class ClassDetailForm extends React.Component {
<Tabs activeKey={`${tab}`} onChange={this.tabChange} animated={false} >
<TabPane tab="排课信息" key="1">
<div className={pageStyle.courseoperate} style={{ paddingLeft: '19px' }}>
{hasBtnPower('sjd/classdetail', 'planAllSchedule') && <Button className={pageStyle.courseoperatebtn} onClick={this.goPlanCourse}>一键排课</Button>}
{hasBtnPower('sjd/classdetail', 'planAllSchedule') && <Button id="classdetail_plancoursebtn" className={pageStyle.courseoperatebtn} onClick={this.goPlanCourse}>一键排课</Button>}
{hasBtnPower('sjd/classdetail', 'removeAllPlans') && <Button className={pageStyle.courseoperatebtn} onClick={this.delCoursePlans}>批量删除</Button>}
</div>
<div className={pageStyle.tablebox}>
......@@ -1559,7 +1598,7 @@ class ClassDetailForm extends React.Component {
<TabPane tab="班级学员" key="2">
<Row type="flex" justify="space-between" className={pageStyle.courseoperate}>
<Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 12 }}>
{hasBtnPower('sjd/classdetail', 'addClassStudent') && <Button className={pageStyle.courseoperatebtn} onClick={this.toAddClassStudent} type="primary" ghost>添加学员</Button>}
{hasBtnPower('sjd/classdetail', 'addClassStudent') && <Button id="classdetail_addStudent" className={pageStyle.courseoperatebtn} onClick={this.toAddClassStudent} type="primary">添加学员</Button>}
{hasBtnPower('sjd/classdetail', 'changeClass') && <Button className={pageStyle.courseoperatebtn} onClick={this.studentsChangeClass}>调至其他班级</Button>}
{hasBtnPower('sjd/classdetail', 'removeClass') && <Button className={pageStyle.courseoperatebtn} onClick={this.removeClassStudent}>移出本班</Button>}
</Col>
......@@ -1605,7 +1644,7 @@ class ClassDetailForm extends React.Component {
/>
</div>
</TabPane>
<TabPane tab="点名情况" key="3">
<TabPane tab={<div style={{ backgroundColor: '#fff' }} id="classdetail_tab3">点名情况</div>} key="3">
<Row type="flex" justify="space-between" className={pageStyle.courseoperate}>
<Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 24 }} lg={{ span: 8 }} style={{ display: 'flex', alignItems: 'center', marginBottom: '12px' }}>
<div className={pageStyle.dianmingtime}>一周点名情况 {scheduleListQueryParams.start_time}{scheduleListQueryParams.end_time}</div>
......@@ -1843,6 +1882,9 @@ function mapStateToProps(state) {
addTimeSubmitting,
courseTimeListShow,
} = state.classdetail;
const {
guideShow,
} = state.userguide;
return {
classDetail,
editClassModalShow,
......@@ -1892,6 +1934,7 @@ function mapStateToProps(state) {
timeArr,
addTimeSubmitting,
courseTimeListShow,
guideShow,
};
}
export default connect(mapStateToProps)(ClassDetail);
......
......@@ -14,8 +14,42 @@ const { TextArea } = Input;
class ClassMgtForm extends React.Component {
componentDidMount() { // 挂载
pageIn('班级管理');
// 初始化地图函数 自定义函数名init
// 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
// const { dispatch } = this.props;
// const addClassBtn = document.getElementById('class_addClass');
// console.log(document.getElementById('class_0'), 'dsadadas');
// if (addClassBtn) {
// dispatch({
// type: 'userguide/getposition',
// payload: {
// page: 'class',
// doms: {
// addClassBtn,
// menuBtn: document.getElementById('menu_3'),
// firstClassBtn: document.getElementById('class_0'),
// },
// },
// });
// }
}
componentWillReceiveProps() {
const { guideStep, dispatch } = this.props;
setTimeout(() => {
const addClassBtn = document.getElementById('class_addClass');
const firstClassBtn = document.getElementById('class_0');
if (addClassBtn && firstClassBtn && guideStep == 4) {
dispatch({
type: 'userguide/getposition',
payload: {
page: 'class',
doms: {
addClassBtn,
menuBtn: document.getElementById('menu_3'),
firstClassBtn,
},
},
});
}
}, 500);
}
componentWillUnmount() { // 卸载
}
......@@ -30,7 +64,10 @@ class ClassMgtForm extends React.Component {
});
}
addClass = () => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'classmgt/updateState',
payload: {
......@@ -337,7 +374,10 @@ class ClassMgtForm extends React.Component {
});
}
goClassDetail = (classInfo, type) => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'classmgt/goClassDetail',
payload: {
......@@ -509,7 +549,7 @@ class ClassMgtForm extends React.Component {
key: 'title',
render: (text, record, index) => {
return (
<div className={pageStyle.classNamebox} onClick={() => this.goClassDetail(record, 2)}>
<div id={`class_${index}`} className={pageStyle.classNamebox} onClick={() => this.goClassDetail(record, 2)}>
{record.title}
</div>
);
......@@ -609,7 +649,7 @@ class ClassMgtForm extends React.Component {
return (
<div className={pageStyle.container}>
<div className={pageStyle.headerbox}>
{hasBtnPower('sjd/classmgt', 'addClass') && <Button icon="plus" className={pageStyle.headerbtn} type="primary" onClick={this.addClass}>添加班级</Button>}
{hasBtnPower('sjd/classmgt', 'addClass') && <Button icon="plus" id="class_addClass" className={pageStyle.headerbtn} type="primary" onClick={this.addClass}>添加班级</Button>}
<Button className={pageStyle.headerbtn} onClick={this.wxSwitch} >微信推送设置</Button>
{hasBtnPower('sjd/classmgt', 'allWindingUp') && <Button className={pageStyle.headerbtn} onClick={this.operateClassStatus}>批量结业</Button>}
<Button icon="download" className={pageStyle.headerbtn} onClick={() => this.exportExcel(columns)} >导出</Button>
......@@ -795,6 +835,12 @@ function mapStateToProps(state) {
wxConfig,
wxTimeKey,
} = state.classmgt;
const {
guideStep,
} = state.userguide;
const {
guideShow,
} = state.userguide;
return {
classList,
editClassModalShow,
......@@ -824,6 +870,8 @@ function mapStateToProps(state) {
wxSubmitting,
wxConfig,
wxTimeKey,
guideStep,
guideShow,
};
}
export default connect(mapStateToProps)(ClassMgt);
......
......@@ -49,6 +49,7 @@
word-break: break-all;
color: #1890FF;
cursor: pointer;
// background-color: #fff;
}
.tableoperatebox {
min-width: 160px;
......
......@@ -15,11 +15,28 @@ class ClassMgtForm extends React.Component {
pageIn('课程管理');
// 初始化地图函数 自定义函数名init
// 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
const { dispatch } = this.props;
const addCourseBtn = document.getElementById('course_addcourse');
if (addCourseBtn) {
dispatch({
type: 'userguide/getposition',
payload: {
page: 'course',
doms: {
addCourseBtn,
menuBtn: document.getElementById('menu_6'),
},
},
});
}
}
componentWillUnmount() { // 卸载
}
setModalVisible(modalVisible) {
const { dispatch, form } = this.props;
const { dispatch, form, guideShow } = this.props;
if (guideShow) {
return;
}
if (modalVisible) {
this.state.isEdit = false;
} else {
......@@ -254,7 +271,7 @@ class ClassMgtForm extends React.Component {
return (
<div className={pageStyle.container}>
<div className={pageStyle.headerbox}>
{hasBtnPower('sjd/course', 'addCourse') && <Button icon="plus" className={pageStyle.headerbtn} onClick={() => this.setModalVisible(true)} type="primary">新增课程</Button>}
{hasBtnPower('sjd/course', 'addCourse') && <Button icon="plus" className={pageStyle.headerbtn} id="course_addcourse" onClick={() => this.setModalVisible(true)} type="primary">新增课程</Button>}
</div>
<div className={pageStyle.tablebox}>
<Table
......@@ -446,6 +463,9 @@ function mapStateToProps(state) {
courseSubmiting,
colorList,
} = state.course;
const {
guideShow,
} = state.userguide;
return {
coursesinfo,
courseid,
......@@ -454,6 +474,7 @@ function mapStateToProps(state) {
editCourseInfo,
courseSubmiting,
colorList,
guideShow,
};
}
export default connect(mapStateToProps)(ClassMgt);
......
......@@ -53,6 +53,19 @@ class StaticCenter extends React.Component {
}
componentDidMount() { // 挂载
pageIn('轻校-概况');
const studentjoinbtn = document.getElementById('index_studentjoin');
const { dispatch } = this.props;
if (studentjoinbtn) {
dispatch({
type: 'userguide/getposition',
payload: {
page: 'indexstatic1',
doms: {
studentjoinbtn,
},
},
});
}
}
componentDidUpdate() {
}
......@@ -116,7 +129,10 @@ class StaticCenter extends React.Component {
});
}
goDeadlineStudent = () => {
const { dispatch, renew } = this.props;
const { dispatch, renew, guideShow } = this.props;
if (guideShow) {
return;
}
if (renew.total === 0) {
message.warning('暂无学员课时数过低需要续费喔');
return;
......@@ -126,7 +142,10 @@ class StaticCenter extends React.Component {
});
}
goBirthStudent = () => {
const { dispatch, birthday } = this.props;
const { dispatch, birthday, guideShow } = this.props;
if (guideShow) {
return;
}
if (birthday.total === 0) {
message.warning('今天没有学员生日喔');
return;
......@@ -136,7 +155,10 @@ class StaticCenter extends React.Component {
});
}
goCallStudent = () => {
const { dispatch, callData } = this.props;
const { dispatch, callData, guideShow } = this.props;
if (guideShow) {
return;
}
if (callData.total === 0) {
message.warning('当前暂无未点名课次喔');
return;
......@@ -146,13 +168,19 @@ class StaticCenter extends React.Component {
});
}
goPlanClass = () => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'indexstaic/goPlanClass',
});
}
goPlanStudent = () => {
const { dispatch, assign } = this.props;
const { dispatch, assign, guideShow } = this.props;
if (guideShow) {
return;
}
if (assign.total === 0) {
message.warning('当前暂无未分配学员喔');
return;
......@@ -295,7 +323,10 @@ class StaticCenter extends React.Component {
}
// 添加学员方法
setModal1Visible(visible) {
const { dispatch, schoolUserInfo } = this.props;
const { dispatch, schoolUserInfo, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'students/updateState',
payload: {
......@@ -866,7 +897,7 @@ class StaticCenter extends React.Component {
<Row gutter={24}>
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 1 }} lg={{ span: 4, offset: 1 }} xl={{ span: 4, offset: 1 }}>
<div className={pageStyle.informItem} onClick={() => this.setModal1Visible(true)}>
<div className={pageStyle.informImg}><img src={`${__IMGCDN__}index/inform_icon1.png`} alt="" />
<div className={pageStyle.informImg} id="index_studentjoin"><img src={`${__IMGCDN__}index/inform_icon1.png`} alt="" />
<Badge className={pageStyle.informNum}>
</Badge>
</div>
......@@ -875,7 +906,7 @@ class StaticCenter extends React.Component {
</Col>
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 1 }} lg={{ span: 4, offset: 1 }} xl={{ span: 4, offset: 1 }}>
<div className={pageStyle.informItem} onClick={this.goCallStudent}>
<div className={pageStyle.informImg}><img src={`${__IMGCDN__}index/inform_icon2.png`} alt="" />
<div className={pageStyle.informImg} id="index_callwarn"><img src={`${__IMGCDN__}index/inform_icon2.png`} alt="" />
<Badge className={pageStyle.informNum} overflowCount={999} count={callData.total}>
</Badge>
</div>
......@@ -884,7 +915,7 @@ class StaticCenter extends React.Component {
</Col>
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 1 }} lg={{ span: 4, offset: 1 }} xl={{ span: 4, offset: 1 }}>
<div className={pageStyle.informItem} onClick={this.goPlanStudent}>
<div className={pageStyle.informImg}><img src={`${__IMGCDN__}index/inform_icon3.png`} alt="" />
<div className={pageStyle.informImg} id="index_planwarn"><img src={`${__IMGCDN__}index/inform_icon3.png`} alt="" />
<Badge className={pageStyle.informNum} overflowCount={999} count={assign.total}>
</Badge>
</div>
......@@ -893,7 +924,7 @@ class StaticCenter extends React.Component {
</Col>
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 1 }} lg={{ span: 4, offset: 1 }} xl={{ span: 4, offset: 1 }}>
<div className={pageStyle.informItem} onClick={this.goBirthStudent}>
<div className={pageStyle.informImg}><img src={`${__IMGCDN__}index/inform_icon4.png`} alt="" />
<div className={pageStyle.informImg} id="index_birthwarn"><img src={`${__IMGCDN__}index/inform_icon4.png`} alt="" />
<Badge className={pageStyle.informNum} overflowCount={999} count={birthday.total}>
</Badge>
</div>
......@@ -902,7 +933,7 @@ class StaticCenter extends React.Component {
</Col>
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 0 }} lg={{ span: 4, offset: 0 }} xl={{ span: 4, offset: 0 }}>
<div className={pageStyle.informItem} onClick={this.goDeadlineStudent}>
<div className={pageStyle.informImg}><img src={`${__IMGCDN__}index/inform_icon5.png`} alt="" />
<div className={pageStyle.informImg} id="index_paywarn"><img src={`${__IMGCDN__}index/inform_icon5.png`} alt="" />
<Badge className={pageStyle.informNum} overflowCount={999} count={renew.total}>
</Badge>
</div>
......@@ -1033,6 +1064,9 @@ function mapStateToProps(state) {
const {
schoolUserInfo,
} = state.webapp;
const {
guideShow,
} = state.userguide;
return {
staticcenter,
clockCharts,
......@@ -1078,6 +1112,7 @@ function mapStateToProps(state) {
studentChangeScheduleListTotal,
studentChangeScheduleListQueryParams,
schoolUserInfo,
guideShow,
};
}
export default connect(mapStateToProps)(StaticCenter);
......
import React from 'react';
import { connect } from 'dva';
import { withRouter, Link } from 'dva/router';
import { Row, Col, Form, Input, Button, Checkbox, message, Tabs } from 'antd';
import LoginStyles from './index.less';
import { LocalStorage, imagifyorigin, pageIn } from '../../utils/index';
import QxLogin from './QxLogin';
import SjdLogin from './SjdLogin';
const { TabPane } = Tabs;
const FormItem = Form.Item;
class LoginForm extends React.Component {
constructor(props) {
super(props);
this.state = {
// date: '',
pwdvisible: false,
loginType: 'psd',
qxLoginType: 'psd',
qxpwdvisible: false,
};
}
componentDidMount() {
......@@ -81,12 +85,6 @@ class LoginForm extends React.Component {
},
});
}
goRegister = () => {
const { dispatch } = this.props;
dispatch({
type: 'login/goregister',
});
}
goResetPsd = () => {
const { dispatch } = this.props;
dispatch({
......@@ -120,11 +118,41 @@ class LoginForm extends React.Component {
pwdvisible: !this.state.pwdvisible,
});
}
qxpwdcansee = () => {
this.setState({
qxpwdvisible: !this.state.qxpwdvisible,
});
}
handleQxSubmit = (e) => {
const { dispatch } = this.props;
const { loginType } = this.state;
e.preventDefault();
this.props.form.validateFields((err, values) => {
const {
mobile, verifycode, needlogin, password,
} = values;
if (!err) {
console.log('1111111');
}
});
}
qxGoPwdLogin = () => {
this.setState({
qxLoginType: 'psd',
});
}
qxGoVerifyLogin = () => {
this.setState({
qxLoginType: 'verifycode',
});
}
render() {
const { getFieldDecorator } = this.props.form;
const { pwdvisible, loginType } = this.state;
const {
locationQuery, logining, countdown, counting, tabtype, teacherLoginQrcode,
pwdvisible, loginType, qxLoginType, qxpwdvisible,
} = this.state;
const {
locationQuery, logining, countdown, counting, tabtype,
} = this.props;
return (
<div className={`login register ${LoginStyles.logincontainer}`}>
......@@ -140,99 +168,14 @@ class LoginForm extends React.Component {
<div className={LoginStyles.sjd_name}>
登录
</div>
<div className={LoginStyles.shifttbbox}>
{/* <div className={`${LoginStyles.shifttb} ${tabtype == 1 ? LoginStyles.active : ''}`} onClick={() => this.tabshift(1)}>
<div className={LoginStyles.tabname}>老师登录</div>
<div className={LoginStyles.tabborder} />
</div> */}
{/* <div className={`${LoginStyles.shifttb} ${tabtype == 2 ? LoginStyles.active : ''}`} onClick={() => this.tabshift(2)}>
<div className={LoginStyles.tabname}>机构/校区账号登录</div>
<div className={LoginStyles.tabborder} />
</div> */}
</div>
{/* { tabtype == 1 &&
<div className={LoginStyles.teacherloginbox}>
<div className={LoginStyles.loginwarntext}>请使用微信扫描小程序二维码登录轻校</div>
<img className={LoginStyles.loginqrcode} src={imagifyorigin(teacherLoginQrcode)} alt="" />
</div>
} */}
{ tabtype == 2 &&
<div className={LoginStyles.businessloginbox}>
<Form onSubmit={this.handleSubmit} className={LoginStyles.loginform}>
<FormItem className="loginrow">
{getFieldDecorator('mobile', {
rules: [
{ required: true, message: '请输入您的手机号!' },
{ pattern: /^1[3456789]{1}[0-9]{9}$/, message: '请输入正确的手机号码!' },
{ max: 11, message: '手机号长度为11位!' },
],
initialValue: locationQuery.mobile || '',
})(
<Input
placeholder="请输入手机号"
maxLength={11}
/>,
)}
</FormItem>
{loginType == 'verifycode' &&
<Row className={`loginrow ${LoginStyles.verycoderow}`}>
<Col span={16}>
<FormItem>
{getFieldDecorator('verifycode', {
rules: [
{ required: true, message: '请输入验证码!' },
{ pattern: /^[0-9]{4}$/, message: '验证码是4位数字验证码' },
],
})(
<Input className="no_border" type="text" autoComplete="off" placeholder="输入验证码" maxLength={4} />,
)}
</FormItem>
</Col>
<Col span={8}>
<div className={`${LoginStyles.verycodebtn} ${counting ? LoginStyles.verycodebtndisable : ''}`} onClick={this.sendVerifyCode}>{counting ? `${countdown}秒后重新获取` : '获取验证码'}</div>
</Col>
</Row>
}
{loginType == 'psd' &&
<Row className={`loginrow ${LoginStyles.verycoderow}`}>
<Col span={20}>
<FormItem>
{getFieldDecorator('password', {
rules: [
{ required: true, message: '请输入您的密码!' },
{ pattern: /^[a-zA-Z0-9]{6,20}$/, message: '密码格式不正确(6-20位字母和数字组合)!' },
],
})(
<Input className="no_border" type={!pwdvisible ? 'password' : 'text'} autoComplete="off" placeholder="请输入密码" />,
)}
</FormItem>
</Col>
<Col span={4} className={LoginStyles.eyebox} onClick={() => this.pwdcansee()}>
{pwdvisible && <img src={`${__IMGCDN__}eyeopen.png`} alt="" className={LoginStyles.eyeopen} />}
{!pwdvisible && <img src={`${__IMGCDN__}eyeclose.png`} alt="" className={LoginStyles.eyeclose} />}
</Col>
</Row>
}
<FormItem className="loginrow">
{loginType == 'verifycode' && <div className={LoginStyles.loginformforgot} onClick={this.goPwdLogin}>密码登录</div>}
{loginType == 'psd' &&
<div className={LoginStyles.loginformforgotbox}>
<div onClick={this.goVerifyLogin}>验证码登录</div>
<div className={LoginStyles.resetpsd} onClick={this.goResetPsd}>忘记密码</div>
</div>
}
<div className={`${LoginStyles.btncontent} 'clearfix'`}>
<Button type="primary" htmlType="submit" size="large" className={LoginStyles.loginformbutton} loading={logining}>
{logining ? '登录中...' : '登录'}
</Button>
</div>
</FormItem>
</Form>
<div className={LoginStyles.registerbox}>
<div className={LoginStyles.noaccount}>还没有账号?</div>
<div className={LoginStyles.goregister} onClick={this.goRegister}>去注册</div>
</div>
</div>}
<Tabs defaultActiveKey="1" animated={false} onChange={this.callback}>
<TabPane tab="轻校账号登录" key="1">
<QxLogin />
</TabPane>
<TabPane tab="商家岛账号登录" key="2">
<SjdLogin />
</TabPane>
</Tabs>
</div>
</Col>
</Row>
......
......@@ -45,6 +45,32 @@
.loginbox {
flex: 1;
padding-top: 42px;
:global {
.ant-tabs-bar {
border-bottom: none;
}
.ant-tabs-nav-container {
font-size: 18px;
color: #000;
text-align: center;
}
// .ant-tabs-nav .ant-tabs-tab-active {
// color: #19B5FE;
// font-weight: 400;
// }
.ant-tabs-nav .ant-tabs-tab {
margin: 0 ;
padding: 12px 0;
color: #959595;
&:first-child {
margin-right: 150px;
}
&.ant-tabs-tab-active {
color: #19B5FE;
font-weight: 400;
}
}
}
}
.sjd_logo{
text-align: center;
......@@ -66,7 +92,7 @@
max-width: 400px;
margin-bottom: 20px;
margin: 0 auto;
padding-top: 48px;
padding-top: 10px;
}
.loginformforgot {
color: #22B8FF;
......@@ -81,7 +107,7 @@
color: #22B8FF;
font-size: 14px;
padding-left: 11px;
margin-bottom: 72px;
margin-bottom: 50px;
line-height: 1;
margin-top: 24px;
display: flex;
......@@ -302,4 +328,4 @@
width: 22px;
height: 11px;
cursor: pointer;
}
\ No newline at end of file
}
......@@ -31,12 +31,15 @@ class LoginForm extends React.Component {
this.props.form.validateFields((err, values) => {
if (!err) {
const {
location, industry, mobile, organization, password, province, verifycode,
mobile, password, code,
} = values;
console.log(values, 'values');
dispatch({
type: 'resetpsd/resetpsd',
payload: {
info: values,
mobile,
password,
code,
},
});
}
......@@ -59,9 +62,9 @@ class LoginForm extends React.Component {
return;
}
dispatch({
type: 'register/getverifycode',
type: 'newregister/getverifycode',
payload: {
type: 2,
sms_type: 8,
mobile,
dispatch,
},
......@@ -102,7 +105,7 @@ class LoginForm extends React.Component {
}
render() {
const { getFieldDecorator } = this.props.form;
const { counting, countdown } = this.props;
const { counting, countdown, mobile } = this.props;
const { pwdvisible } = this.state;
return (
<div className={`login register ${LoginStyles.logincontainer}`}>
......@@ -151,7 +154,7 @@ class LoginForm extends React.Component {
<Row className={`loginrow ${LoginStyles.verycoderow}`}>
<Col span={16}>
<FormItem>
{getFieldDecorator('verify_code', {
{getFieldDecorator('code', {
rules: [
{ required: true, message: '请输入验证码!' },
{ pattern: /^[0-9]{4}$/, message: '验证码是4位数字验证码' },
......@@ -187,12 +190,15 @@ Login.propTypes = {
};
function mapStateToProps(state) {
const { collapsed } = state.webapp;
const { counting, countdown, gettingVerifyCoding } = state.register;
// eslint-disable-next-line no-empty-pattern
const { mobile } = state.resetpsd;
const { counting, countdown, gettingVerifyCoding } = state.newregister;
return {
collapsed,
counting,
countdown,
gettingVerifyCoding,
mobile,
};
}
export default connect(mapStateToProps)(Login);
......@@ -209,7 +209,7 @@ class SchoolAddForm extends React.Component {
required={false}
key={newIndex}
>
<Input placeholder="请输入联系电话" value={k} onChange={e => this.mobileChange(e, newIndex)} />
<Input maxLength={11} placeholder="请输入联系电话" value={k} onChange={e => this.mobileChange(e, newIndex)} />
{mobile.length > 1 ? (
<Button className={pageStyles.delmobile} type="danger" onClick={() => this.delMobile(newIndex)}>删除</Button>
) : null}
......
......@@ -26,7 +26,7 @@ class StudentMgt extends React.Component {
cage: 0,
qrCodeTitle: '',
avatorUploader: {
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
maxsize: 8192, // 奖品图 片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
......@@ -54,6 +54,22 @@ class StudentMgt extends React.Component {
pageIn('学员管理');
// 初始化地图函数 自定义函数名init
// 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
const { dispatch } = this.props;
const addStudentBtn = document.getElementById('student_addStudent');
if (addStudentBtn) {
dispatch({
type: 'userguide/getposition',
payload: {
page: 'student',
doms: {
addStudentBtn,
menuBtn: document.getElementById('menu_5'),
bindQrcodeBtn: document.getElementById('student_bindQrcode'),
inviteQrcodeBtn: document.getElementById('student_inviteQrcode'),
},
},
});
}
}
componentWillUnmount() { // 卸载
}
......@@ -62,7 +78,10 @@ class StudentMgt extends React.Component {
this.state.cage = toyear - dateString.format('YYYY') || 0;
}
setModal1Visible(visible) {
const { dispatch, schoolUserInfo } = this.props;
const { dispatch, schoolUserInfo, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'students/updateState',
payload: {
......@@ -484,7 +503,10 @@ class StudentMgt extends React.Component {
});
}
bindQrcodeShow = () => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
dispatch({
type: 'students/createBindQrcode',
payload: {
......@@ -522,7 +544,10 @@ class StudentMgt extends React.Component {
});
}
inviteCodeDialogVisible = (visible) => {
const { dispatch } = this.props;
const { dispatch, guideShow } = this.props;
if (guideShow) {
return;
}
// this.setState({
// Inviteloading: true,
// });
......@@ -895,11 +920,9 @@ class StudentMgt extends React.Component {
uploadImgUrl={uploadImgUrl}
/>}
<div className={pageStyle.headerbox}>
{hasBtnPower('sjd/student', 'addStudent') && <Button icon="plus" className={pageStyle.headerbtn} type="primary" onClick={() => this.setModal1Visible(true)}>添加</Button>}
{/* <Button className={pageStyle.headerbtn}>批量操作</Button>
{hasBtnPower('sjd/student', 'enrolCode') && <Button className={pageStyle.headerbtn} onClick={this.toSetSelfJoin}>自助报名二维码</Button>} */}
{hasBtnPower('sjd/student', 'bundlingCode') && <Button id={pageStyle.headerself} className={pageStyle.headerbtn} onClick={this.bindQrcodeShow}>自助绑定二维码</Button>}
{hasBtnPower('sjd/student', 'bundlingCode') && <Button id={pageStyle.headerself} loading={Inviteloading} className={pageStyle.headerbtn} onClick={() => this.inviteCodeDialogVisible(true)}>快捷邀请学员</Button>}
{hasBtnPower('sjd/student', 'addStudent') && <Button icon="plus" id="student_addStudent" className={pageStyle.headerbtn} type="primary" onClick={() => this.setModal1Visible(true)}>添加</Button>}
{hasBtnPower('sjd/student', 'bundlingCode') && <Button id="student_bindQrcode" className={pageStyle.headerbtn} onClick={this.bindQrcodeShow}>自助绑定二维码</Button>}
{hasBtnPower('sjd/student', 'bundlingCode') && <Button id="student_inviteQrcode" loading={Inviteloading} className={pageStyle.headerbtn} onClick={() => this.inviteCodeDialogVisible(true)}>快捷邀请学员</Button>}
<Button icon="download" className={pageStyle.downloadbtn} onClick={() => this.exportExcel(columns)} >导出</Button>
</div>
<div className={pageStyle.search}>
......@@ -1327,6 +1350,9 @@ function mapStateToProps(state) {
const {
schoolUserInfo,
} = state.webapp;
const {
guideShow,
} = state.userguide;
return {
studentsinfo,
addOrUpdateDiaShow,
......@@ -1380,6 +1406,7 @@ function mapStateToProps(state) {
deleteOneVisible,
deleteTabKey,
indexQrcodeTitle,
guideShow,
};
}
export default connect(mapStateToProps)(ForgotPassword);
......
......@@ -56,6 +56,11 @@ class StudentAddForm extends React.Component {
[type]: this.checkData(e.target.value),
});
}
hide = () => {
const { form, hide } = this.props;
form.resetFields();
hide();
}
render() {
const {
visible,
......@@ -72,7 +77,7 @@ class StudentAddForm extends React.Component {
visible={visible}
title="续课"
okText="确定"
onCancel={hide}
onCancel={this.hide}
onOk={this.renewCourse}
centered
width={570}
......@@ -123,6 +128,24 @@ class StudentAddForm extends React.Component {
</span>)}
</Form.Item>
</Col>
{
selectedCourseInfo.course_mode == 1 &&
<Col className={pageStyle.course}>
<Form.Item
label="剩余课时"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
<span>付费课时余额:{selectedCourseInfo.surplus_buy}课时&nbsp;&nbsp;&nbsp;&nbsp;赠送课时余额:{selectedCourseInfo.surplus_give}课时</span>
</Form.Item>
</Col>
}
<Row>
<Col span={16}>
{selectedCourseInfo.course_mode == 1 &&
......
......@@ -103,7 +103,7 @@ class UserSettingForm extends React.Component {
dispatch({
type: 'usersetting/getverifycode',
payload: {
type: 2,
sms_type: 8,
mobile,
dispatch,
},
......@@ -114,11 +114,7 @@ class UserSettingForm extends React.Component {
dispatch, form,
} = this.props;
if (!visible) {
form.setFields({
verifycode: '',
confirmpassword: '',
password: '',
});
form.resetFields();
}
dispatch({
type: 'usersetting/updateState',
......@@ -140,16 +136,19 @@ class UserSettingForm extends React.Component {
const { dispatch, form } = this.props;
form.validateFields((err, values) => {
if (!err) {
const {
mobile,
password,
code,
} = values;
dispatch({
type: 'usersetting/resetpsd',
payload: {
values,
mobile,
password,
code,
callBack: () => {
form.setFields({
verifycode: '',
confirmpassword: '',
password: '',
});
form.resetFields();
},
},
});
......@@ -321,7 +320,7 @@ class UserSettingForm extends React.Component {
>
<Row gutter={8}>
<Col span={15}>
{getFieldDecorator('verify_code', {
{getFieldDecorator('code', {
rules: [
{ required: true, message: '请输入四位数字验证码' },
{ pattern: /^[0-9]{4}$/, message: '验证码是4位数字验证码' },
......
......@@ -220,6 +220,16 @@ const ClassRecord = props => (
{ ClassRecord => (<ClassRecord {...props} />) }
</Bundle>
);
const NewRegister = props => (
<Bundle load={() => import(/* webpackChunkName:"NewRegister" */'./pages/newregister/index')}>
{ NewRegister => (<NewRegister {...props} />) }
</Bundle>
);
const DeploySchool = props => (
<Bundle load={() => import(/* webpackChunkName:"DeploySchool" */'./pages/deployschool/index')}>
{ DeploySchool => (<DeploySchool {...props} />) }
</Bundle>
);
function RouterConfig({ history }) {
return (
<ConfigProvider locale={zhCN}>
......@@ -287,8 +297,9 @@ function RouterConfig({ history }) {
<Route path="/resetpsd" exact component={ResetPsd} />
<Route path="/" exact render={() => (<Redirect to="/login" />)} />
<Route path="/login" exact component={Login} />
<Route path="/register" exact component={Register} />
<Route path="/register" exact component={NewRegister} />
<Route path="/rechargedesc" exact component={RechargeDesc} />
<Route path="/deploySchool/:id" exact component={DeploySchool} />
<Route path="/404" render={() => (<Errorpage />)} />
</Switch>
</Router>
......
......@@ -892,6 +892,46 @@ function voiceTimeFormat(time) {
}
return _time;
}
function caculateCirclePosition(place, params) {
const {
width, height, top, left, right, bottom,
} = params;
const position = {};
switch (place) {
case 'top':
position.top = top - 20;
position.left = (left + (width / 2)) - 8;
position.right = (left + (width / 2)) + 8;
position.bottom = top + 12;
// position.top = '';
break;
case 'right':
position.top = (top + (height / 2)) - 8;
position.left = left + width + 4;
position.right = left + width + 20;
position.bottom = (top + (height / 2)) + 8;
break;
case 'bottom':
position.top = top + height + 4;
position.left = (left + (width / 2)) - 8;
position.right = (left + (width / 2)) + 8;
position.bottom = top + height + 20;
break;
case 'left':
position.top = (top + (height / 2)) - 8;
position.left = left - 20;
position.right = left + 12;
position.bottom = (top + (height / 2)) + 8;
break;
default:
break;
}
position.boxwidth = width;
position.boxheight = height;
position.boxtop = top;
position.boxleft = left;
return position;
}
export {
voiceTimeFormat,
getAudioDuration,
......@@ -941,4 +981,5 @@ export {
getFileType,
pptImagify,
getVideoDuration,
caculateCirclePosition,
};
......@@ -4581,6 +4581,12 @@ image-size@~0.5.0:
version "0.5.5"
resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c"
immutability-helper@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/immutability-helper/-/immutability-helper-3.0.1.tgz#4f609c5afbf8d78cb297970e8af2fba8b0eda1d6"
dependencies:
invariant "^2.2.4"
immutable@^3.7.4:
version "3.8.2"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
......
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