代码如下:


组件list  wxml文件

<scroll-view bindscrolltolower="lower" enable-back-to-top scroll-y  style="width:100%;height:calc(100vh - {{onlysearch?115:188}}rpx);" scroll-top="{{y}}" bindscroll="bindscroll">

<block wx:key="{{index}}" wx:for="{{orders}}" wx:if="{{orders&& orders.length > 0 }}">

<order-item isrefund="{{isrefund}}" isservice="{{isservice}}" item="{{item}}" bind:orderdetail="orderdetail" > </order-item>

</block>

<wxc-abnor type="MESSAGE" title="暂时没有数据" wx:if="{{ !loading&&orders.length == 0 }}"></wxc-abnor>

<view id="loadmore" wx:if="{{isloadingmore}}">

<wxc-loadmore text="正在努力加载中...">

</wxc-loadmore>

</view>

</scroll-view>


组件list js文件

bindscroll(e) {

this.triggerEvent('scroll', e.detail.scrollTop)

}



引用组件的代码:

<list orders="{{orders}}" bind:orderdetail="handleDetailOrder" bind:lower="lower" loading="{{loading}}" isloadingmore="{{isloadingmore}}" bind:scroll="scroll" y="{{y}}"> </list>



onLoad() {

 this.setData({ y: 0 })

},


scroll(data) {

this.setData({ y: data.detail })

},











展开全部
收起
0回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部