Commit f66ec063 authored by sujie@126.com's avatar sujie@126.com

dd

parent 9691500b
......@@ -14,6 +14,7 @@ import * as classMgtAjax from '../services/classmgt';
import * as courseAjax from '../services/course';
import * as teachersAjax from '../services/teachers';
import * as classroommgtAjax from '../services/classroommgt';
import * as commonAjax from '../services/common';
import errorcode from '../common/errorcode';
export default {
namespace: 'classmgt',
......@@ -35,6 +36,17 @@ export default {
class_room_id: '',
remark: '',
},
inviteClassInfo: {
school_id: '',
course_id: '',
title: '',
capacity: '',
total: '',
expend: '',
teacher_id: [],
class_room_id: '',
remark: '',
},
classSubmitting: false,
classListQueryParams: {
school_id: 0,
......@@ -103,7 +115,9 @@ export default {
selectedClasskey: [],
selectedClass: [],
statusChangeSubmitting: false,
classrRgistrationShow: true,
classrRgistrationShow: false,
classInviteqrcodeShow: false,
classInviteqrcodeUrl: '',
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -838,6 +852,42 @@ export default {
},
});
},
* classInviteCode({ payload }, { call, put, select }) {
const { params } = payload;
const { sid, schoolUserInfo } = yield select(state => state.webapp);
const { inviteClassInfo } = yield select(state => state.classmgt);
console.log(params, inviteClassInfo, schoolUserInfo);
const saveData = yield call(commonAjax.courseTemplateAdd, {
school_id: sid,
teacher_id: schoolUserInfo.id,
course_id: inviteClassInfo.course.id,
mode_type: params.mode_type,
buy: params.buy || 0,
give: params.give || 0,
class_ids: inviteClassInfo.id,
class_id: inviteClassInfo.id,
});
if (saveData.code == 200) {
const loading = message.loading('小程序生成中..');
const qrcodeData = yield call(commonAjax.generateQrcode, {
scene: `uid=${saveData.data.uuid}&tmp=${saveData.data.id}`,
page: 'src/pages/setting/bindmobile2', // src/pages/setting/bindmobile2
});
setTimeout(loading);
if (qrcodeData.code == 200) {
message.success('小程序码生成成功', 1);
yield put({
type: 'updateState',
payload: {
classInviteqrcodeShow: true,
classInviteqrcodeUrl: qrcodeData.data.url,
},
});
} else {
message.error('小程序码生成失败', 1);
}
}
},
},
reducers: {
save(state, action) {
......
This diff is collapsed.
......@@ -24,4 +24,130 @@
}
.boldText{
font-weight:700;
color:rgba(0,0,0,0.85);
}
.radioBox{
padding-left: 10px;
}
.fromBox{
margin: 0 60px;
border-radius:4px;
border:1px solid rgba(0,0,0,0.15);
margin-top: 20px;
}
.fromTitle{
font-size:18px;
font-family:PingFangSC-Medium,PingFangSC;
font-weight:700;
color:rgba(0,0,0,0.85);
text-align: center;
padding: 15px 0;
}
.fromItem{
display: flex;
justify-content: center;
margin-bottom: 20px;
align-items: center;
.fromItemspan{
display: flex;
align-items: center;
}
}
.codeImgBoxWrapper{
width: 100%;
height: 100%;
background:rgba(0,0,0,0.3);
position: fixed;
left: 0;
top: 0;
z-index: 1000;
}
.codeImgBox{
width:455px;
background:rgba(255,255,255,1);
box-shadow:0px 4px 12px 0px rgba(0,0,0,0.2);
border-radius:4px;
position: absolute;
left: 50%;
top: 10%;
margin-left: -227px;
z-index: 1000;
.closeBtn{
width: 30px;
height: 30px;
background:rgba(24,144,255,1);
color: #fff;
text-align: center;
line-height: 30px;
border-radius: 0 0 0 100%;
position: absolute;
top: 0;
right: 0;
padding: 0 0 5px 5px;
cursor: pointer;
}
.title{
font-size:18px;
font-family:PingFangSC-Medium,PingFangSC;
font-weight:700;
color:rgba(0,0,0,0.85);
padding: 15px 0 10px 0;
text-align: center;
}
.tips{
font-size:12px;
font-family:PingFangSC-Regular,PingFangSC;
font-weight:400;
color:rgba(0,0,0,0.45);
text-align: center;
}
.imgBox{
width:244px;
height:224px;
margin: 0 auto;
.qrCodeImage{
width:244px;
height:224px;
}
}
.saveBtn{
display: block;
width:136px;
height:25px;
background:rgba(23,180,253,1);
border-radius:13px;
font-size:11px;
font-family:PingFangSC-Regular,PingFangSC;
font-weight:400;
color:rgba(255,255,255,1);
line-height:25px;
text-align: center;
margin: 0 auto;
cursor: pointer;
}
.footer{
margin-top: 26px;
width: 100%;
display: flex;
padding: 12px;
justify-content: space-between;
align-items: center;
background:rgba(235,235,235,1);
border-radius:0px 0px 4px 4px;
.text{
width:342px;
font-size:14px;
font-family:PingFangSC-Regular,PingFangSC;
font-weight:400;
color:rgba(102,102,102,1);
line-height:18px;
}
.copyBtn{
font-size:15px;
font-family:PingFangSC-Medium,PingFangSC;
font-weight:500;
color:rgba(23,180,253,1);
cursor: pointer;
}
}
}
\ No newline at end of file
......@@ -366,6 +366,47 @@ class ClassMgtForm extends React.Component {
},
});
}
// 班级报名
goClassInvite = (classInfo) => {
const { dispatch } = this.props;
dispatch({
type: 'classmgt/updateState',
payload: {
inviteClassInfo: classInfo,
classrRgistrationShow: true,
},
});
}
classrRgistrationClose = () => {
//
const { dispatch } = this.props;
dispatch({
type: 'classmgt/updateState',
payload: {
inviteClassInfo: {},
classrRgistrationShow: false,
},
});
}
classrRgistrationSave = (params) => {
//
const { dispatch } = this.props;
dispatch({
type: 'classmgt/classInviteCode',
payload: {
params,
},
});
}
codeImgClose = () => {
const { dispatch } = this.props;
dispatch({
type: 'classmgt/updateState',
payload: {
classInviteqrcodeShow: false,
},
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
......@@ -383,6 +424,9 @@ class ClassMgtForm extends React.Component {
editClassInfo,
classSubmitting,
classrRgistrationShow,
classInviteqrcodeShow,
classInviteqrcodeUrl,
inviteClassInfo,
} = this.props;
const visible = false;
const columns = [
......@@ -466,7 +510,7 @@ class ClassMgtForm extends React.Component {
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.goClassDetail(record, 2)}>班级报名</a>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.goClassInvite(record)}>班级报名</a>
<span className={pageStyle.divideline}>|</span>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.goClassDetail(record, 2)}>学员管理</a>
<span className={pageStyle.divideline}>|</span>
......@@ -617,6 +661,12 @@ class ClassMgtForm extends React.Component {
/>
<ClassrRgistration
visible={classrRgistrationShow}
close={this.classrRgistrationClose}
save={this.classrRgistrationSave}
qrcodeShow={classInviteqrcodeShow}
qrcodeUrl={classInviteqrcodeUrl}
inviteClassInfo={inviteClassInfo}
codeImgClose={this.codeImgClose}
/>
</div>
);
......@@ -649,6 +699,9 @@ function mapStateToProps(state) {
selectedClasskey,
statusChangeSubmitting,
classrRgistrationShow,
classInviteqrcodeShow,
classInviteqrcodeUrl,
inviteClassInfo,
} = state.classmgt;
return {
classList,
......@@ -671,6 +724,9 @@ function mapStateToProps(state) {
selectedClasskey,
statusChangeSubmitting,
classrRgistrationShow,
classInviteqrcodeShow,
classInviteqrcodeUrl,
inviteClassInfo,
};
}
export default connect(mapStateToProps)(ClassMgt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment