{ "usingComponents": { "w-btm-menu": "/components/w-btm-menu/w-btm-menu", "w-back-top": "/components/w-back-top/w-back-top" }, "navigationBarTitleText": "我的闲置" }
<!-- 返回顶部 --> <w-back-top bindtap="onBackTop" wx:if="{{showBackTop}}"/> <!-- 返回顶部 -->
const BACK_TOP_POSITION = 1000;//在哪个位置显示 返回顶部 按钮 Page({ data: { showBackTop: false, },
onPageScroll(options) { let scrollTop = options.scrollTop; //console.log(scrollTop); let flag = scrollTop >= BACK_TOP_POSITION; if (flag != this.data.showBackTop) { this.setData({ showBackTop: flag }) } },
//返回顶部点击事件 onBackTop() { wx.pageScrollTo({ scrollTop: 0, duration: 0 }) this.setData({ showBackTop: false }) },
onReachBottom() { console.log("到底了"); this.load_goodsList(); //加载数据 },
站长微信:xiaomao0055
站长QQ:14496453