收藏
回答

在iphone XS上WXS不执行?

在iphone XS上,系统13.6.1,微信版本8.0.22,WXS不执行是为什么

-------wxml--------
<scroll-view class="scroll-wrap" scroll-y scrollTop="{{scrollTop}}" bindscroll="{{tools.onScroll}}" data-list="{{anchorList}}" scroll-into-view="{{toView}}"  enhanced show-scrollbar="{{false}}">
    <view class="punch-list-item" id="item{{index}}" wx:for="{{contentList}}" wx:key="this">
      <view class="anchor">{{item.fullName}}</view>
      <view  class="anchor-content">
        <view class="anchor-content-item" wx:for="{{item.oneAreaBaseList}}" wx:key="this" style="width: {{photoWidth}}">
          <image wx:if="{{item.isPunch == 1}}" mode="scaleToFill" class="punch-img base{{item.baseId}}" src="{{item.albumImageUrl || '1'}}" bindtap="clickImg" data-currentimg="{{item}}" bindload="imgLoaded" binderror="imgLoaded" style="height: {{windowWidth/375*115}}px;"></image>
          <view wx:else class="item-punch">
            <image class="item-punch-bg" mode="scaleToFill" src="../images/bg-item-punch.png" style="height: {{windowWidth/375*115}}px;"></image>
            <view class="item-punch-content">
              <image class="punch-icon" src="../images/punch-icon.png"></image>
              <view class="punch-text">您还未打卡~</view>
              <view class="punch-btn" bindtap="goBaseDetail" data-baseid="{{item.baseId}}">去打卡</view>
            </view>
          </view>
          <view class="base-name">{{item.baseName}}</view>
        </view>
      </view>
    </view>
  </scroll-view>

-----wxs-----
/** 列表滚动 */
function onScroll(e,ins) {
  console.log('滚动页面');
  var scrollTop = e.detail.scrollTop,
  anchorList = e.currentTarget.dataset.list
    anchorList.forEach(function(item,index) {
      if(scrollTop >= item.top-45) {
        if(index+1 == anchorList.length) {
          ins.callMethod('listScroll',{currentIndex: index})
        }else if(scrollTop < anchorList[index+1].top-45){
          ins.callMethod('listScroll',{currentIndex: index})
        }
      }
    })
}
最后一次编辑于  2022-05-25
回答关注问题邀请回答
收藏

1 个回答

  • 茜茜又困了🐽
    茜茜又困了🐽
    2022-05-25

    代码片段提供下

    2022-05-25
    有用
    回复 1
    • Bill
      Bill
      2022-05-25
      我发现是在iohonexs上image加载完了不触发bindload事件,别的手机都没事儿
      2022-05-25
      回复
登录 后发表内容