Compare commits
No commits in common. "dd243e84dabef0cdec6a78e2ba2c87b601e5cb52" and "852ad874654d1f75c8d4d2576b8c41ac085efe74" have entirely different histories.
dd243e84da
...
852ad87465
@ -80,6 +80,7 @@
|
|||||||
this.checkUserInfo()
|
this.checkUserInfo()
|
||||||
// 当页面显示时,设置tabber的激活项
|
// 当页面显示时,设置tabber的激活项
|
||||||
this.$store.commit('setTabbarCurrent', 0)
|
this.$store.commit('setTabbarCurrent', 0)
|
||||||
|
console.log(this.orderList)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查用户信息
|
// 检查用户信息
|
||||||
|
|||||||
@ -114,9 +114,6 @@
|
|||||||
arr: [], //记录 右边菜单每个item到顶部的距离
|
arr: [], //记录 右边菜单每个item到顶部的距离
|
||||||
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
|
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
|
||||||
timer: null, // 定时器
|
timer: null, // 定时器
|
||||||
|
|
||||||
isScrollingByClick: false, // 添加这个标志 解决点击左侧导航栏点击 右侧内容滚动之后 反过来影响左侧导致跳变
|
|
||||||
scrollingTiemout: null, //timeout对象
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
@ -169,8 +166,6 @@
|
|||||||
totalPrice,
|
totalPrice,
|
||||||
// 点击左边的栏目切换
|
// 点击左边的栏目切换
|
||||||
async swichMenu(index) {
|
async swichMenu(index) {
|
||||||
clearTimeout(this.scrollingTiemout) //每次点击导航栏重置timeout延时
|
|
||||||
this.isScrollingByClick = true
|
|
||||||
if (this.arr.length == 0) {
|
if (this.arr.length == 0) {
|
||||||
await this.getMenuItemTop()
|
await this.getMenuItemTop()
|
||||||
}
|
}
|
||||||
@ -181,9 +176,6 @@
|
|||||||
this.current = index
|
this.current = index
|
||||||
this.leftMenuStatus(index)
|
this.leftMenuStatus(index)
|
||||||
})
|
})
|
||||||
this.scrollingTiemout = setTimeout(() => {
|
|
||||||
this.isScrollingByClick = false
|
|
||||||
}, 800)
|
|
||||||
},
|
},
|
||||||
// 获取一个目标元素的高度
|
// 获取一个目标元素的高度
|
||||||
getElRect(elClass, dataVal) {
|
getElRect(elClass, dataVal) {
|
||||||
@ -270,9 +262,7 @@
|
|||||||
let height2 = this.arr[i + 1]
|
let height2 = this.arr[i + 1]
|
||||||
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
|
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
|
||||||
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
|
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
|
||||||
if (!this.isScrollingByClick) {
|
|
||||||
this.leftMenuStatus(i)
|
this.leftMenuStatus(i)
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user