diff --git a/components/diy_advertising/diy_advertising.js b/components/diy_advertising/diy_advertising.js index ea08dbc..2ae1a91 100644 --- a/components/diy_advertising/diy_advertising.js +++ b/components/diy_advertising/diy_advertising.js @@ -15,7 +15,8 @@ Component({ autoplay:false, interval:5000, duration:1000, - someData: {} + someData: {}, + max_sw_height:null, }, methods: { customMethod: function () { }, @@ -23,6 +24,16 @@ Component({ go_url:function(e){ var url=e.currentTarget.dataset.url; getApp().goto(url); - } + }, + + imageLoad:function(e){ + var imgwidth = e.detail.width; + var imgheight = e.detail.height; + //宽高比 + var ratio = imgwidth / imgheight; + //计算的高度值 + var viewHeight = 715 / ratio; + if (this.data.max_sw_height < viewHeight) this.setData({ max_sw_height: viewHeight }); + } } }) \ No newline at end of file diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml index f7b376d..cf4c379 100644 --- a/components/diy_advertising/diy_advertising.wxml +++ b/components/diy_advertising/diy_advertising.wxml @@ -338,12 +338,12 @@ - + - + diff --git a/components/diy_advertising/diy_advertising.wxss b/components/diy_advertising/diy_advertising.wxss index 0c964de..6dbb494 100644 --- a/components/diy_advertising/diy_advertising.wxss +++ b/components/diy_advertising/diy_advertising.wxss @@ -96,8 +96,6 @@ width: 100%; color: #fff; font-size: 32rpx; - min-height: 300rpx; - line-height: 300rpx; text-align: center; } @@ -106,8 +104,6 @@ width: 98%; color: #fff; font-size: 32rpx; - min-height: 300rpx; - line-height: 300rpx; text-align: center; margin: 8rpx; } @@ -125,8 +121,6 @@ width: 97%; color: #fff; font-size: 32rpx; - min-height: 300rpx; - line-height: 300rpx; text-align: center; margin: 10rpx; } @@ -141,7 +135,6 @@ width: 48%; color: #fff; font-size: 32rpx; - line-height: 300rpx; text-align: center; float: left; margin-left: 8rpx; @@ -153,8 +146,6 @@ width: 48%; color: #fff; font-size: 32rpx; - line-height: 300rpx; - text-align: center; float: left; margin-left: 10rpx; } @@ -278,9 +269,7 @@ .s7_gk7_2 { width: 100%; - height: 362rpx; /* background-color: #99cc66; */ - line-height: 300rpx; text-align: center; margin-right: 10rpx; margin-bottom: 8rpx; @@ -328,7 +317,7 @@ /**index.wxss**/ .swiper { - height: 400rpx; + height: auto; width: 98%; padding:0 7rpx; padding-bottom: 7rpx; @@ -337,7 +326,7 @@ } .swiper image { - height: 100%; + height: auto; width: 100%; margin: 0; } diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index a3bb465..f483645 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -159,9 +159,9 @@ Component({ item.shop_price = goods.shop_price; item.sales_sum = goods.sales_sum; item.goods_id = goods.goods_id; - item.cardprice1 = val.cardprice1; - item.cardprice2 = val.cardprice2; - item.cardprice3 = val.cardprice3; + item.cardprice1 = goods.cardprice1; + item.cardprice2 = goods.cardprice2; + item.cardprice3 = goods.cardprice3; prom_id = res.data.data.prom_id;