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