优化服务分类操作逻辑
This commit is contained in:
parent
035d0c68a4
commit
28e1d7717d
|
@ -157,6 +157,7 @@ export default {
|
|||
updateMenuStatus(index) {
|
||||
this.currentLeftIndex = index;
|
||||
this.scrollLeftTop = index * this.menuHeight - this.wrapHeight / 2;
|
||||
this.$emit("onScroll", this.data[index].id);
|
||||
},
|
||||
/**
|
||||
* 滚动监听
|
||||
|
|
|
@ -4,7 +4,14 @@
|
|||
<widget-search />
|
||||
</view>
|
||||
<view class="cate">
|
||||
<app-cate :offsetHeight="95" :data="data" cateType="cate" @clickItem="clickItem" :activeId="currentId" />
|
||||
<app-cate
|
||||
:offsetHeight="95"
|
||||
:data="data"
|
||||
cateType="cate"
|
||||
:activeId="currentId"
|
||||
@clickItem="clickItem"
|
||||
@onScroll="onScroll"
|
||||
/>
|
||||
</view>
|
||||
<movable-area class="cart-icon-box">
|
||||
<movable-view
|
||||
|
@ -37,6 +44,7 @@ export default {
|
|||
utils: this.$utils,
|
||||
position: { x: 300, y: 1000 },
|
||||
currentId: 0,
|
||||
newId: 0,
|
||||
data: [],
|
||||
};
|
||||
},
|
||||
|
@ -76,6 +84,9 @@ export default {
|
|||
this.currentId = this.indexCateId;
|
||||
},
|
||||
onReady() {},
|
||||
onHide() {
|
||||
this.currentId = this.newId;
|
||||
},
|
||||
onReachBottom() {},
|
||||
onPullDownRefresh() {},
|
||||
methods: {
|
||||
|
@ -125,8 +136,11 @@ export default {
|
|||
})
|
||||
.catch((e) => {});
|
||||
},
|
||||
onScroll(id) {
|
||||
this.newId = id;
|
||||
this.$store.commit("system/indexCateId", id);
|
||||
},
|
||||
clickItem(parentId, id) {
|
||||
this.$store.commit("system/indexCateId", parentId);
|
||||
this.$utils.toPage("/pages/service/list?id=" + id);
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue