Commit 09c6b068 authored by baixian's avatar baixian

111222

parent 32e94aa8
......@@ -77,6 +77,7 @@ class MaterialModalForm extends React.Component {
sm: 4,
}}
footer={
list.length > 0 &&
<div className={pageStyle.tablefooterbox}>
<Pagination
total={Number(total)}
......
......@@ -4,6 +4,9 @@
border-bottom: none;
}
}
.list {
text-align: center;
}
.item {
width: 150px;
height: 150px;
......
......@@ -27,9 +27,13 @@ export default {
cover: '',
type: '',
audio: '',
content: [
intro: [
{ type: 'text', value: '' },
],
remark: '',
study_count: '',
status: '',
content: '',
},
addLoading: false,
},
......@@ -90,12 +94,13 @@ export default {
charge_type: data.data.charge_type,
created_at: data.data.created_at,
type: data.data.type,
content: data.data.content ? JSON.parse(data.data.content) : addCourseObj.content,
intro: data.data.intro && data.data.intro != null ? JSON.parse(data.data.intro) : addCourseObj.intro,
remark: data.data.remark,
study_count: data.data.study_count,
status: data.data.status,
cover: data.data.cover,
audio: data.data.audio,
content: data.data.content,
},
},
});
......@@ -183,7 +188,7 @@ export default {
study_count,
callBack,
} = payload;
addCourseObj.content = JSON.stringify(addCourseObj.content);
addCourseObj.intro = JSON.stringify(addCourseObj.intro);
const newCourseObj = { ...addCourseObj };
console.log(addCourseObj, 'addCourseObj1111111111111111111');
const loadmessage = message.loading('保存中...', 0);
......@@ -193,6 +198,9 @@ export default {
start_time,
study_count,
school_id: sid,
content: JSON.stringify([
{ type: 'mp4', value: 'clock_video-test/member/12351/2019-11-20/fa939b56ae68b1b0e35734a29284778f' },
]),
});
const data = yield call(onlineAjax.editCourse, newParams);
yield put({
......@@ -215,9 +223,16 @@ export default {
start_time: '',
charge_type: '',
created_at: '',
content: [
cover: '',
type: '',
audio: '',
intro: [
{ type: 'text', value: '' },
],
remark: '',
study_count: '',
status: '',
content: '',
},
},
});
......@@ -331,7 +346,7 @@ export default {
const uploadImg = yield call(uploader.uploadImg, params);
const imageUrl = filename;
if (uploadtype == 'uploadImg') {
addCourseObj.content.push({
addCourseObj.intro.push({
type: 'img',
value: imageUrl,
});
......@@ -394,7 +409,7 @@ export default {
const uploadImg = yield call(uploader.uploadVideo, params);
const videoUrl = filename;
if (uploadtype == 'uploadVideo') {
addCourseObj.content.push({
addCourseObj.intro.push({
type: 'video',
value: videoUrl,
});
......@@ -464,13 +479,24 @@ export default {
addCourseObj: { ...addCourseObj },
},
});
} else if (uploadtype == 'uploadDescAudio') {
addCourseObj.intro.push({
type: 'audio',
value: audioUrl,
});
yield put({
type: 'updateState',
payload: {
addCourseObj: { ...addCourseObj },
},
});
}
setTimeout(uploaderLoading);
},
* courseChangeSize({ payload }, { call, put, select }) {
const { textValue, index } = payload;
const { addCourseObj } = yield select(state => state.onlineclasses);
addCourseObj.content[index] = {
addCourseObj.intro[index] = {
type: 'text',
value: textValue,
};
......@@ -484,7 +510,7 @@ export default {
* deleteCourseImg({ payload }, { call, put, select }) {
const { index } = payload;
const { addCourseObj } = yield select(state => state.onlineclasses);
const newContent = addCourseObj.content;
const newContent = addCourseObj.intro;
newContent.splice(index, 1);
yield put({
type: 'updateState',
......@@ -529,16 +555,16 @@ export default {
const { index, direction } = payload;
const { addCourseObj } = yield select(state => state.onlineclasses);
let newContent = [];
newContent = addCourseObj.content;
const currentImg = addCourseObj.content[index];
const preImg = addCourseObj.content[index - 1];
const afterImg = addCourseObj.content[index + 1];
newContent = addCourseObj.intro;
const currentImg = addCourseObj.intro[index];
const preImg = addCourseObj.intro[index - 1];
const afterImg = addCourseObj.intro[index + 1];
if (direction == 'up') {
newContent.splice(index - 1, 2, currentImg, preImg);
} else if (direction == 'down') {
newContent.splice(index, 2, afterImg, currentImg);
}
addCourseObj.content = newContent;
addCourseObj.intro = newContent;
yield put({
type: 'updateState',
payload: {
......@@ -549,7 +575,7 @@ export default {
* courseAddText({ payload }, { call, put, select }) {
const { textValue } = payload;
const { addCourseObj } = yield select(state => state.onlineclasses);
addCourseObj.content.push({
addCourseObj.intro.push({
type: 'text',
value: '',
});
......@@ -578,7 +604,7 @@ export default {
cover: '',
type: '',
audio: '',
content: [
intro: [
{ type: 'text', value: '' },
],
},
......
......@@ -44,11 +44,12 @@ class ThemeEditor extends React.Component {
moveContent,
editorUploadVideo,
} = this.props;
console.log(commentParams, 'commentParams1111111111111');
return (
<div className={pageStyle.container}>
<div className={pageStyle.editorwrap}>
{/* eslint-disable-next-line array-callback-return,consistent-return */}
{commentParams.content.map((item, index) => {
{commentParams.intro.map((item, index) => {
// eslint-disable-next-line default-case
switch (item.type) {
case 'text':
......@@ -59,8 +60,8 @@ class ThemeEditor extends React.Component {
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.intro.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.intro.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
</div>
......@@ -76,8 +77,8 @@ class ThemeEditor extends React.Component {
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.intro.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.intro.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
</div>
......@@ -90,8 +91,8 @@ class ThemeEditor extends React.Component {
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.intro.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.intro.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
</div>
......@@ -99,12 +100,12 @@ class ThemeEditor extends React.Component {
case 'audio':
return (
<div key={index} className={pageStyle.videowrap}>
<audio controls="controls" className={pageStyle.videoPoster} src={imagify(item.value)} />
<audio style={{ height: 90 }} controls="controls" className={pageStyle.videoPoster} src={imagify(item.value)} />
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.intro.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.intro.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
</div>
......
......@@ -63,7 +63,7 @@ class CourseDetailForm extends React.Component {
type: 'onlineclasses/queryvideosignature',
payload: {
files: e.target,
uploadtype: 'uploadaudio',
uploadtype: 'uploadVideo',
},
});
}
......@@ -115,7 +115,7 @@ class CourseDetailForm extends React.Component {
type: 'onlineclasses/queryvoiceignature',
payload: {
files: e.target,
uploadtype: 'uploadImg',
uploadtype: 'uploadDescAudio',
},
});
}
......
......@@ -50,9 +50,13 @@ class ClassMgtForm extends React.Component {
cover: '',
type: '',
audio: '',
content: [
intro: [
{ type: 'text', value: '' },
],
remark: '',
study_count: '',
status: '',
content: '',
},
},
});
......
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