mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 18:36:43 +08:00
修改正常视频浏览器静默状态的上传时间
This commit is contained in:
@@ -396,7 +396,7 @@
|
||||
appendStudyOtherHandle:null,
|
||||
cumulativeDuration:0, //非音频累计时长
|
||||
maxDuration:0, //非音频最大时长
|
||||
defaultMaxTime:1800 //非音频默认最大时间
|
||||
defaultMaxTime:1800, //非音频默认最大时间
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -1400,7 +1400,7 @@
|
||||
//静默处理
|
||||
apiStat.sendEvent(postData).then(rs=>{
|
||||
if(rs.status == 200) {
|
||||
this.appendStartTime = new Date();//重新计时
|
||||
// this.appendStartTime = new Date();//重新计时
|
||||
studyUtil.clearStudyDuration(); //清除本地存储
|
||||
} else {
|
||||
console.log(rs.message);
|
||||
@@ -1469,12 +1469,16 @@
|
||||
let now = new Date();
|
||||
let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
|
||||
let sen = parseInt(m / 1000); //计算秒数
|
||||
duration = duration + $this.appentInterval/1000;//追加的是秒
|
||||
if (sen>=60) { //一分钟保存一次
|
||||
console.log('定时器时间',sen);
|
||||
// 每次添加的是定时器计时的时间
|
||||
duration = duration + sen;//追加的是秒
|
||||
if (duration >= 60) { //一分钟保存一次
|
||||
this.saveStudyDuration(duration);
|
||||
} else {
|
||||
studyUtil.setStudyDuration(duration); //添加到本地存储中
|
||||
}
|
||||
//重新覆盖时间
|
||||
this.appendStartTime = new Date();
|
||||
//启动下次追加学习时长
|
||||
this.appendHandle = setTimeout(function() {
|
||||
$this.appendStudyTime();
|
||||
|
||||
Reference in New Issue
Block a user