对接部分服务分类接口
This commit is contained in:
parent
f5a21ad39b
commit
9cad71a511
|
@ -124,7 +124,7 @@ export default {
|
||||||
(res) => {
|
(res) => {
|
||||||
// 如果节点尚未生成,res值为null,循环调用执行
|
// 如果节点尚未生成,res值为null,循环调用执行
|
||||||
if (!res) {
|
if (!res) {
|
||||||
this.getElRect(elClass);
|
// this.getElRect(elClass);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this[dataVal] = res.height;
|
this[dataVal] = res.height;
|
||||||
|
@ -146,7 +146,7 @@ export default {
|
||||||
.boundingClientRect((rects) => {
|
.boundingClientRect((rects) => {
|
||||||
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
|
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
|
||||||
if (!rects.length) {
|
if (!rects.length) {
|
||||||
this.getMenuItemTop();
|
// this.getMenuItemTop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rects.forEach((rect) => {
|
rects.forEach((rect) => {
|
||||||
|
|
|
@ -36,57 +36,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
utils: this.$utils,
|
utils: this.$utils,
|
||||||
position: { x: 300, y: 1000 },
|
position: { x: 300, y: 1000 },
|
||||||
data: [
|
data: [],
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "热门推荐",
|
|
||||||
icon: "",
|
|
||||||
child: [
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "空调安装",
|
|
||||||
icon: require("@/static/temp/cate/1.png"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "空调拆卸",
|
|
||||||
icon: require("@/static/temp/cate/2.png"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "热水器安装",
|
|
||||||
icon: require("@/static/temp/cate/3.png"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "油烟机安装",
|
|
||||||
icon: require("@/static/temp/cate/4.png"),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "电器安装",
|
|
||||||
icon: "",
|
|
||||||
child: [
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
name: "空调安装",
|
|
||||||
icon: require("@/static/temp/cate/2.png"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 7,
|
|
||||||
name: "空调拆卸",
|
|
||||||
icon: require("@/static/temp/cate/3.png"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
name: "热水器安装",
|
|
||||||
icon: require("@/static/temp/cate/4.png"),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -110,6 +60,28 @@ export default {
|
||||||
x: x - this.$utils.rpx2px(20),
|
x: x - this.$utils.rpx2px(20),
|
||||||
y: y - this.$utils.rpx2px(40),
|
y: y - this.$utils.rpx2px(40),
|
||||||
};
|
};
|
||||||
|
this.$request({
|
||||||
|
api: "service.cate",
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
response.data.forEach((item) => {
|
||||||
|
let child = [];
|
||||||
|
item.child.forEach((v) => {
|
||||||
|
child.push({
|
||||||
|
id: v.id,
|
||||||
|
name: v.name,
|
||||||
|
icon: v.more,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.data.push({
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
icon: item.more,
|
||||||
|
child: child,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {});
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
|
|
|
@ -28,64 +28,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
utils: this.$utils,
|
utils: this.$utils,
|
||||||
data: [
|
cateId: 0,
|
||||||
{
|
data: [],
|
||||||
id: 1,
|
|
||||||
name: "热门推荐",
|
|
||||||
icon: "",
|
|
||||||
child: [
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "空调安装空调安装空调安装空调安装空调安装空调安装",
|
|
||||||
icon: require("@/static/temp/cate/1.png"),
|
|
||||||
buyNumber: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "空调拆卸",
|
|
||||||
icon: require("@/static/temp/cate/2.png"),
|
|
||||||
buyNumber: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "热水器安装",
|
|
||||||
icon: require("@/static/temp/cate/3.png"),
|
|
||||||
buyNumber: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "油烟机安装",
|
|
||||||
icon: require("@/static/temp/cate/4.png"),
|
|
||||||
buyNumber: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "电器安装",
|
|
||||||
icon: "",
|
|
||||||
child: [
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
name: "空调安装",
|
|
||||||
icon: require("@/static/temp/cate/2.png"),
|
|
||||||
buyNumber: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 7,
|
|
||||||
name: "空调拆卸",
|
|
||||||
icon: require("@/static/temp/cate/3.png"),
|
|
||||||
buyNumber: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
name: "热水器安装",
|
|
||||||
icon: require("@/static/temp/cate/4.png"),
|
|
||||||
buyNumber: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -98,7 +42,14 @@ export default {
|
||||||
config: (state) => state.system.config,
|
config: (state) => state.system.config,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad(e) {
|
||||||
|
if (e.id) {
|
||||||
|
this.cateId = e.id;
|
||||||
|
} else {
|
||||||
|
this.$utils.toast("参数错误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
onReachBottom() {},
|
onReachBottom() {},
|
||||||
|
|
Loading…
Reference in New Issue