Commit b114b86950c8d30f8fd845edeaeb2cfc99427ffc
1 parent
c1a60bad
3秒自动跳转的优化, 3秒没有走完,有手动点击的bug优化
Showing
3 changed files
with
32 additions
and
3 deletions
components/auto_go/auto_go.js
... | ... | @@ -3,17 +3,20 @@ Component({ |
3 | 3 | data: { |
4 | 4 | msgStatus:false, |
5 | 5 | countDownNum:3, //默认3秒后跳转 |
6 | + stop:0 //强行停止的开关 | |
6 | 7 | }, |
7 | 8 | methods: { |
8 | 9 | show:function (){ |
10 | + this.data.stop=0; | |
9 | 11 | this.setData({msgStatus:true,countDownNum:3}) |
10 | 12 | this.cut_down(); |
11 | 13 | }, |
12 | 14 | hide:function (){ |
13 | 15 | this.setData({msgStatus:false}) |
14 | 16 | }, |
15 | - //定时器跳转 | |
17 | + //-- 定时器跳转 -- | |
16 | 18 | cut_down(){ |
19 | + if(this.data.stop) return false; | |
17 | 20 | if(this.data.countDownNum>0){ |
18 | 21 | var a=this.data.countDownNum-1; |
19 | 22 | this.setData({countDownNum:a}) |
... | ... | @@ -21,9 +24,15 @@ Component({ |
21 | 24 | this.cut_down(); |
22 | 25 | },1000); |
23 | 26 | }else{ |
27 | + if(this.data.stop) return false; | |
24 | 28 | this.hide(); |
25 | 29 | this.triggerEvent('childFun'); |
26 | 30 | } |
31 | + }, | |
32 | + //-- 3秒跳转的自动关闭 -- | |
33 | + stop(){ | |
34 | + this.data.stop=1; | |
35 | + this.hide(); | |
27 | 36 | } |
28 | 37 | } |
29 | 38 | ... | ... |
pages/activity/pind_list/pind_list.js
... | ... | @@ -237,7 +237,7 @@ Page({ |
237 | 237 | |
238 | 238 | setTimeout(()=>{ |
239 | 239 | wx.hideLoading(); |
240 | - },400) | |
240 | + },500) | |
241 | 241 | |
242 | 242 | }, |
243 | 243 | |
... | ... | @@ -261,6 +261,12 @@ Page({ |
261 | 261 | type: a, |
262 | 262 | goodlist: [] |
263 | 263 | }); |
264 | + | |
265 | + if(a==0){ | |
266 | + var auto_go = th.selectComponent("#auto_go"); | |
267 | + auto_go.stop(); | |
268 | + } | |
269 | + | |
264 | 270 | this.reloadGoodList(); |
265 | 271 | }, |
266 | 272 | ... | ... |
pages/activity/seckill_list/seckill_list.js
... | ... | @@ -256,7 +256,7 @@ Page({ |
256 | 256 | |
257 | 257 | setTimeout(()=>{ |
258 | 258 | wx.hideLoading(); |
259 | - },400) | |
259 | + },500) | |
260 | 260 | |
261 | 261 | |
262 | 262 | |
... | ... | @@ -281,6 +281,12 @@ Page({ |
281 | 281 | type: a, |
282 | 282 | goodlist: null |
283 | 283 | }); |
284 | + | |
285 | + if(a==0){ | |
286 | + var auto_go = th.selectComponent("#auto_go"); | |
287 | + auto_go.stop(); | |
288 | + } | |
289 | + | |
284 | 290 | this.reloadGoodList(); |
285 | 291 | }, |
286 | 292 | |
... | ... | @@ -388,6 +394,14 @@ Page({ |
388 | 394 | for (var i = 0; i < plist.length; i++) { |
389 | 395 | |
390 | 396 | if (plist[i].user_price) plist[i].price = plist[i].user_price; |
397 | + let price=plist[i].price+'' | |
398 | + if (price && price.indexOf('.')>-1) { | |
399 | + let priceArr = price.split(".") | |
400 | + plist[i].price_n = priceArr[0] | |
401 | + plist[i].price_xs = priceArr[1] | |
402 | + }else{ | |
403 | + plist[i].price_n = price | |
404 | + } | |
391 | 405 | var prom_id = plist[i].id; |
392 | 406 | await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + |
393 | 407 | os.stoid + "/1/" + prom_id, {} | ... | ... |