Commit ca0384c234e45826866c7205d4ca23cdce9d2f78

Authored by yvan.ni
1 parent 80acf21c

广告自定义模板的功能的显示, 商品分组的功能等级价的显示

components/diy_advertising/diy_advertising.js
@@ -15,7 +15,8 @@ Component({ @@ -15,7 +15,8 @@ Component({
15 autoplay:false, 15 autoplay:false,
16 interval:5000, 16 interval:5000,
17 duration:1000, 17 duration:1000,
18 - someData: {} 18 + someData: {},
  19 + max_sw_height:null,
19 }, 20 },
20 methods: { 21 methods: {
21 customMethod: function () { }, 22 customMethod: function () { },
@@ -23,6 +24,16 @@ Component({ @@ -23,6 +24,16 @@ Component({
23 go_url:function(e){ 24 go_url:function(e){
24 var url=e.currentTarget.dataset.url; 25 var url=e.currentTarget.dataset.url;
25 getApp().goto(url); 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 \ No newline at end of file 40 \ No newline at end of file
components/diy_advertising/diy_advertising.wxml
@@ -338,12 +338,12 @@ @@ -338,12 +338,12 @@
338 338
339 <!--幻灯片--> 339 <!--幻灯片-->
340 <block wx:if='{{object.style==4}}'> 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 <block wx:for="{{object.data}}" wx:for-index="index" > 342 <block wx:for="{{object.data}}" wx:for-index="index" >
343 <block wx:if="{{item.src!=''}}"> 343 <block wx:if="{{item.src!=''}}">
344 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 344 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
345 <swiper-item> 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 </swiper-item> 347 </swiper-item>
348 </view> 348 </view>
349 </block> 349 </block>
components/diy_advertising/diy_advertising.wxss
@@ -96,8 +96,6 @@ @@ -96,8 +96,6 @@
96 width: 100%; 96 width: 100%;
97 color: #fff; 97 color: #fff;
98 font-size: 32rpx; 98 font-size: 32rpx;
99 - min-height: 300rpx;  
100 - line-height: 300rpx;  
101 text-align: center; 99 text-align: center;
102 } 100 }
103 101
@@ -106,8 +104,6 @@ @@ -106,8 +104,6 @@
106 width: 98%; 104 width: 98%;
107 color: #fff; 105 color: #fff;
108 font-size: 32rpx; 106 font-size: 32rpx;
109 - min-height: 300rpx;  
110 - line-height: 300rpx;  
111 text-align: center; 107 text-align: center;
112 margin: 8rpx; 108 margin: 8rpx;
113 } 109 }
@@ -125,8 +121,6 @@ @@ -125,8 +121,6 @@
125 width: 97%; 121 width: 97%;
126 color: #fff; 122 color: #fff;
127 font-size: 32rpx; 123 font-size: 32rpx;
128 - min-height: 300rpx;  
129 - line-height: 300rpx;  
130 text-align: center; 124 text-align: center;
131 margin: 10rpx; 125 margin: 10rpx;
132 } 126 }
@@ -141,7 +135,6 @@ @@ -141,7 +135,6 @@
141 width: 48%; 135 width: 48%;
142 color: #fff; 136 color: #fff;
143 font-size: 32rpx; 137 font-size: 32rpx;
144 - line-height: 300rpx;  
145 text-align: center; 138 text-align: center;
146 float: left; 139 float: left;
147 margin-left: 8rpx; 140 margin-left: 8rpx;
@@ -153,8 +146,6 @@ @@ -153,8 +146,6 @@
153 width: 48%; 146 width: 48%;
154 color: #fff; 147 color: #fff;
155 font-size: 32rpx; 148 font-size: 32rpx;
156 - line-height: 300rpx;  
157 - text-align: center;  
158 float: left; 149 float: left;
159 margin-left: 10rpx; 150 margin-left: 10rpx;
160 } 151 }
@@ -278,9 +269,7 @@ @@ -278,9 +269,7 @@
278 269
279 .s7_gk7_2 { 270 .s7_gk7_2 {
280 width: 100%; 271 width: 100%;
281 - height: 362rpx;  
282 /* background-color: #99cc66; */ 272 /* background-color: #99cc66; */
283 - line-height: 300rpx;  
284 text-align: center; 273 text-align: center;
285 margin-right: 10rpx; 274 margin-right: 10rpx;
286 margin-bottom: 8rpx; 275 margin-bottom: 8rpx;
@@ -328,7 +317,7 @@ @@ -328,7 +317,7 @@
328 /**index.wxss**/ 317 /**index.wxss**/
329 318
330 .swiper { 319 .swiper {
331 - height: 400rpx; 320 + height: auto;
332 width: 98%; 321 width: 98%;
333 padding:0 7rpx; 322 padding:0 7rpx;
334 padding-bottom: 7rpx; 323 padding-bottom: 7rpx;
@@ -337,7 +326,7 @@ @@ -337,7 +326,7 @@
337 } 326 }
338 327
339 .swiper image { 328 .swiper image {
340 - height: 100%; 329 + height: auto;
341 width: 100%; 330 width: 100%;
342 margin: 0; 331 margin: 0;
343 } 332 }
components/diy_goodsGroup/diy_goodsGroup.js
@@ -159,9 +159,9 @@ Component({ @@ -159,9 +159,9 @@ Component({
159 item.shop_price = goods.shop_price; 159 item.shop_price = goods.shop_price;
160 item.sales_sum = goods.sales_sum; 160 item.sales_sum = goods.sales_sum;
161 item.goods_id = goods.goods_id; 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 prom_id = res.data.data.prom_id; 166 prom_id = res.data.data.prom_id;
167 167