Commit b114b86950c8d30f8fd845edeaeb2cfc99427ffc

Authored by yvan.ni
1 parent c1a60bad

3秒自动跳转的优化, 3秒没有走完,有手动点击的bug优化

components/auto_go/auto_go.js
@@ -3,17 +3,20 @@ Component({ @@ -3,17 +3,20 @@ Component({
3 data: { 3 data: {
4 msgStatus:false, 4 msgStatus:false,
5 countDownNum:3, //默认3秒后跳转 5 countDownNum:3, //默认3秒后跳转
  6 + stop:0 //强行停止的开关
6 }, 7 },
7 methods: { 8 methods: {
8 show:function (){ 9 show:function (){
  10 + this.data.stop=0;
9 this.setData({msgStatus:true,countDownNum:3}) 11 this.setData({msgStatus:true,countDownNum:3})
10 this.cut_down(); 12 this.cut_down();
11 }, 13 },
12 hide:function (){ 14 hide:function (){
13 this.setData({msgStatus:false}) 15 this.setData({msgStatus:false})
14 }, 16 },
15 - //定时器跳转 17 + //-- 定时器跳转 --
16 cut_down(){ 18 cut_down(){
  19 + if(this.data.stop) return false;
17 if(this.data.countDownNum>0){ 20 if(this.data.countDownNum>0){
18 var a=this.data.countDownNum-1; 21 var a=this.data.countDownNum-1;
19 this.setData({countDownNum:a}) 22 this.setData({countDownNum:a})
@@ -21,9 +24,15 @@ Component({ @@ -21,9 +24,15 @@ Component({
21 this.cut_down(); 24 this.cut_down();
22 },1000); 25 },1000);
23 }else{ 26 }else{
  27 + if(this.data.stop) return false;
24 this.hide(); 28 this.hide();
25 this.triggerEvent('childFun'); 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,7 +237,7 @@ Page({
237 237
238 setTimeout(()=>{ 238 setTimeout(()=>{
239 wx.hideLoading(); 239 wx.hideLoading();
240 - },400) 240 + },500)
241 241
242 }, 242 },
243 243
@@ -261,6 +261,12 @@ Page({ @@ -261,6 +261,12 @@ Page({
261 type: a, 261 type: a,
262 goodlist: [] 262 goodlist: []
263 }); 263 });
  264 +
  265 + if(a==0){
  266 + var auto_go = th.selectComponent("#auto_go");
  267 + auto_go.stop();
  268 + }
  269 +
264 this.reloadGoodList(); 270 this.reloadGoodList();
265 }, 271 },
266 272
pages/activity/seckill_list/seckill_list.js
@@ -256,7 +256,7 @@ Page({ @@ -256,7 +256,7 @@ Page({
256 256
257 setTimeout(()=>{ 257 setTimeout(()=>{
258 wx.hideLoading(); 258 wx.hideLoading();
259 - },400) 259 + },500)
260 260
261 261
262 262
@@ -281,6 +281,12 @@ Page({ @@ -281,6 +281,12 @@ Page({
281 type: a, 281 type: a,
282 goodlist: null 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 this.reloadGoodList(); 290 this.reloadGoodList();
285 }, 291 },
286 292
@@ -388,6 +394,14 @@ Page({ @@ -388,6 +394,14 @@ Page({
388 for (var i = 0; i < plist.length; i++) { 394 for (var i = 0; i < plist.length; i++) {
389 395
390 if (plist[i].user_price) plist[i].price = plist[i].user_price; 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 var prom_id = plist[i].id; 405 var prom_id = plist[i].id;
392 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + 406 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
393 os.stoid + "/1/" + prom_id, {} 407 os.stoid + "/1/" + prom_id, {}