Commit 073d1181 authored by wangwei's avatar wangwei

星星系统

parent 4100783e
......@@ -315,6 +315,7 @@
course_type:this.$route.query.course_type,
parent_category_id:this.parent_category_id,
};
this.thisLesson.nowTime = Date.parse(new Date());
localStorage.setItem('lessonDetail',JSON.stringify(this.thisLesson));
this.$router.push({name:'newLesson',query:query})
}else{
......
......@@ -59,19 +59,21 @@
},
mounted(){
this.initPage();
this.timeInterval =setInterval(()=>{
this.stillTime ++;
},1000)
},
methods:{
backList(){
let lessonDetail = JSON.parse(localStorage.getItem('lessonDetail'));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime- lessonDetail.nowTime)/1000;
let json = {
page_type:0,
page_id:this.page_id,
stay_time:this.stillTime,
stay_time:lookTime,
};
subUserLessonApi(this.$route.query.elementId,this.$route.query.category_id,this.$route.query.periods_id,json).then(res=>{
clearInterval(this.timeInterval);
lessonDetail.total_watch_time = res;
lessonDetail.nowTime = nowTime;
localStorage.setItem('lessonDetail',JSON.stringify(lessonDetail));
});
let query={
periods_id:this.$route.query.periods_id,
......@@ -83,13 +85,18 @@
},
changeTitle(type){
this.nowShow = type;
let lessonDetail = JSON.parse(localStorage.getItem('lessonDetail'));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime- lessonDetail.nowTime)/1000;
let json = {
page_type:0,
page_id:this.page_id,
stay_time:this.stillTime,
stay_time:lookTime,
};
subUserLessonApi(this.$route.query.elementId,this.$route.query.category_id,this.$route.query.periods_id,json).then(res=>{
this.stillTime = 0 ;
lessonDetail.total_watch_time = res;
lessonDetail.nowTime = nowTime;
localStorage.setItem('lessonDetail',JSON.stringify(lessonDetail));
});
switch (type) {
case 1:
......
<template>
<div class="share-page">
<div class="share-block">
<div class="bg-title" :style="{backgroundImage:`url('${shareBg}')`}">
</div>
<div class="bg-desc">
</div>
<div class="content" :style="{backgroundImage:`url('${shareConBg}')`}">
<div class="main-content">
<div class="head-block">
<img src="http://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKY2qKktZffhlfqtXG1XcxFsGMm9Id63PnwhKH1p40ibDH2IGusbibnib4gg2RgUyLz21BsEzR7SyqDg/132"/>
</div>
<div class="content-title" :style="{backgroundImage:`url('${shareTitle}')`}">
</div>
<div>
</div>
</div>
<div class="main-content-desc">
</div>
</div>
</div>
</div>
</template>
<script>
import shareBg from '../../assets/newLesson/shareBg.png'
import shareConBg from '../../assets/newLesson/shareConBg.png'
import shareTitle from '../../assets/newLesson/shareTitle.png'
export default {
name: "share",
data(){
return {
shareBg:shareBg,
shareConBg:shareConBg,
shareTitle:shareTitle
}
}
}
</script>
<style scoped lang="less">
@import "../../util/public";
.share-page{
position: absolute;
background: #EEEEEE;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 10;
.share-block{
position: absolute;
border-radius: 8*@toVw;
top: 20*@toVw;
left: 20*@toVw;
right: 20*@toVw;
bottom: 20*@toVw;
.bg-title{
position: absolute;
top: 0;
left: 0;
right: 0;
height: 60*@toVw;
background-size: 100% 100%;
z-index: -1;
}
.bg-desc{
position: absolute;
top: 58*@toVw;
left: 0;
right: 0;
bottom: 0;
background: white;
z-index: -1;
border-radius: 0 0 8*@toVw 8*@toVw;
}
.content{
width: 291*@toVw;
height: (422-53)*@toVw;
padding-top: 53*@toVw;
margin-top: 20*@toVw;
background-size: 100% 100%;
}
.main-content{
width: 261*@toVw;
height: 263*@toVw;
background: white;
border-radius: 8*@toVw;
position: relative;
.head-block{
position: absolute;
height: 85*@toVw;
width: 85*@toVw;
text-align: center;
border-radius: 200*@toVw;
left: 50%;
margin-left: -40*@toVw;
background: white;
top: -38*@toVw;
img{
border-radius: 200*@toVw;
width: 64*@toVw;
margin-top: 7*@toVw;
height: 64*@toVw;
}
}
.content-title{
width: 225*@toVw;
height: 54*@toVw;
line-height: 50*@toVw;
color: white;
font-size: 20*@toVw;
text-align: center;
background-size: 100% 100%;
position: absolute;
top: 25*@toVw;
left: 50%;
margin-left: -112.5*@toVw;
}
}
.main-content-desc{
width: 261*@toVw;
height: 82*@toVw;
background: white;
border-radius: 8*@toVw;
margin-top: 10*@toVw;
}
}
}
</style>
......@@ -44,6 +44,7 @@
</div>
</mt-popup>
<guide-block/>
<share-page/>
</div>
</template>
......@@ -52,19 +53,22 @@
import luolacoming from '../../assets/newLesson/luoLacoming.png'
import luolalaila from '../../assets/newLesson/luolalaila.png'
import guideBlock from '../guide/video'
import {subUserLessonApi} from "../../service/api";
import tapToAudio from '../../assets/tapToAudio.png'
import finishStuat from '../../assets/newLesson/finishStudy.png'
import noFinishDia from './nofinishdia'
import sharePage from './share'
export default {
name: "play",
components:{
guideBlock,
noFinishDia
noFinishDia,
sharePage
},
data(){
return{
finishStuat:finishStuat,
popupVisible:true,
popupVisible:false,
ageShow:false,
showObj:{
video:[],
......@@ -87,7 +91,24 @@
},
methods:{
finishStudy(){
this.popupVisible = true
let lessonDetail = JSON.parse(localStorage.getItem('lessonDetail'));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime- lessonDetail.nowTime)/1000;
let json = {
page_type:0,
page_id:5,
stay_time:lookTime,
};
subUserLessonApi(this.$route.query.elementId,this.$route.query.category_id,this.$route.query.periods_id,json).then(res=>{
lessonDetail.total_watch_time = res;
lessonDetail.nowTime = nowTime;
localStorage.setItem('lessonDetail',JSON.stringify(lessonDetail));
});
if((Number(lookTime) + Number(lessonDetail.total_watch_time))/60 < 7){
this.popupVisible = true
}else{
}
},
videoEnd(event){
event.srcElement.play()
......
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