826

parent 9c134c52
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div class="tips">{{showObj.audio[index].tips}}</div> <div class="tips">{{showObj.audio[index].tips}}</div>
</div> </div>
<!-- @click="imgPop=true" --> <!-- @click="imgPop=true" -->
<div :class="{'image-block':true}" ref="imageBlock" > <div :class="{'image-block':true}" ref="imageBlock">
<img ref="imgItem" @click="ImagePreviewF(index)" :src="showObj.audio[index].image" /> <img ref="imgItem" @click="ImagePreviewF(index)" :src="showObj.audio[index].image" />
</div> </div>
<div class="btnBox"> <div class="btnBox">
...@@ -141,8 +141,8 @@ ...@@ -141,8 +141,8 @@
<no-finish-dia /> <no-finish-dia />
</div> </div>
</mt-popup> </mt-popup>
<div v-if="imgModel" class='imgBox' style="background: transparent"> <div v-if="imgModel" class="imgBox" style="background: transparent">
<div class="box" > <div class="box">
<img ref="imgItem" :src="showObj.audio[index].image" /> <img ref="imgItem" :src="showObj.audio[index].image" />
</div> </div>
</div> </div>
...@@ -151,7 +151,8 @@ ...@@ -151,7 +151,8 @@
@backList="backList()" @backList="backList()"
ref="sharePage" ref="sharePage"
@closeShare="closeShare()" @closeShare="closeShare()"
:contentData="contentData"/> :contentData="contentData"
/>
</div> </div>
<audio ref="audioDom" id="audioDom" class="audio" :src="audioPoint"></audio> <audio ref="audioDom" id="audioDom" class="audio" :src="audioPoint"></audio>
</div> </div>
...@@ -161,7 +162,7 @@ ...@@ -161,7 +162,7 @@
import { Toast } from "vant"; import { Toast } from "vant";
import { Popup } from "mint-ui"; import { Popup } from "mint-ui";
import tapToVideo from "../../assets/tapToVideo.png"; import tapToVideo from "../../assets/tapToVideo.png";
import { ImagePreview } from 'vant'; import { ImagePreview } from "vant";
import { import {
getUserCollectApi, getUserCollectApi,
addUserCollectApi, addUserCollectApi,
...@@ -187,7 +188,7 @@ export default { ...@@ -187,7 +188,7 @@ export default {
}, },
data() { data() {
return { return {
imgModel:false, imgModel: false,
userCourse: {}, userCourse: {},
finishStuat: finishStuat, finishStuat: finishStuat,
popupVisible: false, popupVisible: false,
...@@ -212,7 +213,7 @@ export default { ...@@ -212,7 +213,7 @@ export default {
timer: null, timer: null,
playType: Number(localStorage.getItem("playType")) | 0, playType: Number(localStorage.getItem("playType")) | 0,
audioPoint: "", audioPoint: "",
stay_time:'' stay_time: ""
}; };
}, },
mounted() { mounted() {
...@@ -223,14 +224,12 @@ export default { ...@@ -223,14 +224,12 @@ export default {
} }
}, },
methods: { methods: {
ImagePreviewF(index){ ImagePreviewF(index) {
ImagePreview({ ImagePreview({
images: [ images: [this.showObj.audio[index].image],
this.showObj.audio[index].image, lazyLoad: true,
], startPosition: 0,
lazyLoad:true, showIndex: false
startPosition:0,
showIndex:false
}); });
}, },
changeStar(data) { changeStar(data) {
...@@ -762,8 +761,6 @@ export default { ...@@ -762,8 +761,6 @@ export default {
page_id: 5, page_id: 5,
stay_time: lookTime stay_time: lookTime
}; };
getUserWatchApi({category_id:query.category_id}).then(res => {
this.$store.dispatch("setWatchDetail", res);
subUserLessonApi( subUserLessonApi(
query.elementId, query.elementId,
query.category_id, query.category_id,
...@@ -774,23 +771,18 @@ export default { ...@@ -774,23 +771,18 @@ export default {
lessonDetail.nowTime = nowTime; lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num; lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
});
if ( if (
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 < (Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 <
7 7
) { ) {
this.popupVisible2 = true; this.popupVisible2 = true;
// debugger
} else { } else {
getUserWatchApi({ category_id: query.category_id }).then(res => {
this.$store.dispatch("setWatchDetail", res);
this.share_show = true; this.share_show = true;
} // debugger
}); });
if (
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 <
7
) {
this.popupVisible2 = true;
} else {
this.share_show = true;
setTimeout(() => { setTimeout(() => {
if (this.$store.state.lookStatus == 0) { if (this.$store.state.lookStatus == 0) {
this.audioPoint = audioGood; this.audioPoint = audioGood;
...@@ -799,12 +791,13 @@ export default { ...@@ -799,12 +791,13 @@ export default {
} else { } else {
this.audioPoint = audioPerfect; this.audioPoint = audioPerfect;
} }
this.$refs.audioDom.load() this.$refs.audioDom.load();
setTimeout(()=>{ setTimeout(() => {
this.$refs.audioDom.play() this.$refs.audioDom.play();
},100) }, 100);
}, 300); }, 300);
} }
});
// this.$refs.sharePage.playAudio() // this.$refs.sharePage.playAudio()
// this.$refs.sharePage.initPage() // this.$refs.sharePage.initPage()
} }
...@@ -858,19 +851,19 @@ export default { ...@@ -858,19 +851,19 @@ export default {
background-size: 40 * @toVw 290 * @toVw; background-size: 40 * @toVw 290 * @toVw;
display: inline-block; display: inline-block;
} }
.imgBox{ .imgBox {
position:fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
top: 0; top: 0;
left: 0; left: 0;
.box{ .box {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
transform: translateX(0px); transform: translateX(0px);
img{ img {
position: absolute; position: absolute;
width:80vw; width: 80vw;
margin: auto; margin: auto;
top: 0; top: 0;
left: 0; left: 0;
...@@ -878,7 +871,6 @@ export default { ...@@ -878,7 +871,6 @@ export default {
bottom: 0; bottom: 0;
} }
} }
} }
._282918034425091245 { ._282918034425091245 {
height: 8 * @toVw; height: 8 * @toVw;
...@@ -1181,8 +1173,7 @@ export default { ...@@ -1181,8 +1173,7 @@ export default {
padding: 20 * @toVw; padding: 20 * @toVw;
} }
} }
.mint-popup{ .mint-popup {
} }
.imgPop-block { .imgPop-block {
// max-height: 500 * @toVw; // max-height: 500 * @toVw;
...@@ -1909,7 +1900,7 @@ export default { ...@@ -1909,7 +1900,7 @@ export default {
} }
</style> </style>
<style> <style>
.van-image-preview__image{ .van-image-preview__image {
/* max-height: 150%; */ /* max-height: 150%; */
/* bottom: none; */ /* bottom: none; */
} }
......
...@@ -420,6 +420,7 @@ export default { ...@@ -420,6 +420,7 @@ export default {
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
}); });
},120000) },120000)
debugger
this.$store.dispatch('setTimeout',this.saveTime) this.$store.dispatch('setTimeout',this.saveTime)
}, },
initPage() { initPage() {
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
<div <div
class="video-block hp-video" class="video-block hp-video"
v-if="showObj.video[videoIndex]" v-if="showObj.video[videoIndex]"
v-show="!share_show && !popupVisible && !star"> v-show="!share_show && !popupVisible && !star"
>
<video <video
ref="videoDom" ref="videoDom"
id="myVideo" id="myVideo"
...@@ -218,11 +219,11 @@ export default { ...@@ -218,11 +219,11 @@ export default {
}, },
false false
); );
console.log(videojs) // console.log(videojs)
}, },
methods: { methods: {
activity() {}, activity() {},
sliceUrl(){ sliceUrl() {
localStorage.setItem("clarityType", this.clarityType); localStorage.setItem("clarityType", this.clarityType);
this.showObj.video.forEach(el => { this.showObj.video.forEach(el => {
el.url = el.url =
...@@ -241,13 +242,13 @@ export default { ...@@ -241,13 +242,13 @@ export default {
this.currentTime = this.$refs.videoDom.currentTime; this.currentTime = this.$refs.videoDom.currentTime;
if (a == "1280") { if (a == "1280") {
this.clarityType = 1280; this.clarityType = 1280;
this.sliceUrl() this.sliceUrl();
} else if (a == "720") { } else if (a == "720") {
this.clarityType = 720; this.clarityType = 720;
this.sliceUrl() this.sliceUrl();
} else { } else {
this.clarityType = 540; this.clarityType = 540;
this.sliceUrl() this.sliceUrl();
} }
this.secClarity = false; this.secClarity = false;
// this.$nextTick(()=>{ // this.$nextTick(()=>{
...@@ -324,8 +325,6 @@ export default { ...@@ -324,8 +325,6 @@ export default {
page_id: 5, page_id: 5,
stay_time: lookTime stay_time: lookTime
}; };
getUserWatchApi({ category_id: query.category_id }).then(res => {
this.$store.dispatch("setWatchDetail", res);
subUserLessonApi( subUserLessonApi(
query.elementId, query.elementId,
query.category_id, query.category_id,
...@@ -336,20 +335,17 @@ export default { ...@@ -336,20 +335,17 @@ export default {
lessonDetail.nowTime = nowTime; lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num; lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
});
if ( if (
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 < (Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 <
7 7
) { ) {
this.popupVisible = true; this.popupVisible = true;
} else { } else {
getUserWatchApi({ category_id: query.category_id }).then(res => {
this.$store.dispatch("setWatchDetail", res);
this.share_show = true; this.share_show = true;
} // debugger
}); });
if ((Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 < 7) {
this.popupVisible = true;
} else {
this.share_show = true;
setTimeout(() => { setTimeout(() => {
if (this.$store.state.lookStatus == 0) { if (this.$store.state.lookStatus == 0) {
this.audioPoint = audioGood; this.audioPoint = audioGood;
...@@ -364,6 +360,7 @@ export default { ...@@ -364,6 +360,7 @@ export default {
}, 100); }, 100);
}, 300); }, 300);
} }
});
}, },
videoEnd(event) { videoEnd(event) {
event.srcElement.play(); event.srcElement.play();
...@@ -380,7 +377,10 @@ export default { ...@@ -380,7 +377,10 @@ export default {
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName: elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(0,9) + JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" + "-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10, 10,
...@@ -431,7 +431,7 @@ export default { ...@@ -431,7 +431,7 @@ export default {
videoPlay() { videoPlay() {
// 神策埋点 点击操作 // 神策埋点 点击操作
// this.$refs.videoDom.load() // this.$refs.videoDom.load()
console.log('canplay') console.log("canplay");
var video = document.getElementById("myVideo"); var video = document.getElementById("myVideo");
if (this.currentTime) { if (this.currentTime) {
setTimeout(() => { setTimeout(() => {
...@@ -482,7 +482,7 @@ export default { ...@@ -482,7 +482,7 @@ export default {
: 1280; : 1280;
if (this.contentData.content.age && value === 2) { if (this.contentData.content.age && value === 2) {
let video = []; let video = [];
video = this.$common.deepCopy(this.contentData.content.video) video = this.$common.deepCopy(this.contentData.content.video);
video.forEach(el => { video.forEach(el => {
let str = el.url; let str = el.url;
if (this.contentData.title == 2) { if (this.contentData.title == 2) {
...@@ -495,7 +495,7 @@ export default { ...@@ -495,7 +495,7 @@ export default {
}; };
} else { } else {
let video = []; let video = [];
video = this.$common.deepCopy(this.contentData.content.video) video = this.$common.deepCopy(this.contentData.content.video);
video.forEach(el => { video.forEach(el => {
let str = el.url; let str = el.url;
if (this.contentData.title == 2) { if (this.contentData.title == 2) {
......
...@@ -41,9 +41,9 @@ if (process.env.NODE_ENV == 'production') { ...@@ -41,9 +41,9 @@ if (process.env.NODE_ENV == 'production') {
} }
Vue.prototype.$common = common Vue.prototype.$common = common
if (process.env.NODE_ENV != 'production') { // if (process.env.NODE_ENV != 'production') {
new VConsole(); // new VConsole();
} // }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
next() next()
......
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