|
|
@@ -726,6 +726,10 @@ export default {
|
|
|
}, 5000);
|
|
|
}
|
|
|
}
|
|
|
+ // 重新启动章节奖励计时器(如果符合条件)
|
|
|
+ if (this.pickCatalog.videoId && (this.hasGotPageEntryReward == 1 || this.hasGotPageEntryReward == 2)) {
|
|
|
+ this.startPageEntryTimer();
|
|
|
+ }
|
|
|
this.playFun()
|
|
|
if (this.showPayTips) {
|
|
|
this.$refs.popTip.open();
|
|
|
@@ -743,6 +747,16 @@ export default {
|
|
|
onHide() {
|
|
|
const type = this.showAudio ? 'audio' : 'video'
|
|
|
this.pauseFun(type);
|
|
|
+ // 清理所有定时器,避免后台运行时资源泄漏
|
|
|
+ this.endCountsTime();
|
|
|
+ this.stopPageEntryTimer();
|
|
|
+ // 关闭WebSocket连接和心跳
|
|
|
+ if (this.socket != null) {
|
|
|
+ this.socket.close()
|
|
|
+ clearInterval(this.pingpangTimes)
|
|
|
+ this.pingpangTimes = null
|
|
|
+ this.socket = null
|
|
|
+ }
|
|
|
},
|
|
|
onUnload() {
|
|
|
if (this.socket != null) {
|