Commit a4f5d121 by yuananting

fix:解决合并代码的冲突

parents da9c44e2 b998aab6
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
} }
} }
.operate{ .operate{
display:inline-block;
margin-top:24px; margin-top:24px;
.btn { .btn {
padding:5px 12px; padding:5px 12px;
......
...@@ -44,6 +44,10 @@ const FileVerifyMap = { ...@@ -44,6 +44,10 @@ const FileVerifyMap = {
type: "word", type: "word",
maxSize: 100 maxSize: 100
}, },
"application/wps-writer": {
type: "word",
maxSize: 100,
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": { "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
type: "word", type: "word",
maxSize: 100 maxSize: 100
...@@ -133,13 +137,13 @@ const FileTypeIcon = { ...@@ -133,13 +137,13 @@ const FileTypeIcon = {
PPTX: "https://image.xiaomaiketang.com/xm/847pFAdYGW.png", PPTX: "https://image.xiaomaiketang.com/xm/847pFAdYGW.png",
PDF: "https://image.xiaomaiketang.com/xm/rrEJMNkhTG.png", PDF: "https://image.xiaomaiketang.com/xm/rrEJMNkhTG.png",
MP3: "https://image.xiaomaiketang.com/xm/ykjnSWDyQ6.png", MP3: "https://image.xiaomaiketang.com/xm/ykjnSWDyQ6.png",
MP4: "https://image.xiaomaiketang.com/xm/TKwbQGYDBR.png", MP4: "https://image.xiaomaiketang.com/xm/yK3ASiS8ch.png",
JPG: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png", JPG: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png",
JPEG: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png", JPEG: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png",
PNG: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png", PNG: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png",
GIF: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png", GIF: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png",
BMP: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png", BMP: "https://image.xiaomaiketang.com/xm/XRkX8JBTPs.png",
VIDEO: "https://image.xiaomaiketang.com/xm/TKwbQGYDBR.png" VIDEO: 'https://image.xiaomaiketang.com/xm/yK3ASiS8ch.png'
}; };
const UploadIcon = "https://image.xiaomaiketang.com/xm/4DXNrZWWsd.png"; const UploadIcon = "https://image.xiaomaiketang.com/xm/4DXNrZWWsd.png";
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-01 17:21:21 * @Date: 2020-12-01 17:21:21
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-22 14:56:34 * @LastEditTime: 2021-07-09 15:33:33
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -62,6 +62,9 @@ export function saveYoZoFileVersionId(params: object) { ...@@ -62,6 +62,9 @@ export function saveYoZoFileVersionId(params: object) {
export function yoZoUpload(ossUrl:String,appId:String,uploadSign:String){ export function yoZoUpload(ossUrl:String,appId:String,uploadSign:String){
return axios.post(`https://dmc.yozocloud.cn/api/file/http?fileUrl=${ossUrl}&appId=${appId}&sign=${uploadSign}`) return axios.post(`https://dmc.yozocloud.cn/api/file/http?fileUrl=${ossUrl}&appId=${appId}&sign=${uploadSign}`)
} }
export function saveFileVersionIdByCourseChapter(params: object) {
return Service.Hades('public/hades/saveFileVersionIdByCourseChapter', params);
}
export const getOssClient = ( export const getOssClient = (
data: object, data: object,
instId: string, instId: string,
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-01 17:20:49 * @Date: 2020-12-01 17:20:49
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-22 14:57:01 * @LastEditTime: 2021-07-09 15:33:59
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { getUserStore, getUserPermission ,logout,getStoreUser,sendBizAuthCode,editUserPhone,checkBizAuthCode,sendNewPhoneAuthCode,sendLoginAuthCode,login,getLastedVersion, getEnterpriseUser,getWXWorkLoginNoCheck,getLesseeVersionMsg,getYoZoSign,saveYoZoFileVersionId,yoZoUpload} from '@/data-source/base/request-apis'; import { getUserStore, getUserPermission ,logout,getStoreUser,sendBizAuthCode,editUserPhone,checkBizAuthCode,sendNewPhoneAuthCode,sendLoginAuthCode,login,getLastedVersion, getEnterpriseUser,getWXWorkLoginNoCheck,getLesseeVersionMsg,getYoZoSign,saveYoZoFileVersionId,yoZoUpload,saveFileVersionIdByCourseChapter} from '@/data-source/base/request-apis';
export default class StoreService { export default class StoreService {
// 获取员工列表 // 获取员工列表
...@@ -73,4 +73,7 @@ export default class StoreService { ...@@ -73,4 +73,7 @@ export default class StoreService {
static yoZoUpload(ossUrl:String,appId:String,uploadSign:String){ static yoZoUpload(ossUrl:String,appId:String,uploadSign:String){
return yoZoUpload(ossUrl,appId,uploadSign); return yoZoUpload(ossUrl,appId,uploadSign);
} }
static saveFileVersionIdByCourseChapter(params: any){
return saveFileVersionIdByCourseChapter(params);
}
} }
\ No newline at end of file
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-20 09:21:40 * @Date: 2020-08-20 09:21:40
* @LastEditors: zhangleyuan * @LastEditors: yuananting
* @LastEditTime: 2021-03-04 17:16:30 * @LastEditTime: 2021-07-15 11:48:58
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -77,6 +77,10 @@ const FILR_VERIFY_MAP = { ...@@ -77,6 +77,10 @@ const FILR_VERIFY_MAP = {
type: "word", type: "word",
maxSize: 100 maxSize: 100
}, },
"application/wps-writer": {
type: "word",
maxSize: 100,
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": { "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
type: "word", type: "word",
maxSize: 100 maxSize: 100
......
...@@ -149,7 +149,7 @@ class AddLiveBasic extends React.Component { ...@@ -149,7 +149,7 @@ class AddLiveBasic extends React.Component {
<span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}> <span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}>
使用默认图 使用默认图
</span> </span>
<div className='tips'>建议尺寸1280*720px,图片支持jpg、jpeg、png格式</div> <div className='tips'>建议尺寸1280*720px或16:9。封面图最大5M,支持jpg、jpeg和png</div>
</div> </div>
<div className='img-content'> <div className='img-content'>
{isDefaultCover && <span className='tag'>默认图</span>} {isDefaultCover && <span className='tag'>默认图</span>}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-07-23 14:54:16 * @Date: 2020-07-23 14:54:16
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-12 11:39:35 * @LastEditTime: 2021-07-15 14:02:37
* @Description: 大班直播课预览弹窗 * @Description: 大班直播课预览弹窗
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -166,12 +166,7 @@ class PreviewCourseModal extends React.Component { ...@@ -166,12 +166,7 @@ class PreviewCourseModal extends React.Component {
<div className='container__header'> <div className='container__header'>
<Choose> <Choose>
<When condition={type === 'videoCourse'}> <When condition={type === 'videoCourse'}>
<video <img src={coverUrl ? coverUrl : `https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png`} className='course-cover' alt='' />
controls
src={courseChapterList.length && courseChapterList[0].mediaUrl || scheduleVideoUrl }
poster={coverUrl ? coverUrl : `https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png`}
className='course-url'
/>
</When> </When>
<Otherwise> <Otherwise>
<img src={coverUrl} className='course-cover' alt='' /> <img src={coverUrl} className='course-cover' alt='' />
......
...@@ -116,7 +116,7 @@ class ShareLiveModal extends React.Component { ...@@ -116,7 +116,7 @@ class ShareLiveModal extends React.Component {
} }
break; break;
case 'videoClass': // 视频课 case 'videoClass': // 视频课
coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'; coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png';
break; break;
case 'graphicsClass': // 图文课 case 'graphicsClass': // 图文课
coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png'; coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-15 13:57:59 * @LastEditTime: 2021-07-15 14:02:45
* @Description: 线下课新增/编辑页 * @Description: 线下课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -758,7 +758,7 @@ class AddOfflineCourse extends React.Component { ...@@ -758,7 +758,7 @@ class AddOfflineCourse extends React.Component {
<span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}> <span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}>
使用默认图 使用默认图
</span> </span>
<div className='tips'>建议尺寸1280*720px,图片支持jpg、jpeg、png格式</div> <div className='tips'>建议尺寸1280*720px或16:9。封面图最大5M,支持jpg、jpeg和png</div>
</div> </div>
<div className='img-content'> <div className='img-content'>
{isDefaultCover && <span className='tag'>默认图</span>} {isDefaultCover && <span className='tag'>默认图</span>}
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-15 14:00:19 * @LastEditTime: 2021-07-15 14:10:09
* @Description: 线上课新增/编辑页 * @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import React from 'react' import React from 'react'
import { Button, Input, message, Modal, Cascader, Tooltip, Form, Popconfirm } from 'antd' import { Button, Input, message, Modal, Cascader, Tooltip, Form, Popconfirm,Menu,Dropdown} from 'antd'
import { FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum' import { FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum'
import ShowTips from '@/components/ShowTips' import ShowTips from '@/components/ShowTips'
import Breadcrumbs from '@/components/Breadcrumbs' import Breadcrumbs from '@/components/Breadcrumbs'
...@@ -85,9 +85,10 @@ class AddVideoCourse extends React.Component { ...@@ -85,9 +85,10 @@ class AddVideoCourse extends React.Component {
introduce: '', introduce: '',
courseChapterList:[ courseChapterList:[
], // 课节列表 ], // 课节列表
videoType: "MP4", // videoType: "MP4",
mediaNameAlias: '', // 任一视频重命名的名称(气泡框) mediaNameAlias: '', // 任一视频重命名的名称(气泡框)
popConfirmVisible: false selectTypeList:['MP4'],
accept:'video/mp4'
} }
} }
...@@ -137,8 +138,8 @@ class AddVideoCourse extends React.Component { ...@@ -137,8 +138,8 @@ class AddVideoCourse extends React.Component {
const { courseName, shelfState, whetherVisitorsJoin, courseMediaVOS, categoryOneName, categoryTwoName, categoryId, courseChapterVOList =[] } = result const { courseName, shelfState, whetherVisitorsJoin, courseMediaVOS, categoryOneName, categoryTwoName, categoryId, courseChapterVOList =[] } = result
let coverId let coverId
let coverUrl let coverUrl
let videoDuration // let videoDuration
let videoName // let videoName
let scheduleMedia = [] let scheduleMedia = []
let scheduleVideoUrl let scheduleVideoUrl
let hasIntro let hasIntro
...@@ -176,8 +177,8 @@ class AddVideoCourse extends React.Component { ...@@ -176,8 +177,8 @@ class AddVideoCourse extends React.Component {
loadintroduce: !hasIntro, loadintroduce: !hasIntro,
coverId, coverId,
coverUrl, coverUrl,
videoName, // videoName,
videoDuration, // videoDuration,
scheduleMedia, scheduleMedia,
courseName, courseName,
scheduleVideoUrl, scheduleVideoUrl,
...@@ -203,10 +204,8 @@ class AddVideoCourse extends React.Component { ...@@ -203,10 +204,8 @@ class AddVideoCourse extends React.Component {
} }
handleGoBack = () => { handleGoBack = () => {
const { coverId, videoName, videoDuration, courseName, scheduleMedia, courseChapterList, categoryId, shelfState, whetherVisitorsJoin } = this.state const { coverId,courseName, scheduleMedia, courseChapterList, categoryId, shelfState, whetherVisitorsJoin } = this.state
if ( if (
videoName ||
videoDuration ||
!courseChapterList.length || !courseChapterList.length ||
!_.isEqual(scheduleMedia, defaultScheduleMedia) || !_.isEqual(scheduleMedia, defaultScheduleMedia) ||
categoryId || categoryId ||
...@@ -275,13 +274,11 @@ class AddVideoCourse extends React.Component { ...@@ -275,13 +274,11 @@ class AddVideoCourse extends React.Component {
// 显示预览弹窗 // 显示预览弹窗
handleShowPreviewModal = () => { handleShowPreviewModal = () => {
const { coverUrl, scheduleVideoUrl, courseName, scheduleMedia, videoDuration, introduce, courseChapterList, categoryName } = this.state const { coverUrl, scheduleVideoUrl, courseName, scheduleMedia,introduce, courseChapterList, categoryName } = this.state
const courseBasinInfo = { const courseBasinInfo = {
coverUrl, coverUrl,
scheduleVideoUrl, scheduleVideoUrl,
courseName, courseName,
videoDuration
} }
const courseIntroInfo = { const courseIntroInfo = {
liveCourseMediaRequests: scheduleMedia, liveCourseMediaRequests: scheduleMedia,
...@@ -320,8 +317,10 @@ class AddVideoCourse extends React.Component { ...@@ -320,8 +317,10 @@ class AddVideoCourse extends React.Component {
return; return;
} }
selectedFileList.map((file,index) => { selectedFileList.map((file,index) => {
console.log('')
const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file; const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file;
console.log('folderFormat',folderFormat);
if(folderFormat === 'MP4'){
const videoDom = document.createElement('video') const videoDom = document.createElement('video')
videoDom.src = ossUrl videoDom.src = ossUrl
videoDom.onloadedmetadata = () => { videoDom.onloadedmetadata = () => {
...@@ -335,14 +334,32 @@ class AddVideoCourse extends React.Component { ...@@ -335,14 +334,32 @@ class AddVideoCourse extends React.Component {
mediaUrl: ossUrl, mediaUrl: ossUrl,
sort: _courseChapterList.length sort: _courseChapterList.length
}) })
this.setState({ this.setState({
size: folderSize,
videoName: folderName,
videoType: folderFormat,
courseChapterList: _courseChapterList courseChapterList: _courseChapterList
}) })
} }
}else{
let _mediaName = folderName;
if(folderFormat === 'PDF'){
_mediaName = folderName.replace('.pdf','')
}else{
_mediaName = folderName.replace('.doc','') && folderName.replace('.docx','')
}
const suffix = _.last(folderName.split('.')).toUpperCase();
_courseChapterList.push({
mediaContent: resourceId,
contentType: 'SCHEDULE',
mediaType: suffix,
mediaName: _mediaName,
resourceId,
mediaUrl: ossUrl,
sort: _courseChapterList.length
})
this.setState({
courseChapterList: _courseChapterList
})
}
}) })
} }
...@@ -396,8 +413,8 @@ class AddVideoCourse extends React.Component { ...@@ -396,8 +413,8 @@ class AddVideoCourse extends React.Component {
id, id,
coverId, coverId,
pageType, pageType,
videoName, // videoName,
videoDuration, // videoDuration,
courseName, courseName,
scheduleMedia, scheduleMedia,
categoryId, categoryId,
...@@ -409,8 +426,8 @@ class AddVideoCourse extends React.Component { ...@@ -409,8 +426,8 @@ class AddVideoCourse extends React.Component {
} = this.state } = this.state
const commonParams = { const commonParams = {
videoName, // videoName,
videoDuration, videoDuration:0, //后端的必要参数,不能传空
scheduleMedia: scheduleMedia.filter((item) => !!item.mediaContent), scheduleMedia: scheduleMedia.filter((item) => !!item.mediaContent),
categoryId, categoryId,
courseName, courseName,
...@@ -463,7 +480,7 @@ class AddVideoCourse extends React.Component { ...@@ -463,7 +480,7 @@ class AddVideoCourse extends React.Component {
return false return false
} }
if (!courseChapterList.length) { if (!courseChapterList.length) {
message.warning('请上传视频') message.warning('请上传课节')
resolve(false) resolve(false)
return false return false
} }
...@@ -535,7 +552,6 @@ class AddVideoCourse extends React.Component { ...@@ -535,7 +552,6 @@ class AddVideoCourse extends React.Component {
chapterNameValidateStatus: '', chapterNameValidateStatus: '',
        chapterNameHelpMsg: '',         chapterNameHelpMsg: '',
mediaNameAlias: '', mediaNameAlias: '',
popConfirmVisible: false
}) })
}); });
...@@ -629,7 +645,40 @@ class AddVideoCourse extends React.Component { ...@@ -629,7 +645,40 @@ class AddVideoCourse extends React.Component {
courseChapterList: _courseChapterList courseChapterList: _courseChapterList
}) })
} }
renderTypemenu =()=>{
return <Menu>
<Menu.Item>
<span onClick={()=>{this.selectFileType("VIDEO")}}>
视频文件
</span>
</Menu.Item>
<Menu.Item>
<span onClick={()=>{this.selectFileType("WORD_PDF")}}>
资料文件
</span>
</Menu.Item>
</Menu>
}
selectFileType = (type) =>{
const { courseChapterList } = this.state;
if(courseChapterList.length >= 20) {
message.warning(`最多只能上传20个文件`);
return;
}
if(type==="VIDEO"){
this.setState({
showSelectFileModal: true,
selectTypeList:['MP4'],
accept:'video/mp4'
})
}else{
this.setState({
showSelectFileModal: true,
selectTypeList:['DOC','DOCX','PDF'],
accept:'.doc,.docx,.pdf'
})
}
}
render() { render() {
const { const {
pageType, pageType,
...@@ -638,7 +687,7 @@ class AddVideoCourse extends React.Component { ...@@ -638,7 +687,7 @@ class AddVideoCourse extends React.Component {
scheduleMedia, scheduleMedia,
showSelectFileModal, showSelectFileModal,
diskList, diskList,
videoType, // videoType,
shelfState, shelfState,
categoryName, categoryName,
courseCatalogList, courseCatalogList,
...@@ -652,11 +701,10 @@ class AddVideoCourse extends React.Component { ...@@ -652,11 +701,10 @@ class AddVideoCourse extends React.Component {
id, id,
courseChapterList, courseChapterList,
imageFile, imageFile,
popConfirmVisible selectTypeList,
accept
} = this.state } = this.state
const defaultCover = 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png';
const courseWareIcon = FileVerifyMap[videoType] ? FileTypeIcon[FileVerifyMap[videoType].type] : FileTypeIcon[videoType]
const defaultCover = 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png';
const isDefaultCover = coverUrl === defaultCover || coverUrl == null; const isDefaultCover = coverUrl === defaultCover || coverUrl == null;
return ( return (
...@@ -684,11 +732,11 @@ class AddVideoCourse extends React.Component { ...@@ -684,11 +732,11 @@ class AddVideoCourse extends React.Component {
<div className='upload-video mt16'> <div className='upload-video mt16'>
<div className='content flex'> <div className='content flex'>
<span className='label required'>视频上传</span> <span className='label required'>上传课节</span>
</div> </div>
<div className='sub-content'> <div className='sub-content'>
<div className="btn-wrap"> <div className="btn-wrap">
<Button {/* <Button
onClick={() => { onClick={() => {
if(courseChapterList.length >= 20) { if(courseChapterList.length >= 20) {
message.warning(`最多只能上传20个文件`); message.warning(`最多只能上传20个文件`);
...@@ -697,10 +745,20 @@ class AddVideoCourse extends React.Component { ...@@ -697,10 +745,20 @@ class AddVideoCourse extends React.Component {
this.setState({ this.setState({
showSelectFileModal: true showSelectFileModal: true
}) })
}}>添加视频</Button> }}>添加视频</Button> */}
<div className='select-file'>
<Dropdown overlay={this.renderTypemenu()}>
<Button>选择文件</Button>
</Dropdown>
</div>
<div className='course-ware--empty'>从资料云盘中选择视频</div> <div className='course-ware--empty'>从资料云盘中选择视频</div>
</div> </div>
<div className='tips'>视频数量限制20个,每个视频文件大小不超过2G</div> <div className='tips'>
课节数量限制20个,文件规格说明
<Tooltip title="视频支持mp4格式,大小不超过2G;文件支持PDF、docx、doc格式,大小不超过100M">
<i className='icon iconfont' style={{ cursor: 'pointer', color: '#bfbfbf', fontSize: '14px'}}> &#xe61d;</i>
</Tooltip>
</div>
</div> </div>
</div> </div>
...@@ -712,7 +770,7 @@ class AddVideoCourse extends React.Component { ...@@ -712,7 +770,7 @@ class AddVideoCourse extends React.Component {
_.map(courseChapterList,(item,index) => { _.map(courseChapterList,(item,index) => {
return <div className='course-ware' key={index}> return <div className='course-ware' key={index}>
<div className="course-ware__index">{index < 9 ? `0${index + 1 } ` : `${index + 1 } `}</div> <div className="course-ware__index">{index < 9 ? `0${index + 1 } ` : `${index + 1 } `}</div>
<img className='course-ware__img' src={courseWareIcon} alt='' /> <img className='course-ware__img' src={FileTypeIcon[item.mediaType]} alt='' />
<div className='course-ware__name'>{item.mediaName && item.mediaName.length > 24 ? <Tooltip title={item.mediaName}>{item.mediaName}</Tooltip>:item.mediaName}</div> <div className='course-ware__name'>{item.mediaName && item.mediaName.length > 24 ? <Tooltip title={item.mediaName}>{item.mediaName}</Tooltip>:item.mediaName}</div>
<div className="course-chapter__opt" id={item.resourceId}> <div className="course-chapter__opt" id={item.resourceId}>
<div className={`up ${Number(index) === 0 ? 'disabled':''}`} onClick={()=> this.handleChangeIndex(true,item.sort,item.resourceId)}>上移</div> <div className={`up ${Number(index) === 0 ? 'disabled':''}`} onClick={()=> this.handleChangeIndex(true,item.sort,item.resourceId)}>上移</div>
...@@ -757,7 +815,7 @@ class AddVideoCourse extends React.Component { ...@@ -757,7 +815,7 @@ class AddVideoCourse extends React.Component {
</If> </If>
<div className='cover-url flex mt16'> <div className='cover-url flex mt16'>
<div className='label'>课程封面</div> <div className='label'>封面图</div>
<div className='cover-url__wrap'> <div className='cover-url__wrap'>
<div className='opt-btns'> <div className='opt-btns'>
<div> <div>
...@@ -784,7 +842,7 @@ class AddVideoCourse extends React.Component { ...@@ -784,7 +842,7 @@ class AddVideoCourse extends React.Component {
isDefaultCover && <span className="tag">默认图</span> isDefaultCover && <span className="tag">默认图</span>
} }
{/* 如果视频和封面都没有上传的话, 那么就显示缺省, 如果上传了视频, 那么封面图就默认显示视频的第一帧, 如果上传了封面图, 那么就显示上传的封面图 */} {/* 如果视频和封面都没有上传的话, 那么就显示缺省, 如果上传了视频, 那么封面图就默认显示视频的第一帧, 如果上传了封面图, 那么就显示上传的封面图 */}
<img src={coverUrl || `https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png`} alt='' /> <img src={coverUrl || `https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png`} alt='' />
</div> </div>
</div> </div>
</div> </div>
...@@ -852,13 +910,14 @@ class AddVideoCourse extends React.Component { ...@@ -852,13 +910,14 @@ class AddVideoCourse extends React.Component {
<SelectPrepareFileModal <SelectPrepareFileModal
multiple={true} multiple={true}
operateType='select' operateType='select'
selectTypeList={['MP4']} selectTypeList={selectTypeList}
accept='video/mp4' accept={accept}
queryTypeEnum={'ONLINE'}
confirm={{ confirm={{
title: '文件过大,无法上传', title: '文件过大,无法上传',
content: '为保障学员的观看体验,上传的视频大小不能超过2G' content: '上传的视频大小不能超过2G,文件大小不能超过100M'
}} }}
tooltip={'格式支持mp4,大小不超过2G'} tooltip={''}
isOpen={showSelectFileModal} isOpen={showSelectFileModal}
diskList={diskList} diskList={diskList}
addVideo={true} addVideo={true}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-04-28 18:05:30 * @Date: 2020-04-28 18:05:30
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-09 16:21:13 * @LastEditTime: 2021-07-15 14:04:21
* @Description: 线上课课程课节详情 * @Description: 线上课课程课节详情
*/ */
...@@ -12,12 +12,15 @@ import { withRouter } from "react-router-dom"; ...@@ -12,12 +12,15 @@ import { withRouter } from "react-router-dom";
import CourseService from '@/domains/course-domain/CourseService' import CourseService from '@/domains/course-domain/CourseService'
import underscore from 'underscore'; import underscore from 'underscore';
import ScanFileModal from '@/modules/resource-disk/modal/ScanFileModal.jsx'; import ScanFileModal from '@/modules/resource-disk/modal/ScanFileModal.jsx';
import { FileTypeIcon } from '@/common/constants/academic/lessonEnum'
import BaseService from "@/domains/basic-domain/baseService";
import {YZ_APPId,YZ_PREVIEW_URL} from '@/domains/basic-domain/constants';
import PreviewFileModal from '@/bu-components/PreviewFileModal';
import './VideoCourseDetail.less'; import './VideoCourseDetail.less';
declare var getParameterByName: any; declare var getParameterByName: any;
declare var window: any; declare var window: any;
const FileTypeIconMap:any = FileTypeIcon
function VideoCourseDetail(){ function VideoCourseDetail(){
const courseId = window.getParameterByName("courseId"); // 课程ID const courseId = window.getParameterByName("courseId"); // 课程ID
const [coverUrl,setCoverUrl] = useState(""); const [coverUrl,setCoverUrl] = useState("");
...@@ -27,7 +30,11 @@ function VideoCourseDetail(){ ...@@ -27,7 +30,11 @@ function VideoCourseDetail(){
const [courseName,setCourseName] = useState(""); const [courseName,setCourseName] = useState("");
const [categoryName,setCategoryName] = useState(""); const [categoryName,setCategoryName] = useState("");
const [scanFileModal,setScanFileModal] = useState<any>(null); const [scanFileModal,setScanFileModal] = useState<any>(null);
const [showPreviewModal,setShowPreviewModal] = useState(false); //是否显示loading
// const [previewing,setPreviewing] = useState(false); //是否正在预览
const [previewStatus,setPreviewStatus] = useState('UPLOAD'); //预览文件的生成状态
const [url,setUrl] = useState('');
let previewing = false;
useEffect(()=>{ useEffect(()=>{
handleFetchScheudleDetail(courseId); handleFetchScheudleDetail(courseId);
},[courseId]) },[courseId])
...@@ -73,9 +80,9 @@ function VideoCourseDetail(){ ...@@ -73,9 +80,9 @@ function VideoCourseDetail(){
setCourseChapterList(courseChapterVOList); setCourseChapterList(courseChapterVOList);
}) })
} }
async function handleScanFileModal(fileType: string = "MP4", fileObj:any){
function handleScanFileModal(fileType: string = "MP4", fileObj: Object){ const {fileVersionId,name,mediaUrl,id} = fileObj;
if(fileType === "VIDEO"){
const scanFileModal = ( const scanFileModal = (
<ScanFileModal <ScanFileModal
fileType={fileType} fileType={fileType}
...@@ -86,6 +93,65 @@ function VideoCourseDetail(){ ...@@ -86,6 +93,65 @@ function VideoCourseDetail(){
/> />
); );
setScanFileModal(scanFileModal) setScanFileModal(scanFileModal)
}else{
if(!fileVersionId){
setShowPreviewModal(true);
previewing = true;
setPreviewStatus('UPLOAD');
const uploadParams ={
fileUrl:mediaUrl,
yoZoTypeEnum:'UPLOAD'
}
const uploadSign:any = await BaseService.getYoZoSign(uploadParams);
BaseService.yoZoUpload(mediaUrl,YZ_APPId,uploadSign).then(async function (response){
const saveParams ={
fileVersionId:response.data.data.fileVersionId,
courseChapterId:id
}
BaseService.saveFileVersionIdByCourseChapter(saveParams);
if(previewing){
const previewParams ={
fileVersionId:response.data.data.fileVersionId,
yoZoTypeEnum:'VIEW',
htmlTitle:name
}
const previewSign = await BaseService.getYoZoSign(previewParams);
const url = `${YZ_PREVIEW_URL}?fileVersionId=${response.data.data.fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${name}`
setPreviewStatus('UPLOAD_SUCCESS');
setUrl(url)
}
})
}else{
const previewParams ={
fileVersionId,
yoZoTypeEnum:'VIEW',
htmlTitle:name
}
const previewSign = await BaseService.getYoZoSign(previewParams);
const url = `${YZ_PREVIEW_URL}?fileVersionId=${fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${name}`
const a = document.createElement('a');
document.body.appendChild(a);
a.setAttribute('href', url);
a.setAttribute('target', '_blank');
a.click();
document.body.removeChild(a)
}
}
}
// function previewingSet(){
// return new Promise(async (resolve) => {
// setShowPreviewModal(true);
// setPreviewing(true);
// setPreviewStatus('UPLOAD');
// resolve(true);
// })
// }
function cancelPreview(){
setShowPreviewModal(false);
// setPreviewing(false);
previewing = false;
setPreviewStatus('UPLOAD');
} }
...@@ -101,7 +167,7 @@ function VideoCourseDetail(){ ...@@ -101,7 +167,7 @@ function VideoCourseDetail(){
<div className="course-detail"> <div className="course-detail">
<div className='course-detail__img'> <div className='course-detail__img'>
{/* 如果视频和封面都没有上传的话, 那么就显示缺省, 如果上传了视频, 那么封面图就默认显示视频的第一帧, 如果上传了封面图, 那么就显示上传的封面图 */} {/* 如果视频和封面都没有上传的话, 那么就显示缺省, 如果上传了视频, 那么封面图就默认显示视频的第一帧, 如果上传了封面图, 那么就显示上传的封面图 */}
<img src={coverUrl || `https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png`} alt='' /> <img src={coverUrl || `https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png`} alt='' />
</div> </div>
<div className="course-detail__info"> <div className="course-detail__info">
<div className="info__title">{courseName}</div> <div className="info__title">{courseName}</div>
...@@ -116,9 +182,9 @@ function VideoCourseDetail(){ ...@@ -116,9 +182,9 @@ function VideoCourseDetail(){
<If condition={courseChapterList.length > 0}> <If condition={courseChapterList.length > 0}>
{ {
underscore.map(courseChapterList,(item: any,index: number) => { underscore.map(courseChapterList,(item: any,index: number) => {
return <div className='course-ware' onClick={()=>{handleScanFileModal("MP4",item)}} key={index}> return <div className='course-ware' onClick={()=>{handleScanFileModal(item.mediaType,item)}} key={index}>
<div className="course-ware__index">{index < 9 ? `0${index + 1 } ` : index + 1}</div> <div className="course-ware__index">{index < 9 ? `0${index + 1 } ` : index + 1}</div>
<img className='course-ware__img' src='https://image.xiaomaiketang.com/xm/TKwbQGYDBR.png' alt='' /> <img className='course-ware__img' src={FileTypeIconMap[item.mediaType]} alt='' />
<div className='course-ware__name'>{item.name}</div> <div className='course-ware__name'>{item.name}</div>
</div> </div>
}) })
...@@ -127,6 +193,9 @@ function VideoCourseDetail(){ ...@@ -127,6 +193,9 @@ function VideoCourseDetail(){
</div> </div>
</div> </div>
</div> </div>
{ showPreviewModal &&
<PreviewFileModal onCancel={()=>cancelPreview()} previewStatus={previewStatus} url={url}/>
}
{scanFileModal} {scanFileModal}
</div> </div>
} }
......
...@@ -12,7 +12,9 @@ function ChapterList(props){ ...@@ -12,7 +12,9 @@ function ChapterList(props){
<div className='course-ware__index'>{index < 9 ? `0${index + 1 } ` : `${index + 1 } `}</div> <div className='course-ware__index'>{index < 9 ? `0${index + 1 } ` : `${index + 1 } `}</div>
<div className="course-ware__detail"> <div className="course-ware__detail">
<div className='course-ware__detail__name'>{item.mediaName}</div> <div className='course-ware__detail__name'>{item.mediaName}</div>
{ item.mediaType === 'VIDEO' &&
<div className='course-ware__detail__duration'>{window.formatDuration(item.videoDuration)}</div> <div className='course-ware__detail__duration'>{window.formatDuration(item.videoDuration)}</div>
}
</div> </div>
</div> </div>
}) })
......
...@@ -2,6 +2,7 @@ import User from "@/common/js/user"; ...@@ -2,6 +2,7 @@ import User from "@/common/js/user";
import CourseService from "@/domains/course-domain/CourseService"; import CourseService from "@/domains/course-domain/CourseService";
import React from "react"; import React from "react";
import { Modal } from "antd"; import { Modal } from "antd";
import { FileTypeIcon } from '@/common/constants/academic/lessonEnum'
import "./LearningDetailModal.less"; import "./LearningDetailModal.less";
class LearningDetailModal extends React.Component { class LearningDetailModal extends React.Component {
...@@ -58,11 +59,7 @@ class LearningDetailModal extends React.Component { ...@@ -58,11 +59,7 @@ class LearningDetailModal extends React.Component {
<div className="course-ware__index">{`${ <div className="course-ware__index">{`${
index < 9 ? `0${index + 1}` : index + 1 index < 9 ? `0${index + 1}` : index + 1
} `}</div> } `}</div>
<img <img className='course-ware__img' src={FileTypeIcon[item.mediaType]} alt='' />
className="course-ware__img"
src="https://image.xiaomaiketang.com/xm/TKwbQGYDBR.png"
alt=""
/>
<div className="course-ware__name">{item.courseChapterName && item.courseChapterName.replace('.MP4','')}</div> <div className="course-ware__name">{item.courseChapterName && item.courseChapterName.replace('.MP4','')}</div>
</div> </div>
......
...@@ -68,7 +68,7 @@ class VideoCourseList extends React.Component { ...@@ -68,7 +68,7 @@ class VideoCourseList extends React.Component {
<img <img
className='course-cover' className='course-cover'
src={ src={
coverUrl || 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png' coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'
} }
alt='封面图' alt='封面图'
/> />
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: * @Description:
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-12 14:49:40 * @Date: 2021-03-12 14:49:40
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-06-11 16:44:59 * @LastEditTime: 2021-07-15 14:07:42
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -421,7 +421,7 @@ class AddCourse extends React.Component { ...@@ -421,7 +421,7 @@ class AddCourse extends React.Component {
coverUrl || coverUrl ||
(videoCourseDivision === 'internal' (videoCourseDivision === 'internal'
? `${mediaCourseUrl}?x-oss-process=video/snapshot,t_0,m_fast` ? `${mediaCourseUrl}?x-oss-process=video/snapshot,t_0,m_fast`
: 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png') : 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png')
} }
alt='' alt=''
/> />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-05 10:50:30 * @Date: 2021-07-05 10:50:30
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-06 15:16:47 * @LastEditTime: 2021-07-14 14:32:55
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -13,6 +13,7 @@ import PlanService from '@/domains/plan-domain/planService'; ...@@ -13,6 +13,7 @@ import PlanService from '@/domains/plan-domain/planService';
import User from '@/common/js/user'; import User from '@/common/js/user';
import './UserLearnDetailModal.less'; import './UserLearnDetailModal.less';
import _ from 'underscore'; import _ from 'underscore';
import { FileTypeIcon } from '@/common/constants/academic/lessonEnum'
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'; const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
const CourseType = { const CourseType = {
LIVE: { LIVE: {
...@@ -193,10 +194,10 @@ class UserLearnDetailModal extends React.Component { ...@@ -193,10 +194,10 @@ class UserLearnDetailModal extends React.Component {
return ( return (
<div className='chapter-record'> <div className='chapter-record'>
<span> <span>
{chapterIndex + 1}.{index + 1}&nbsp; {index < 9 ? `0${index + 1} ` : index + 1}
</span> </span>
<img className='chapter-img' src='https://image.xiaomaiketang.com/xm/TKwbQGYDBR.png' /> <img className='chapter-img' src={FileTypeIcon[record.mediaType]} />
<span>{record.name}</span> <span className='chapter-name'>{record.name}</span>
</div> </div>
); );
}, },
......
...@@ -65,6 +65,12 @@ ...@@ -65,6 +65,12 @@
height: 18px; height: 18px;
margin: 0 10px; margin: 0 10px;
} }
.chapter-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 400px;
}
} }
.record-name { .record-name {
display: flex; display: flex;
......
...@@ -397,7 +397,7 @@ class SelectOperatorModal extends React.Component { ...@@ -397,7 +397,7 @@ class SelectOperatorModal extends React.Component {
const { coverUrl } = record; const { coverUrl } = record;
return ( return (
<div className='course-info'> <div className='course-info'>
<img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'} alt='' /> <img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'} alt='' />
<div className='course-name'>{record.courseName}</div> <div className='course-name'>{record.courseName}</div>
</div> </div>
); );
......
...@@ -101,7 +101,7 @@ class SelectPrepareFileModal extends React.Component { ...@@ -101,7 +101,7 @@ class SelectPrepareFileModal extends React.Component {
// 获取文件列表 // 获取文件列表
handleFetchFolderList = (params = {}, loadMore = false) => { handleFetchFolderList = (params = {}, loadMore = false) => {
// 根据当前根节点获取文件列表 // 根据当前根节点获取文件列表
const { selectTypeList } = this.props; const { selectTypeList,queryTypeEnum} = this.props;
const { query, folderList, currentRootDisk } = this.state; const { query, folderList, currentRootDisk } = this.state;
const _params = { const _params = {
...query, ...query,
...@@ -114,6 +114,9 @@ class SelectPrepareFileModal extends React.Component { ...@@ -114,6 +114,9 @@ class SelectPrepareFileModal extends React.Component {
if (selectTypeList) { if (selectTypeList) {
_params.folderFileType = selectTypeList _params.folderFileType = selectTypeList
} }
if(queryTypeEnum){
_params.queryTypeEnum = queryTypeEnum
}
Service.Hades(FOLDERLIST_URL_MAP[currentRootDisk.disk], _params).then((res) => { Service.Hades(FOLDERLIST_URL_MAP[currentRootDisk.disk], _params).then((res) => {
const { result = {} } = res; const { result = {} } = res;
......
...@@ -34,7 +34,7 @@ class ScanFileModal extends React.Component { ...@@ -34,7 +34,7 @@ class ScanFileModal extends React.Component {
style={{ width: 632, objectFit: "cover" }} style={{ width: 632, objectFit: "cover" }}
/> />
)} )}
{fileType === "MP4" && ( {fileType === "VIDEO" && (
<div> <div>
<Player <Player
src={item.mediaUrl || item.ossAddress || item.ossUrl} src={item.mediaUrl || item.ossAddress || item.ossUrl}
......
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