From b114b86950c8d30f8fd845edeaeb2cfc99427ffc Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 14 Jun 2023 11:06:56 +0800 Subject: [PATCH] 3秒自动跳转的优化, 3秒没有走完,有手动点击的bug优化 --- components/auto_go/auto_go.js | 11 ++++++++++- pages/activity/pind_list/pind_list.js | 8 +++++++- pages/activity/seckill_list/seckill_list.js | 16 +++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/components/auto_go/auto_go.js b/components/auto_go/auto_go.js index 2acae76..c01018d 100644 --- a/components/auto_go/auto_go.js +++ b/components/auto_go/auto_go.js @@ -3,17 +3,20 @@ Component({ data: { msgStatus:false, countDownNum:3, //默认3秒后跳转 + stop:0 //强行停止的开关 }, methods: { show:function (){ + this.data.stop=0; this.setData({msgStatus:true,countDownNum:3}) this.cut_down(); }, hide:function (){ this.setData({msgStatus:false}) }, - //定时器跳转 + //-- 定时器跳转 -- cut_down(){ + if(this.data.stop) return false; if(this.data.countDownNum>0){ var a=this.data.countDownNum-1; this.setData({countDownNum:a}) @@ -21,9 +24,15 @@ Component({ this.cut_down(); },1000); }else{ + if(this.data.stop) return false; this.hide(); this.triggerEvent('childFun'); } + }, + //-- 3秒跳转的自动关闭 -- + stop(){ + this.data.stop=1; + this.hide(); } } diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index 28757d6..8bece44 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -237,7 +237,7 @@ Page({ setTimeout(()=>{ wx.hideLoading(); - },400) + },500) }, @@ -261,6 +261,12 @@ Page({ type: a, goodlist: [] }); + + if(a==0){ + var auto_go = th.selectComponent("#auto_go"); + auto_go.stop(); + } + this.reloadGoodList(); }, diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index 9a05a79..aae4ded 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -256,7 +256,7 @@ Page({ setTimeout(()=>{ wx.hideLoading(); - },400) + },500) @@ -281,6 +281,12 @@ Page({ type: a, goodlist: null }); + + if(a==0){ + var auto_go = th.selectComponent("#auto_go"); + auto_go.stop(); + } + this.reloadGoodList(); }, @@ -388,6 +394,14 @@ Page({ for (var i = 0; i < plist.length; i++) { if (plist[i].user_price) plist[i].price = plist[i].user_price; + let price=plist[i].price+'' + if (price && price.indexOf('.')>-1) { + let priceArr = price.split(".") + plist[i].price_n = priceArr[0] + plist[i].price_xs = priceArr[1] + }else{ + plist[i].price_n = price + } var prom_id = plist[i].id; await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/1/" + prom_id, {} -- libgit2 0.21.4