<view class="box"><swiper indicator-active-color="#ff832a" indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" current="0" bindchange="swiperChange" style="width: 100%; height: 120rpx; display: block; box-sizing: border-box; left: NaNrpx; top: NaNrpx">
<block wx:for="{{imgUrls}}" wx:key="lunbo">
<swiper-item >
<image style="width:100%; height: 120px; display: inline-block; box-sizing: border-box; left: NaNrpx; top: NaNrpx" src="{{item}}" />
</swiper-item>
</block>
</swiper></view>
<image wx:if="{{flag}}" class="xindex1" bindtap='enterShow' src="/resource/Rcicon.png"></image>
js:
swiperChange: function (e) {
e.detail.current == 0 ? this.flag = true : this.flag = false
console.log(this.flag)
},
改变轮播图片,能输出flag的值。但是w-if判断就是不能隐藏图片