3659关注12004浏览
代码如下:
组件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 })
},
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>