Commit 690edfa1 authored by 刘攀's avatar 刘攀

修复bug

parent 3282b308
......@@ -934,7 +934,7 @@ export default {
if (newList.length) {
util
.getAllElementTop(classify.map(item => item.dom_id), res =>
res.map(item => item.top - res[0].top)
res.map(item => (item && res[0] ? item.top - res[0].top : 0))
)
.then(res => (this._classifyTopVals = res))
}
......@@ -1375,12 +1375,19 @@ export default {
},
// 商品列表滚动监听
onCateringGoodsListScroll(e) {
if (this._disabledScrollFlag) return (this._disabledScrollFlag = false)
if (this._disabledScrollFlag) {
this._disabledScrollFlag = false
return
}
let index = 0
this._classifyTopVals.forEach((citem, cIndex) => {
if (citem < e.detail.scrollTop) index = cIndex
})
if (index === this.cateringCurrentClassifyIndex) return
if (this._classifyTopVals) {
this._classifyTopVals.forEach((citem, cIndex) => {
if (citem < e.detail.scrollTop) index = cIndex
})
}
if (index === this.cateringCurrentClassifyIndex) {
return
}
this.cateringCurrentClassifyIndex = index
this.listLeftIntoScroll =
'left_classify_' + this.cateringClassifyArr[index > 3 ? index - 3 : 0]['id']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment