Commit 30534db5 by 李嘉林

轮播图显示条件

parent 284341e6
...@@ -23,9 +23,18 @@ Component({ ...@@ -23,9 +23,18 @@ Component({
duration: 500, duration: 500,
activeIndex: 0, activeIndex: 0,
bannerHeight: 0, bannerHeight: 0,
firstLoad:false, firstLoad: false,
newArr: [],
},
ready() {
console.log('----------------------30')
this.setData({'newArr':this.newList()})
console.log(this.data.newArr,this.newList(),'--------32')
}, },
methods: { methods: {
newList(){
return this.data.datas.componentData.imgList.filter(item=>item.visible==undefined || item.visible==1) || []
},
customMethod() { customMethod() {
console.log("hello world! I am learning 微信小程序"); console.log("hello world! I am learning 微信小程序");
}, },
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
bindchange="bannerChange" bindchange="bannerChange"
style="height:{{bannerHeight}}" style="height:{{bannerHeight}}"
> >
<block wx:for="{{datas.componentData.imgList}}" wx:key="index"> <block wx:for="{{newArr}}" wx:key="index">
<swiper-item data-item="{{item}}" bindtap="onClick"> <swiper-item data-item="{{item}}" bindtap="onClick">
<view class="swiper-item"> <view class="swiper-item">
<image <image
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<view class="dots"> <view class="dots" wx:if="{{newArr.length>1}}">
<view <view
class="dotsItem {{index==activeIndex?'isDotsColor':''}} {{datas.componentData.indStyle == 'flat'?'dotsStyle1':'dotsStyle2'}} {{datas.componentData.indBorderShow==true?'dotBorder':''}}" class="dotsItem {{index==activeIndex?'isDotsColor':''}} {{datas.componentData.indStyle == 'flat'?'dotsStyle1':'dotsStyle2'}} {{datas.componentData.indBorderShow==true?'dotBorder':''}}"
wx:for="{{datas.componentData.imgList}}" wx:for="{{newArr}}"
wx:key="index" wx:key="index"
></view> ></view>
</view> </view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment