Commit c54581745c053e12f0269d85c18b16f7c5a94a56

Authored by yvan.ni
1 parent 397e0899

秒杀,拼团清理定时器

components/diy_pingd_buy/diy_pingd_buy.js
... ... @@ -47,7 +47,12 @@ Component({
47 47 th.countDown2(th);
48 48 }, 1000);
49 49 }
50   - }
  50 + },
  51 +
  52 + hide:function () {
  53 + // 页面被被销毁的时候,清除定时器
  54 + clearInterval(this.data.timer);
  55 + }
51 56 },
52 57  
53 58  
... ...
components/diy_seckill/diy_seckill.js
... ... @@ -51,6 +51,11 @@ Component({
51 51 }, 1000);
52 52 }
53 53 },600)
  54 + },
  55 +
  56 + hide:function () {
  57 + // 页面被被销毁的时候,清除定时器
  58 + clearInterval(this.data.timer);
54 59 }
55 60 },
56 61  
... ...