|
@@ -140,7 +140,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-show="!item.down">
|
|
|
- <course-tree :isBuy="false"></course-tree>
|
|
|
+ <course-tree
|
|
|
+ :propParam="{
|
|
|
+ courseId: item.courseId,
|
|
|
+ }"
|
|
|
+ :isBuy="false"
|
|
|
+ ></course-tree>
|
|
|
<u-line></u-line>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -167,10 +172,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-show="!item.down">
|
|
|
- <view v-for="(itemM, indexM) in item.menuList" :key="indexM">
|
|
|
- <course-tree :isBuy="false"></course-tree>
|
|
|
- <u-line></u-line>
|
|
|
- </view>
|
|
|
+ <course-tree :isBuy="false"></course-tree>
|
|
|
+ <u-line></u-line>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -361,9 +364,7 @@ export default {
|
|
|
courseList: [],
|
|
|
menuList: [],
|
|
|
freeMenuList: [],
|
|
|
- startStatus: false,
|
|
|
playbackRate: [1.0],
|
|
|
- isAllowSeek: "no",
|
|
|
vid: "",
|
|
|
autoplay: true,
|
|
|
listenConfigList: [],
|
|
@@ -506,6 +507,9 @@ export default {
|
|
|
this.listenSecond = listen.auditionMinute;
|
|
|
if (this.listenSecond > 0) {
|
|
|
if (item.recordingUrl) {
|
|
|
+ if (this.vid && !this.refPlv) {
|
|
|
+ this.refPlv = this.$refs.player;
|
|
|
+ }
|
|
|
this.vid = item.recordingUrl;
|
|
|
if (this.refPlv) {
|
|
|
this.refPlv.changeVid({
|
|
@@ -609,54 +613,19 @@ export default {
|
|
|
},
|
|
|
timeupdate(time) {
|
|
|
if (time >= this.listenSecond) {
|
|
|
- this.refPlv && (this.refPlv = this.$refs.player);
|
|
|
- this.refPlv.playPause();
|
|
|
- this.refPlv.exitFullScreen();
|
|
|
+ let refPlv = this.$refs.player;
|
|
|
+ refPlv.playPause();
|
|
|
+ refPlv.exitFullScreen();
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
content: "试听结束,购买课程可学习全部",
|
|
|
showCancel: false,
|
|
|
success: (resst) => {
|
|
|
this.vid = "";
|
|
|
+ this.refPlv = "";
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
- console.log("🚀 ~ file: detail.vue:615 ~ timeupdate ~ time:", time);
|
|
|
- },
|
|
|
- onStateChange(newstate, oldstate) {
|
|
|
- if (newstate.detail.newstate == "playing") {
|
|
|
- //开始播放
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
- }
|
|
|
- this.timer = setInterval(this.timeEvent, 1500); //定时器
|
|
|
- }
|
|
|
- },
|
|
|
- closePlay() {
|
|
|
- this.$store.commit("setPlaySectionId", { playSectionId: 0 });
|
|
|
- this.vid = "";
|
|
|
- this.startStatus = false;
|
|
|
- },
|
|
|
- timeEvent() {
|
|
|
- let self = this;
|
|
|
- var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
- if (polyvPlayerContext != null) {
|
|
|
- let PlayCurrentTime = polyvPlayerContext.getCurrentTime();
|
|
|
- if (PlayCurrentTime >= this.listenSecond) {
|
|
|
- polyvPlayerContext.stop();
|
|
|
- polyvPlayerContext.exitFullScreen();
|
|
|
- clearInterval(this.timer);
|
|
|
- this.timer = null;
|
|
|
- uni.showModal({
|
|
|
- title: "提示",
|
|
|
- content: "试听结束,购买课程可学习全部",
|
|
|
- showCancel: false,
|
|
|
- success: function (resst) {
|
|
|
- self.closePlay();
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
openCourse(item) {
|
|
|
this.courseId = item.courseId;
|
|
@@ -850,7 +819,6 @@ export default {
|
|
|
},
|
|
|
paramsFn() {
|
|
|
return {
|
|
|
- courseId: this.courseId,
|
|
|
listenConfigList: this.listenConfigList,
|
|
|
};
|
|
|
},
|
|
@@ -1233,43 +1201,6 @@ export default {
|
|
|
this.closePop();
|
|
|
});
|
|
|
},
|
|
|
- loadPlayerScript(callback) {
|
|
|
- if (!window.polyvPlayer) {
|
|
|
- const myScript = document.createElement("script");
|
|
|
- myScript.setAttribute(
|
|
|
- "src",
|
|
|
- "https://player.polyv.net/script/player.js"
|
|
|
- );
|
|
|
- myScript.onload = callback;
|
|
|
- document.body.appendChild(myScript);
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- },
|
|
|
- // 播放视频
|
|
|
- loadPlayer() {
|
|
|
- const polyvPlayer = window.polyvPlayer;
|
|
|
- this.$api.polyvVideoSign(this.vid).then(async (res) => {
|
|
|
- console.log("播放凭证res", res);
|
|
|
- this.player = await polyvPlayer({
|
|
|
- wrap: "#player",
|
|
|
- width: "100%",
|
|
|
- showLine: "off",
|
|
|
- height: 218,
|
|
|
- ban_history_time: "on",
|
|
|
- vid: this.vid,
|
|
|
- forceH5: true,
|
|
|
- autoplay: this.autoplay,
|
|
|
- speed: this.playbackRate,
|
|
|
- teaser_show: 1,
|
|
|
- tail_show: 1,
|
|
|
- hideSwitchPlayer: true,
|
|
|
- ts: res.data.data.ts,
|
|
|
- sign: res.data.data.sign,
|
|
|
- });
|
|
|
- this.polyvPlayerContext = this.player;
|
|
|
- });
|
|
|
- },
|
|
|
},
|
|
|
provide() {
|
|
|
return {
|