Commit af02c5e2 authored by wangxuelai's avatar wangxuelai

''

parents 19ee4edd 15f9b66b
......@@ -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?1575470194049" charset="utf-8"></script>
<script src="dist/main.js?1575538017286" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -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);
......
......@@ -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',
......
......@@ -167,6 +167,26 @@ export default {
});
}
},
* developSkip({ payload }, { call, put, select }) {
const { schoolId } = yield select(state => state.newregister);
const { sid } = yield select(state => state.webapp);
const data = yield call(newregister.deploySchool, {
school_id: schoolId || sid,
type: 6,
});
if (data.code == 200) {
yield put(routerRedux.push({
pathname: '/sjd/indexstaic',
}));
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* goHome({ payload }, { put }) {
yield put(routerRedux.push({
pathname: '/sjd/indexstaic',
......
......@@ -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 }) {
......
......@@ -1174,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',
......
import React from 'react';
import { connect } from 'dva';
import { Row, Col, Form, Input, Button, Icon, Select, Cascader, message, Modal } from 'antd';
import { withRouter, Link } from 'dva/router';
import pageStyle from './index.less';
import { LocalStorage, SessionStorage, pageIn } from '../../utils/index';
const { TextArea } = Input;
......@@ -82,6 +83,14 @@ class DeploySchoolForm extends React.Component {
},
});
}
handleSkip = () => {
const { dispatch } = this.props;
dispatch({
type: 'newregister/developSkip',
payload: {
},
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
......@@ -125,8 +134,8 @@ class DeploySchoolForm extends React.Component {
<div className={pageStyle.typeImg}>
<img className={pageStyle.img} src={`${__IMGCDN__}${item.img}`} alt="" />
{
deployType === Number(item.id) ? <img className={pageStyle.checkImg} src={`${__IMGCDN__}/developschool/checked.png`} alt="" />
: <img className={pageStyle.checkImg} src={`${__IMGCDN__}/developschool/un_checked.png`} alt="" />
deployType === Number(item.id) ? <img className={pageStyle.checkImg} src={`${__IMGCDN__}developschool/checked.png`} alt="" />
: <img className={pageStyle.checkImg} src={`${__IMGCDN__}developschool/un_checked.png`} alt="" />
}
</div>
<div className={pageStyle.typeSize}>{item.title}</div>
......@@ -135,7 +144,8 @@ class DeploySchoolForm extends React.Component {
})
}
</div>
<Button type="primary" className={pageStyle.createBtn} onClick={this.handleClick}>一键部署(80999位校长已部署)</Button>
<Button type="primary" className={pageStyle.createBtn} onClick={this.handleClick}>一键部署(30899位校长已部署)</Button>
<div className={pageStyle.skip} onClick={this.handleSkip}>跳过</div>
<Modal
visible={deployVisible}
onOk={this.handlePositionOk}
......
......@@ -307,3 +307,13 @@
width: 630px;
}
}
.skip {
font-size:16px;
font-family:PingFang SC;
font-weight:400;
color:rgba(99,99,99,1);
line-height:48px;
text-align: center;
margin-top: 45px;
cursor: pointer;
}
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';
const { TabPane } = Tabs;
const FormItem = Form.Item;
class QxLoginForm extends React.Component {
constructor(props) {
super(props);
this.state = {
qxLoginType: 'psd',
qxpwdvisible: false,
};
}
componentDidMount() {
pageIn('轻校-登录页面');
}
componentWillUnmount() {
const { dispatch } = this.props;
dispatch({
type: 'register/unloadstate',
});
}
handleQxSubmit = (e) => {
const { dispatch } = this.props;
const { qxLoginType } = this.state;
e.preventDefault();
this.props.form.validateFields((err, values) => {
const {
mobile, code, needlogin, password,
} = values;
if (!err) {
if (qxLoginType == 'verifycode') {
dispatch({
type: 'login/qxLogin',
payload: {
mobile,
code,
type: 'verify',
needlogin: true,
},
});
} else if (qxLoginType == 'psd') {
dispatch({
type: 'login/qxLogin',
payload: {
mobile,
type: 'pwd',
password,
needlogin: true,
},
});
}
}
});
}
sendCode = () => {
const {
dispatch, form, gettingVerifyCoding, counting,
} = this.props;
if (gettingVerifyCoding || counting) {
return;
}
const mobile = form.getFieldValue('mobile');
if (mobile === undefined) {
message.error('请输入手机号', 1);
return;
}
if (!/^1[345789]{1}[0-9]{9}$/.test(mobile)) {
message.error('请输入正确的手机号', 1);
return;
}
dispatch({
type: 'newregister/getverifycode',
payload: {
sms_type: 6,
mobile,
dispatch,
},
});
}
goResetPsd = () => {
const { dispatch } = this.props;
dispatch({
type: 'login/goresetpsd',
});
}
qxpwdcansee = () => {
this.setState({
qxpwdvisible: !this.state.qxpwdvisible,
});
}
qxGoPwdLogin = () => {
this.setState({
qxLoginType: 'psd',
});
}
qxGoVerifyLogin = () => {
this.setState({
qxLoginType: 'verifycode',
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
qxLoginType, qxpwdvisible,
} = this.state;
const {
locationQuery, qxLoading, countdown, counting,
} = this.props;
return (
<div>
<div className={LoginStyles.businessloginbox}>
<Form onSubmit={this.handleQxSubmit} 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>
{qxLoginType == 'verifycode' &&
<Row className={`loginrow ${LoginStyles.verycoderow}`}>
<Col span={16}>
<FormItem>
{getFieldDecorator('code', {
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.sendCode}>{counting ? `${countdown}秒后重新获取` : '获取验证码'}</div>
</Col>
</Row>
}
{qxLoginType == 'psd' &&
<Row className={`loginrow ${LoginStyles.verycoderow}`}>
<Col span={20}>
<FormItem>
{getFieldDecorator('password', {
rules: [
{ required: qxLoginType == 'psd', message: '请输入您的密码!' },
{ pattern: /^[a-zA-Z0-9]{6,20}$/, message: '密码格式不正确(6-20位字母和数字组合)!' },
],
})(
<Input className="no_border" type={!qxpwdvisible ? 'password' : 'text'} autoComplete="off" placeholder="请输入密码" />,
)}
</FormItem>
</Col>
<Col span={4} className={LoginStyles.eyebox} onClick={() => this.qxpwdcansee()}>
{qxpwdvisible && <img src={`${__IMGCDN__}eyeopen.png`} alt="" className={LoginStyles.eyeopen} />}
{!qxpwdvisible && <img src={`${__IMGCDN__}eyeclose.png`} alt="" className={LoginStyles.eyeclose} />}
</Col>
</Row>
}
<FormItem className="loginrow">
{qxLoginType == 'verifycode' && <div className={LoginStyles.loginformforgot} onClick={this.qxGoPwdLogin}>密码登录</div>}
{qxLoginType == 'psd' &&
<div className={LoginStyles.loginformforgotbox}>
<div onClick={this.qxGoVerifyLogin}>验证码登录</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={qxLoading}>
{qxLoading ? '登录中...' : '登录'}
</Button>
</div>
</FormItem>
</Form>
<div className={LoginStyles.registerbox}>
<div className={LoginStyles.noaccount}>还没有账号?</div>
<Link className={LoginStyles.goregister} to="/register" target="_blank">去注册</Link>
</div>
</div>
</div>
);
}
}
const QxLogin = Form.create()(QxLoginForm);
QxLogin.propTypes = {
};
function mapStateToProps(state) {
const { collapsed, locationQuery } = state.webapp;
const {
countdown, counting, gettingVerifyCoding,
} = state.newregister;
const {
qxLoading, tabtype, teacherLoginQrcode,
} = state.login;
return {
collapsed, locationQuery, qxLoading, countdown, counting, tabtype, teacherLoginQrcode, gettingVerifyCoding,
};
}
export default connect(mapStateToProps)(QxLogin);
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';
const { TabPane } = Tabs;
const FormItem = Form.Item;
class SjdLoginForm extends React.Component {
constructor(props) {
super(props);
this.state = {
pwdvisible: false,
loginType: 'psd',
};
}
componentDidMount() {
pageIn('轻校-登录页面');
}
componentWillUnmount() {
const { dispatch } = this.props;
dispatch({
type: 'register/unloadstate',
});
}
handleSubmit = (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) {
if (loginType == 'verifycode') {
dispatch({
type: 'login/sjdLogin',
payload: {
mobile,
verifycode,
type: 'verify',
needlogin: true,
},
});
} else if (loginType == 'psd') {
dispatch({
type: 'login/sjdLogin',
payload: {
mobile,
type: 'pwd',
password,
needlogin: true,
},
});
}
}
});
}
sendVerifyCode = () => {
const {
dispatch, form, gettingVerifyCoding, counting,
} = this.props;
if (gettingVerifyCoding || counting) {
return;
}
const mobile = form.getFieldValue('mobile');
if (mobile === undefined) {
message.error('请输入手机号', 1);
return;
}
if (!/^1[345789]{1}[0-9]{9}$/.test(mobile)) {
message.error('请输入正确的手机号', 1);
return;
}
dispatch({
type: 'register/getverifycode',
payload: {
type: 5,
mobile,
dispatch,
},
});
}
goResetPsd = () => {
const { dispatch } = this.props;
dispatch({
type: 'login/goresetpsd',
});
}
goPwdLogin = () => {
this.setState({
loginType: 'psd',
});
}
goVerifyLogin = () => {
this.setState({
loginType: 'verifycode',
});
}
generateIcon = (name) => {
return <i className={`${name} bg_icon`} />;
}
tabshift = (type) => {
const { dispatch } = this.props;
dispatch({
type: 'login/tabshift',
payload: {
type,
},
});
}
pwdcansee = () => {
this.setState({
pwdvisible: !this.state.pwdvisible,
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
pwdvisible, loginType,
} = this.state;
const {
locationQuery, logining, countdown, counting, tabtype,
} = this.props;
return (
<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>
<Link className={LoginStyles.goregister} to="/register" target="_blank">去注册</Link>
</div>
</div>}
</div>
);
}
}
const SjdLogin = Form.create()(SjdLoginForm);
SjdLogin.propTypes = {
};
function mapStateToProps(state) {
const { collapsed, locationQuery } = state.webapp;
const {
countdown, counting, gettingVerifyCoding,
} = state.register;
const { logining, tabtype, teacherLoginQrcode } = state.login;
return {
collapsed, locationQuery, logining, countdown, counting, tabtype, teacherLoginQrcode, gettingVerifyCoding,
};
}
export default connect(mapStateToProps)(SjdLogin);
......@@ -4,15 +4,18 @@ 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() {
......@@ -82,12 +85,6 @@ class LoginForm extends React.Component {
},
});
}
goRegister = () => {
const { dispatch } = this.props;
dispatch({
type: 'login/goregister',
});
}
goResetPsd = () => {
const { dispatch } = this.props;
dispatch({
......@@ -121,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}`}>
......@@ -141,100 +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>
<Link className={LoginStyles.goregister} to="/register" target="_blank">去注册</Link>
{/* <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,27 @@
.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;
&:first-child {
margin-right: 150px;
}
}
}
}
.sjd_logo{
text-align: center;
......@@ -66,7 +87,7 @@
max-width: 400px;
margin-bottom: 20px;
margin: 0 auto;
padding-top: 48px;
padding-top: 10px;
}
.loginformforgot {
color: #22B8FF;
......@@ -81,7 +102,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 +323,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}
......
......@@ -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位数字验证码' },
......
......@@ -27,3 +27,12 @@ export function deploySchool(params) {
data,
});
}
export function forgetPassword(params) {
const data = qs.stringify(params);
return request({
url: `${api.newRegister.forget_password}`,
method: 'POST',
data,
needAuth: false,
});
}
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