From 08006c504e1e689e41fc59e03e49362ec17415f4 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Sat, 25 Jul 2020 16:12:45 +0800 Subject: [PATCH] 1. 自定义模板里面 不同的手机显示的主页轮播图 显示的图片切换按钮 不一样的bug优化 --- components/diy_advertising/diy_advertising.js | 8 ++++++-- components/diy_advertising/diy_advertising.wxml | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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}} -- libgit2 0.21.4