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