cover-view实现列表会出现明显的卡顿怎么处理?
发布于 6 年前 作者 amo 4099 次浏览 来自 官方Issues
<block wx:if="{{isShowBroadcastView}}">
      <cover-view class="listBackView" >
        <!-- 标题 -->
        <cover-view id="close" bindtap='buttonAction' class="listBackView-titleView">
          <cover-view class="listBackView-titleView-leftText">直播商品{{listArray.length>0?listArray.length:''}}</cover-view>
          <!-- x -->
          <cover-image  class="listBackView-titleView-rightText" src="/assets/resources/Clear1.png" ></cover-image>
        </cover-view>
        <!-- 列表 -->
        <cover-view class="listBackView-scroll">
          <block wx:for="{{listArray}}"   wx:key="productId">
            <cover-view class="cell">
              <!-- 图片 -->
              <cover-view class="cell-imageBackView">
                <!-- <cover-image class="cell-image" src="/assets/resources/circlePruduct.png"></cover-image> -->
                <cover-view class="cell-image">
                <cover-thumb
                  thumb="{{item.kpv.thumbnail}}"
                  has-video="{{item.kpv.video}}"
                  stock-disable="{{(item.kpv.stockDisable && stockOn && startQuantityOn)||(item.kpv.stockEmpty && stockOn)}}"                 marginRight="0"
                  marginLeft="0"
                />
                
                </cover-view>
                
                <cover-view class="cell-image-rank">
                  <cover-view class="cell-image-rank-text">{{index+1}}</cover-view>
                </cover-view>

                <block wx:if="{{item.selected}}">
                  <cover-view class="cell-image-selectedview">
                    <cover-view class="cell-image-selectedview-text">讲解</cover-view>
                  </cover-view>
                </block>
                
              </cover-view>
            
              <!-- 右边内容 -->
              <cover-view class="cell-rightView">
                <cover-view class="cell-title">{{item.productName}}</cover-view>
                <cover-view class="cell-number">{{'   '}}</cover-view>
                <cover-view class="cell-priceView">
                  <cover-view class="cell-priceView-symbol">¥</cover-view>
                  <cover-view class="cell-priceView-price">
                    <cover-view style="font-size:42rpx"></cover-view>
                    <cover-view style="font-size:34rpx">/</cover-view>
                  </cover-view>
                </cover-view>
                <cover-view class="cell-line"></cover-view>
                
                <cover-view class=" cell-addBtn"
                      catch:tap='operateProductAction'
                      id="{{index}}"
                >
                  <cover-view id="{{'selected'+index}}" catch:tap="buttonAction" class="cell-addBtn-text">购买</cover-view>
                </cover-view>
              </cover-view>
            </cover-view>

          </block>
        </cover-view>
        
      </cover-view>
    </block>

因为是在 live-player 上布局,所以只能使用cover-view来画列表,结果特别卡,而且点击隐藏列表的时候,反应很慢
1 回复

你好,麻烦具体描述问题流程,提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部