Commit 30534db5 by 李嘉林

轮播图显示条件

parent 284341e6
......@@ -23,9 +23,18 @@ Component({
duration: 500,
activeIndex: 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: {
newList(){
return this.data.datas.componentData.imgList.filter(item=>item.visible==undefined || item.visible==1) || []
},
customMethod() {
console.log("hello world! I am learning 微信小程序");
},
......
......@@ -11,7 +11,7 @@
bindchange="bannerChange"
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">
<view class="swiper-item">
<image
......@@ -25,10 +25,10 @@
</swiper-item>
</block>
</swiper>
<view class="dots">
<view class="dots" wx:if="{{newArr.length>1}}">
<view
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"
></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