Commit 8fe11545 by chenwq

优化页面滚动逻辑,新增返回顶部功能

1 parent 6955f4ea
...@@ -23,6 +23,7 @@ Page({ ...@@ -23,6 +23,7 @@ Page({
isRefreshing: false, isRefreshing: false,
isLastPage: false, isLastPage: false,
isLoading: false, isLoading: false,
scrollTop: 0,
statusMap, statusMap,
tabsList: [ tabsList: [
{ title: "全部", name: "all" }, { title: "全部", name: "all" },
...@@ -57,6 +58,9 @@ Page({ ...@@ -57,6 +58,9 @@ Page({
}); });
} }
// 返回顶部
this.setData({ scrollTop: 0 });
// 列表曝光埋点 // 列表曝光埋点
if (wx.$Track && wx.$Track.reportEvent) { if (wx.$Track && wx.$Track.reportEvent) {
wx.$Track.reportEvent("liebiao_puguang"); wx.$Track.reportEvent("liebiao_puguang");
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
</view> </view>
<scroll-view <scroll-view
scroll-y scroll-y
scroll-top="{{scrollTop}}"
enable-back-to-top enable-back-to-top
refresher-enabled="{{ true }}" refresher-enabled="{{ true }}"
bindrefresherrefresh="onRefresh" bindrefresherrefresh="onRefresh"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!