Commit 5e20f4dfc96b1e4559bc4094f7fe945a0c2fe9c0

Authored by fengtao
1 parent 23df9d7e

fix:修改筛选时停留在当前页面

... ... @@ -79,7 +79,8 @@ export default {
79 79 list: [],
80 80 pre: false,
81 81 isJudgeNextPage: '',
82   - distance: 0
  82 + distance: 0,
  83 + scrollDistance: 0
83 84 };
84 85 },
85 86 onLoad(e) {
... ... @@ -91,20 +92,12 @@ export default {
91 92 onShow() {
92 93 this.pre = uni.getStorageSync('storagePre');
93 94 if (this.pre) {
94   - // this.page.num = 1;
95   - // this.loadData(this.page.num);
96 95 }
97 96 },
98 97 onHide() {
99 98 uni.removeStorageSync('storagePre');
100 99 },
101 100 methods: {
102   - // topBack(num) {
103   - // uni.pageScrollTo({
104   - // scrollTop: 0, // 滚动到页面的目标位置 这个是滚动到顶部, 0
105   - // duration: 10 // 滚动动画的时长
106   - // });
107   - // },
108 101 formatType(e) {
109 102 return e?.type == 'OTHER' ? '其他' : e?.type == 'MEETING' ? '会议' : '公告';
110 103 },
... ... @@ -117,6 +110,17 @@ export default {
117 110 this.page.num = 1;
118 111 this.model1.userInfo.type = e.name;
119 112 this.loadData(1, this.isJudgeNextPage == '' ? null : this.isJudgeNextPage);
  113 + uni.pageScrollTo({
  114 + scrollTop: this.scrollDistance + 20,
  115 + duration: 50
  116 + });
  117 + uni.pageScrollTo({
  118 + scrollTop: this.scrollDistance - 20,
  119 + duration: 50
  120 + });
  121 + },
  122 + onPageScroll(e) {
  123 + this.scrollDistance = e.scrollTop;
120 124 },
121 125 /*下拉刷新的回调 */
122 126 downCallback() {
... ... @@ -158,7 +162,6 @@ export default {
158 162 }
159 163 })
160 164 .catch(e => {
161   - // uni.$u.toast(e.data?.message);
162 165 this.mescroll.endErr();
163 166 });
164 167 },
... ...