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
1b56f95f
Commit
1b56f95f
authored
Jan 11, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理安装直播客户端
parent
8c741b60
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
31 deletions
+25
-31
src/components/DownloadLiveModal.jsx
+13
-28
src/modules/course-manage/components/LiveCourseList.jsx
+12
-3
No files found.
src/components/DownloadLiveModal.jsx
View file @
1b56f95f
import
React
from
'react'
import
React
from
'react'
;
import
{
Modal
,
Button
}
from
"antd"
;
import
{
Modal
,
Button
}
from
"antd"
;
import
"./DownloadLiveModal.less"
import
"./DownloadLiveModal.less"
...
@@ -12,37 +13,12 @@ class DownloadLiveModal extends React.Component {
...
@@ -12,37 +13,12 @@ class DownloadLiveModal extends React.Component {
type
:
'pre'
,
type
:
'pre'
,
}
}
}
}
downloadLiveClient
(){
if
(
type
===
'pre'
)
{
const
isMac
=
/macintosh|mac os x/i
.
test
(
navigator
.
userAgent
);
if
(
isMac
){
Modal
.
info
({
title
:
"抱歉,暂不支持Mac版"
,
content
:
"Mac版正在开发中,敬请期待"
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
okText
:
'我知道了'
});
return
;
}
url
&&
window
.
open
(
url
);
this
.
setState
({
image
:
'https://image.xiaomaiketang.com/xm/wPwRdaa7MM.png'
,
tip
:
'安装完成后,再次打开即可开始直播。'
,
text
:
'我知道了'
,
type
:
'finish'
,
})
}
else
{
this
.
props
.
onCancel
();
}
}
render
()
{
render
()
{
const
{
url
}
=
this
.
props
;
const
{
url
}
=
this
.
props
;
const
{
image
,
tip
,
text
,
type
}
=
this
.
state
;
const
{
image
,
tip
,
text
,
type
}
=
this
.
state
;
return
<
Modal
return
<
Modal
visible=
{
true
}
visible=
{
true
}
maskClosable=
{
false
}
title=
"下载客户端"
title=
"下载客户端"
className=
"download-live-modal"
className=
"download-live-modal"
footer=
{
null
}
footer=
{
null
}
...
@@ -56,8 +32,17 @@ class DownloadLiveModal extends React.Component {
...
@@ -56,8 +32,17 @@ class DownloadLiveModal extends React.Component {
type=
"primary"
type=
"primary"
className=
"download-button"
className=
"download-button"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
type
===
'pre'
)
{
url
&&
window
.
open
(
url
);
this
.
setState
({
image
:
'https://image.xiaomaiketang.com/xm/wPwRdaa7MM.png'
,
tip
:
'安装完成后,再次打开即可开始直播。'
,
text
:
'我知道了'
,
type
:
'finish'
,
})
}
else
{
this
.
props
.
onCancel
();
}
}
}
}
}
>
{
text
}
</
Button
>
>
{
text
}
</
Button
>
</
Modal
>
</
Modal
>
...
...
src/modules/course-manage/components/LiveCourseList.jsx
View file @
1b56f95f
...
@@ -30,6 +30,7 @@ import './LiveCourseList.less';
...
@@ -30,6 +30,7 @@ import './LiveCourseList.less';
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
DataList
from
'../DataList/DataList'
;
import
DataList
from
'../DataList/DataList'
;
import
User
from
'@/common/js/user'
;
import
User
from
'@/common/js/user'
;
...
@@ -67,9 +68,10 @@ class LiveCourseList extends React.Component {
...
@@ -67,9 +68,10 @@ class LiveCourseList extends React.Component {
}
}
componentWillMount
(){
componentWillMount
(){
this
.
parseColumns
();
this
.
parseColumns
();
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getDownloadVersion
()
}
}
// 显示分享弹窗
// 显示分享弹窗
handleShowShareModal
=
(
item
,
needStr
=
false
)
=>
{
handleShowShareModal
=
(
item
,
needStr
=
false
)
=>
{
...
@@ -173,7 +175,7 @@ class LiveCourseList extends React.Component {
...
@@ -173,7 +175,7 @@ class LiveCourseList extends React.Component {
<
span
className=
"course-time"
>
{
formatDate
(
"YYYY-MM-DD H:i"
,
parseInt
(
record
.
startTime
))
}
~
{
formatDate
(
"H:i"
,
parseInt
(
record
.
endTime
))
}
</
span
>
<
span
className=
"course-time"
>
{
formatDate
(
"YYYY-MM-DD H:i"
,
parseInt
(
record
.
startTime
))
}
~
{
formatDate
(
"H:i"
,
parseInt
(
record
.
endTime
))
}
</
span
>
<
span
className=
"course-status"
style=
{
{
color
:
courseStateShow
[
record
.
courseState
].
color
,
border
:
`1px solid ${courseStateShow[record.courseState].color}`
}
}
>
{
courseStateShow
[
record
.
courseState
].
title
}
</
span
>
<
span
className=
"course-status"
style=
{
{
color
:
courseStateShow
[
record
.
courseState
].
color
,
border
:
`1px solid ${courseStateShow[record.courseState].color}`
}
}
>
{
courseStateShow
[
record
.
courseState
].
title
}
</
span
>
</
div
>
</
div
>
<
div
class=
"teacher-assistant"
>
<
div
class
Name
=
"teacher-assistant"
>
<
span
className=
"teacher"
>
讲师:
{
record
.
teacherName
}
</
span
>
<
span
className=
"teacher"
>
讲师:
{
record
.
teacherName
}
</
span
>
{
record
.
admins
.
length
>
0
&&
{
record
.
admins
.
length
>
0
&&
...
@@ -411,7 +413,14 @@ class LiveCourseList extends React.Component {
...
@@ -411,7 +413,14 @@ class LiveCourseList extends React.Component {
_query
.
size
=
size
;
_query
.
size
=
size
;
this
.
props
.
onChange
(
_query
)
this
.
props
.
onChange
(
_query
)
}
}
getDownloadVersion
()
{
BaseService
.
getLastedVersion
({
model
:
1
,
platform
:
1
})
.
then
((
res
)
=>
{
const
{
result
=
{}
}
=
res
;
this
.
setState
({
downloadUrl
:
result
.
releaseUrl
});
})
}
render
()
{
render
()
{
const
{
total
,
query
,
courseList
,
loading
}
=
this
.
props
;
const
{
total
,
query
,
courseList
,
loading
}
=
this
.
props
;
const
{
current
,
size
}
=
query
;
const
{
current
,
size
}
=
query
;
...
...
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