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
656640df
Commit
656640df
authored
Jan 12, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Plain Diff
feat:处理冲突
parents
83860eb7
9330ecb7
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
338 additions
and
125 deletions
+338
-125
src/common/js/axios.ts
+3
-3
src/components/DownloadLiveModal.jsx
+13
-28
src/components/ImgCutModalNew.jsx
+1
-0
src/data-source/base/request-apis.ts
+4
-1
src/domains/basic-domain/baseService.ts
+6
-2
src/domains/basic-domain/constants.ts
+3
-3
src/domains/course-domain/constants.ts
+6
-3
src/index.html
+2
-2
src/modules/course-manage/AddLive.jsx
+1
-1
src/modules/course-manage/DataList/CourseData.jsx
+2
-2
src/modules/course-manage/components/LiveCourseFilter.jsx
+4
-2
src/modules/course-manage/components/LiveCourseList.jsx
+57
-30
src/modules/course-manage/components/LiveCourseOpt.jsx
+11
-9
src/modules/course-manage/modal/PreviewCourseModal.jsx
+23
-10
src/modules/course-manage/video-course/AddVideoCourse.jsx
+45
-18
src/modules/course-manage/video-course/components/VideoCourseFilter.jsx
+5
-3
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+16
-7
src/modules/root/Header.tsx
+135
-0
src/modules/root/Login.jsx
+1
-1
No files found.
src/common/js/axios.ts
View file @
656640df
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:31
* @LastEditors: zhangleyuan
* @LastEditTime: 202
0-12-22 15:24:03
* @LastEditTime: 202
1-01-09 14:39:46
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -27,7 +27,7 @@ interface HeadersType{
storeId
?:
any
,
storeUserId
?:
any
,
userId
?:
any
,
token
?:
any
xm
token
?:
any
}
class
Axios
{
static
post
(
...
...
@@ -49,7 +49,7 @@ class Axios {
headerObject
.
userId
=
User
.
getUserId
();
}
if
(
User
.
getToken
()){
headerObject
.
token
=
User
.
getToken
();
headerObject
.
xm
token
=
User
.
getToken
();
}
const
instance
:
AxiosInstance
=
axios
.
create
({
timeout
:
TIME_OUT
,
...
...
src/components/DownloadLiveModal.jsx
View file @
656640df
import
React
from
'react'
import
React
from
'react'
;
import
{
Modal
,
Button
}
from
"antd"
;
import
"./DownloadLiveModal.less"
...
...
@@ -12,37 +13,12 @@ class DownloadLiveModal extends React.Component {
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
()
{
const
{
url
}
=
this
.
props
;
const
{
image
,
tip
,
text
,
type
}
=
this
.
state
;
return
<
Modal
visible=
{
true
}
maskClosable=
{
false
}
title=
"下载客户端"
className=
"download-live-modal"
footer=
{
null
}
...
...
@@ -56,8 +32,17 @@ class DownloadLiveModal extends React.Component {
type=
"primary"
className=
"download-button"
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
>
</
Modal
>
...
...
src/components/ImgCutModalNew.jsx
View file @
656640df
...
...
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import
{
Modal
,
Button
}
from
'antd'
;
import
Service
from
'@/common/js/service'
;
import
User
from
'@/common/js/user'
;
import
PhotoClip
from
'photoclip'
let
cutFlag
=
false
;
class
ImgCutModalNew
extends
React
.
Component
{
...
...
src/data-source/base/request-apis.ts
View file @
656640df
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan
* @LastEditTime: 202
0-12-22 15:39:00
* @LastEditTime: 202
1-01-09 11:06:42
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -38,6 +38,9 @@ export function sendNewPhoneAuthCode(params: object) {
export
function
editUserPhone
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/editUserPhone"
,
params
);
}
export
function
getLastedVersion
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/getLastedVersion"
,
params
);
}
export
const
getOssClient
=
(
data
:
object
,
instId
:
string
,
...
...
src/domains/basic-domain/baseService.ts
View file @
656640df
...
...
@@ -2,12 +2,12 @@
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan
* @LastEditTime: 202
0-12-11 11:36:19
* @LastEditTime: 202
1-01-09 11:08:02
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
}
from
'@/data-source/base/request-apis'
;
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
,
getLastedVersion
}
from
'@/data-source/base/request-apis'
;
export
default
class
StoreService
{
// 获取员工列表
...
...
@@ -46,4 +46,7 @@ export default class StoreService {
static
login
(
params
:
any
){
return
login
(
params
);
}
static
getLastedVersion
(
params
:
any
){
return
getLastedVersion
(
params
);
}
}
\ No newline at end of file
src/domains/basic-domain/constants.ts
View file @
656640df
/*
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 202
0-12-26 14:10:34
* @LastEditTime: 202
1-01-11 15:21:59
* @LastEditors: zhangleyuan
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
...
...
@@ -25,5 +25,6 @@ export const USER_TYPE: string = 'B';
export
const
PROJECT
=
'xmzj-web-b'
;
export
const
VERSION
=
'5.4.8'
;
export
const
PREFIX
=
'cloud-class'
;
// host
export
const
BASIC_HOST
:
string
=
BASIC_HOST_MAP
[
ENV
];
\ No newline at end of file
export
const
BASIC_HOST
:
string
=
BASIC_HOST_MAP
[
ENV
];
src/domains/course-domain/constants.ts
View file @
656640df
/*
* @Author: 吴文洁
* @Date: 2020-08-20 09:21:40
* @LastEditors:
wuf
an
* @LastEditTime: 2021-01-
06 21:16:34
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2021-01-
11 15:35:49
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -25,7 +25,7 @@ const shareUrlMap: MapInterface = {
'gray'
:
'https://prod.xiaomai5.com/share/show?appid='
}
const
LIVE_SHARE_MAP
:
MapInterface
=
{
const
LIVE_SHARE_MAP
:
MapInterface
=
{
dev
:
'https://dev.xiaomai5.com/store-live/index.html#/'
,
dev1
:
'https://dev.xiaomai5.com/store-live/index.html#/'
,
rc
:
'https://rc.xiaomai5.com/store-live/index.html#/'
,
...
...
@@ -33,6 +33,9 @@ const shareUrlMap: MapInterface = {
prod
:
'https://res.xiaomai0.com/store-live/index.html#/'
,
}
export
const
appId
:
string
=
appIdMap
[
ENV
];
export
const
shareUrl
:
string
=
shareUrlMap
[
ENV
];
export
const
LIVE_SHARE
:
string
=
LIVE_SHARE_MAP
[
ENV
];
src/index.html
View file @
656640df
<!--
* @Author: 吴文洁
* @Date: 2020-08-24 12:20:57
* @LastEditors:
wuf
an
* @LastEditTime: 2021-01-12
13:52:23
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2021-01-12
21:13:37
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
-->
...
...
src/modules/course-manage/AddLive.jsx
View file @
656640df
...
...
@@ -388,7 +388,7 @@ handleChangeBasicInfo = (field, value) => {
message
.
warning
(
'请选择上课日期'
);
resolve
(
false
);
return
;
}
else
if
(
startTime
===
endTime
)
{
}
else
if
(
startTime
===
endTime
||
startTime
>
endTime
)
{
message
.
warning
(
'结束时间必须晚于开始时间'
);
resolve
(
false
);
return
;
...
...
src/modules/course-manage/DataList/CourseData.jsx
View file @
656640df
...
...
@@ -151,8 +151,8 @@ class DataList extends React.Component {
},
{
title
:
"累计在线时长"
,
dataIndex
:
"
watch
Duration"
,
sorter
:
(
a
,
b
)
=>
a
.
watchDuration
-
b
.
watch
Duration
,
dataIndex
:
"
total
Duration"
,
sorter
:
(
a
,
b
)
=>
a
.
totalDuration
-
b
.
total
Duration
,
sortDirections
:
[
"descend"
,
"ascend"
],
render
:
(
text
,
record
)
=>
{
//如无离开时间,就置空
...
...
src/modules/course-manage/components/LiveCourseFilter.jsx
View file @
656640df
...
...
@@ -98,8 +98,10 @@ class LiveCourseFilter extends React.Component {
query
.
endTime
=
dates
[
1
].
valueOf
();
}
this
.
setState
({
query
,
current
:
1
,
query
:{
...
query
,
current
:
1
,
}
},
()
=>
{
this
.
props
.
onChange
(
this
.
state
.
query
);
})
...
...
src/modules/course-manage/components/LiveCourseList.jsx
View file @
656640df
...
...
@@ -28,10 +28,13 @@ import ShareLiveModal from '../modal/ShareLiveModal';
import
'./LiveCourseList.less'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
,
LIVE_REPLAY_MAP
}
from
'@/domains/course-domain/constants'
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
DataList
from
'../DataList/DataList'
;
import
User
from
'@/common/js/user'
;
import
_
from
"underscore"
;
import
user
from
'@/common/js/user'
;
const
{
confirm
}
=
Modal
;
const
courseStateShow
=
{
...
...
@@ -67,9 +70,10 @@ class LiveCourseList extends React.Component {
}
componentWillMount
(){
this
.
parseColumns
();
}
componentDidMount
()
{
this
.
getDownloadVersion
()
}
// 显示分享弹窗
handleShowShareModal
=
(
item
,
needStr
=
false
)
=>
{
...
...
@@ -173,7 +177,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-status"
style=
{
{
color
:
courseStateShow
[
record
.
courseState
].
color
,
border
:
`1px solid ${courseStateShow[record.courseState].color}`
}
}
>
{
courseStateShow
[
record
.
courseState
].
title
}
</
span
>
</
div
>
<
div
class=
"teacher-assistant"
>
<
div
class
Name
=
"teacher-assistant"
>
<
span
className=
"teacher"
>
讲师:
{
record
.
teacherName
}
</
span
>
{
record
.
admins
.
length
>
0
&&
...
...
@@ -255,29 +259,34 @@ class LiveCourseList extends React.Component {
dataIndex
:
"operate"
,
render
:
(
val
,
item
)
=>
{
return
(
<
div
className=
"operate"
>
{
(
item
.
courseState
===
"UN_START"
||
item
.
courseState
===
"STARTING"
)
&&
{
((
item
.
courseState
===
"UN_START"
||
item
.
courseState
===
"STARTING"
)
&&
(
item
.
teacherId
===
User
.
getUserId
()
||
_
.
pluck
(
item
.
admins
,
"adminId"
).
includes
(
User
.
getUserId
())))
&&
<>
<
div
key=
"enter_live_room1"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleEnterLiveRoom
(
item
)
}
}
>
进入直播间
</
div
>
<
span
className=
"operate__item split"
key=
"view_play_back_split"
>
|
</
span
>
</>
}
{
(
item
.
courseState
===
"FINISH"
)
&&
<>
<
div
key=
"view_play_back"
className=
"operate__item"
>
查看回放
</
div
>
<
div
key=
"view_play_back"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleViewPlayBack
(
item
)}
}
>
查看回放
</
div
>
<
span
className=
"operate__item split"
key=
"view_play_back_split"
>
|
</
span
>
</>
}
{
item
.
courseState
!==
"EXPIRED"
&&
<>
<
span
className=
"operate__item split"
key=
"view_play_back_split"
>
|
</
span
>
<
div
key=
"share"
className=
"operate__item"
...
...
@@ -383,25 +392,24 @@ class LiveCourseList extends React.Component {
),
});
}
else
{
// axios
// .Apollo("public/businessLive/getCourseDetail", {
// liveCourseId: item.liveCourseId,
// })
// .then((res) => {
// const url = `xiaomai5://instId=${instId}&courseId=${item.liveCourseId}&teacherId=${item.teacherId}&uid=${ teacherId ? User_t.uid() : User.uid()}&aid=${teacherId ? "" : User.aid()}&tid=${teacherId || ""}&identity=${identity}&classType=${item.liveType}&xmVersion=${window.NewVersion ? '5.0' : '4.0'}`;
// if (res.result.courseState === "FINISH") {
// Modal.warning({
// title: "刷新页面",
// icon: <QuestionCircleOutlined />,
// content: "课次已结束,请刷新一下",
// onOk: () => {
// this.refreshCourseList();
// }
// });
// } else {
this
.
setState
({
url
:
''
,
openDownloadModal
:
true
});
// }
// });
CourseService
.
getLiveCloudCourseDetail
({
liveCourseId
:
item
.
liveCourseId
,
})
.
then
((
res
)
=>
{
const
url
=
`xmqx://liveCourseId=
${
item
.
liveCourseId
}
`
;
if
(
res
.
result
.
courseState
===
"FINISH"
)
{
Modal
.
warning
({
title
:
"刷新页面"
,
icon
:
<
QuestionCircleOutlined
/>,
content
:
"课次已结束,请刷新一下"
,
onOk
:
()
=>
{
this
.
refreshCourseList
();
}
});
}
else
{
this
.
setState
({
url
,
openDownloadModal
:
true
});
}
});
}
}
onShowSizeChange
=
(
current
,
size
)
=>
{
...
...
@@ -412,7 +420,26 @@ class LiveCourseList extends React.Component {
_query
.
size
=
size
;
this
.
props
.
onChange
(
_query
)
}
getDownloadVersion
()
{
BaseService
.
getLastedVersion
({
model
:
5
,
platform
:
1
})
.
then
((
res
)
=>
{
const
{
result
=
{}
}
=
res
;
this
.
setState
({
downloadUrl
:
result
.
releaseUrl
});
})
}
handleViewPlayBack
=
(
item
)
=>
{
let
htmlUrl
;
if
(
item
.
teacherId
===
User
.
getUserId
){
htmlUrl
=
`
${
LIVE_SHARE
}
replay/
${
item
.
liveCourseId
}
?teacherId=
${
User
.
getUserId
}
&id=
${
User
.
getStoreId
}
`
;
}
else
if
(
_
.
pluck
(
item
.
admins
,
"adminId"
).
includes
(
User
.
getUserId
())){
htmlUrl
=
`
${
LIVE_SHARE
}
replay/
${
item
.
liveCourseId
}
?userId=
${
User
.
getUserId
()}
&id=
${
User
.
getStoreId
}
`
;
}
else
{
htmlUrl
=
`
${
LIVE_SHARE
}
replay/
${
item
.
liveCourseId
}
?id=
${
User
.
getStoreId
}
`
;
}
window
.
open
(
htmlUrl
);
}
render
()
{
const
{
total
,
query
,
courseList
,
loading
}
=
this
.
props
;
const
{
current
,
size
}
=
query
;
...
...
src/modules/course-manage/components/LiveCourseOpt.jsx
View file @
656640df
...
...
@@ -8,7 +8,9 @@
import
React
from
'react'
;
import
{
Button
,
Modal
,
message
}
from
'antd'
;
import
Service
from
'@/common/js/service'
;
import
'./liveCourseOpt.less'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
class
LiveCourseOpt
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -23,15 +25,15 @@ class LiveCourseOpt extends React.Component {
const
isMac
=
/macintosh|mac os x/i
.
test
(
navigator
.
userAgent
);
// 判断用户系统
if
(
!
isMac
)
{
// axios
// .Apollo("anon/version/getLastedVersion", { model: 1
, platform: 1 })
//
.then((res) => {
//
const a = document.createElement("a");
//
document.body.appendChild(a);
//
a.href = res.result.releaseUrl;
//
a.click();
//
document.body.removeChild(a);
//
})
BaseService
.
getLastedVersion
({
model
:
5
,
platform
:
1
})
.
then
((
res
)
=>
{
const
a
=
document
.
createElement
(
"a"
);
document
.
body
.
appendChild
(
a
);
a
.
href
=
res
.
result
.
releaseUrl
;
a
.
click
();
document
.
body
.
removeChild
(
a
);
})
}
else
{
Modal
.
info
({
title
:
"抱歉,暂不支持Mac版"
,
...
...
src/modules/course-manage/modal/PreviewCourseModal.jsx
View file @
656640df
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-07-23 14:54:16
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-0
8 17:49:46
* @LastEditTime: 2021-01-0
9 16:26:03
* @Description: 大班直播课预览弹窗
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -36,7 +36,16 @@ class PreviewCourseModal extends React.Component {
}
}
dealTimeDuration
=
(
time
)
=>
{
const
diff
=
Math
.
floor
(
time
%
3600
);
let
hours
=
Math
.
floor
(
time
/
3600
);
let
mins
=
Math
.
floor
(
diff
/
60
);
let
seconds
=
Math
.
floor
(
time
%
60
);
hours
=
hours
<
10
?
(
"0"
+
hours
)
:
hours
;
mins
=
mins
<
10
?
(
"0"
+
mins
)
:
mins
;
seconds
=
seconds
<
10
?
(
"0"
+
seconds
)
:
seconds
;
return
hours
+
":"
+
mins
+
":"
+
seconds
;
}
dealWithTime
=
(
startTime
,
endTime
)
=>
{
const
startDate
=
new
Date
(
Number
(
startTime
));
const
endDate
=
new
Date
(
Number
(
endTime
));
...
...
@@ -64,8 +73,8 @@ class PreviewCourseModal extends React.Component {
render
()
{
const
{
courseBasicInfo
,
courseClassInfo
=
{},
courseIntroInfo
,
type
,
courseState
}
=
this
.
props
;
const
{
coverUrl
,
courseName
,
scheduleVideoUrl
}
=
courseBasicInfo
;
const
{
courseBasicInfo
,
courseClassInfo
=
{},
courseIntroInfo
,
type
,
courseState
,
origin
}
=
this
.
props
;
const
{
coverUrl
,
courseName
,
scheduleVideoUrl
,
videoDuration
}
=
courseBasicInfo
;
const
{
liveDate
,
calendarTime
,
startTime
,
endTime
,
timeHorizonStart
,
timeHorizonEnd
,
teacherName
}
=
courseClassInfo
;
const
{
liveCourseMediaRequests
}
=
courseIntroInfo
;
...
...
@@ -128,13 +137,15 @@ class PreviewCourseModal extends React.Component {
<
img
src=
{
coverUrl
}
className=
"course-cover"
/>
}
</
div
>
{
type
===
'videoCourse'
?
<
div
className=
"container__body"
>
<
div
className=
"title__name"
>
{
courseName
}
</
div
>
<
div
className=
"title__inst-name"
>
{
window
.
currentUserInstInfo
.
name
}
</
div
>
</
div
>
:
{
videoDuration
&&
<
div
>
视频时长:
{
this
.
dealTimeDuration
(
videoDuration
)
}
</
div
>
}
</
div
>
:
<
div
className=
"container__body"
>
<
div
className=
"container__body__title"
>
<
div
className=
"title__name"
>
{
courseName
}
</
div
>
...
...
@@ -144,13 +155,11 @@ class PreviewCourseModal extends React.Component {
<
span
className=
"time__label"
>
上课时间:
</
span
>
<
span
className=
"time__value"
>
{
[
<
span
>
{
liveDateStr
}
</
span
>,
<
span
>
{
startTimeStr
}
~
{
endTimeStr
}
</
span
>
]
}
</
span
>
</
div
>
<
div
className=
"container__body__teacher"
>
...
...
@@ -161,7 +170,11 @@ class PreviewCourseModal extends React.Component {
}
<
div
className=
"container__introduction"
>
<
div
className=
"container__introduction__title"
>
直播简介
</
div
>
{
type
===
'videoCourse'
?
<
div
className=
"container__introduction__title"
>
视频简介
</
div
>
:
<
div
className=
"container__introduction__title"
>
直播简介
</
div
>
}
<
div
className=
"container__introduction__list editor-box"
>
{
liveCourseMediaRequests
.
map
((
item
,
index
)
=>
{
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
656640df
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
08 17:56:17
* @LastEditTime: 2021-01-
12 11:34:42
* @Description: 视频课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -22,11 +22,23 @@ import PreviewCourseModal from '../modal/PreviewCourseModal';
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
User
from
'@/common/js/user'
;
import
_
from
"underscore"
;
import
'./AddVideoCourse.less'
;
const
EDIT_BOX_KEY
=
Math
.
random
(
16
);
const
EDIT_BOX_KEY
=
Math
.
random
();
const
fieldNames
=
{
label
:
'categoryName'
,
value
:
'id'
,
children
:
'sonCategoryList'
};
//添加课程时课程默认的一些值
const
defaultShelfState
=
'YES'
;
const
defaultScheduleMedia
=
[{
contentType
:
'INTRO'
,
mediaType
:
'TEXT'
,
mediaContent
:
''
,
key
:
EDIT_BOX_KEY
}]
const
whetherVisitorsJoin
=
'NO'
class
AddVideoCourse
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -39,7 +51,6 @@ class AddVideoCourse extends React.Component {
id
,
// 视频课ID,编辑的时候从URL上带过来
pageType
,
// 页面类型: add->新建 edit->编辑
imageFile
:
null
,
// 需要被截取的图片
courseName
:
null
,
// 视频课名称
scheduleVideoId
:
null
,
// 视频课链接
coverId
:
null
,
// 视频封面的recourceId
...
...
@@ -50,7 +61,7 @@ class AddVideoCourse extends React.Component {
contentType
:
"INTRO"
,
mediaType
:
'TEXT'
,
mediaContent
:
''
,
key
:
Math
.
random
()
key
:
EDIT_BOX_KEY
}],
diskList
:
[],
// 机构可见磁盘目录
selectedFileList
:
[],
// 已经从资料云盘中勾选的文件
...
...
@@ -171,22 +182,36 @@ class AddVideoCourse extends React.Component {
categoryName
,
categoryId
});
})
}
handleGoBack
=
()
=>
{
Modal
.
confirm
({
title
:
'确认要返回吗?'
,
content
:
'返回后,本次编辑的内容将不被保存。'
,
okText
:
'确认返回'
,
cancelText
:
'留在本页'
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
onOk
:
()
=>
{
RCHistory
.
goBack
();
}
});
const
{
coverId
,
videoName
,
videoDuration
,
courseName
,
scheduleMedia
,
scheduleVideoId
,
categoryId
,
shelfState
,
whetherVisitorsJoin
}
=
this
.
state
;
if
(
videoName
||
videoDuration
||
scheduleVideoId
||
!
_
.
isEqual
(
scheduleMedia
,
defaultScheduleMedia
)
||
categoryId
||
courseName
||
coverId
||
shelfState
!==
defaultShelfState
||
whetherVisitorsJoin
!==
whetherVisitorsJoin
){
Modal
.
confirm
({
title
:
'确认要返回吗?'
,
content
:
'返回后,本次编辑的内容将不被保存。'
,
okText
:
'确认返回'
,
cancelText
:
'留在本页'
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
onOk
:
()
=>
{
RCHistory
.
goBack
();
}
});
}
else
{
RCHistory
.
goBack
();
}
}
// 修改表单
...
...
@@ -239,15 +264,17 @@ class AddVideoCourse extends React.Component {
coverUrl
,
scheduleVideoUrl
,
courseName
,
scheduleMedia
scheduleMedia
,
videoDuration
}
=
this
.
state
;
const
courseBasinInfo
=
{
coverUrl
,
scheduleVideoUrl
,
courseName
,
videoDuration
}
const
courseIntroInfo
=
{
liveCourseMediaRequests
:
scheduleMedia
}
...
...
src/modules/course-manage/video-course/components/VideoCourseFilter.jsx
View file @
656640df
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:11:57
* @LastEditors: zhangleyuan
* @LastEditTime: 202
0-12-31 18:27:26
* @LastEditTime: 202
1-01-09 11:50:00
* @Description: 视频课-搜索模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -97,8 +97,10 @@ class VideoCourseFilter extends React.Component {
query
.
endTime
=
dates
[
1
].
valueOf
();
}
this
.
setState
({
query
,
current
:
1
,
query
:{
...
query
,
current
:
1
,
}
},
()
=>
{
this
.
props
.
onChange
(
this
.
state
.
query
);
})
...
...
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
656640df
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:12:45
* @LastEditors: wufan
* @LastEditTime: 2021-01-
09 13:59:06
* @LastEditTime: 2021-01-
12 20:11:09
* @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -95,7 +95,16 @@ class VideoCourseList extends React.Component {
{
title
:
'创建人'
,
key
:
'createName'
,
dataIndex
:
'createName'
dataIndex
:
'createName'
,
render
:
(
val
)
=>
{
return
(
<
Tooltip
title=
{
val
}
>
<
div
>
{
val
.
length
>
4
?
`${val.slice(0,4)}
...
`
:
val
}
</
div
>
</
Tooltip
>
)
}
},
{
title
:
<
span
>
...
...
@@ -269,17 +278,17 @@ class VideoCourseList extends React.Component {
const
{
query
}
=
this
.
props
;
let
{
order
:
_order
}
=
query
;
// 按创建时间升序排序
if
(
columnKey
===
'create
Time
'
&&
order
===
'ascend'
)
{
_order
=
'CREATED_ASC'
;
}
if
(
columnKey
===
'create
d
'
&&
order
===
'ascend'
)
{
_order
=
'CREATED_ASC'
;
}
// 按创建时间降序排序
if
(
columnKey
===
'create
Time
'
&&
order
===
'descend'
)
{
_order
=
'CREATED_DESC'
;
}
if
(
columnKey
===
'create
d
'
&&
order
===
'descend'
)
{
_order
=
'CREATED_DESC'
;
}
// 按更新时间升序排序
if
(
columnKey
===
'update
Time
'
&&
order
===
'ascend'
)
{
_order
=
'UPDATED_ASC'
;
}
if
(
columnKey
===
'update
d
'
&&
order
===
'ascend'
)
{
_order
=
'UPDATED_ASC'
;
}
// 按更新时间降序排序
if
(
columnKey
===
'update
Time
'
&&
order
===
'descend'
)
{
_order
=
'UPDATED_DESC'
;
}
if
(
columnKey
===
'update
d
'
&&
order
===
'descend'
)
{
_order
=
'UPDATED_DESC'
;
}
const
_query
=
{
...
query
,
order
:
_order
order
Enum
:
_order
};
this
.
props
.
onChange
(
_query
);
}
...
...
src/modules/root/Header.tsx
0 → 100644
View file @
656640df
/*
* @Author: 吴文洁
* @Date: 2019-09-10 18:26:03
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-22 15:39:35
* @Description:
*/
import
React
,
{
useContext
,
useState
}
from
'react'
;
import
'./Header.less'
;
import
{
Menu
,
Dropdown
,
Modal
}
from
'antd'
;
import
{
QuestionCircleOutlined
}
from
"@ant-design/icons"
;
import
{
withRouter
}
from
'react-router-dom'
;
import
User
from
'@/common/js/user'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
{
XMContext
}
from
'@/store/context'
;
import
logoImg
from
'@/common/images/logo.png'
;
const
baseImg
=
'https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png'
const
{
confirm
}
=
Modal
;
interface
headerProps
{
menuType
:
boolean
,
handleMenuType
:()
=>
void
}
function
Header
(
props
:
headerProps
){
const
{
menuType
,
handleMenuType
}
=
props
;
const
ctx
:
any
=
useContext
(
XMContext
);
function
userMenu
()
{
return
(
<
Menu
style=
{
{
maxWidth
:
"250px"
,
marginTop
:
5
,
}
}
>
<
Menu
.
Item
style=
{
{
whiteSpace
:
"normal"
,
wordBreak
:
"break-all"
}
}
key=
"1"
onClick=
{
()
=>
toPersonalInfoPage
()
}
>
个人设置
</
Menu
.
Item
>
<
Menu
.
Item
style=
{
{
whiteSpace
:
"normal"
,
wordBreak
:
"break-all"
}
}
key=
"2"
onClick=
{
e
=>
{
handleLogoutConfirm
();
}
}
>
退出登录
</
Menu
.
Item
>
</
Menu
>
);
}
function
handleMenu
(){
handleMenuType
();
};
function
toPersonalInfoPage
(){
window
.
RCHistory
.
push
({
pathname
:
`/personal-info`
,
})
}
function
handleLogoutConfirm
(){
return
confirm
({
title
:
"你确定要退出登录吗?"
,
content
:
"退出后,需重新登录"
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
okText
:
"退出登录"
,
cancelText
:
"点错了"
,
onOk
:
()
=>
{
handleLogout
();
},
});
}
function
handleLogout
(){
BaseService
.
logout
({}).
then
((
res
)
=>
{
User
.
removeUserId
();
User
.
removeToken
();
window
.
RCHistory
.
push
({
pathname
:
`/login`
,
})
});
}
return
(
<
div
id=
"top-container"
className=
"top-container"
>
<
div
className=
"top top-nav"
>
<
div
>
<
img
src=
{
logoImg
}
className=
"logo"
alt=
""
/>
{
menuType
&&
(
<
span
className=
"logo-name"
>
小麦企培
</
span
>
)
}
</
div
>
{
menuType
?
(
<
span
className=
"icon iconfont cursor ml20 handLike"
onClick=
{
handleMenu
}
>

</
span
>
)
:
(
<
span
className=
"icon iconfont cursor ml20 handLike"
onClick=
{
handleMenu
}
>

</
span
>
)
}
<
div
className=
"message-help"
>
<
div
className=
"store-name"
>
{
User
.
getStoreName
()
}
</
div
>
<
Dropdown
overlay=
{
userMenu
()
}
>
<
div
className=
"user"
>
<
img
style=
{
{
width
:
32
+
"px"
,
height
:
32
+
"px"
,
borderRadius
:
"50%"
,
overflow
:
"hidden"
,
flexShrink
:
0
,
}
}
src=
{
(
ctx
.
xmState
&&
ctx
.
xmState
.
storeList
&&
ctx
.
xmState
.
storeList
[
0
].
avatar
)
?
ctx
.
xmState
.
storeList
[
0
].
avatar
:
baseImg
}
/>
{
ctx
.
xmState
&&
ctx
.
xmState
.
storeList
&&
(
<
span
className=
"name"
>
{
ctx
.
xmState
.
storeList
[
0
].
nickName
}
</
span
>
)
}
</
div
>
</
Dropdown
>
</
div
>
</
div
>
</
div
>
);
}
export
default
Header
;
src/modules/root/Login.jsx
View file @
656640df
...
...
@@ -115,7 +115,7 @@ function Login(props) {
<
div
className=
"login-page"
>
<
div
className=
"login-main"
>
<
div
className=
"left-banner"
>
<
div
><
img
src=
{
require
(
"../../common/images/logo.png"
)
}
alt=
""
style=
{
{
width
:
60
,
height
:
61
}
}
/></
div
>
<
div
><
img
src=
{
require
(
"../../common/images/logo.png"
)
}
alt=
""
style=
{
{
width
:
60
,
height
:
61
}
}
/></
div
>
<
div
className=
"name"
>
小麦企培
</
div
>
<
div
className=
"desc"
>
一键开启直播授课 让知识更有价值
</
div
>
</
div
>
...
...
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