Commit 3c3737d4 authored by wangxuelai's avatar wangxuelai

''

parent e89891cd
...@@ -17,6 +17,6 @@ ...@@ -17,6 +17,6 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="dist/main.js?1574753959867" charset="utf-8"></script> <script src="dist/main.js?1574757759016" charset="utf-8"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -70,6 +70,8 @@ export default { ...@@ -70,6 +70,8 @@ export default {
study_count: '', study_count: '',
status: '', status: '',
content: '', content: '',
is_encrypt: 1,
password: '',
}, },
editLoading: false, editLoading: false,
materialVisible: false, materialVisible: false,
...@@ -349,6 +351,8 @@ export default { ...@@ -349,6 +351,8 @@ export default {
cover: data.cover, cover: data.cover,
audio: data.audio, audio: data.audio,
content: data.content, content: data.content,
is_encrypt: data.is_encrypt,
password: data.password,
}, },
}, },
}); });
...@@ -932,6 +936,7 @@ export default { ...@@ -932,6 +936,7 @@ export default {
if (file && (REGEXP_VIDEO.test(file.type) || file.type === '')) { if (file && (REGEXP_VIDEO.test(file.type) || file.type === '')) {
const uploadSignature = yield call(uploader.uploadVideoSignature, params); const uploadSignature = yield call(uploader.uploadVideoSignature, params);
signature = uploadSignature.data; signature = uploadSignature.data;
console.log('dadasdad');
yield put({ yield put({
type: 'uploadvideo', type: 'uploadvideo',
payload: { payload: {
...@@ -1124,7 +1129,7 @@ export default { ...@@ -1124,7 +1129,7 @@ export default {
}, },
* editCourse({ payload }, { call, put, select }) { * editCourse({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp); const { sid } = yield select(state => state.webapp);
const { editLoading, addCourseObj } = yield select(state => state.coursegatherdetail); const { editLoading, addCourseObj, id } = yield select(state => state.coursegatherdetail);
if (editLoading) { if (editLoading) {
return; return;
} }
...@@ -1168,28 +1173,34 @@ export default { ...@@ -1168,28 +1173,34 @@ export default {
callBack(); callBack();
} }
yield put({ yield put({
type: 'updateState', type: 'getGatherDetail',
payload: { payload: {
addCourseObj: { id,
title: '',
start_time: '',
charge_type: '',
created_at: '',
cover: '',
type: '',
audio: '',
intro: [
{ type: 'text', value: '' },
],
remark: '',
study_count: '',
status: '',
content: '',
},
}, },
}); });
yield delay(50); // yield put({
yield put(routerRedux.push('/sjd/coursegather')); // type: 'updateState',
// payload: {
// addCourseObj: {
// title: '',
// start_time: '',
// charge_type: '',
// created_at: '',
// cover: '',
// type: '',
// audio: '',
// intro: [
// { type: 'text', value: '' },
// ],
// remark: '',
// study_count: '',
// status: '',
// content: '',
// },
// },
// });
// yield delay(50);
// yield put(routerRedux.push('/sjd/coursegather'));
} else { } else {
yield put({ yield put({
type: 'webapp/errorrequestresolve', type: 'webapp/errorrequestresolve',
......
...@@ -55,13 +55,14 @@ class CourseDetailForm extends React.Component { ...@@ -55,13 +55,14 @@ class CourseDetailForm extends React.Component {
}, },
}); });
} }
courseUploadVideo = (e) => { courseUploadVideo = ({ files, uploadtype, time }) => {
const { dispatch } = this.props; const { dispatch, addCourseObj } = this.props;
dispatch({ dispatch({
type: 'coursegatherdetail/queryvideosignature', type: 'coursegatherdetail/queryvideosignature',
payload: { payload: {
files: e.target, files,
uploadtype: 'uploadVideo', uploadtype,
time,
}, },
}); });
} }
...@@ -209,6 +210,7 @@ class CourseDetailForm extends React.Component { ...@@ -209,6 +210,7 @@ class CourseDetailForm extends React.Component {
materiaList, materiaList,
queryParams, queryParams,
materiaListTotal, materiaListTotal,
toChangePsd,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -301,8 +303,8 @@ class CourseDetailForm extends React.Component { ...@@ -301,8 +303,8 @@ class CourseDetailForm extends React.Component {
<span className="ant-form-text">设置学习人数基数,让学员更有东西学习喔</span> <span className="ant-form-text">设置学习人数基数,让学员更有东西学习喔</span>
</FormItem> </FormItem>
<FormItem {...formItemModalLineLayout} label="课程类型"> <FormItem {...formItemModalLineLayout} label="课程类型">
<div className={pageStyle.courseType}>{addCourseObj.is_encrypt == 1 ? '加密' : '未加密'}</div> <div className={pageStyle.courseType}>{addCourseObj.is_encrypt == 1 ? `加密 密码:${addCourseObj.password}` : '未加密'}</div>
<span className="hreflink" style={{ marginLeft: '10px' }}>修改</span> <span className="hreflink" style={{ marginLeft: '10px' }} onClick={toChangePsd}>修改</span>
{/* <span className={pageStyle.typeEdit}>点击修改</span> */} {/* <span className={pageStyle.typeEdit}>点击修改</span> */}
{/* <span className="ant-form-text">有人报名则无法修改课程类型</span> */} {/* <span className="ant-form-text">有人报名则无法修改课程类型</span> */}
</FormItem> </FormItem>
......
...@@ -19,17 +19,50 @@ import AddCourseModal from './AddCourseModal'; ...@@ -19,17 +19,50 @@ import AddCourseModal from './AddCourseModal';
import ManageCourse from './ManageCourse'; import ManageCourse from './ManageCourse';
import MaterialModal from '../../../components/MaterialModal'; import MaterialModal from '../../../components/MaterialModal';
import UploadCourseware from '../../../components/UploadCourseware'; import UploadCourseware from '../../../components/UploadCourseware';
import ChangePsdModal from '../../onlineclasses/ChangePsdModal';
class StaticCenter extends React.Component { class StaticCenter extends React.Component {
constructor(props) {
super(props);
this.state = {
addWareType: 1, // 1是批量操作时添加 2 单课添加课程
psdChangeShow: false,
};
}
componentDidMount() { // 挂载 componentDidMount() { // 挂载
pageIn('轻校-专栏详情'); pageIn('轻校-专栏详情');
this.state = { this.state = {
addWareType: 1, // 1是批量操作时添加 2 单课添加课程 addWareType: 1, // 1是批量操作时添加 2 单课添加课程
psdChangeShow: false,
}; };
} }
componentDidUpdate() { componentDidUpdate() {
} }
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
} }
toChangePsd = () => {
this.setState({
psdChangeShow: true,
});
}
savePsd = (value, callback) => {
const { dispatch, addCourseObj } = this.props;
dispatch({
type: 'coursegatherdetail/updateState',
payload: {
addCourseObj: {
...addCourseObj,
is_encrypt: value.is_encrypt ? 1 : 2,
password: value.password ? value.password : '',
},
},
});
this.setState({
psdChangeShow: false,
});
if (callback && (typeof callback == 'function')) {
callback();
}
}
tabShift = (tab) => { tabShift = (tab) => {
const { dispatch, gatherDetail } = this.props; const { dispatch, gatherDetail } = this.props;
dispatch({ dispatch({
...@@ -696,6 +729,7 @@ class StaticCenter extends React.Component { ...@@ -696,6 +729,7 @@ class StaticCenter extends React.Component {
isEditSingleCourse, isEditSingleCourse,
editSingleCourseInfo, editSingleCourseInfo,
saveSingleCourseSubmitting, saveSingleCourseSubmitting,
addCourseObj,
} = this.props; } = this.props;
const menu = ( const menu = (
<Menu> <Menu>
...@@ -769,7 +803,9 @@ class StaticCenter extends React.Component { ...@@ -769,7 +803,9 @@ class StaticCenter extends React.Component {
queryChartParams={queryChartParams} queryChartParams={queryChartParams}
dateChange={this.dateChange} dateChange={this.dateChange}
/>} />}
{tabIndex == 3 && <CourseDetail />} {tabIndex == 3 && <CourseDetail
toChangePsd={this.toChangePsd}
/>}
{tabIndex == 4 && <CommentList />} {tabIndex == 4 && <CommentList />}
<AddCourseModal <AddCourseModal
courseList={allCourseList} courseList={allCourseList}
...@@ -806,6 +842,11 @@ class StaticCenter extends React.Component { ...@@ -806,6 +842,11 @@ class StaticCenter extends React.Component {
delCourseware={this.delCourseware} delCourseware={this.delCourseware}
chooseFromCourseMateria={this.chooseFromCourseMateria} chooseFromCourseMateria={this.chooseFromCourseMateria}
/> />
<ChangePsdModal
visible={this.state.psdChangeShow}
info={addCourseObj}
save={this.savePsd}
/>
</div> </div>
); );
} }
...@@ -846,6 +887,7 @@ function mapStateToProps(state) { ...@@ -846,6 +887,7 @@ function mapStateToProps(state) {
isEditSingleCourse, isEditSingleCourse,
editSingleCourseInfo, editSingleCourseInfo,
saveSingleCourseSubmitting, saveSingleCourseSubmitting,
addCourseObj,
} = state.coursegatherdetail; } = state.coursegatherdetail;
return { return {
tabIndex, tabIndex,
...@@ -878,6 +920,7 @@ function mapStateToProps(state) { ...@@ -878,6 +920,7 @@ function mapStateToProps(state) {
isEditSingleCourse, isEditSingleCourse,
editSingleCourseInfo, editSingleCourseInfo,
saveSingleCourseSubmitting, saveSingleCourseSubmitting,
addCourseObj,
}; };
} }
export default connect(mapStateToProps)(StaticCenter); export default connect(mapStateToProps)(StaticCenter);
......
...@@ -38,9 +38,8 @@ class ChangePsdModal extends React.Component { ...@@ -38,9 +38,8 @@ class ChangePsdModal extends React.Component {
save({ save({
is_encrypt, is_encrypt,
password, password,
callBack: () => { }, () => {
form.resetFields(); form.resetFields();
},
}); });
} }
}); });
...@@ -65,14 +64,14 @@ class ChangePsdModal extends React.Component { ...@@ -65,14 +64,14 @@ class ChangePsdModal extends React.Component {
}; };
return ( return (
<Modal <Modal
visible={false} visible={visible}
maskClosable={false} maskClosable={false}
zIndex={110} zIndex={110}
width={600} width={600}
bodyStyle={{ bodyStyle={{
padding: '40px 20px', padding: '40px 20px',
}} }}
title="回复" title="修改密码"
closable={false} closable={false}
onCancel={this.close} onCancel={this.close}
okText="保存" okText="保存"
......
...@@ -278,6 +278,7 @@ class CourseDetailForm extends React.Component { ...@@ -278,6 +278,7 @@ class CourseDetailForm extends React.Component {
materiaListTotal, materiaListTotal,
coursewareInfo, coursewareInfo,
info, info,
toChangePsd,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -302,7 +303,6 @@ class CourseDetailForm extends React.Component { ...@@ -302,7 +303,6 @@ class CourseDetailForm extends React.Component {
const selectBefore = ( const selectBefore = (
<div>{title.length + textLength}/40</div> <div>{title.length + textLength}/40</div>
); );
console.log(addCourseObj, 'addCourseObj');
return ( return (
<div className={pageStyle.container}> <div className={pageStyle.container}>
<Form hideRequiredMark className={pageStyle.modalform} labelAlign="left" onSubmit={this.save}> <Form hideRequiredMark className={pageStyle.modalform} labelAlign="left" onSubmit={this.save}>
...@@ -371,8 +371,8 @@ class CourseDetailForm extends React.Component { ...@@ -371,8 +371,8 @@ class CourseDetailForm extends React.Component {
<span className="ant-form-text">设置学习人数基数,让学员更有东西学习喔</span> <span className="ant-form-text">设置学习人数基数,让学员更有东西学习喔</span>
</FormItem> </FormItem>
<FormItem {...formItemModalLineLayout} label="课程类型"> <FormItem {...formItemModalLineLayout} label="课程类型">
<div className={pageStyle.courseType}>{addCourseObj.is_encrypt == 1 ? '加密' : '未加密'}</div> <div className={pageStyle.courseType}>{addCourseObj.is_encrypt == 1 ? `加密 密码:${addCourseObj.password}` : '未加密'}</div>
<span className="hreflink" style={{ marginLeft: '10px' }}>修改</span> <span className="hreflink" style={{ marginLeft: '10px' }} onClick={toChangePsd}>修改</span>
{/* <span className={pageStyle.typeEdit}>点击修改</span> */} {/* <span className={pageStyle.typeEdit}>点击修改</span> */}
{/* <span className="ant-form-text">有人报名则无法修改课程类型</span> */} {/* <span className="ant-form-text">有人报名则无法修改课程类型</span> */}
</FormItem> </FormItem>
......
...@@ -35,6 +35,7 @@ class singleDetailForm extends React.Component { ...@@ -35,6 +35,7 @@ class singleDetailForm extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
psdChangeShow: false,
}; };
} }
componentDidMount() { // 挂载 componentDidMount() { // 挂载
...@@ -44,6 +45,11 @@ class singleDetailForm extends React.Component { ...@@ -44,6 +45,11 @@ class singleDetailForm extends React.Component {
} }
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
} }
toChangePsd = () => {
this.setState({
psdChangeShow: true,
});
}
changeStatus = (key) => { changeStatus = (key) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
...@@ -148,6 +154,25 @@ class singleDetailForm extends React.Component { ...@@ -148,6 +154,25 @@ class singleDetailForm extends React.Component {
}, },
}); });
} }
savePsd = (value, callback) => {
const { dispatch, addCourseObj } = this.props;
dispatch({
type: 'onlineclasses/updateState',
payload: {
addCourseObj: {
...addCourseObj,
is_encrypt: value.is_encrypt ? 1 : 2,
password: value.password ? value.password : '',
},
},
});
this.setState({
psdChangeShow: false,
});
if (callback && (typeof callback == 'function')) {
callback();
}
}
render() { render() {
const { const {
form: { getFieldDecorator, getFieldValue }, form: { getFieldDecorator, getFieldValue },
...@@ -193,7 +218,9 @@ class singleDetailForm extends React.Component { ...@@ -193,7 +218,9 @@ class singleDetailForm extends React.Component {
</div> </div>
<Tabs className={pageStyle.tabs} defaultActiveKey="1" onChange={this.callback} animated={false}> <Tabs className={pageStyle.tabs} defaultActiveKey="1" onChange={this.callback} animated={false}>
<TabPane tab="课程详情" key="1"> <TabPane tab="课程详情" key="1">
<CourseDetail /> <CourseDetail
toChangePsd={this.toChangePsd}
/>
</TabPane> </TabPane>
<TabPane tab="数据分析" key="2"> <TabPane tab="数据分析" key="2">
<StaticBox /> <StaticBox />
...@@ -218,8 +245,9 @@ class singleDetailForm extends React.Component { ...@@ -218,8 +245,9 @@ class singleDetailForm extends React.Component {
save={this.materialSave2} save={this.materialSave2}
/> />
<ChangePsdModal <ChangePsdModal
visible visible={this.state.psdChangeShow}
info={addCourseObj} info={addCourseObj}
save={this.savePsd}
/> />
</div> </div>
); );
......
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