| @@ -19,6 +19,7 @@ Page({ | |||
| downNum:15,//倒计时时间 | |||
| setInt:null,//倒计时元素 | |||
| pizeTip:0,//抓奖提示框 | |||
| pageUnload:false,//页面是否退出了 | |||
| setGroup:{ | |||
| left:null, | |||
| right: null, | |||
| @@ -120,7 +121,8 @@ Page({ | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| this.data.pageUnload = true; | |||
| clearInterval(this.data.setInt); | |||
| }, | |||
| /** | |||
| @@ -426,6 +428,9 @@ Page({ | |||
| }) | |||
| }, | |||
| getGameAwardList: function () {//获取游戏中奖数据 | |||
| if(this.data.pageUnload){ | |||
| return; | |||
| } | |||
| app.wxRequest(app.globalData.urlRoot + "award/getGameAwardList", this.data.configure,res=>{ | |||
| if(res.code==200){ | |||
| if(res.data){ | |||
| @@ -474,6 +479,9 @@ Page({ | |||
| },this) | |||
| }, | |||
| noMoreData: function (duration,left){ | |||
| if(this.data.pageUnload){ | |||
| return; | |||
| } | |||
| console.log(1); | |||
| this.aniFun(duration, left); | |||
| setTimeout(() => { | |||