diff --git a/components/diy_advertising/diy_advertising.js b/components/diy_advertising/diy_advertising.js index 6f66ec4..c0245df 100644 --- a/components/diy_advertising/diy_advertising.js +++ b/components/diy_advertising/diy_advertising.js @@ -16,7 +16,7 @@ Component({ interval:3000, duration:1000, someData: {}, - max_sw_height:getApp().globalData.windowWidth, + max_sw_height:260, }, methods: { @@ -34,7 +34,11 @@ Component({ var ratio = imgwidth / imgheight; //计算的高度值 var viewHeight = 715 / ratio; - if (this.data.max_sw_height < viewHeight) this.setData({ max_sw_height: viewHeight }); + var hei=this.data.max_sw_height; + + if (hei< viewHeight) { + this.setData({ max_sw_height: viewHeight }); + } } } }) diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml index 649845c..78add5a 100644 --- a/components/diy_advertising/diy_advertising.wxml +++ b/components/diy_advertising/diy_advertising.wxml @@ -412,14 +412,14 @@ - {{item.title}} + {{item.title}} - {{item.title}} + {{item.title}}