Browse Source

修改主页面滚动

hella_online_20240829
lijuncheng 5 months ago
parent
commit
529ed07161
  1. 7
      src/pages/index/index.vue

7
src/pages/index/index.vue

@ -94,6 +94,7 @@
arr: [], arr: [],
scrollRightTop: 0, // scroll-view scrollRightTop: 0, // scroll-view
timer: null, // timer: null, //
timerHome: null, //
forcedLogin: false, forcedLogin: false,
count: 1, count: 1,
position: [-10, -10], position: [-10, -10],
@ -315,14 +316,14 @@
if (this.arr.length == 0) { if (this.arr.length == 0) {
await this.getMenuItemTop(); await this.getMenuItemTop();
} }
if (this.timer) return; if (this.timerHome) return;
if (!this.menuHeight) { if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight'); await this.getElRect('menu-scroll-view', 'menuHeight');
} }
setTimeout(() => { // setTimeout(() => { //
this.timer = null; this.timerHome = null;
// scrollHeight // scrollHeight
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2; let scrollHeight = e.detail.scrollTop + this.menuHeight / 5;
for (let i = 0; i < this.arr.length; i++) { for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i]; let height1 = this.arr[i];
let height2 = this.arr[i + 1]; let height2 = this.arr[i + 1];

Loading…
Cancel
Save