Commit 41ce37de94fb0b5ff39d7466d846c87d5029c9e0

Authored by 后端开发-许程
1 parent 164c5e7b

商品分类

pages/goods/categoryList/categoryList.js
@@ -98,21 +98,30 @@ Page({ @@ -98,21 +98,30 @@ Page({
98 if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); } 98 if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); }
99 that.setData({ store_config: e,is_do:1 }); 99 that.setData({ store_config: e,is_do:1 });
100 if ( that.data.is_show_gb != 1 && that.data.is_show_pp != 1){ 100 if ( that.data.is_show_gb != 1 && that.data.is_show_pp != 1){
101 - console.log("品类数据", that.data.is_pl_time); 101 +
102 102
103 - that.data.pl_timer = setInterval(function () {  
104 - var one_level_classify = that.data.one_level_classify;  
105 - if (that.data.is_pl_time == 1 && one_level_classify.length>0){  
106 - that.setData({ select_classify_on: 0, index: 0, goodslist: one_level_classify[0].array });  
107 - clearInterval(that.data.pl_timer); 103 + that.data.pl_timer = setInterval(function () {
  104 +
  105 + that.requestFirstCategoris();
  106 + console.log("8888888888888888888", that.data.one_level_classify.length);
  107 + if (that.data.one_level_classify.length>0){
  108 + console.log("7777777777777777777777", that.data.one_level_classify);
  109 + //清除定时器
  110 + clearInterval(that.data.pl_timer);
108 } 111 }
109 - }, 500); 112 + },1000);
  113 +
  114 + console.log(that.data.one_level_classify);
  115 + that.setData({ select_classify_on: 0, index: 0, goodslist: one_level_classify[0]});
110 116
111 } else if (that.data.is_show_gb != 1 ){ 117 } else if (that.data.is_show_gb != 1 ){
112 - // console.log("品类数据", that.data.is_show_pl); 118 +
113 119
114 that.setData({ select_classify_on: 220, classify_name: "品牌" }); 120 that.setData({ select_classify_on: 220, classify_name: "品牌" });
115 } 121 }
  122 +
  123 + var one_level_classify = that.data.one_level_classify;
  124 +
116 125
117 if (that.data.is_show_pl) that.setData({ currentTab: 0 }); 126 if (that.data.is_show_pl) that.setData({ currentTab: 0 });
118 else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); } 127 else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); }
@@ -207,6 +216,7 @@ Page({ @@ -207,6 +216,7 @@ Page({
207 216
208 console.log("现在是1级与2级所有的数据", arr) 217 console.log("现在是1级与2级所有的数据", arr)
209 t.setData({one_level_classify:arr}); 218 t.setData({one_level_classify:arr});
  219 +
210 } 220 }
211 } 221 }
212 }); 222 });
@@ -464,21 +474,21 @@ Page({ @@ -464,21 +474,21 @@ Page({
464 474
465 for(var i=0;i<arr.length;i++){ 475 for(var i=0;i<arr.length;i++){
466 if (arr[i].arrays.length>0) { 476 if (arr[i].arrays.length>0) {
467 - console.log("有进来吗5555", ); 477 +
468 this.setData({ is_level_three: 1 }); 478 this.setData({ is_level_three: 1 });
469 break; 479 break;
470 } 480 }
471 this.setData({ is_level_three: 0 }); 481 this.setData({ is_level_three: 0 });
472 } 482 }
473 if (this.data.is_level_three!=1) { 483 if (this.data.is_level_three!=1) {
474 - console.log("2级"); 484 +
475 485
476 this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr }); 486 this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr });
477 487
478 488
479 } else { 489 } else {
480 this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr }); 490 this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr });
481 - console.log("3级这是什么东西", this.data.goodslist); 491 +
482 492
483 } 493 }
484 } 494 }