From c76bfe50fca0a39d2eaf3354401110597ff5d0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAPTOP-D7TKRI82=5C=E9=82=93?= <52643018@qq.com> Date: Wed, 23 Jun 2021 09:49:49 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=9B=9E=E5=88=B0=E9=A1=B6=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/mixin.js | 8 ++------ pages/index/index.vue | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/common/mixin.js b/common/mixin.js index ac4ad22..f7303db 100644 --- a/common/mixin.js +++ b/common/mixin.js @@ -1,18 +1,14 @@ export default{ data(){ return { - // 返回顶部 - needToTop: false + pageScrollTop: 0, // 页面距离顶部的距离 } }, onLoad(option){ }, onPageScroll(res) { - if(res.scrollTop > 1000){ - this.needToTop = true; - } - this.needToTop = false; + this.pageScrollTop = res.scrollTop; }, // 页面转发分享 async onShareAppMessage(res) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 80559ff..5170813 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -29,7 +29,8 @@ {{ tab.loadingText }} - + + @@ -46,7 +47,7 @@ return { tab_list: [{ name: '推荐', - list: [1, 2, 3], + list: [1, 2, 3, 4,5,6,7,8], ...shared }, { name: '每日必抢', @@ -80,7 +81,6 @@ this.$http(this.API.API_GOODS_LIST, {data: 1}).then(res => { console.log(res); }).catch(err => err); - console.log(this.needToTop) }, methods: { change(index) {