diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 0dac118..d4b0f5e 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -35,6 +35,9 @@ Page({ index:223, classify_name:"国家",//项目类型 brand_list:null,//品牌列表 + + one_level_classify:[],// 新的版本左边的边分类1级 + ishaf_three:0//判断有没有3级 }, onLoad: function(tt) { const res = wx.getSystemInfoSync(), @@ -68,9 +71,9 @@ Page({ this.setData({ lettersPosition: temp }); - console.log(this.data.is_used_share,"是什么东西啊"); + if (this.data.is_used_share==0){ - console.log("有进来m"); + this.get_nation(); } @@ -78,9 +81,15 @@ Page({ }, onShow:function(){ + getApp 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); + var is_newsgoodstype = switch_list.is_newsgoodstype; + that.setData({ is_used_share :is_newsgoodstype}); if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); } if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); } if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); } @@ -115,13 +124,15 @@ Page({ success: function(e) { var arr=new Array(); var dda = e.data.data.pageData; - console.log(dda.length); + + console.log(dda, "所有的数据"); + if (this.data.is_used_share == 0) {//is_used_share控制新旧版本 for(var i=0;i0){ + + if (parseInt(need_to_insert.parent_id) == parseInt(two_item[pp].items.id)) { + + arr[dd].array[pp].arrays.push(need_to_insert); arr.ishaf_three = 0; break; + } + + } + + } + } + } + + } + + console.log("现在是1级与2级所有的数据", arr) + t.setData({one_level_classify:arr}); + } } }); }, @@ -271,7 +326,8 @@ Page({ }, success: function (e) { var dda = e.data.data.pageData; - + + s.setData({ nationlist:dda}) } }); @@ -368,15 +424,52 @@ Page({ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; }, - // 新的版本分类 + // 新的版本分类点击一级分类 click_classify:function(e){ + this.data.ishaf_three=0; var indexs=e.currentTarget.dataset.index; var name = e.currentTarget.dataset.name; - console.log("获取当前下标",indexs); - this.setData({ select_classify_on: indexs, index: indexs, classify_name:name}); + var cid = e.currentTarget.dataset.cid; + var pid = e.currentTarget.dataset.pid; + var arr = e.currentTarget.dataset.arr; + if (indexs==220){ this.get_brand(); } + + if (arr!="undefined" && arr!=undefined){ + if (arr.length==0){ + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; + wx.navigateTo({ url: lurl }); + return false; + } + if (arr.length != 0){ + + for(var i=0;i0){ + console.log("000000"); + // for (var z = 0;z + - - + + + - - + + - - - {{item.good_name}} - - + +{{goods.items.name}} + + 选择更多 + + + + + + + + + {{item.name}} + + + + + diff --git a/pages/goods/categoryList/categoryList.wxss b/pages/goods/categoryList/categoryList.wxss index 44e9a82..fc78bac 100644 --- a/pages/goods/categoryList/categoryList.wxss +++ b/pages/goods/categoryList/categoryList.wxss @@ -203,17 +203,20 @@ margin-top: 8rpx; width: 33%; height: 100%; border-right: 1rpx solid #eee; + white-space: nowrap; + } .share_type{ margin: auto; - width: 60%; + width: 58%; margin-top: 35rpx; +overflow: hidden; } .xc-letter-spacing{ padding-left: 29rpx; padding-right: 29rpx; -width: 52%; +width: 51%; margin: auto; margin-top: 35rpx; @@ -222,7 +225,7 @@ margin-top: 35rpx; .world_sn{ white-space: nowrap; overflow: hidden; -width: 50%; +width: 58%; /* letter-spacing: 60rpx; */ margin: auto; margin-top: 35rpx; @@ -262,8 +265,8 @@ width: 60%; width: 90%; margin: auto; flex-wrap:wrap; - justify-content:space-between; - height: 90%; + max-height: 90%; + overflow-y:scroll; overflow: hidden scroll; @@ -271,7 +274,7 @@ width: 60%; .country_img-frame{ width: 48%; height: 140rpx; - + } .country_img{ width: 100%; @@ -318,12 +321,13 @@ line-height: 65rpx; width: 30%; height: 220rpx; margin-top: 18rpx; + margin-right: 15rpx; } .brand_img{ width:100%; - height: 70%; + height: 61.5%; margin-bottom: 10rpx } .brand_img-name{ @@ -344,6 +348,14 @@ width: 62%; line-height: 37rpx; height: 35rpx; margin-top: 24rpx; + } + .divider_line{ + width: 100%; + border-bottom: 6rpx solid #eee; + } + .sort-name{ + width: 132rpx; +overflow: hidden; +margin: auto; - - } \ No newline at end of file +} \ No newline at end of file