修改我的小区金刚区显示数量

This commit is contained in:
赵毅 2025-07-09 15:21:32 +08:00
parent bef2944dff
commit 2c071d2d86
3 changed files with 40 additions and 7 deletions

View File

@ -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', // 公告信息分页
};

View File

@ -82,7 +82,8 @@
</swiper>
</div>
<div class="close" @click="closeAds">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png"></image>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_close.png">
</image>
</div>
</div>
</div>
@ -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() {

View File

@ -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: "",
}],