From 1a3b39f31e64aedac011bcc53b7c28f5fc0dafa9 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Thu, 13 Aug 2020 15:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=91=E5=8A=A8=E5=88=B0=E9=A1=B6=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pageB/search/searchGoods.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pageB/search/searchGoods.vue b/pageB/search/searchGoods.vue index 8b118f2..b4c3efc 100644 --- a/pageB/search/searchGoods.vue +++ b/pageB/search/searchGoods.vue @@ -11,7 +11,7 @@ 好评 - + @@ -39,7 +39,10 @@ export default { loadStatus: 'loadmore', timer: true, // 防止上拉加载短时间内多次调用, value:"", - top:0 + scrollTop: 0, + old: { + scrollTop: 0 + } } }, watch: { @@ -65,6 +68,9 @@ export default { this.ShopSearch() }, methods: { + scroll: function(e) { + this.old.scrollTop = e.detail.scrollTop; // 必要 + }, setNavSearchInput(keyword) { console.log(keyword); // #ifdef APP-PLUS @@ -133,7 +139,10 @@ export default { switchCurrent(current) { this.page = 1 if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc; - this.top=0 + this.scrollTop = this.old.scrollTop + this.$nextTick(function() { + this.scrollTop = 0 + }); this.ShopSearch() this.current = current; },