Commit 42ba818f by wufan

feat:完成直播课和视频课分享功能

parent 80ea47d4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-31 09:34:51 * @Date: 2020-08-31 09:34:51
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2020-12-17 14:14:43 * @LastEditTime: 2021-01-06 20:18:46
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -23,7 +23,7 @@ class Service { ...@@ -23,7 +23,7 @@ class Service {
return Axios.post('POST', `hades/${url}`, params, option); 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); return Axios.post('POST', `sales/${url}`, params, option);
} }
......
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-12-12 11:57:10 * @Date: 2020-12-12 11:57:10
* @LastEditors: zhangleyuan * @LastEditors: wufan
* @LastEditTime: 2020-12-25 17:48:50 * @LastEditTime: 2021-01-06 20:18:16
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -12,6 +12,9 @@ import Service from "@/common/js/service"; ...@@ -12,6 +12,9 @@ import Service from "@/common/js/service";
export function fetchLecturerData(params: object) { export function fetchLecturerData(params: object) {
return Service.Hades("public/courseCloud/queryTeacherVisitData", params); return Service.Hades("public/courseCloud/queryTeacherVisitData", params);
} }
export function getQrcode(params: object) {
return Service.Sales("public/businessShow/convertShortUrls", params);
}
export function fetchUserData(params: object) { export function fetchUserData(params: object) {
return Service.Hades("public/courseCloud/queryStudentVisitData", params); return Service.Hades("public/courseCloud/queryStudentVisitData", params);
......
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-11-25 18:25:02 * @Date: 2020-11-25 18:25:02
* @LastEditors: zhangleyuan * @LastEditors: wufan
* @LastEditTime: 2020-12-25 18:21:33 * @LastEditTime: 2021-01-06 20:17:40
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { fetchLecturerData, fetchUserData, exportStudentCourseData,exportPlayBackCourseData, fetchPlaybackList,createLiveCloudCourse,getLiveCloudCoursePage, import {
getLiveCloudCourseDetail,updateLiveCloudCourse,turnOnOrOffLiveCloudCourse,delLiveCloudCourse,changeVideoShelfState,createVideoSchedule,delVideoSchedule,editVideoSchedule,userWatchInfo,videoSchedulePage,videoScheduleDetail,videoWatchInfo} from '@/data-source/course/request-api'; 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 { export default class courseService {
// 获取讲师上课数据 // 获取讲师上课数据
...@@ -15,6 +17,11 @@ export default class courseService { ...@@ -15,6 +17,11 @@ export default class courseService {
return fetchLecturerData(params); return fetchLecturerData(params);
} }
// 生成二维码
static getQrcode(params: any) {
return getQrcode(params);
}
// 获取用户上课数据 // 获取用户上课数据
static fetchUserData(params: any) { static fetchUserData(params: any) {
return fetchUserData(params); return fetchUserData(params);
...@@ -25,7 +32,7 @@ export default class courseService { ...@@ -25,7 +32,7 @@ export default class courseService {
static getLiveCloudCoursePage(params: any) { static getLiveCloudCoursePage(params: any) {
return getLiveCloudCoursePage(params); return getLiveCloudCoursePage(params);
} }
// 导出学生上课数据 // 导出学生上课数据
static exportStudentCourseData(params: any) { static exportStudentCourseData(params: any) {
return exportStudentCourseData(params); return exportStudentCourseData(params);
...@@ -40,7 +47,7 @@ export default class courseService { ...@@ -40,7 +47,7 @@ export default class courseService {
static fetchPlaybackList(params: any) { static fetchPlaybackList(params: any) {
return fetchPlaybackList(params); return fetchPlaybackList(params);
} }
static getLiveCloudCourseDetail(params: any) { static getLiveCloudCourseDetail(params: any) {
return getLiveCloudCourseDetail(params); return getLiveCloudCourseDetail(params);
} }
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-20 09:21:40 * @Date: 2020-08-20 09:21:40
* @LastEditors: zhangleyuan * @LastEditors: wufan
* @LastEditTime: 2020-12-25 18:27:16 * @LastEditTime: 2021-01-06 20:38:03
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -26,11 +26,11 @@ const shareUrlMap: MapInterface = { ...@@ -26,11 +26,11 @@ const shareUrlMap: MapInterface = {
} }
const LIVE_SHARE_MAP: MapInterface = { const LIVE_SHARE_MAP: MapInterface = {
dev: 'https://dev.xiaomai5.com/xiaomai-live-share/index.html#/', dev: 'https://dev.xiaomai5.com/store-live/index.html#/',
dev1: 'https://dev.xiaomai5.com/xiaomai-live-share/index.html#/', dev1: 'https://dev.xiaomai5.com/store-live/index.html#/',
rc: 'https://rc.xiaomai5.com/xiaomai-live-share/index.html#/', rc: 'https://rc.xiaomai5.com/store-live/index.html#/',
gray: 'https://res.xiaomai5.com/xiaomai-live-share/gray/index.html#/', gray: 'https://res.xiaomai0.com/store-live/gray/index.html#/',
prod: 'https://res.xiaomai5.com/xiaomai-live-share/index.html#/', prod: 'https://res.xiaomai0.com/store-live/index.html#/',
} }
export const appId: string = appIdMap[ENV]; export const appId: string = appIdMap[ENV];
......
...@@ -31,6 +31,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons'; ...@@ -31,6 +31,7 @@ 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 DataList from '../DataList/DataList'; import DataList from '../DataList/DataList';
import User from '@/common/js/user';
const { confirm } = Modal; const { confirm } = Modal;
const courseStateShow = { const courseStateShow = {
...@@ -73,13 +74,11 @@ class LiveCourseList extends React.Component { ...@@ -73,13 +74,11 @@ class LiveCourseList extends React.Component {
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (item, needStr = false) => { handleShowShareModal = (item, needStr = false) => {
const _appId = appId; const _appId = appId;
const _shareUrl = shareUrl;
const { liveCourseId } = item; const { liveCourseId } = item;
const { saaSVersionEnum } = window.currentUserInstInfo;
const htmlUrl = `${LIVE_SHARE}liveShare?id=${liveCourseId}&saasVersion=${saaSVersionEnum}`; const htmlUrl = `${LIVE_SHARE}store/${User.getStoreId()}/live_detail/${liveCourseId}`;
const link = `${_appId}&redirect_uri=${encodeURIComponent(htmlUrl)}%26appid%3D${_appId}&response_type=code&scope=snsapi_base&state=state#wechat_redirect`; 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 longUrl = `${_shareUrl}${link}`; console.log('htmlUrl',htmlUrl,longUrl);
const shareData = { ...item, longUrl }; const shareData = { ...item, longUrl };
const shareLiveModal = ( const shareLiveModal = (
......
...@@ -13,6 +13,7 @@ import html2canvas from 'html2canvas'; ...@@ -13,6 +13,7 @@ import html2canvas from 'html2canvas';
import qrcode from "@/libs/qrcode/qrcode.js"; import qrcode from "@/libs/qrcode/qrcode.js";
import User from '@/common/js/user'; import User from '@/common/js/user';
import $ from 'jquery'; import $ from 'jquery';
import CourseService from "@/domains/course-domain/CourseService";
import './ShareLiveModal.less'; import './ShareLiveModal.less';
...@@ -36,22 +37,22 @@ class ShareLiveModal extends React.Component { ...@@ -36,22 +37,22 @@ class ShareLiveModal extends React.Component {
handleConvertShortUrl = () => { handleConvertShortUrl = () => {
const { longUrl } = this.props.data; const { longUrl } = this.props.data;
// // 发请求 // 发请求
// axios.Sales('public/businessShow/convertShortUrls', { CourseService.getQrcode({
// 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
// }, () => { }, () => {
// const qrcodeWrapDom = document.querySelector('#qrcodeWrap'); const qrcodeWrapDom = document.querySelector('#qrcodeWrap');
// const qrcodeNode = new qrcode({ const qrcodeNode = new qrcode({
// text: this.state.shareUrl, text: this.state.shareUrl,
// size: 98, size: 98,
// }) })
// qrcodeWrapDom.appendChild(qrcodeNode); qrcodeWrapDom.appendChild(qrcodeNode);
// }); });
// }) })
} }
componentWillUnmount() { componentWillUnmount() {
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:12:45 * @Date: 2020-08-05 10:12:45
* @LastEditors: zhangleyuan * @LastEditors: wufan
* @LastEditTime: 2020-12-31 18:26:57 * @LastEditTime: 2021-01-06 20:53:27
* @Description: 视频课-列表模块 * @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -11,6 +11,7 @@ import { Table, Modal, message , Tooltip,Switch,Dropdown} from 'antd'; ...@@ -11,6 +11,7 @@ import { Table, Modal, message , Tooltip,Switch,Dropdown} from 'antd';
import { PageControl } from "@/components"; import { PageControl } from "@/components";
import { LIVE_SHARE_MAP } from '@/common/constants/academic/cloudClass'; 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'; import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal';
...@@ -233,13 +234,14 @@ class VideoCourseList extends React.Component { ...@@ -233,13 +234,14 @@ class VideoCourseList extends React.Component {
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (record, needStr = false) => { handleShowShareModal = (record, needStr = false) => {
// const appId = CONFIG.appId[ENV];
const shareUrl = "";
const { id, scheduleVideoUrl } = record; const { id, scheduleVideoUrl } = record;
const htmlUrl = `${LIVE_SHARE_MAP[ENV]}videoShare?id=${id}`; const _appId = appId;
const link = htmlUrl; const { liveCourseId } = record;
const longUrl = "";
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 { coverUrl, scheduleName } = record;
const shareData = { const shareData = {
......
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