Commit 3de1828fef73391485a97c9aad8ab53de9ea1f91

Authored by yvan.ni
1 parent a47cb52b

在滑动加载的时候,要暂停一下定时器,避免卡顿

pages/activity/seckill_list/seckill_list.js
@@ -176,6 +176,9 @@ Page({ @@ -176,6 +176,9 @@ Page({
176 } 176 }
177 } 177 }
178 var txt = "timer_js[" + idx + "]"; 178 var txt = "timer_js[" + idx + "]";
  179 +
  180 + if (!th.data.is_timer) return;
  181 +
179 th.setData({ 182 th.setData({
180 [txt]: obj 183 [txt]: obj
181 }); 184 });
@@ -194,6 +197,7 @@ Page({ @@ -194,6 +197,7 @@ Page({
194 if (!this.data.ismore) return false; 197 if (!this.data.ismore) return false;
195 if(this.data.lding) return false; 198 if(this.data.lding) return false;
196 this.data.lding=1; 199 this.data.lding=1;
  200 + this.data.is_timer=0; //暂停一下定时器
197 201
198 202
199 var e = this, 203 var e = this,
@@ -227,6 +231,7 @@ Page({ @@ -227,6 +231,7 @@ Page({
227 wx.hideLoading(); 231 wx.hideLoading();
228 232
229 th.data.ismore = 0; 233 th.data.ismore = 0;
  234 + this.data.is_timer=1;
230 if (e.data.currentPage == 1 && this.data.type == 1) { 235 if (e.data.currentPage == 1 && this.data.type == 1) {
231 236
232 //-- 弄到即将开始 -- 237 //-- 弄到即将开始 --
@@ -261,6 +266,7 @@ Page({ @@ -261,6 +266,7 @@ Page({
261 } 266 }
262 267
263 this.data.lding=0; 268 this.data.lding=0;
  269 + this.data.is_timer=1;
264 return false; 270 return false;
265 } 271 }
266 272
@@ -307,6 +313,7 @@ Page({ @@ -307,6 +313,7 @@ Page({
307 },200) 313 },200)
308 314
309 this.data.lding=0; 315 this.data.lding=0;
  316 + this.data.is_timer=1;
310 317
311 318
312 319