Commit 3c3737d4 authored by wangxuelai's avatar wangxuelai

''

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