From 2c071d2d8654157ecc660c519691c60255377c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Wed, 9 Jul 2025 15:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84=E5=B0=8F?= =?UTF-8?q?=E5=8C=BA=E9=87=91=E5=88=9A=E5=8C=BA=E6=98=BE=E7=A4=BA=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v2Community.js | 2 ++ packages/community/index/index.vue | 43 ++++++++++++++++++++---- packages/storeManagement/index/index.vue | 2 +- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/api/v2Community.js b/api/v2Community.js index 31073f6a..f2bed11f 100644 --- a/api/v2Community.js +++ b/api/v2Community.js @@ -14,6 +14,8 @@ export const apiArr = { navPage: '/api/v2/wechat/community-navigation-crud/page', // 小区图标导航信息分页 advPage: '/api/v2/wechat/community-advertisement-crud/page', // 小区广告信息分页 + commInfo: '//api/v2/wechat/nav-display-crud/comm/info', // 小区导航设置信息详情 + categoryPage: '/api/v2/wechat/announcement-category-crud/page', // 公告分类信息分页 infoPage: '/api/v2/wechat/announcement-crud/page', // 公告信息分页 }; diff --git a/packages/community/index/index.vue b/packages/community/index/index.vue index a7315526..ab2aed8d 100644 --- a/packages/community/index/index.vue +++ b/packages/community/index/index.vue @@ -82,7 +82,8 @@
- + +
@@ -151,7 +152,10 @@ infoList: [], selectedTab: 0, - currentAdIndex: 0 + currentAdIndex: 0, + + rowNum: 0, + colNum: 0, } }, async onLoad(options) { @@ -161,7 +165,7 @@ this.localHeight = meun.height; // this.getCommunityList() this.communityVal = uni.getStorageSync('changeCommData').name - await this.getfunctionList() + await this.getfunctionNum() this.getAdvertising() this.getCategoryList() }, @@ -211,19 +215,46 @@ // 获取当前轮播图索引 this.currentIdx = event.detail.current; }, + + async getfunctionNum() { + const res = await request(apiArr.commInfo, "POST", {}, { + slice: false + }); + this.rowNum = res.nav_row_num_comm + this.colNum = res.nav_row_total_comm + return await this.getfunctionList() + }, + + // async getfunctionList() { + // const res = await request(apiArr.navPage, "POST", { + // community_id: Number(uni.getStorageSync('changeCommData').id), + // page_num: 1, + // page_size: 50 + // }) + // this.functionList = res.rows.map(item => { + // return { + // ...item, + // nav_icon: picUrl + item.nav_icon + // }; + // }); + // console.log(this.functionList) + // }, async getfunctionList() { const res = await request(apiArr.navPage, "POST", { community_id: Number(uni.getStorageSync('changeCommData').id), page_num: 1, page_size: 50 - }) - this.functionList = res.rows.map(item => { + }); + // 获取 rowNum 和 colNum 的乘积 + const totalItems = this.rowNum * this.colNum; + // 使用 slice 方法截取前 totalItems 个元素 + this.functionList = res.rows.slice(0, totalItems).map(item => { return { ...item, nav_icon: picUrl + item.nav_icon }; }); - console.log(this.functionList) + console.log(this.functionList); }, async getAdvertising() { diff --git a/packages/storeManagement/index/index.vue b/packages/storeManagement/index/index.vue index 00d7ad59..c0572132 100644 --- a/packages/storeManagement/index/index.vue +++ b/packages/storeManagement/index/index.vue @@ -90,7 +90,7 @@ show: false, show2: false, baseList: [{ - image: "", + image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/page_user_Group_1568.png", name: "订单", url: "", }],