Commit ca0384c234e45826866c7205d4ca23cdce9d2f78
1 parent
80acf21c
广告自定义模板的功能的显示, 商品分组的功能等级价的显示
Showing
4 changed files
with
20 additions
and
20 deletions
components/diy_advertising/diy_advertising.js
... | ... | @@ -15,7 +15,8 @@ Component({ |
15 | 15 | autoplay:false, |
16 | 16 | interval:5000, |
17 | 17 | duration:1000, |
18 | - someData: {} | |
18 | + someData: {}, | |
19 | + max_sw_height:null, | |
19 | 20 | }, |
20 | 21 | methods: { |
21 | 22 | customMethod: function () { }, |
... | ... | @@ -23,6 +24,16 @@ Component({ |
23 | 24 | go_url:function(e){ |
24 | 25 | var url=e.currentTarget.dataset.url; |
25 | 26 | getApp().goto(url); |
26 | - } | |
27 | + }, | |
28 | + | |
29 | + imageLoad:function(e){ | |
30 | + var imgwidth = e.detail.width; | |
31 | + var imgheight = e.detail.height; | |
32 | + //宽高比 | |
33 | + var ratio = imgwidth / imgheight; | |
34 | + //计算的高度值 | |
35 | + var viewHeight = 715 / ratio; | |
36 | + if (this.data.max_sw_height < viewHeight) this.setData({ max_sw_height: viewHeight }); | |
37 | + } | |
27 | 38 | } |
28 | 39 | }) |
29 | 40 | \ No newline at end of file | ... | ... |
components/diy_advertising/diy_advertising.wxml
... | ... | @@ -338,12 +338,12 @@ |
338 | 338 | |
339 | 339 | <!--幻灯片--> |
340 | 340 | <block wx:if='{{object.style==4}}'> |
341 | - <swiper class="swiper" indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> | |
341 | + <swiper class="swiper" indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" style="height:{{max_sw_height}}rpx" > | |
342 | 342 | <block wx:for="{{object.data}}" wx:for-index="index" > |
343 | 343 | <block wx:if="{{item.src!=''}}"> |
344 | 344 | <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> |
345 | 345 | <swiper-item> |
346 | - <image src="{{item.src}}" class="slide-image" mode="aspectFill" /> | |
346 | + <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /> | |
347 | 347 | </swiper-item> |
348 | 348 | </view> |
349 | 349 | </block> | ... | ... |
components/diy_advertising/diy_advertising.wxss
... | ... | @@ -96,8 +96,6 @@ |
96 | 96 | width: 100%; |
97 | 97 | color: #fff; |
98 | 98 | font-size: 32rpx; |
99 | - min-height: 300rpx; | |
100 | - line-height: 300rpx; | |
101 | 99 | text-align: center; |
102 | 100 | } |
103 | 101 | |
... | ... | @@ -106,8 +104,6 @@ |
106 | 104 | width: 98%; |
107 | 105 | color: #fff; |
108 | 106 | font-size: 32rpx; |
109 | - min-height: 300rpx; | |
110 | - line-height: 300rpx; | |
111 | 107 | text-align: center; |
112 | 108 | margin: 8rpx; |
113 | 109 | } |
... | ... | @@ -125,8 +121,6 @@ |
125 | 121 | width: 97%; |
126 | 122 | color: #fff; |
127 | 123 | font-size: 32rpx; |
128 | - min-height: 300rpx; | |
129 | - line-height: 300rpx; | |
130 | 124 | text-align: center; |
131 | 125 | margin: 10rpx; |
132 | 126 | } |
... | ... | @@ -141,7 +135,6 @@ |
141 | 135 | width: 48%; |
142 | 136 | color: #fff; |
143 | 137 | font-size: 32rpx; |
144 | - line-height: 300rpx; | |
145 | 138 | text-align: center; |
146 | 139 | float: left; |
147 | 140 | margin-left: 8rpx; |
... | ... | @@ -153,8 +146,6 @@ |
153 | 146 | width: 48%; |
154 | 147 | color: #fff; |
155 | 148 | font-size: 32rpx; |
156 | - line-height: 300rpx; | |
157 | - text-align: center; | |
158 | 149 | float: left; |
159 | 150 | margin-left: 10rpx; |
160 | 151 | } |
... | ... | @@ -278,9 +269,7 @@ |
278 | 269 | |
279 | 270 | .s7_gk7_2 { |
280 | 271 | width: 100%; |
281 | - height: 362rpx; | |
282 | 272 | /* background-color: #99cc66; */ |
283 | - line-height: 300rpx; | |
284 | 273 | text-align: center; |
285 | 274 | margin-right: 10rpx; |
286 | 275 | margin-bottom: 8rpx; |
... | ... | @@ -328,7 +317,7 @@ |
328 | 317 | /**index.wxss**/ |
329 | 318 | |
330 | 319 | .swiper { |
331 | - height: 400rpx; | |
320 | + height: auto; | |
332 | 321 | width: 98%; |
333 | 322 | padding:0 7rpx; |
334 | 323 | padding-bottom: 7rpx; |
... | ... | @@ -337,7 +326,7 @@ |
337 | 326 | } |
338 | 327 | |
339 | 328 | .swiper image { |
340 | - height: 100%; | |
329 | + height: auto; | |
341 | 330 | width: 100%; |
342 | 331 | margin: 0; |
343 | 332 | } | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.js
... | ... | @@ -159,9 +159,9 @@ Component({ |
159 | 159 | item.shop_price = goods.shop_price; |
160 | 160 | item.sales_sum = goods.sales_sum; |
161 | 161 | item.goods_id = goods.goods_id; |
162 | - item.cardprice1 = val.cardprice1; | |
163 | - item.cardprice2 = val.cardprice2; | |
164 | - item.cardprice3 = val.cardprice3; | |
162 | + item.cardprice1 = goods.cardprice1; | |
163 | + item.cardprice2 = goods.cardprice2; | |
164 | + item.cardprice3 = goods.cardprice3; | |
165 | 165 | |
166 | 166 | prom_id = res.data.data.prom_id; |
167 | 167 | ... | ... |