Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
b6807c33
Commit
b6807c33
authored
Jan 25, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改海报不显示的问题
parent
e14bd165
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
36 deletions
+113
-36
src/core/antd.less
+6
-0
src/domains/basic-domain/constants.ts
+1
-1
src/domains/course-domain/constants.ts
+1
-1
src/modules/course-manage/modal/ShareLiveModal.jsx
+78
-23
src/modules/course-manage/modal/ShareLiveModal.less
+6
-2
src/modules/course-manage/video-course/AddVideoCourse.jsx
+3
-2
src/modules/course-manage/video-course/AddVideoCourse.less
+10
-4
src/modules/course-manage/video-course/components/AddVideoIntro.jsx
+2
-1
src/modules/course-manage/video-course/components/AddVideoIntro.less
+5
-1
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+1
-1
No files found.
src/core/antd.less
View file @
b6807c33
...
@@ -637,3 +637,8 @@ mr0 {
...
@@ -637,3 +637,8 @@ mr0 {
.ant-select-dropdown .rc-virtual-list-scrollbar .rc-virtual-list-scrollbar-thumb{
.ant-select-dropdown .rc-virtual-list-scrollbar .rc-virtual-list-scrollbar-thumb{
background: #D6D6D6 !important;
background: #D6D6D6 !important;
}
}
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-content > table > thead > tr > .ant-table-cell-fix-right-first::after,
.ant-table.ant-table-bordered > .ant-table-container > .ant-table-content > table > tbody > tr > .ant-table-cell-fix-right-first::after
{
border-right:none !important;
}
\ No newline at end of file
src/domains/basic-domain/constants.ts
View file @
b6807c33
/*
/*
* @Author: 陈剑宇
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-01-
19 14:32:47
* @LastEditTime: 2021-01-
25 13:58:01
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @Description:
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
...
...
src/domains/course-domain/constants.ts
View file @
b6807c33
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-20 09:21:40
* @Date: 2020-08-20 09:21:40
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
18 21:05:31
* @LastEditTime: 2021-01-
25 13:53:13
* @Description:
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
...
src/modules/course-manage/modal/ShareLiveModal.jsx
View file @
b6807c33
...
@@ -24,6 +24,7 @@ class ShareLiveModal extends React.Component {
...
@@ -24,6 +24,7 @@ class ShareLiveModal extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
shareUrl
:
'https://xiaomai5.com/liveShare?courseId=12'
shareUrl
:
'https://xiaomai5.com/liveShare?courseId=12'
}
}
...
@@ -32,6 +33,43 @@ class ShareLiveModal extends React.Component {
...
@@ -32,6 +33,43 @@ class ShareLiveModal extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
// 获取短链接
// 获取短链接
this
.
handleConvertShortUrl
();
this
.
handleConvertShortUrl
();
// const { needStr, data, type } = this.props;
// const { courseName, coverUrl = DEFAULT_COVER, scheduleVideoUrl } = data;
// const { shareUrl ,time} = this.state;
// // 判断是否是默认图, 默认图不需要在URL后面增加字符串
// const isDefaultCover = coverUrl === DEFAULT_COVER;
// let coverImgSrc = coverUrl;
// if(type === 'videoClass'){
// if(!coverUrl || isDefaultCover){
// coverImgSrc = `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring`
// }
// }else{
// data.courseMediaVOS.map((item,index)=>{
// if( item.contentType === "COVER"){
// coverImgSrc = item.mediaUrl;
// }
// })
// }
// let image = new Image()
// image.src =coverImgSrc + '?v=' + Math.random()
// image.crossOrigin = "*"
// image.onload = ()=>{
// let imgData = getBase64Image(image)
// this.setState({imgData})
// }
// function getBase64Image (img) {
// let canvas = document.createElement("canvas")
// canvas.width = img.width
// canvas.height = img.height
// let ctx = canvas.getContext("2d")
// ctx.drawImage(img, 0, 0, img.width, img.height)
// let dataURL = canvas.toDataURL("image/png")
// return dataURL
// }
}
}
handleConvertShortUrl
=
()
=>
{
handleConvertShortUrl
=
()
=>
{
...
@@ -42,6 +80,7 @@ class ShareLiveModal extends React.Component {
...
@@ -42,6 +80,7 @@ class ShareLiveModal extends React.Component {
urls
:
[
longUrl
]
urls
:
[
longUrl
]
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
{
result
=
[]
}
=
res
;
this
.
setState
({
this
.
setState
({
shareUrl
:
result
[
0
].
shortUrl
shareUrl
:
result
[
0
].
shortUrl
},
()
=>
{
},
()
=>
{
...
@@ -62,15 +101,24 @@ class ShareLiveModal extends React.Component {
...
@@ -62,15 +101,24 @@ class ShareLiveModal extends React.Component {
// 下载海报
// 下载海报
handleDownloadPoster
=
()
=>
{
handleDownloadPoster
=
()
=>
{
const
dom
=
document
.
querySelector
(
'#poster'
);
this
.
setState
({
html2canvas
(
dom
,
{
showImg
:
true
,
useCORS
:
true
,
time
:
new
Date
().
valueOf
()
}).
then
(
canvas
=>
{
},()
=>
{
this
.
setState
({
time
:
new
Date
().
valueOf
()},()
=>
{
let
node
=
document
.
getElementById
(
'poster'
);
domtoimage
.
toPng
(
node
)
.
then
((
imgData
)
=>
{
console
.
log
(
imgData
)
const
download
=
document
.
createElement
(
'a'
);
const
download
=
document
.
createElement
(
'a'
);
const
{
courseName
}
=
this
.
props
.
data
;
const
{
courseName
}
=
this
.
props
.
data
;
const
dataUrl
=
canvas
.
toDataURL
(
'image/png'
);
$
(
download
).
attr
(
'href'
,
imgData
).
attr
(
'download'
,
`
${
courseName
}
.png`
).
get
(
0
).
click
();
$
(
download
).
attr
(
'href'
,
dataUrl
).
attr
(
'download'
,
`
${
courseName
}
.png`
).
get
(
0
).
click
();
// this.props.close()
})
})
})
})
}
}
// 复制分享链接
// 复制分享链接
...
@@ -84,17 +132,23 @@ class ShareLiveModal extends React.Component {
...
@@ -84,17 +132,23 @@ class ShareLiveModal extends React.Component {
render
()
{
render
()
{
const
{
needStr
,
data
,
type
}
=
this
.
props
;
const
{
needStr
,
data
,
type
}
=
this
.
props
;
const
{
courseName
,
coverUrl
=
DEFAULT_COVER
,
scheduleVideoUrl
}
=
data
;
const
{
courseName
,
coverUrl
=
DEFAULT_COVER
,
scheduleVideoUrl
}
=
data
;
const
{
shareUrl
}
=
this
.
state
;
const
{
shareUrl
,
imgData
,
showImg
,
time
}
=
this
.
state
;
// 判断是否是默认图, 默认图不需要在URL后面增加字符串
// 判断是否是默认图, 默认图不需要在URL后面增加字符串
const
isDefaultCover
=
coverUrl
===
DEFAULT_COVER
;
const
isDefaultCover
=
coverUrl
===
DEFAULT_COVER
;
const
coverImgSrc
=
type
===
'videoClass'
let
coverImgSrc
=
coverUrl
;
// 如果是默认图, 显示视频的第一帧, 否则显示上传的视频封面
if
(
type
===
'videoClass'
){
?
((
!
coverUrl
||
isDefaultCover
)
if
(
!
coverUrl
||
isDefaultCover
){
?
`
${
scheduleVideoUrl
}
?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring`
coverImgSrc
=
`
${
scheduleVideoUrl
}
?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring`
:
`
${
coverUrl
}
`
)
}
:
`
${
coverUrl
}
`
}
else
{
data
.
courseMediaVOS
.
map
((
item
,
index
)
=>
{
if
(
item
.
contentType
===
"COVER"
){
coverImgSrc
=
item
.
mediaUrl
;
}
})
}
return
(
return
(
...
@@ -107,7 +161,8 @@ class ShareLiveModal extends React.Component {
...
@@ -107,7 +161,8 @@ class ShareLiveModal extends React.Component {
className=
"share-live-modal"
className=
"share-live-modal"
onCancel=
{
this
.
props
.
close
}
onCancel=
{
this
.
props
.
close
}
>
>
<
div
className=
"left"
id=
"poster"
>
<
div
className=
"left"
>
<
div
id=
"poster"
>
<
div
className=
"store-name"
>
<
div
className=
"store-name"
>
<
span
className=
"text"
>
{
storeName
}
</
span
>
<
span
className=
"text"
>
{
storeName
}
</
span
>
</
div
>
</
div
>
...
@@ -117,13 +172,16 @@ class ShareLiveModal extends React.Component {
...
@@ -117,13 +172,16 @@ class ShareLiveModal extends React.Component {
type
===
"liveClass"
&&
type
===
"liveClass"
&&
<
div
class=
"live-couse-name"
>
{
courseName
}
</
div
>
<
div
class=
"live-couse-name"
>
{
courseName
}
</
div
>
}
}
{
showImg
?
<
img
<
img
crossOrigin=
'*'
src=
{
coverImgSrc
}
src=
{
coverImgSrc
+
`?=${time}`
}
className=
"course-cover"
/>:
<
img
src=
{
coverImgSrc
+
`?=${time}`
}
className=
"course-cover"
className=
"course-cover"
/>
/>
}
<
div
className=
"qrcode-wrap"
>
<
div
className=
"qrcode-wrap"
>
<
div
className=
"qrcode-wrap__left"
>
<
div
className=
"qrcode-wrap__left"
>
<
div
className=
"text"
>
长按识别二维码进入观看
</
div
>
<
div
className=
"text"
>
长按识别二维码进入观看
</
div
>
...
@@ -132,7 +190,7 @@ class ShareLiveModal extends React.Component {
...
@@ -132,7 +190,7 @@ class ShareLiveModal extends React.Component {
<
div
className=
"qrcode-wrap__right"
id=
"qrcodeWrap"
>
<
div
className=
"qrcode-wrap__right"
id=
"qrcodeWrap"
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"right"
>
<
div
className=
"right"
>
<
div
className=
"share-poster right__item"
>
<
div
className=
"share-poster right__item"
>
...
@@ -142,8 +200,6 @@ class ShareLiveModal extends React.Component {
...
@@ -142,8 +200,6 @@ class ShareLiveModal extends React.Component {
}
}
{
type
===
"videoClass"
&&
{
type
===
"videoClass"
&&
<
div
className=
"sub-title"
>
用户可通过微信识别二维码,报名观看视频
</
div
>
<
div
className=
"sub-title"
>
用户可通过微信识别二维码,报名观看视频
</
div
>
}
}
<
div
className=
"content"
onClick=
{
this
.
handleDownloadPoster
}
>
下载海报
</
div
>
<
div
className=
"content"
onClick=
{
this
.
handleDownloadPoster
}
>
下载海报
</
div
>
...
@@ -162,7 +218,6 @@ class ShareLiveModal extends React.Component {
...
@@ -162,7 +218,6 @@ class ShareLiveModal extends React.Component {
<
Button
type=
"primary"
onClick=
{
this
.
handleCopy
}
>
复制
</
Button
>
<
Button
type=
"primary"
onClick=
{
this
.
handleCopy
}
>
复制
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
Modal
>
</
Modal
>
)
)
...
...
src/modules/course-manage/modal/ShareLiveModal.less
View file @
b6807c33
.share-live-modal {
.share-live-modal {
.ant-modal-body {
.ant-modal-body {
display: flex;
display: flex;
#poster{
background: #FFF;
margin:0;
padding: 20px;
}
.left {
.left {
width: 303px;
width: 303px;
padding: 20px;
margin: 0 32px 0 16px;
margin: 0 32px 0 16px;
box-shadow:0px 2px 10px 0px rgba(0,0,0,0.05);
box-shadow:0px 2px 10px 0px rgba(0,0,0,0.05);
border-radius: 12px;
border-radius: 12px;
.course-name-title {
.course-name-title {
font-size: 14px;
font-size: 14px;
color: #333;
color: #333;
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
b6807c33
...
@@ -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: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
18 18:18:49
* @LastEditTime: 2021-01-
25 13:46:13
* @Description: 视频课新增/编辑页
* @Description: 视频课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -540,6 +540,7 @@ class AddVideoCourse extends React.Component {
...
@@ -540,6 +540,7 @@ class AddVideoCourse extends React.Component {
</
div
>
</
div
>
{
/* 选择备课文件弹窗 */
}
{
/* 选择备课文件弹窗 */
}
{
showSelectFileModal
&&
<
SelectPrepareFileModal
<
SelectPrepareFileModal
operateType=
"select"
operateType=
"select"
selectTypeList=
{
[
'MP4'
]
}
selectTypeList=
{
[
'MP4'
]
}
...
@@ -557,7 +558,7 @@ class AddVideoCourse extends React.Component {
...
@@ -557,7 +558,7 @@ class AddVideoCourse extends React.Component {
}
}
}
}
onSelect=
{
this
.
handleSelectVideo
}
onSelect=
{
this
.
handleSelectVideo
}
/>
/>
}
<
ImgCutModalNew
<
ImgCutModalNew
title=
"裁剪"
title=
"裁剪"
width=
{
550
}
width=
{
550
}
...
...
src/modules/course-manage/video-course/AddVideoCourse.less
View file @
b6807c33
.add-video-course-page {
.add-video-course-page {
.box{
margin-bottom:16px !important;
}
.ant-radio-group {
.ant-radio-group {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
@@ -25,7 +27,11 @@
...
@@ -25,7 +27,11 @@
.form {
.form {
margin-top: 16px;
margin-top: 16px;
padding: 0 16px;
padding: 0 16px;
.label{
display:inline-block;
text-align:right;
width:85px;
}
.required {
.required {
position: relative;
position: relative;
...
@@ -33,7 +39,7 @@
...
@@ -33,7 +39,7 @@
position: absolute;
position: absolute;
content: '*';
content: '*';
color: red;
color: red;
left:
-10
px;
left:
5
px;
top: 6px;
top: 6px;
}
}
...
@@ -110,7 +116,7 @@
...
@@ -110,7 +116,7 @@
}
}
.sub-content {
.sub-content {
margin-left:
70
px;
margin-left:
85
px;
margin-top: 4px;
margin-top: 4px;
.tips {
.tips {
...
...
src/modules/course-manage/video-course/components/AddVideoIntro.jsx
View file @
b6807c33
...
@@ -264,6 +264,7 @@ class AddVideoIntro extends React.Component {
...
@@ -264,6 +264,7 @@ class AddVideoIntro extends React.Component {
</
div
>
</
div
>
</
div
>
</
div
>
{
/* 选择暖场图文件弹窗 */
}
{
/* 选择暖场图文件弹窗 */
}
{
showSelectFileModal
&&
<
SelectPrepareFileModal
<
SelectPrepareFileModal
operateType=
"select"
operateType=
"select"
accept=
{
selectType
===
"INTRO"
?
"image/jpeg,image/png,image/jpg"
:
"video/mp4,image/jpeg,image/png,image/jpg"
}
accept=
{
selectType
===
"INTRO"
?
"image/jpeg,image/png,image/jpg"
:
"video/mp4,image/jpeg,image/png,image/jpg"
}
...
@@ -275,7 +276,7 @@ class AddVideoIntro extends React.Component {
...
@@ -275,7 +276,7 @@ class AddVideoIntro extends React.Component {
}
}
}
}
onSelect=
{
this
.
handleSelectVideo
}
onSelect=
{
this
.
handleSelectVideo
}
/>
/>
}
</
div
>
</
div
>
)
)
}
}
...
...
src/modules/course-manage/video-course/components/AddVideoIntro.less
View file @
b6807c33
...
@@ -8,7 +8,11 @@
...
@@ -8,7 +8,11 @@
color: #999;
color: #999;
}
}
}
}
.label{
display:inline-block;
text-align:right;
width:85px;
}
.playback,
.playback,
.introduce {
.introduce {
display: flex;
display: flex;
...
...
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
b6807c33
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:12:45
* @Date: 2020-08-05 10:12:45
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-2
2 16:25:06
* @LastEditTime: 2021-01-2
5 13:58:13
* @Description: 视频课-列表模块
* @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment