Commit 9c34f659 authored by IvyXia123's avatar IvyXia123

时间问题

parent b5c738c5
......@@ -763,10 +763,11 @@
let query = JSON.parse(sessionStorage.getItem("classQuery"));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = {
page_type: 0,
page_id: 5,
stay_time: lookTime
stay_time: (nowTime - lessonDetail.nowTime) / 1000
};
subUserLessonApi(
query.elementId,
......
......@@ -107,16 +107,20 @@
* @param periods_id
* @param page_id
*/
async subUserLessonFn(elementId, category_id, periods_id, page_id) {
subUserLessonFn(elementId, category_id, periods_id, page_id) {
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: page_id,
stay_time: lookTime
stay_time: (nowTime - lessonDetail.nowTime) / 1000
};
console.log(json)
subUserLessonApi(elementId, category_id, periods_id, json).then((res) => {
this.totalStarNum = res.total_star_num
})
// const subUserLessonDatac = await subUserLessonApi(elementId, category_id, periods_id, json)
// this.totalStarNum = subUserLessonDatac.total_star_num
},
......
......@@ -98,14 +98,7 @@
sharePage
},
mounted() {
// 直接跳转和提交跳转
if(this.$route.params.evaluate === 1 || this.$route.params.evaluate === 3) {
this.nowShow = parseInt(this.$route.params.type)
this.type = parseInt(this.$route.params.type)
this.changeTitle(parseInt(this.$route.params.type))
}else {
this.initPage();
}
this.initPage();
},
/**
* 离开页面前关闭--这个记录看课时长
......@@ -218,7 +211,7 @@
let json = {
page_type: 0,
page_id: this.page_id,
stay_time: lookTime
stay_time: (nowTime - lessonDetail.nowTime) / 1000
};
subUserLessonApi(
this.elementId,
......@@ -230,6 +223,7 @@
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
let query = {
periods_id: this.periods_id,
course_type: this.course_type,
......@@ -418,7 +412,7 @@
this.parent_category_id = this.$route.query.parent_category_id;
this.course_type = this.$route.query.course_type;
this.countTimeFn()
this.lesson = JSON.parse(localStorage.getItem("lessonDetail"));
this.lesson = JSON.parse(localStorage.getItem("lessonDetail"));
// debugger
getUserWatchApi({category_id:this.category_id}).then(res => {
this.watchDetail = res;
......
......@@ -197,8 +197,6 @@
this.videoWidth = Number(document.documentElement.clientWidth) / 3.8;
},
mounted() {
if(this.$route.params.evaluate === 1)
this.finishStudy()
this.changeAge(this.contentData.age);
let that = this;
// console.log(document.documentElement.clientWidth)
......@@ -325,7 +323,6 @@
closeShare() {
// this.$route = {}
this.share_show = false;
console.log(this.$route)
},
finishStudy() {
if (this.$refs.videoDom) {
......@@ -336,10 +333,11 @@
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
stay_time: (nowTime - lessonDetail.nowTime) / 1000
};
// 提交看课数据 记录看课时长
subUserLessonApi(
......
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