From d556c5cb0534c98d2e776888432b484d51b272c5 Mon Sep 17 00:00:00 2001 From: cheng.xu Date: Fri, 11 Oct 2019 16:01:14 +0800 Subject: [PATCH] 商品分类 --- pages/goods/categoryList/categoryList.js | 30 +++++++++++++++++++++++++++--- pages/goods/categoryList/categoryList.wxml | 14 +++++++++----- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index f843053..48798d0 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -38,6 +38,8 @@ Page({ one_level_classify:[],// 新的版本左边的边分类1级 is_level_three:0,//判断有没有3级 cat_id:0, + pl_timer: null,//只有品类的定时器 + is_pl_time:0, }, onLoad: function(tt) { const res = wx.getSystemInfoSync(), @@ -84,6 +86,7 @@ Page({ var that=this; getApp().getConfig2(function (e) { + var data=e; var switch_list_data = data.switch_list; var switch_list = JSON.parse(switch_list_data); @@ -93,7 +96,25 @@ Page({ if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); } if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); } that.setData({ store_config: e,is_do:1 }); - + if ( that.data.is_show_gb != 1 && that.data.is_show_pp != 1){ + console.log("品类数据", that.data.is_pl_time); + var one_level_classify = that.data.one_level_classify; + that.data.pl_timer = setInterval(function () { + console.log("品类数据", that.data.is_pl_time); + that.requestFirstCategoris(); + if (that.data.is_pl_time==1){ + console.log("品类数据", that.data.is_pl_time); + clearInterval(that.data.pl_timer); + } + }, 6000); + console.log(one_level_classify,"999999999999999999999999999999999" ); + that.setData({ select_classify_on: 0, index: 0, goodslist: one_level_classify[0].array}); + } else if (that.data.is_show_gb != 1 ){ + // console.log("品类数据", that.data.is_show_pl); + + that.setData({ select_classify_on: 220, classify_name: "品牌" }); + } + if (that.data.is_show_pl) that.setData({ currentTab: 0 }); else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); } else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); } @@ -123,8 +144,10 @@ Page({ success: function(e) { var arr=new Array(); var dda = e.data.data.pageData; - - console.log(dda, "所有的数据"); + if (dda != null && dda !=""&&dda!=undefined){ + t.setData({is_pl_time:1}); + } + if (t.data.is_used_share == 0) {//is_used_share控制新旧版本 for(var i=0;i - {{ittms.items.name}} + {{ittms.items.name}} @@ -164,7 +164,7 @@ - + {{ishaf_three==1?good_list.name:classify_name}} @@ -182,7 +182,7 @@ - + {{classify_name}} @@ -204,7 +204,8 @@ - + + @@ -225,8 +226,9 @@ - + + @@ -251,9 +253,11 @@ + + -- libgit2 0.21.4