diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 4298060..f0a1954 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -115,9 +115,9 @@ Component({ var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 var url = ""; - if (prom_type == 1) { + if (prom_type == 6) { url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; - } else if (prom_type == 6) { + } else if (prom_type == 1) { url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; } if(url==""){ @@ -130,11 +130,11 @@ Component({ return app.request.promiseGet(url, {}) } - }).then(res => { index++; var prom = res.data.data; - if (prom != null) { + var now=ut.gettimestamp(); + if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time { + await app.request.promiseGet(url, {}).then(res => { var prom = res.data.data; - if (prom != null) { + if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time { //商品地址 var goods = res.data.data; - console.log("goods"); - console.log(goods); - // th.setData({ - // goods_btn: res.data.data - // }) + item.goods_name = val.goods_name; item.goods_img = th.data.imghost + val.original_img; item.market_price = val.market_price; @@ -260,16 +258,16 @@ Component({ var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 var url = ""; - if (prom_type == 1) { + if (prom_type == 6) { url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; - } else if (prom_type == 6) { + } else if (prom_type == 1) { url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; } if(url!=null){ - app.request.promiseGet(url, {}).then(res => { + await app.request.promiseGet(url, {}).then(res => { var prom = res.data.data; - if (prom != null) { + if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time - - - - - + + + + + - - + + > - - - - - - - + - + - - - - - {{item.goods_name}} + - ¥{{item.shop_price}} + + + ¥{{item.shop_price}} + + ¥{{item.market_price}} - 销量:{{item.sales_sum}}件 - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - + + - - - - - - + - - - - - - - - - - + - - - - @@ -476,223 +92,34 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - + + - - - + - - - - - + - - - - @@ -712,203 +139,61 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - + + + + + + + + + + - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + 销量:{{item.sales_sum}}件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - ¥{{item.shop_price}} - ¥{{item.market_price}} - - 销量:{{item.sales_sum}}件 - - - - - - + + + + - - - - - - - - - + - - - + - - + + \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss index ad4e535..850342e 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxss +++ b/components/diy_goodsGroup/diy_goodsGroup.wxss @@ -1,42 +1,30 @@ /* pages/diy_zs/diy_zs.wxss */ - +.zwp_3{ margin-top: 10rpx} .zs_goods{ - width: 100%; - min-height: 500rpx; -border: 2rpx #ddd solid; -margin: 0 auto; -} - -.zwp_3{ - /* width: 30%; */ + width: 700rpx; + border: 1rpx #ddd solid; + margin-bottom: 10rpx; + margin: 0 auto; + } - .s1_gk_a1{ display: inline; width: auto; height: auto; } -.clear{ - clear: both; -} +.clear{ clear: both;} .zs_top{ width: 100%; min-height: 700rpx; margin: 0 auto; - padding-left:22rpx; -padding-bottom:30rpx; - -display: flex; -/* padding-left: 6rpx; */ -/* padding-right: 30rpx; */ + margin-bottom:30rpx; + display: flex; } .zs_t_img { - width: 700rpx; - height: 700rpx; - /* margin: 0 auto; */ - /* background-color: bisque; */ - + width: 698rpx; + height: 698rpx; + margin: 1rpx auto; } .zs_center{ @@ -53,8 +41,9 @@ display: flex; overflow: hidden; text-overflow: ellipsis; margin-bottom:10rpx; -font-size:28rpx; + font-size:28rpx; white-space: nowrap; + width: 640rpx } @@ -104,43 +93,39 @@ font-size:28rpx; .zs_t1{ width: 56rpx; height: 56rpx; - position: relative; - right: 58rpx; - bottom: -640rpx; + position: absolute; + left: 0rpx; + top: 10rpx; } .zs_t2{ width: 56rpx; height: 56rpx; - position: relative; - right: 58rpx; - bottom: -2rpx; + position: absolute; + right: 0rpx; + top: 10rpx; } .zs_t3{ width: 56rpx; height: 56rpx; - position: relative; - right: 692rpx; - bottom: -4rpx; + position: absolute; + left: 0rpx; + bottom: 10rpx; } .zs_t4{ width: 56rpx; height: 56rpx; - position: relative; - right: 692rpx; - bottom: -642rpx; + position: absolute; + right: 20rpx; + bottom: 10rpx; } - -/* xiao */ - - .zs_goods_xiao_bottom{ width: 100%; min-height: 300rpx; @@ -165,24 +150,15 @@ font-size:28rpx; .zs_top_x{ width: 400rpx; height: 318rpx; - margin-top: 20rpx; - /* /* padding-top:30rpx; -padding-bottom:30rpx; */ - -display: flex; - + margin-top: 20rpx; + display: flex; } -/* .zs_goods_xiao{ - background-color: white; -} */ - .zs_t_img_x { width: 290rpx; height: 290rpx; margin-left: 20rpx; - /* background-color: bisque; */ - + } .zs_center_x{ @@ -381,61 +357,57 @@ top: 234rpx; } + +/*---俩列图片位置---*/ .zs_t1_2l{ width: 56rpx; height: 56rpx; - position: relative; - right: -2rpx; - top: -310rpx; + position: absolute; + left: 0rpx; + top: 10rpx; } - .zs_t2_2l{ width: 56rpx; height: 56rpx; - position: relative; - right: -294rpx; - bottom: 310rpx; + position: absolute; + right: 0rpx; + top: 10rpx; } .zs_t3_2l{ width: 56rpx; height: 56rpx; - position: relative; - right: -294rpx; - bottom: 68rpx; + position: absolute; + left: 0rpx; + bottom: 10rpx; } .zs_t4_2l{ width: 56rpx; height: 56rpx; - position: relative; - right: -2rpx; - bottom: 68rpx; + position: absolute; + right: 0rpx; + bottom: 10rpx; } + + /*一个3列*/ .zs_goods_wai_san{ - width: 240rpx; + width: 230rpx; display: flex; - margin-left: 8rpx; + margin-left: 10rpx; float: left; margin-bottom: 8rpx; - background-color:white; - + background-color:white; } .zs_goods_san{ width: 240rpx; } - - - - - - .zs_goods_3l{ width: 240rpx; min-height: 300rpx; @@ -445,22 +417,15 @@ top: 234rpx; } .zs_top_3l{ - width: 240rpx; - height: 240rpx; - - - - - - + width: 232rpx; + height: 232rpx; } .zs_t_img_3l { - width:237rpx; - height: 240rpx; + width:232rpx; + height: 232rpx; margin: 0 auto; background-color: bisque; - } .zs_center_3l{ @@ -469,27 +434,28 @@ top: 234rpx; font-size: 28rpx; color: #333; text-align: left; - padding: 0 10rpx; + padding: 0 10rpx; } .zs_wz1_3l{ - overflow: hidden; - text-overflow: ellipsis; + margin-bottom:10rpx; font-size:30rpx; height: 80rpx; - width: 227rpx; - /* white-space: nowrap; */ + width: 220rpx; + + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } .zs_wz2_3l{ - /* overflow: hidden; - text-overflow: ellipsis; */ margin-bottom:10rpx; font-size:30rpx; - /* white-space: nowrap; */ - display: flex; + display: flex; } .zs_wz3_3l{ @@ -497,7 +463,7 @@ top: 234rpx; text-overflow: ellipsis; margin-bottom:10rpx; font-size:30rpx; - white-space: nowrap; + white-space: nowrap; } .zs_wz4_3l{ @@ -505,7 +471,7 @@ top: 234rpx; text-overflow: ellipsis; margin-bottom:10rpx; font-size:30rpx; - white-space: nowrap; + white-space: nowrap; } .zs_wz5_3l{ @@ -519,38 +485,40 @@ top: 234rpx; .zs_t1_3l{ width: 56rpx; height: 56rpx; - position: relative; - right: 0rpx; - top: -250rpx; + position: absolute; + left: 0rpx; + top: 10rpx; } .zs_t2_3l{ width: 56rpx; height: 56rpx; - position: relative; - right: -177rpx; - bottom: 250rpx; + position: absolute; + right: 0rpx; + top: 10rpx; } .zs_t3_3l{ width: 56rpx; height: 56rpx; - position: relative; - right: -177rpx; - bottom: 67rpx; + position: absolute; + left: 0rpx; + bottom: 10rpx; } .zs_t4_3l{ width: 56rpx; height: 56rpx; - position: relative; + position: absolute; right: 0rpx; - bottom: 67rpx; + bottom: 10rpx; } .zs_goods_wai{ background-color: white; margin-top: 10rpx; -} \ No newline at end of file +} + +.rel{position: relative} \ No newline at end of file diff --git a/components/diy_goodsGroup/g_filter.wxs b/components/diy_goodsGroup/g_filter.wxs new file mode 100644 index 0000000..8bba9f3 --- /dev/null +++ b/components/diy_goodsGroup/g_filter.wxs @@ -0,0 +1,84 @@ +//获取样式 +var get_class = function(column,position) { + //--列的情况 + if(column==1){ return "zs_t"+position; } + //--俩列的情况 + if(column==2){ return "zs_t"+position+"_2l"; } + //--三列的情况 + if(column==3){ return "zs_t"+position+"_3l"; } + //----列表的情况----- + if(column==4 ){ return "zs_t1_x"+position; } + +} + + +var g_filters = { + //-- 判断是不是有等级价 -- + is_has_rank:function(rank_switch,item){ + if(!rank_switch) return false; + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true} + return false; + }, + + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- + get_card_price:function(goods,all_card,type){ + var price1=parseFloat(goods['cardprice1']); + var price2 = parseFloat(goods['cardprice2']); + var price3 = parseFloat(goods['cardprice3']); + if(!all_card){ + if(type==0) return 0; + return ""; + } + + var min_price=null; + var min_name=null; + //---设置对应的价格名字---- + for(var i=0;i<3;i++) { + var vl=all_card[i]; + if(vl['CorrPrice']=="Price1" && price1>0) + { + if(min_price==null) { + min_price=price1;min_name=vl['CardName']; + } + else if(price10) + { + if(min_price==null) { + min_price=price2;min_name=vl['CardName']; + } + else if(price20) + { + if(min_price==null) { + min_price=price3;min_name=vl['CardName']; + } + else if(price34 ) min_name=min_name.substring(0, 4); + return min_name; + }, +} + + +module.exports = { + get_class: get_class, + is_has_rank:g_filters.is_has_rank, + get_card_price:g_filters.get_card_price, +} diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 86f83c8..f2e6a4a 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -262,7 +262,7 @@ - + @@ -278,7 +278,7 @@ - +