version/0412
fanfan 9 months ago
parent 9f89663edf
commit f1e6abd44a
  1. 7
      pages/category/index.vue

@ -85,11 +85,10 @@
if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() {
this.current = index;
// this.current = index;
this.scrollRightTop = this.arr[index];
this.leftMenuStatus(index);
})
console.log(index, this.current)
},
getGoodsTypeList() {
const that = this;
@ -148,7 +147,7 @@
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// this.current = index+1;
this.current = index;
// item
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
@ -192,7 +191,7 @@
let height2 = this.arr[i + 1];
// height2
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i);
this.leftMenuStatus(i+1);
return;
}
}

Loading…
Cancel
Save