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
42ba818f
Commit
42ba818f
authored
Jan 06, 2021
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:完成直播课和视频课分享功能
parent
80ea47d4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
43 deletions
+55
-43
src/common/js/service.ts
+2
-2
src/data-source/course/request-api.ts
+5
-2
src/domains/course-domain/CourseService.ts
+11
-4
src/domains/course-domain/constants.ts
+7
-7
src/modules/course-manage/components/LiveCourseList.jsx
+4
-5
src/modules/course-manage/modal/ShareLiveModal.jsx
+17
-16
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+9
-7
No files found.
src/common/js/service.ts
View file @
42ba818f
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:51
* @LastEditors: wufan
* @LastEditTime: 202
0-12-17 14:14:43
* @LastEditTime: 202
1-01-06 20:18:46
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -23,7 +23,7 @@ class Service {
return
Axios
.
post
(
'POST'
,
`hades/
${
url
}
`
,
params
,
option
);
}
static
Sales
(
url
:
string
,
params
:
any
,
option
:
any
)
{
static
Sales
(
url
:
string
,
params
:
any
,
option
?
:
any
)
{
return
Axios
.
post
(
'POST'
,
`sales/
${
url
}
`
,
params
,
option
);
}
...
...
src/data-source/course/request-api.ts
View file @
42ba818f
/*
* @Author: wufan
* @Date: 2020-12-12 11:57:10
* @LastEditors:
zhangleyu
an
* @LastEditTime: 202
0-12-25 17:48:50
* @LastEditors:
wuf
an
* @LastEditTime: 202
1-01-06 20:18:16
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -12,6 +12,9 @@ import Service from "@/common/js/service";
export
function
fetchLecturerData
(
params
:
object
)
{
return
Service
.
Hades
(
"public/courseCloud/queryTeacherVisitData"
,
params
);
}
export
function
getQrcode
(
params
:
object
)
{
return
Service
.
Sales
(
"public/businessShow/convertShortUrls"
,
params
);
}
export
function
fetchUserData
(
params
:
object
)
{
return
Service
.
Hades
(
"public/courseCloud/queryStudentVisitData"
,
params
);
...
...
src/domains/course-domain/CourseService.ts
View file @
42ba818f
/*
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors:
zhangleyu
an
* @LastEditTime: 202
0-12-25 18:21:33
* @LastEditors:
wuf
an
* @LastEditTime: 202
1-01-06 20:17:40
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
fetchLecturerData
,
fetchUserData
,
exportStudentCourseData
,
exportPlayBackCourseData
,
fetchPlaybackList
,
createLiveCloudCourse
,
getLiveCloudCoursePage
,
getLiveCloudCourseDetail
,
updateLiveCloudCourse
,
turnOnOrOffLiveCloudCourse
,
delLiveCloudCourse
,
changeVideoShelfState
,
createVideoSchedule
,
delVideoSchedule
,
editVideoSchedule
,
userWatchInfo
,
videoSchedulePage
,
videoScheduleDetail
,
videoWatchInfo
}
from
'@/data-source/course/request-api'
;
import
{
fetchLecturerData
,
fetchUserData
,
exportStudentCourseData
,
exportPlayBackCourseData
,
fetchPlaybackList
,
createLiveCloudCourse
,
getLiveCloudCoursePage
,
getLiveCloudCourseDetail
,
updateLiveCloudCourse
,
turnOnOrOffLiveCloudCourse
,
delLiveCloudCourse
,
changeVideoShelfState
,
createVideoSchedule
,
delVideoSchedule
,
editVideoSchedule
,
userWatchInfo
,
videoSchedulePage
,
videoScheduleDetail
,
videoWatchInfo
,
getQrcode
}
from
'@/data-source/course/request-api'
;
export
default
class
courseService
{
// 获取讲师上课数据
...
...
@@ -15,6 +17,11 @@ export default class courseService {
return
fetchLecturerData
(
params
);
}
// 生成二维码
static
getQrcode
(
params
:
any
)
{
return
getQrcode
(
params
);
}
// 获取用户上课数据
static
fetchUserData
(
params
:
any
)
{
return
fetchUserData
(
params
);
...
...
src/domains/course-domain/constants.ts
View file @
42ba818f
/*
* @Author: 吴文洁
* @Date: 2020-08-20 09:21:40
* @LastEditors:
zhangleyu
an
* @LastEditTime: 202
0-12-25 18:27:16
* @LastEditors:
wuf
an
* @LastEditTime: 202
1-01-06 20:38:03
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -26,11 +26,11 @@ const shareUrlMap: MapInterface = {
}
const
LIVE_SHARE_MAP
:
MapInterface
=
{
dev
:
'https://dev.xiaomai5.com/
xiaomai-live-shar
e/index.html#/'
,
dev1
:
'https://dev.xiaomai5.com/
xiaomai-live-shar
e/index.html#/'
,
rc
:
'https://rc.xiaomai5.com/
xiaomai-live-shar
e/index.html#/'
,
gray
:
'https://res.xiaomai
5.com/xiaomai-live-shar
e/gray/index.html#/'
,
prod
:
'https://res.xiaomai
5.com/xiaomai-live-shar
e/index.html#/'
,
dev
:
'https://dev.xiaomai5.com/
store-liv
e/index.html#/'
,
dev1
:
'https://dev.xiaomai5.com/
store-liv
e/index.html#/'
,
rc
:
'https://rc.xiaomai5.com/
store-liv
e/index.html#/'
,
gray
:
'https://res.xiaomai
0.com/store-liv
e/gray/index.html#/'
,
prod
:
'https://res.xiaomai
0.com/store-liv
e/index.html#/'
,
}
export
const
appId
:
string
=
appIdMap
[
ENV
];
...
...
src/modules/course-manage/components/LiveCourseList.jsx
View file @
42ba818f
...
...
@@ -31,6 +31,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons';
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
DataList
from
'../DataList/DataList'
;
import
User
from
'@/common/js/user'
;
const
{
confirm
}
=
Modal
;
const
courseStateShow
=
{
...
...
@@ -73,13 +74,11 @@ class LiveCourseList extends React.Component {
// 显示分享弹窗
handleShowShareModal
=
(
item
,
needStr
=
false
)
=>
{
const
_appId
=
appId
;
const
_shareUrl
=
shareUrl
;
const
{
liveCourseId
}
=
item
;
const
{
saaSVersionEnum
}
=
window
.
currentUserInstInfo
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
liveShare?id=
${
liveCourseId
}
&saasVersion=
${
saaSVersionEnum
}
`
;
const
l
ink
=
`
${
_appId
}
&redirect_uri=
${
encodeURIComponent
(
htmlUrl
)}
%26appid%3D
${
_appId
}
&response_type=code&scope=snsapi_base&state=state#wechat_redirect`
;
cons
t
longUrl
=
`
${
_shareUrl
}${
link
}
`
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
store/
${
User
.
getStoreId
()}
/live_detail/
${
liveCourseId
}
`
;
const
l
ongUrl
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
_appId
}
&redirect_uri=
${
encodeURIComponent
(
htmlUrl
)}
%26appid%3D
${
_appId
}
&response_type=code&scope=snsapi_base&state=state#wechat_redirect`
;
cons
ole
.
log
(
'htmlUrl'
,
htmlUrl
,
longUrl
)
;
const
shareData
=
{
...
item
,
longUrl
};
const
shareLiveModal
=
(
...
...
src/modules/course-manage/modal/ShareLiveModal.jsx
View file @
42ba818f
...
...
@@ -13,6 +13,7 @@ import html2canvas from 'html2canvas';
import
qrcode
from
"@/libs/qrcode/qrcode.js"
;
import
User
from
'@/common/js/user'
;
import
$
from
'jquery'
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
'./ShareLiveModal.less'
;
...
...
@@ -36,22 +37,22 @@ class ShareLiveModal extends React.Component {
handleConvertShortUrl
=
()
=>
{
const
{
longUrl
}
=
this
.
props
.
data
;
//
//
发请求
// axios.Sales('public/businessShow/convertShortUrls',
{
//
urls: [longUrl]
//
}).then((res) => {
//
const { result = [] } = res;
//
this.setState({
//
shareUrl: result[0].shortUrl
//
}, () => {
//
const qrcodeWrapDom = document.querySelector('#qrcodeWrap');
//
const qrcodeNode = new qrcode({
//
text: this.state.shareUrl,
//
size: 98,
//
})
//
qrcodeWrapDom.appendChild(qrcodeNode);
//
});
//
})
// 发请求
CourseService
.
getQrcode
(
{
urls
:
[
longUrl
]
}).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
this
.
setState
({
shareUrl
:
result
[
0
].
shortUrl
},
()
=>
{
const
qrcodeWrapDom
=
document
.
querySelector
(
'#qrcodeWrap'
);
const
qrcodeNode
=
new
qrcode
({
text
:
this
.
state
.
shareUrl
,
size
:
98
,
})
qrcodeWrapDom
.
appendChild
(
qrcodeNode
);
});
})
}
componentWillUnmount
()
{
...
...
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
42ba818f
/*
* @Author: 吴文洁
* @Date: 2020-08-05 10:12:45
* @LastEditors:
zhangleyu
an
* @LastEditTime: 202
0-12-31 18:26:5
7
* @LastEditors:
wuf
an
* @LastEditTime: 202
1-01-06 20:53:2
7
* @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -11,6 +11,7 @@ import { Table, Modal, message , Tooltip,Switch,Dropdown} from 'antd';
import
{
PageControl
}
from
"@/components"
;
import
{
LIVE_SHARE_MAP
}
from
'@/common/constants/academic/cloudClass'
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
ShareLiveModal
from
'@/modules/course-manage/modal/ShareLiveModal'
;
...
...
@@ -233,13 +234,14 @@ class VideoCourseList extends React.Component {
// 显示分享弹窗
handleShowShareModal
=
(
record
,
needStr
=
false
)
=>
{
// const appId = CONFIG.appId[ENV];
const
shareUrl
=
""
;
const
{
id
,
scheduleVideoUrl
}
=
record
;
const
htmlUrl
=
`
${
LIVE_SHARE_MAP
[
ENV
]}
videoShare?id=
${
id
}
`
;
const
link
=
htmlUrl
;
const
longUrl
=
""
;
const
_appId
=
appId
;
const
{
liveCourseId
}
=
record
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
store/
${
User
.
getStoreId
()}
/video_detail/
${
liveCourseId
}
`
;
const
longUrl
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
_appId
}
&redirect_uri=
${
encodeURIComponent
(
htmlUrl
)}
%26appid%3D
${
_appId
}
&response_type=code&scope=snsapi_base&state=state#wechat_redirect`
;
const
{
coverUrl
,
scheduleName
}
=
record
;
const
shareData
=
{
...
...
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