对接部分服务分类接口
This commit is contained in:
parent
f5a21ad39b
commit
9cad71a511
|
@ -124,7 +124,7 @@ export default {
|
|||
(res) => {
|
||||
// 如果节点尚未生成,res值为null,循环调用执行
|
||||
if (!res) {
|
||||
this.getElRect(elClass);
|
||||
// this.getElRect(elClass);
|
||||
return;
|
||||
}
|
||||
this[dataVal] = res.height;
|
||||
|
@ -146,7 +146,7 @@ export default {
|
|||
.boundingClientRect((rects) => {
|
||||
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
|
||||
if (!rects.length) {
|
||||
this.getMenuItemTop();
|
||||
// this.getMenuItemTop();
|
||||
return;
|
||||
}
|
||||
rects.forEach((rect) => {
|
||||
|
|
|
@ -36,57 +36,7 @@ export default {
|
|||
return {
|
||||
utils: this.$utils,
|
||||
position: { x: 300, y: 1000 },
|
||||
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"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
data: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
@ -110,6 +60,28 @@ export default {
|
|||
x: x - this.$utils.rpx2px(20),
|
||||
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() {},
|
||||
onReady() {},
|
||||
|
|
|
@ -28,64 +28,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
utils: this.$utils,
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
cateId: 0,
|
||||
data: [],
|
||||
bottom: 0,
|
||||
};
|
||||
},
|
||||
|
@ -98,7 +42,14 @@ export default {
|
|||
config: (state) => state.system.config,
|
||||
}),
|
||||
},
|
||||
onLoad() {},
|
||||
onLoad(e) {
|
||||
if (e.id) {
|
||||
this.cateId = e.id;
|
||||
} else {
|
||||
this.$utils.toast("参数错误");
|
||||
return;
|
||||
}
|
||||
},
|
||||
onShow() {},
|
||||
onReady() {},
|
||||
onReachBottom() {},
|
||||
|
|
Loading…
Reference in New Issue