From 4b52425f65845bd5f68405c18f85547a3eed61c3 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Tue, 8 Sep 2020 08:57:12 +0800 Subject: [PATCH] 商品分组的修改 --- components/diy_goodsGroup/diy_goodsGroup.js | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------ components/diy_goodsGroup/diy_goodsGroup.wxml | 25 ++++++++++++++++++++++--- components/diy_goodsGroup/diy_goodsGroup.wxss | 41 +++++++++++++++++++++++++++++++++-------- components/diy_goodsGroup/g_filter.wxs | 2 ++ 4 files changed, 140 insertions(+), 125 deletions(-) diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 94a3d36..b73299f 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -44,6 +44,7 @@ Component({ is_nav:0, nav_list:null, title_index:0, + swiper_hei:0, }, ready: function () {}, @@ -70,16 +71,21 @@ Component({ if(idlist) idlist=ut.sub_last(idlist); nav_list[ij].idlist=idlist; } - this.setData({nav_list:nav_list,is_nav:this.data.object.is_nav}); + this.setData({nav_list:nav_list,is_nav:parseInt(this.data.object.is_nav)}); } - - + // 在组件实例进入页面节点树时执行 this.data.classstyle_id = nav_item.classstyle; this.data.goodscount = this.data.object.goodscount; this.data.wgroup =nav_item.wgroup; - - + + var hei=280; + if(this.data.object.goodstit) hei+=80; + if(this.data.object.goodsprice) hei+=80; + if(this.data.object.goodsnum) hei+=80; + + this.setData({swiper_hei:hei}); + if (nav_item.goodsclass == 1) { this.data.is_recommend = 1 } @@ -203,60 +209,8 @@ Component({ total: res.data.data.total }) th.data.currentPage++; - var now=ut.gettimestamp(); - - goods.forEach(async function (val, ind) { - var item = {}; - var prom_id = null; - console.log(val.goodsid); - //app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => { - //商品地址 - //var goods = res.data.data; - - item.goods_name = val.goods_name; - item.goods_img = th.data.imghost + val.original_img; - item.market_price = val.market_price; - item.shop_price = val.shop_price; - item.sales_sum = val.sales_sum; - item.goods_id = val.goods_id; - - item.cardprice1 = val.cardprice1; - item.cardprice2 = val.cardprice2; - item.cardprice3 = val.cardprice3; - - prom_id = val.prom_id; - - var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单 - - var url = ""; - if (prom_type == 6) { - url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; - } else if (prom_type == 1) { - url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; - } - if(url!="") { - await app.request.promiseGet(url, {}).then(res => { - var prom = null - if (res && res.data) prom=res.data.data; - if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time { - //商品地址 - var goods = res.data.data; - - item.goods_name = val.goods_name; - item.goods_img = th.data.imghost + val.original_img; - item.market_price = val.market_price; - item.shop_price = val.shop_price; - item.sales_sum = val.sales_sum; - item.goods_id = val.goods_id; - - item.cardprice1 = val.cardprice1; - item.cardprice2 = val.cardprice2; - item.cardprice3 = val.cardprice3; - - prom_id = val.prom_id; - - var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 - - var url = ""; - if (prom_type == 6) { - url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; - } else if (prom_type == 1) { - url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; - } - - if(url!=null){ - await app.request.promiseGet(url, {}).then(res => { - var prom =null; - if(res && res.data) res.data.data; - if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time { + + item.goods_name = val.goods_name; + item.goods_img = th.data.imghost + val.original_img; + item.market_price = val.market_price; + item.shop_price = val.shop_price; + item.sales_sum = val.sales_sum; + item.goods_id = val.goods_id; + + item.cardprice1 = val.cardprice1; + item.cardprice2 = val.cardprice2; + item.cardprice3 = val.cardprice3; + + prom_id = val.prom_id; + + var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单 + + var url = ""; + if (prom_type == 6) { + url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; + } else if (prom_type == 1) { + url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; + } + + if(url!=null){ + await getApp().request.promiseGet(url, {}).then(res => { + var prom =null; + if(res && res.data) res.data.data; + if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time - + - - + + + + + + + + + + + + + + + + diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss index 5a84a92..b36491f 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxss +++ b/components/diy_goodsGroup/diy_goodsGroup.wxss @@ -398,7 +398,7 @@ } .zs_goods_3l { - width: 236rpx; + width: 228rpx; min-height: 300rpx; margin: 0 auto; padding: 2rpx; @@ -419,7 +419,6 @@ .zs_center_3l { width: 100%; - min-height: 200rpx; font-size: 28rpx; color: #333; text-align: left; @@ -575,7 +574,7 @@ .ai-center{align-items: center;} .gr_title_list{ width:95%; margin-left:2.5%} -.gr_title_item{ padding:0 10rpx;flex-shrink: 0;} +.gr_title_item{ padding:0 10rpx;flex-shrink: 0;flex-grow: 1; text-align: center;} .border_zhijiao{ @@ -606,12 +605,10 @@ .s_prom { width: 100%; background-color: white; - min-height: 200rpx; } swiper { display: block; - height: 400rpx; } .right_k { @@ -630,7 +627,6 @@ swiper { .sp { - min-height: 300rpx; width: 100%; background-color: white; padding: 18rpx; @@ -651,7 +647,6 @@ swiper { width: 210rpx; height: 100%; position: relative; - top: -74rpx; left: 0rpx; } @@ -689,7 +684,6 @@ swiper { .sp_wz { width: 210rpx; - min-height: 100rpx; } .sp_wz .sp_wzi { @@ -785,3 +779,34 @@ swiper { .t_red{ color:red;} +.sp .sp_top .s_img image.zs_t3_3l{ + width: 56rpx; + height: 56rpx; + position: absolute; + left: 0rpx; + bottom: 10rpx; +} +.sp .sp_top .s_img image.zs_t1_3l{ +width: 56rpx; +height: 56rpx; +position: absolute; +left: 0rpx; +top: 10rpx; +} + +.sp .sp_top .s_img image.zs_t2_3l{ + width: 56rpx; + height: 56rpx; + position: absolute; + right: 0rpx; + top: 10rpx; + +} +.sp .sp_top .s_img image.zs_t4_3l{ + width: 56rpx; + height: 56rpx; + position: absolute; + right: 0rpx; + bottom: 10rpx; + +} \ No newline at end of file diff --git a/components/diy_goodsGroup/g_filter.wxs b/components/diy_goodsGroup/g_filter.wxs index bffffae..6b5e379 100644 --- a/components/diy_goodsGroup/g_filter.wxs +++ b/components/diy_goodsGroup/g_filter.wxs @@ -8,6 +8,8 @@ var get_class = function(column,position) { if(column==3){ return "zs_t"+position+"_3l"; } //----列表的情况----- if(column==4 ){ return "zs_t1_x"+position; } + //--滑动的情况 + if(column==5){ return "zs_t"+position+"_3l"; } } -- libgit2 0.21.4