Commit 9c34f659 authored by IvyXia123's avatar IvyXia123

时间问题

parent b5c738c5
...@@ -763,10 +763,11 @@ ...@@ -763,10 +763,11 @@
let query = JSON.parse(sessionStorage.getItem("classQuery")); let query = JSON.parse(sessionStorage.getItem("classQuery"));
let nowTime = Date.parse(new Date()); let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000; let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = { let json = {
page_type: 0, page_type: 0,
page_id: 5, page_id: 5,
stay_time: lookTime stay_time: (nowTime - lessonDetail.nowTime) / 1000
}; };
subUserLessonApi( subUserLessonApi(
query.elementId, query.elementId,
......
...@@ -107,16 +107,20 @@ ...@@ -107,16 +107,20 @@
* @param periods_id * @param periods_id
* @param page_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 lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date()); let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000; let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = { let json = {
page_type: 0, page_type: 0,
page_id: page_id, 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) // const subUserLessonDatac = await subUserLessonApi(elementId, category_id, periods_id, json)
// this.totalStarNum = subUserLessonDatac.total_star_num // this.totalStarNum = subUserLessonDatac.total_star_num
}, },
......
...@@ -98,14 +98,7 @@ ...@@ -98,14 +98,7 @@
sharePage sharePage
}, },
mounted() { 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 @@ ...@@ -218,7 +211,7 @@
let json = { let json = {
page_type: 0, page_type: 0,
page_id: this.page_id, page_id: this.page_id,
stay_time: lookTime stay_time: (nowTime - lessonDetail.nowTime) / 1000
}; };
subUserLessonApi( subUserLessonApi(
this.elementId, this.elementId,
...@@ -230,6 +223,7 @@ ...@@ -230,6 +223,7 @@
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));
let query = { let query = {
periods_id: this.periods_id, periods_id: this.periods_id,
course_type: this.course_type, course_type: this.course_type,
......
...@@ -197,8 +197,6 @@ ...@@ -197,8 +197,6 @@
this.videoWidth = Number(document.documentElement.clientWidth) / 3.8; this.videoWidth = Number(document.documentElement.clientWidth) / 3.8;
}, },
mounted() { mounted() {
if(this.$route.params.evaluate === 1)
this.finishStudy()
this.changeAge(this.contentData.age); this.changeAge(this.contentData.age);
let that = this; let that = this;
// console.log(document.documentElement.clientWidth) // console.log(document.documentElement.clientWidth)
...@@ -325,7 +323,6 @@ ...@@ -325,7 +323,6 @@
closeShare() { closeShare() {
// this.$route = {} // this.$route = {}
this.share_show = false; this.share_show = false;
console.log(this.$route)
}, },
finishStudy() { finishStudy() {
if (this.$refs.videoDom) { if (this.$refs.videoDom) {
...@@ -336,10 +333,11 @@ ...@@ -336,10 +333,11 @@
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")); let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date()); let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000; let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = { let json = {
page_type: 0, page_type: 0,
page_id: 5, page_id: 5,
stay_time: lookTime stay_time: (nowTime - lessonDetail.nowTime) / 1000
}; };
// 提交看课数据 记录看课时长 // 提交看课数据 记录看课时长
subUserLessonApi( 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