Commit f11f305f authored by wangxuelai's avatar wangxuelai

''

parent f59bb835
......@@ -22,6 +22,7 @@ export default {
myNickname: `${dakaapi}member/me`,
schedulesTime: `${dakaapi}member/erp/schedules_time`,
courseTemplate: `${dakaapi}member/erp/course_template`,
erpVerifyCode: `${dakaapi}common/sms`,
newLogin: {
loginPost: `${dakaapi}common/business_login`,
},
......
......@@ -121,6 +121,7 @@ export default {
give: '',
class_ids: '',
},
studentAvator: '',
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -426,7 +427,7 @@ export default {
},
* studentsAdd({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
const { studentSubmiting } = yield select(state => state.students);
const { studentSubmiting, studentAvator } = yield select(state => state.students);
if (!sid) {
return;
}
......@@ -461,7 +462,7 @@ export default {
school_id: sid,
name,
birthday,
avatar,
avatar: studentAvator,
remark,
mobile,
reservemobile,
......@@ -739,6 +740,15 @@ export default {
message.error(delData.msg, 1);
}
},
* updateStudentAvatar({ payload }, { call, put, select }) {
const { avatar } = payload;
yield put({
type: 'updateState',
payload: {
studentAvator: avatar,
},
});
},
},
reducers: {
save(state, action) {
......
......@@ -265,6 +265,7 @@ export default {
payload: {
studentsdetail: studentsdetail.data,
datetime: studentsdetail.datetime,
studentAvator: studentsdetail.data.avatar || '',
},
});
} else {
......@@ -281,7 +282,7 @@ export default {
* studentsPut({ payload }, { call, put, select }) {
const { id } = payload;
const { sid } = yield select(state => state.webapp);
const { studentSubmiting, studentId } = yield select(state => state.studentsinfo);
const { studentSubmiting, studentId, studentAvator } = yield select(state => state.studentsinfo);
if (!sid) {
return;
}
......@@ -310,7 +311,7 @@ export default {
school_id: sid,
name,
birthday,
avatar,
avatar: studentAvator,
remark,
mobile,
reserve_mobile,
......@@ -453,6 +454,15 @@ export default {
message.error(studentsLogsData.msg, 1);
}
},
* updateStudentAvatar({ payload }, { call, put, select }) {
const { avatar } = payload;
yield put({
type: 'updateState',
payload: {
studentAvator: avatar,
},
});
},
},
reducers: {
save(state, action) {
......
......@@ -214,6 +214,20 @@ export default {
avatar: `${filename}?x-oss-process=${cropperUrl}`,
},
});
} else if (uploadtype == 'studentAvatorupload') {
yield put({
type: 'students/updateStudentAvatar',
payload: {
avatar: `${filename}?x-oss-process=${cropperUrl}`,
},
});
} else if (uploadtype == 'studenedittAvatorupload') {
yield put({
type: 'studentsinfo/updateStudentAvatar',
payload: {
avatar: `${filename}?x-oss-process=${cropperUrl}`,
},
});
}
},
* unloadstates({ payload }, { call, put }) { // 释放该页面存储的所有状态
......
......@@ -10,6 +10,7 @@ import {
getRandomFilename,
} from '../utils/index';
import * as usersettingajax from '../services/usersetting';
import * as commonAjax from '../services/common';
import * as register from '../services/register';
import errorcode from '../common/errorcode';
export default {
......@@ -29,6 +30,13 @@ export default {
gettingVerifyCoding: false, // 防止获取验证码重复提交
resetPsdDiaShow: false,
resetPsdSubmitting: false,
bindWxShow: false,
erpCounting: false,
erpCountdown: 60,
gettingErpVerifyCoding: false,
erptimer: null,
previewQrcodeShow: false,
previewQrcode: '',
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -75,7 +83,7 @@ export default {
clearInterval(setTimer);
}
payload.dispatch({
type: 'updateState',
type: 'usersetting/updateState',
payload: {
countdown: newCountdowm,
counting: newCounting,
......@@ -167,6 +175,93 @@ export default {
* goback({ payload }, { call, put, select }) {
yield put(routerRedux.goBack());
},
* sendErpVerifyCode({ payload }, { call, put, select }) {
const {
erpCountdown, erpCounting, gettingErpVerifyCoding, erptimer,
} = yield select(state => state.usersetting);
const { mobile, sms_type } = payload;
let newCountdowm = erpCountdown;
let newCounting = erpCounting;
if (gettingErpVerifyCoding) {
return;
}
yield put({
type: 'updateState',
payload: {
gettingErpVerifyCoding: true,
erpCounting: false,
},
});
const verifycodehide = message.loading('正在获取验证码....', 0);
const data = yield call(commonAjax.getErpVerifyCode, { mobile, sms_type });
if (data.code == 200) {
setTimeout(verifycodehide);
message.success('验证码获取成功', 1);
yield put({
type: 'updateState',
payload: {
gettingErpVerifyCoding: false,
},
});
newCounting = true;
yield put({
type: 'updateState',
payload: {
erpCounting: newCounting,
},
});
const setTimer = setInterval(() => {
newCountdowm--;
if (newCountdowm <= 0) {
newCountdowm = 60;
newCounting = false;
clearInterval(setTimer);
}
payload.dispatch({
type: 'usersetting/updateState',
payload: {
erpCountdown: newCountdowm,
erpCounting: newCounting,
erptimer: setTimer,
},
});
}, 1000);
} else {
setTimeout(verifycodehide);
yield put({
type: 'updateState',
payload: {
gettingErpVerifyCoding: false,
erpCounting: false,
erpCountdown: 60,
},
});
message.error(errorcode[data.code] && errorcode[data.code].cn, 1);
}
},
* createQrcode({ payload }, { call, put, select }) {
const { mobile, callBack } = payload;
const qrcodeData = yield call(commonAjax.generateQrcode, {
scene: mobile,
page: 'src/pages/websiteindex/index',
});
if (qrcodeData.code == 200) {
message.success('小程序码生成成功', 1);
yield put({
type: 'updateState',
payload: {
bindWxShow: false,
previewQrcodeShow: true,
previewQrcode: qrcodeData.data.url,
},
});
if (callBack && (typeof callBack == 'function')) {
callBack();
}
} else {
message.error('小程序码生成失败', 1);
}
},
},
reducers: {
save(state, action) {
......
......@@ -3,7 +3,7 @@ import React from 'react';
import { Icon, Button, Row, Col, Input, InputNumber, Select, Checkbox, Table, Modal, Form, Alert, DatePicker } from 'antd';
import moment from 'moment';
import pageStyle from './StudentAdd.less';
import { pageIn } from '../../utils/index';
import { pageIn, imagify } from '../../utils/index';
const { Option } = Select;
const { TextArea } = Input;
......@@ -129,6 +129,13 @@ class StudentAddForm extends React.Component {
const { datetime } = this.props;
return current && current > moment(datetime, 'YYYY-MM-DD');
}
uploadAvator = (e) => {
const { uploadAvator } = this.props;
uploadAvator({
files: e.target,
uploadtype: 'studentAvatorupload',
});
}
render() {
const {
visible,
......@@ -137,6 +144,7 @@ class StudentAddForm extends React.Component {
operator,
teacherList,
toChangeOperator,
studentAvator,
} = this.props;
const {
usefulClassList, modeType, modeTypeArr,
......@@ -210,8 +218,11 @@ class StudentAddForm extends React.Component {
</Col>
</Col>
<Col sm={{ span: 8 }} style={{ textAlign: 'center' }}>
<img className={pageStyle.avatar} src="https://wx.qlogo.cn/mmopen/vi_32/GY0ZvN3sdDsic3MyuFVfmnu9buGSH0EfMhjD8wsH9QwtcQQYQCkAew6xwgPqsmmEbc0456rY7o5gPiah5rrL4ySA/132" alt="1" />
<span>上传头像</span>
<img className={pageStyle.avatar} src={imagify(studentAvator) || 'https://wx.qlogo.cn/mmopen/vi_32/GY0ZvN3sdDsic3MyuFVfmnu9buGSH0EfMhjD8wsH9QwtcQQYQCkAew6xwgPqsmmEbc0456rY7o5gPiah5rrL4ySA/132'} alt="1" />
<span style={{ position: 'relative' }}>
<input type="file" id="uploadinput" className={pageStyle.fileuploadinput} onChange={(e) => { this.uploadAvator(e); }} accept="image/*" />
上传头像
</span>
</Col>
</Row>
</div>
......
......@@ -11,6 +11,15 @@
.changeOperate {
margin-left: 10px;
}
.fileuploadinput {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
:global {
.addstudentcontent {
.ant-form-item {
......
......@@ -8,11 +8,34 @@ import OperatorChange from '../../components/operatorChange';
import EliminateEdit from './eliminateEdit';
import SelfJoin from './SelfJoin';
import StudentAdd from './StudentAdd';
import Cropper from '../../components/Cropper';
const { Option } = Select;
const { TextArea } = Input;
class StudentMgt extends React.Component {
state = {
cage: 0,
avatorUploader: {
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
dragMode: 'move',
viewMode: 1,
aspectRatio: 1,
autoCropArea: 0.8,
guides: !1,
center: !0,
highlight: !1,
dragCrop: !1,
cropBoxMovable: !1,
cropBoxResizable: !1,
zoom: -0.2,
checkImageOrigin: !0,
background: !1,
rotatable: !0,
},
},
},
};
componentDidMount() { // 挂载
pageIn('学员管理');
......@@ -367,6 +390,40 @@ class StudentMgt extends React.Component {
},
});
}
uploadStudentAvator = ({ files, uploadtype }) => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/queryimgsignature',
payload: {
files,
avatorUploader: this.state.avatorUploader,
uploadtype,
},
});
}
getCropperUrl = (url) => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/updateState',
payload: {
cropperUrl: url,
},
});
}
cancelCropper = () => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/cancelcropper',
});
}
sureCropper = () => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/surecropper',
payload: {
},
});
}
// 自主报名相关代码
render() {
const { getFieldDecorator } = this.props.form;
......@@ -398,6 +455,10 @@ class StudentMgt extends React.Component {
courseModuleTotal,
courseModuleList,
courseModuleInfo,
cropperboxShow,
uploadImgUrl,
avatorUploader,
studentAvator,
} = this.props;
const columns = [
{
......@@ -496,6 +557,13 @@ class StudentMgt extends React.Component {
];
return (
<div className={`${pageStyle.container} container`}>
{cropperboxShow && <Cropper
avatorUploader={this.state.avatorUploader}
cancelCropper={this.cancelCropper}
getCropperUrl={this.getCropperUrl}
sureCropper={this.sureCropper}
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> */}
......@@ -652,6 +720,8 @@ class StudentMgt extends React.Component {
operator={operator} // 默认操作人
hide={() => this.setModal1Visible(false)}
toChangeOperator={this.toChangeOperator}
uploadAvator={this.uploadStudentAvator}
studentAvator={studentAvator}
/>
<OperatorChange
teacherList={teacherList}
......@@ -687,6 +757,11 @@ StudentMgt.propTypes = {
};
function mapStateToProps(state) {
const {
cropperboxShow,
uploadImgUrl,
avatorUploader,
} = state.uploader;
const {
studentsinfo,
addOrUpdateDiaShow,
......@@ -713,6 +788,7 @@ function mapStateToProps(state) {
courseModuleTotal,
courseModuleList,
courseModuleInfo,
studentAvator,
} = state.students;
const {
schoolUserInfo,
......@@ -744,6 +820,10 @@ function mapStateToProps(state) {
courseModuleTotal,
courseModuleList,
courseModuleInfo,
cropperboxShow,
uploadImgUrl,
avatorUploader,
studentAvator,
};
}
export default connect(mapStateToProps)(ForgotPassword);
......
......@@ -3,7 +3,7 @@ import React from 'react';
import { Icon, Button, Row, Col, Input, InputNumber, Select, Checkbox, Table, Modal, Form, Alert, DatePicker } from 'antd';
import moment from 'moment';
import pageStyle from './StudentEdit.less';
import { pageIn } from '../../utils/index';
import { pageIn, imagify } from '../../utils/index';
const { Option } = Select;
const { TextArea } = Input;
......@@ -76,15 +76,22 @@ class StudentAddForm extends React.Component {
}
disabledDate = (current) => {
const { datetime } = this.props;
console.log(datetime, 'datetime');
return current && current > moment(datetime, 'YYYY-MM-DD');
}
uploadAvator = (e) => {
const { uploadAvator } = this.props;
uploadAvator({
files: e.target,
uploadtype: 'studenedittAvatorupload',
});
}
render() {
const {
visible,
hide,
studentsdetail,
studentSubmiting,
studentAvator,
} = this.props;
const { modeType, modeTypeArr } = this.state;
const { getFieldDecorator } = this.props.form;
......@@ -156,8 +163,11 @@ class StudentAddForm extends React.Component {
</Col>
</Col>
<Col sm={{ span: 8 }} style={{ textAlign: 'center' }}>
<img className={pageStyle.avatar} src="https://wx.qlogo.cn/mmopen/vi_32/GY0ZvN3sdDsic3MyuFVfmnu9buGSH0EfMhjD8wsH9QwtcQQYQCkAew6xwgPqsmmEbc0456rY7o5gPiah5rrL4ySA/132" alt="1" />
<span>上传头像</span>
<img className={pageStyle.avatar} src={imagify(studentAvator) || 'https://wx.qlogo.cn/mmopen/vi_32/GY0ZvN3sdDsic3MyuFVfmnu9buGSH0EfMhjD8wsH9QwtcQQYQCkAew6xwgPqsmmEbc0456rY7o5gPiah5rrL4ySA/132'} alt="1" />
<span style={{ position: 'relative' }}>
<input type="file" id="uploadinput" className={pageStyle.fileuploadinput} onChange={(e) => { this.uploadAvator(e); }} accept="image/*" />
上传头像
</span>
</Col>
</Row>
</div>
......
......@@ -7,4 +7,13 @@
justify-content:center;
text-align: center;
margin:-5px auto 5px;
}
.fileuploadinput {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
\ No newline at end of file
......@@ -3,10 +3,11 @@ import React from 'react';
import moment from 'moment';
import { Icon, Button, Row, Col, Tabs, Select, Descriptions, InputNumber, DatePicker, Form, Timeline, Avatar, Card, Table, Modal, Input, Pagination } from 'antd';
import pageStyle from './index.less';
import { pageIn, hasBtnPower } from '../../utils/index';
import { pageIn, hasBtnPower, imagify } from '../../utils/index';
import StudentEdit from './StudentEdit';
import ChangeCourse from './ChangeCourse';
import OperatorChange from '../../components/operatorChange';
import Cropper from '../../components/Cropper';
import Renew from './Renew';
const { confirm } = Modal;
const { Option } = Select;
......@@ -16,6 +17,28 @@ const { TabPane } = Tabs;
class StudentMgt extends React.Component {
state = {
teacherVisible: false,
avatorUploader: {
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
dragMode: 'move',
viewMode: 1,
aspectRatio: 1,
autoCropArea: 0.8,
guides: !1,
center: !0,
highlight: !1,
dragCrop: !1,
cropBoxMovable: !1,
cropBoxResizable: !1,
zoom: -0.2,
checkImageOrigin: !0,
background: !1,
rotatable: !0,
},
},
},
};
componentDidMount() { // 挂载
pageIn('学员详情管理');
......@@ -291,6 +314,40 @@ class StudentMgt extends React.Component {
},
});
}
uploadStudentAvator = ({ files, uploadtype }) => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/queryimgsignature',
payload: {
files,
avatorUploader: this.state.avatorUploader,
uploadtype,
},
});
}
getCropperUrl = (url) => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/updateState',
payload: {
cropperUrl: url,
},
});
}
cancelCropper = () => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/cancelcropper',
});
}
sureCropper = () => {
const { dispatch } = this.props;
dispatch({
type: 'uploader/surecropper',
payload: {
},
});
}
render() {
const {
studentsdetail,
......@@ -319,6 +376,10 @@ class StudentMgt extends React.Component {
teacherList,
changeOperatorShow,
datetime,
cropperboxShow,
uploadImgUrl,
avatorUploader,
studentAvator,
} = this.props;
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY/MM/DD';
......@@ -516,6 +577,13 @@ class StudentMgt extends React.Component {
}
return (
<div className={pageStyle.container}>
{cropperboxShow && <Cropper
avatorUploader={this.state.avatorUploader}
cancelCropper={this.cancelCropper}
getCropperUrl={this.getCropperUrl}
sureCropper={this.sureCropper}
uploadImgUrl={uploadImgUrl}
/>}
<Modal
visible={this.state.teacherVisible}
okText="确定"
......@@ -542,7 +610,7 @@ class StudentMgt extends React.Component {
<div className={pageStyle.searchbox}>
<Row className={pageStyle.settingcontent}>
<Col xs={{ span: 12 }} sm={{ span: 5 }} lg={{ span: 5 }} xl={{ span: 3 }} xxl={{ span: 2 }} className={pageStyle.avatarbox}>
<img className={pageStyle.avatar} src="https://wx.qlogo.cn/mmopen/vi_32/GY0ZvN3sdDsic3MyuFVfmnu9buGSH0EfMhjD8wsH9QwtcQQYQCkAew6xwgPqsmmEbc0456rY7o5gPiah5rrL4ySA/132" alt="1" />
<img className={pageStyle.avatar} src={imagify(studentsdetail.avatar) || 'https://wx.qlogo.cn/mmopen/vi_32/GY0ZvN3sdDsic3MyuFVfmnu9buGSH0EfMhjD8wsH9QwtcQQYQCkAew6xwgPqsmmEbc0456rY7o5gPiah5rrL4ySA/132'} alt="1" />
</Col>
<Col xs={{ span: 12 }} sm={{ span: 19 }} lg={{ span: 19 }} xl={{ span: 16 }} xxl={{ span: 12 }}>
<Descriptions>
......@@ -691,6 +759,8 @@ class StudentMgt extends React.Component {
save={this.saveStudentInfo}
studentSubmiting={studentSubmiting}
datetime={datetime}
uploadAvator={this.uploadStudentAvator}
studentAvator={studentAvator}
/>
<OperatorChange
teacherList={teacherList}
......@@ -743,6 +813,7 @@ function mapStateToProps(state) {
operator,
teacherList,
datetime,
studentAvator,
} = state.studentsinfo;
const {
courseList,
......@@ -750,6 +821,11 @@ function mapStateToProps(state) {
const {
schoolUserInfo,
} = state.webapp;
const {
cropperboxShow,
uploadImgUrl,
avatorUploader,
} = state.uploader;
return {
studentsdetail,
studentid,
......@@ -778,6 +854,10 @@ function mapStateToProps(state) {
teacherList,
schoolUserInfo,
datetime,
cropperboxShow,
uploadImgUrl,
avatorUploader,
studentAvator,
};
}
export default connect(mapStateToProps)(ForgotPassword);
......
import React from 'react';
import { connect } from 'dva';
import { Row, Col, Modal, Form, Input, Button, message } from 'antd';
import pageStyles from './BindWx.less';
import Cropper from '../../components/Cropper';
import { pageIn, imagify } from '../../utils/index';
const { Search } = Input;
const FormItem = Form.Item;
class UserSettingForm extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
componentDidMount() {
}
componentWillUnmount() {
const { dispatch } = this.props;
}
sureBindWx = () => {
const { form, bindWxPost } = this.props;
form.validateFields((err, values) => {
if (!err) {
bindWxPost(values, () => {
form.resetFields();
});
}
});
}
onCancel = () => {
const { form, onCancel } = this.props;
form.resetFields();
onCancel(false);
}
render() {
const {
visible,
userInfo,
erpCounting,
erpCountdown,
sendVerifyCode,
onCancel,
previewQrcodeShow,
previewQrcode,
closeQrcodeShow,
} = this.props;
const { getFieldDecorator } = this.props.form;
return (
<div>
<Modal
visible={visible}
title="重置密码"
okText="保存"
zIndex={110}
onOk={this.sureBindWx}
// confirmLoading={resetPsdSubmitting}
onCancel={this.onCancel}
maskClosable={false}
width="540px"
>
<div style={{ width: 300, margin: '0 auto 20px', fontSize: '14px' }}>身份验证: 验证码将发送到超级管理员绑定的手机号({userInfo.mobile}),请注意查收</div>
<div style={{ width: 300, margin: '0 auto' }}>
<Form className="modalform" labelAlign="left">
<Form.Item>
<Row gutter={8}>
<Col span={15}>
{getFieldDecorator('verify_code', {
rules: [
{ required: true, message: '请输入四位数字验证码' },
{ pattern: /^[0-9]{4}$/, message: '验证码是4位数字验证码' },
],
})(<Input type="text" maxLength={4} placeholder="请输入验证码" />)}
</Col>
<Col span={9} style={{ color: '#1890FF', cursor: 'pointer', fontSize: '14px' }}>
<div className={`${pageStyles.verycodebtn} ${erpCounting ? pageStyles.verycodebtndisable : ''}`} onClick={sendVerifyCode}>{erpCounting ? `${erpCountdown}秒后重新获取` : '发送验证码'}</div>
</Col>
</Row>
</Form.Item>
</Form>
</div>
</Modal>
<Modal
visible={previewQrcodeShow}
footer={null}
onCancel={closeQrcodeShow}
title={<div style={{ textAlign: 'center', fontWeight: 700 }}>扫描二维码绑定微信号</div>}
>
<img
alt=""
src={imagify(previewQrcode)}
style={{
width: 200,
height: 200,
display: 'block',
margin: '0 auto',
}}
/>
</Modal>
</div>
);
}
}
UserSettingForm.propTypes = {
};
const UserSetting = Form.create()(UserSettingForm);
function mapStateToProps(state) {
const {
cropperboxShow,
uploadImgUrl,
avatorUploader,
} = state.uploader;
const {
userInfo,
} = state.webapp;
const {
counting,
countdown,
gettingVerifyCoding,
resetPsdDiaShow,
resetPsdSubmitting,
bindWxShow,
} = state.usersetting;
return {
cropperboxShow,
resetPsdDiaShow,
uploadImgUrl,
avatorUploader,
userInfo,
gettingVerifyCoding,
counting,
countdown,
resetPsdSubmitting,
bindWxShow,
};
}
export default connect(mapStateToProps)(UserSetting);
@import '../../less/variables.less';
.container {
min-height: 100vh;
background-color: #F0F2F5;
}
.header {
background-color: #fff;
color: #000000;
font-size: 14px;
padding-left: 32px;
line-height: 64px;
}
.content {
padding: 23px 25px 33px;
}
.settingbox {
background-color: #fff;
border-radius: 2px;
min-height: 800px;
}
.titlebox {
line-height: 55px;
border-bottom: 1px solid #E9E9E9;
padding-left: 32px;
padding-right: 23px;
line-height: 54px;
color: #000;
font-weight: 600;
font-size: 16px;
margin-bottom: 50px;
display: flex;
justify-content: space-between;
align-items: center;
}
.settingcontent {
padding: 0 32px 20px;
}
.avatarbox {
text-align: center;
margin-bottom: 37px;
}
.avatar {
display: block;
width: 86px;
height: 86px;
border-radius: 50%;
margin: 0 auto 16px;
}
.uploadbtn {
display: inline-block;
cursor: pointer;
margin: 0 auto;
color: #1890FF;
font-size: 16px;
line-height: 1;
position: relative;
cursor: pointer;
}
.infoline {
text-align: center;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
.infooperate {
width: 60px;
text-align: right;
color: #108EE9;
font-size: 14px;
cursor: pointer;
}
.infodetail {
text-align: left;
width: 237px;
font-size: 14px;
color: #000;
}
.fileuploadinput {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
@media (max-width: 768px){
.content {
padding: 23px 8px 33px;
}
.userinfo {
padding: 32px 8px 32px;
}
.titlebox {
padding-left: 8px;
padding-right: 8px;
}
.schoollist {
padding: 0 8px 20px;
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import React from 'react';
import { connect } from 'dva';
import { Row, Col, Modal, Form, Input, Button, message } from 'antd';
import pageStyles from './index.less';
import BindWx from './BindWx';
import Cropper from '../../components/Cropper';
import { pageIn, imagify } from '../../utils/index';
const { Search } = Input;
......@@ -101,7 +102,7 @@ class UserSettingForm extends React.Component {
type: 'usersetting/getverifycode',
payload: {
type: 2,
mobile: 13095705152,
mobile,
dispatch,
},
});
......@@ -124,6 +125,15 @@ class UserSettingForm extends React.Component {
},
});
}
BindWxDiaVisible = (visible) => {
const { dispatch } = this.props;
dispatch({
type: 'usersetting/updateState',
payload: {
bindWxShow: visible,
},
});
}
resetPsd = () => {
const { dispatch, form } = this.props;
form.validateFields((err, values) => {
......@@ -144,6 +154,44 @@ class UserSettingForm extends React.Component {
}
});
}
bindWxPost = (values, callBack) => {
const { dispatch, userInfo, form } = this.props;
dispatch({
type: 'usersetting/createQrcode',
payload: {
mobile: userInfo.mobile,
callBack,
},
});
}
closeQrcodeShow = () => {
const { dispatch } = this.props;
dispatch({
type: 'usersetting/updateState',
payload: {
previewQrcodeShow: false,
},
});
}
sendBindWxVerifyCode = () => {
const {
dispatch,
userInfo,
erpCounting,
gettingErpVerifyCoding,
} = this.props;
if (gettingErpVerifyCoding || erpCounting) {
return;
}
dispatch({
type: 'usersetting/sendErpVerifyCode',
payload: {
sms_type: 1,
mobile: userInfo.mobile,
dispatch,
},
});
}
render() {
const {
cropperboxShow,
......@@ -154,6 +202,11 @@ class UserSettingForm extends React.Component {
countdown,
resetPsdDiaShow,
resetPsdSubmitting,
bindWxShow,
erpCounting,
erpCountdown,
previewQrcodeShow,
previewQrcode,
} = this.props;
const { getFieldDecorator } = this.props.form;
return (
......@@ -184,7 +237,7 @@ class UserSettingForm extends React.Component {
</div>
<div className={pageStyles.infoline}>
<div className={pageStyles.infodetail}>绑定微信:&nbsp;&nbsp;未绑定</div>
<div className={pageStyles.infooperate}>立即绑定</div>
<div className={pageStyles.infooperate} onClick={() => this.BindWxDiaVisible(true)}>立即绑定</div>
</div>
</Row>
</Row>
......@@ -297,6 +350,18 @@ class UserSettingForm extends React.Component {
</Form.Item>
</Form>
</Modal>
<BindWx
visible={bindWxShow}
userInfo={userInfo}
erpCounting={erpCounting}
erpCountdown={erpCountdown}
sendVerifyCode={this.sendBindWxVerifyCode}
onCancel={() => this.BindWxDiaVisible(false)}
bindWxPost={this.bindWxPost}
previewQrcodeShow={previewQrcodeShow}
previewQrcode={previewQrcode}
closeQrcodeShow={this.closeQrcodeShow}
/>
</Row>
);
}
......@@ -322,6 +387,12 @@ function mapStateToProps(state) {
gettingVerifyCoding,
resetPsdDiaShow,
resetPsdSubmitting,
bindWxShow,
erpCounting,
erpCountdown,
gettingErpVerifyCoding,
previewQrcodeShow,
previewQrcode,
} = state.usersetting;
return {
cropperboxShow,
......@@ -333,6 +404,12 @@ function mapStateToProps(state) {
counting,
countdown,
resetPsdSubmitting,
bindWxShow,
erpCounting,
erpCountdown,
gettingErpVerifyCoding,
previewQrcodeShow,
previewQrcode,
};
}
export default connect(mapStateToProps)(UserSetting);
......@@ -66,3 +66,11 @@ export function courseTemplateDetail(params) {
method: 'GET',
});
}
export function getErpVerifyCode(params) {
const data = qs.stringify(params);
return request({
url: `${api.erpVerifyCode}`,
method: 'POST',
data,
});
}
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