From 3de1828fef73391485a97c9aad8ab53de9ea1f91 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Thu, 15 Feb 2024 06:48:54 +0800 Subject: [PATCH] 在滑动加载的时候,要暂停一下定时器,避免卡顿 --- pages/activity/seckill_list/seckill_list.js | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index 6837a56..19f5907 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -176,6 +176,9 @@ Page({ } } var txt = "timer_js[" + idx + "]"; + + if (!th.data.is_timer) return; + th.setData({ [txt]: obj }); @@ -194,6 +197,7 @@ Page({ if (!this.data.ismore) return false; if(this.data.lding) return false; this.data.lding=1; + this.data.is_timer=0; //暂停一下定时器 var e = this, @@ -227,6 +231,7 @@ Page({ wx.hideLoading(); th.data.ismore = 0; + this.data.is_timer=1; if (e.data.currentPage == 1 && this.data.type == 1) { //-- 弄到即将开始 -- @@ -261,6 +266,7 @@ Page({ } this.data.lding=0; + this.data.is_timer=1; return false; } @@ -307,6 +313,7 @@ Page({ },200) this.data.lding=0; + this.data.is_timer=1; -- libgit2 0.21.4