分类列表点击事件添加parentId
This commit is contained in:
parent
8d202a25b4
commit
35b5535a97
|
@ -36,8 +36,8 @@
|
|||
:key="index"
|
||||
:style="{ height: index == data.length - 1 ? wrapHeight + utils.rpx2px(110) + 'px' : 'auto' }"
|
||||
>
|
||||
<cate-tmpl v-if="cateType === 'cate'" :data="item" @clickItem="clickItem"></cate-tmpl>
|
||||
<list-tmpl v-if="cateType === 'list'" :data="item" @clickItem="clickItem"></list-tmpl>
|
||||
<cate-tmpl v-if="cateType === 'cate'" :parentId="item.id" :data="item" @clickItem="clickItem"></cate-tmpl>
|
||||
<list-tmpl v-if="cateType === 'list'" :parentId="item.id" :data="item" @clickItem="clickItem"></list-tmpl>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -247,8 +247,8 @@ export default {
|
|||
});
|
||||
this.swichMenu(this.activeIndex);
|
||||
},
|
||||
clickItem(id) {
|
||||
this.$emit("clickItem", id);
|
||||
clickItem(parentId, id) {
|
||||
this.$emit("clickItem", parentId, id);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -19,6 +19,10 @@ export default {
|
|||
return {};
|
||||
},
|
||||
props: {
|
||||
parentId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: [],
|
||||
|
@ -30,7 +34,7 @@ export default {
|
|||
destroyed() {},
|
||||
methods: {
|
||||
clickItem(id) {
|
||||
this.$emit("clickItem", id);
|
||||
this.$emit("clickItem", this.parentId, id);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -21,6 +21,10 @@ export default {
|
|||
return {};
|
||||
},
|
||||
props: {
|
||||
parentId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: [],
|
||||
|
@ -35,7 +39,7 @@ export default {
|
|||
destroyed() {},
|
||||
methods: {
|
||||
clickItem(id) {
|
||||
this.$emit("clickItem", id);
|
||||
this.$emit("clickItem", this.parentId, id);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ export default {
|
|||
})
|
||||
.catch((e) => {});
|
||||
},
|
||||
clickItem(id) {
|
||||
clickItem(parentId, id) {
|
||||
this.$utils.toPage("/pages/service/list?id=" + id);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -87,7 +87,7 @@ export default {
|
|||
createOrder() {
|
||||
this.$utils.toPage("/pages/order/create");
|
||||
},
|
||||
clickItem(id) {
|
||||
clickItem(parentId, id) {
|
||||
this.$utils.toPage("/pages/service/detail?id=" + id);
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue