IOS端swiper组件切换current>0后面的swiper-item不显示,安卓无此问题。?
发布于 5 年前 作者 hqian 7328 次浏览 来自 官方Issues
<view class="swiper_cont">
    <swiper indicator-dots="{{false}}" current="{{currentIndex}}" autoplay="{{false}}" previous-margin="46rpx" next-margin="46rpx" bindchange="handdleSwiper" style=" height: 463rpx;">
      <swiper-item style="height: 403rpx;" wx:for="{{cardList}}" wx:key="{{item.scardid}}">
        <view class="card {{currentIndex === index ? '' : 'card_s'}}" style=" background: url({{cdnPath}}img/myOilCard/bg.png) no-repeat; background-size: 100% 100%; margin: 71rpx auto 0 auto;" wx:if="{{item.scardid}}">
          <!--  -->
          <view class="info">
            <view class="cardName">
              <image src="{{cdnPath}}img/myOilCard/cardLogo.png" alt mode="widthFix" class="img"></image>
              <text>中石化友途加油卡</text>
            </view>
            <view class="h1">{{item.scardid}}</view>
            <view class="p">持卡人:{{item.owner}}</view>
            <view class="type" wx:if="{{item.cardType === '3' || item.cardType === '4'}}" style=" background: url({{cdnPath}}img/myOilCard/typeBg.png) no-repeat; background-size: 100% 100%;">
              <text wx:if="{{item.cardType === '3'}}">主卡</text>
              <text wx:elif="{{item.cardType === '4'}}">副卡</text>
              <text wx:elif="{{item.cardType === '1'}}">待校验</text>
              <text wx:elif="{{item.cardType === '2'}}">卡号错误</text>
            </view>
            <view class="deletBtn" data-item="{{item}}" bindtap="deletCard">
              <text>删除此卡</text>
            </view>
          </view>
        </view>
        <view class="card {{currentIndex === index ? '' : 'card_s'}}" bindtap="addOilNewCard" style=" background: url({{cdnPath}}img/myOilCard/bg.png) no-repeat; background-size: 100% 100%; margin: 71rpx auto 0 auto;" wx:else>
          <!--  -->
          <view class="add">
            <view class="icon">
              <image src="{{cdnPath}}img/myOilCard/add.png" alt mode="widthFix" class="img"></image>
            </view>
            <view class="h1">添加加油卡</view>
          </view>
        </view>
      </swiper-item>
    </swiper>
  </view>

求解,该问题怎么解决。安卓机型测试 华为 VIVO OPPO无问题。苹果测试 6 8 机型 系统13.1.3有这个问题

1 回复

swiper-item上不要写style,写到里面的view上

回到顶部