Commit 0997c860 by maolipeng

feat:企微直播。。。。

parent 61a5d6d2
......@@ -155,4 +155,21 @@ export default class WechatApi {
});
});
}
//进入直播间
static enterLiveRoom(id) {
return new Promise((resolve, reject) => {
wx.ready(() => {
wx.invoke('startLiving', {
"livingId": id,
}, function(res) {
if (res.err_msg === "startLiving:ok") {
resolve(true)
} else {
reject(res.err_msg); //错误处理
}
});
});
})
}
}
......@@ -400,8 +400,8 @@ function CreateWorkWXCourse() {
const previewLiveCourseModal = (
<PreviewCourseModal
courseBasicInfo={basicInfo}
courseClassInfo={addLiveClassInfo}
courseIntroInfo={addLiveIntroInfo}
courseClassInfo={{...classInfo,endTime}}
courseIntroInfo={{introduce:introduce,categoryName:basicInfo.courseName}}
type={type}
courseState={courseState}
close={() => {
......
......@@ -7,9 +7,11 @@
*/
import User from '@/common/js/user';
import WechatApi from '@/common/js/wechatApi';
import college from '@/common/lottie/college';
import { PageControl, XMTable } from '@/components';
import DownloadLiveModal from '@/components/DownloadLiveModal';
import { isWorkWx } from '@/core/platform';
import BaseService from '@/domains/basic-domain/baseService';
import { LIVE_SHARE } from '@/domains/course-domain/constants';
import CourseService from '@/domains/course-domain/CourseService';
......@@ -734,6 +736,22 @@ class LiveCourseList extends React.Component {
),
});
} else {
if (item.thirdPartType === "WECHAT") {
//进入企微直播间
if (!isWorkWx()) {
Modal.warning({
title: '提示',
content: "请使用企业微信进入直播间"
})
return
}
WechatApi.enterLiveRoom(item.livingId).then((res)=> {
console.log(res)
}).catch((err)=> {
console.log(err)
})
return
}
CourseService.getLiveCloudCourseDetail({
liveCourseId: item.liveCourseId,
}).then((res) => {
......
......@@ -47,17 +47,14 @@
box-shadow: 0px 2px 8px 3px rgba(41, 102, 255, 0.1);
border-radius: 5px;
text-align: center;
background-size: contain;
background-repeat: no-repeat;
.logo {
width: 80px;
height: 80px;
margin: 31px auto 0 auto;
}
.xiaomai-logo {
background-image: url("https://image.xiaomaiketang.com/xm/ZxaYpAy8kB.png");
}
.qiwei-logo {
background-image: url("https://image.xiaomaiketang.com/xm/7Sjm26wAt8.png");
}
.item-title {
font-size: 16px;
font-weight: 500;
......@@ -83,6 +80,12 @@
cursor: pointer;
}
}
.xiaomai-logo {
background-image: url("https://image.xiaomaiketang.com/xm/rjwN8Yc7xa.png");
}
.qiwei-logo {
background-image: url("https://image.xiaomaiketang.com/xm/CzdyntSxha.png");
}
}
}
}
......
......@@ -30,13 +30,13 @@ export default function LiveModeSelect(props: LiveModeSelectProps) {
<span className="icon iconfont close" onClick={handleClose}>&#xe6ef;</span>
</div>
<div className="content">
<div className="item">
<div className="logo xiaomai-logo"></div>
<div className="item xiaomai-logo">
<div className="logo"></div>
<div className="item-title">小麦直播</div>
<div className="des">通过小麦企学院“PC客户<br/>端”进行直播</div>
<div className="button" onClick={handleSelect0}>立即创建</div>
</div>
<div className="item">
<div className="item qiwei-logo">
<div className="logo qiwei-logo"></div>
<div className="item-title">企微直播</div>
<div className="des">通过“企业微信APP”进行<br/>直播进行直播</div>
......
......@@ -48,6 +48,7 @@ class PreviewCourseModal extends React.Component {
return hours + ":" + mins + ":" + seconds;
};
dealWithTime = (startTime, endTime) => {
debugger
const startDate = new Date(Number(startTime));
const endDate = new Date(Number(endTime));
......
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