给小区添加默认图标

This commit is contained in:
赵毅 2025-09-03 14:22:51 +08:00
parent dc5e328b3c
commit f6741c1a9b

View File

@ -134,7 +134,50 @@ export default {
communityList: [], communityList: [],
flag: false, flag: false,
functionList: [], functionList: [
{
create_time: "2025-07-04 17:28:35",
id: 4,
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/repairList/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s1b1lyxawt8cnke.png",
nav_name: "报事报修",
other_appid: "",
other_path: "",
sort: 5,
update_time: "2025-08-29 11:39:54",
visible_communities: ""
},
{
create_time: "2025-07-05 10:48:27",
id: 5,
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/propertyPayment/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s1t7d1k0qmuha61.png",
nav_name: "物业缴费",
other_appid: "",
other_path: "",
sort: 4,
update_time: "2025-08-29 11:40:02",
visible_communities: "",
},
{
create_time: "2025-07-05 10:49:02",
id: 7,
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/providentFund/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s29e33rd7rsrecf.png",
nav_name: "物业公积金",
other_appid: "",
other_path: "",
sort: 2,
update_time: "2025-08-29 11:39:21",
visible_communities: ""
}
],
ads1Show: false, ads1Show: false,
ads2Show: false, ads2Show: false,
@ -318,15 +361,25 @@ export default {
console.log(res, "xx"); console.log(res, "xx");
// rowNum colNum // rowNum colNum
const totalItems = this.rowNum * this.colNum; const totalItems = this.rowNum * this.colNum - 3;
// 使 slice totalItems // totalItems
this.functionList = res.rows.slice(0, totalItems).map((item) => { const newItems = res.rows.slice(0, totalItems).map((item) => {
return { return {
...item, ...item,
nav_icon: picUrl + item.nav_icon, nav_icon: picUrl + item.nav_icon,
}; };
}); });
// nav_name
newItems.forEach(newItem => {
const exists = this.functionList.some(existingItem =>
existingItem.nav_name === newItem.nav_name
);
if (!exists) {
this.functionList.push(newItem);
}
});
console.log("functionList", this.functionList); console.log("functionList", this.functionList);
}, },