version/0412
shuxiaoquan 9 months ago
parent 1793d8f1a4
commit 12449a517f
  1. 9
      pages/category/index.vue

@ -85,17 +85,16 @@
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);
})
},
getGoodsTypeList() {
const that = this;
console.log(cstegory.list(), '接口地址')
return new Promise((resolve, reject) => {
cstegory.list({
is_hot: 0
// is_hot: 0
})
.then(res => {
//
@ -147,9 +146,9 @@
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
this.current = index;
// item
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
this.current = index-1;
},
// item
@ -166,7 +165,7 @@
}
rects.forEach((rect) => {
// rects[0].top()
this.arr.push(rect.top - rects[0].top + 5);
this.arr.push(rect.top - rects[0].top);
resolve();
})
}).exec()

Loading…
Cancel
Save