提交 54b58277 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-coursedetail-0817' of...

Merge branch 'dev-coursedetail-0817' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam into dev-coursedetail-0817

* 'dev-coursedetail-0817' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam:
  remove useless wxbridge
  修改分享
  修改全屏
......@@ -49,11 +49,14 @@ export default {
.course-covers-wrapper {
display: flex;
flex-direction: column;
left: 0;
top: 50%;
width: 100%;
height: 210px;
background: rgba(0, 0, 0, 0.8);
justify-content: center;
align-content: center;
transform: translate3d(0, -50%, 0);
.tips {
display: inline-block;
margin-bottom: 15px;
......
......@@ -12,7 +12,7 @@
* GlobalWorkerOptions.workerSrc需要一个加载路径
*/
import pdfJS from 'pdfjs-dist/es5/build/pdf';
pdfJS.GlobalWorkerOptions.workerSrc = 'https://cdn.bootcdn.net/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js';
pdfJS.GlobalWorkerOptions.workerSrc = '//cdn.bootcdn.net/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js';
import coverImg from '@/images/course/lock-big.png';
export default {
......@@ -37,7 +37,6 @@ export default {
},
methods: {
async drawPDF() {
console.log('_____url_______', this.url);
if (!this.url) {
return;
}
......@@ -86,7 +85,7 @@ export default {
cover.style.height = '100%';
cover.style.background = `url(${coverImg}) no-repeat center center`;
cover.style.backgroundSize = '50px auto';
cover.style.backgroundColor = 'rgba(255, 255, 255, .8)';
cover.style.backgroundColor = 'rgba(255, 255, 255, .85)';
cover.onclick = () => {
if (!this.$store.getters.logged) {
this.$store.dispatch('goLogin');
......
......@@ -102,6 +102,10 @@ import { formatLeftTimeObj } from '@/utils';
export default {
name: 'pica-video',
props: {
coverType: {
type: Number,
default: 0,
},
download: {
type: Function,
default: () => {}
......@@ -374,6 +378,7 @@ export default {
this.finish = true;
this.showReplay = true;
this.provedOver = true;
this.isFullScreen = false;
},
// 播放结束
onEnded() {
......@@ -383,6 +388,11 @@ export default {
this.player.style.display = 'none';
}
this.reportOnOff(2);
this.$nextTick(() => {
if (this.coverType > 0 && this.coverType !== 13) {
this.isFullScreen = false;
}
})
},
onError() {
if (this.url) {
......
......@@ -73,6 +73,12 @@ export const wxShare = (option = {}, successCB = () => {}) => {
});
};
function wxHideMenu() {
wx.ready(() => {
WeixinJSBridge.call('hideOptionMenu');
});
}
export const wxDisabledShare = () => {
wx.ready(() => {
wx.hideMenuItems({
......@@ -95,7 +101,7 @@ export const wxDisabledShare = () => {
* @param source
* @param option
*/
export const wechatShare = async (option = {}, successCB = () => {}) => {
export const wechatShare = (option = {}, successCB = () => {}, hideMenu) => {
const shareOption = {
link: location.href,
title: `云鹊医!`,
......@@ -106,7 +112,11 @@ export const wechatShare = async (option = {}, successCB = () => {}) => {
...option
};
wxConfig(shareOption.link);
wxShare(shareOption, successCB);
if (hideMenu) {
wxHideMenu()
} else {
wxShare(shareOption, successCB);
}
};
Vue.prototype.wechatShare = wechatShare;
......
......@@ -2,7 +2,7 @@
<div class="course-detail">
<!-- 视频 -->
<div class="video-box">
<pica-video ref="picaVideo" @onVideoEnd="onVideoEnd" @onReplay="onReplay">
<pica-video ref="picaVideo" :coverType="coverType" @onVideoEnd="onVideoEnd" @onReplay="onReplay">
<!-- 试看结束 -->
<div class="cover" v-if="logged && coverType === 1">
<course-covers coverTips="试看结束<br />请来云鹊医App学习完整课程" :isSingle="true" rightBtnText="学习完整课程" @btnClick="btnClick" />
......@@ -12,7 +12,7 @@
<course-covers coverTips="本课程为付费课程,请来云鹊医App学习" :isSingle="true" rightBtnText="去云鹊医App" @btnClick="btnClick" />
</div>
<!-- 下一个提示 -->
<div class="next-countdown" v-if="coverType === 3">3秒后播放下一节</div>
<div class="next-countdown" v-if="coverType === 13">3秒后播放下一节</div>
<!-- 未学完提示 -->
<div class="cover" v-if="logged && coverType === 4">
<course-covers coverTips="您已学习至最后一节<br />但本课程中仍有未学完的内容" :isSingle="true" rightBtnText="继续学完本课程" @btnClick="btnClick" />
......@@ -91,7 +91,6 @@ import CourseComment from '@/components/course/course-comment';
import Loading from "@/components/common/common-loading";
import DownloadButton from "@/components/course/download-button";
import { getPdfFileUrl, formatLeftTimeObj, deepCopy } from '@/utils';
import { wxDisabledShare } from '@/utils/wxShare';
export default {
components: {
......@@ -161,11 +160,11 @@ export default {
const { width } = this.$el.querySelector('.tab-item').getBoundingClientRect();
this.videoH = height;
this.tabW = width;
wxDisabledShare();
this.wechatShare(undefined, undefined, true);
},
methods: {
getCourseInfo() {
const { courseId = 2 } = this.$route.query;
const { courseId = 6 } = this.$route.query;
const projectId = this.projectId || 797;
this.showLoading = true;
this.GET(`/contents/courses/${courseId}/pcCourseInfo`, { projectId }).then(res => {
......@@ -386,7 +385,7 @@ export default {
}
} else { // 3秒后播放下一个
let next = chapters[curtI]['lectures'][curtJ + 1] || chapters[curtI + 1]['lectures'][0];
this.coverType = 3;
this.coverType = 13;
setTimeout(() => {
this.selectLecture(next);
}, 3000)
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册