diff --git a/api/common.js b/api/common.js index d775b09..58a23a7 100644 --- a/api/common.js +++ b/api/common.js @@ -10,7 +10,7 @@ export const indexListReq = data => post('/com/publish-list/list', data) export const swiperListReq = () => get('/sys/sys-swiper') -export const communityListReq = () => get('/zhsq/zhsq-base-village') +export const communityListReq = () => get('/zhsq/zhsq-base-village?withFeeItem=true&withPopulation=true') export const roomListReq = params => get('/zhsq/zhsq-base-room', {params}) diff --git a/pages.json b/pages.json index 6927c69..b3aa5ae 100644 --- a/pages.json +++ b/pages.json @@ -99,6 +99,13 @@ { "navigationBarTitleText" : "小区概览" } + }, + { + "path" : "pages/community/detail", + "style" : + { + "navigationBarTitleText" : "详情" + } } ], "subPackages": [ diff --git a/pages/community/index.vue b/pages/community/index.vue index fcd5827..7c71bf3 100644 --- a/pages/community/index.vue +++ b/pages/community/index.vue @@ -2,18 +2,27 @@ - + @@ -23,22 +32,60 @@ import CustomTabbar from "@/components/customTabbar.vue"; import {communityListReq} from "@/api/common"; export default { - name: "articleList", + name: "CommunityIndex", components: {CustomTabbar}, data() { return { - cateId: null, list: [] } }, methods: { async getList() { - const {data} = await communityListReq() - this.list = data + try { + const {data} = await communityListReq() + this.list = data + } catch (error) { + console.error('获取小区列表失败:', error) + uni.showToast({ + title: '获取数据失败', + icon: 'none' + }) + } + }, + goToDetail(item) { + // 跳转到详情页,传递小区ID + uni.navigateTo({ + url: `/pages/community/detail?id=${item.id}` + }) } }, - onLoad({id}) { + onLoad() { this.getList() } } - \ No newline at end of file + + + \ No newline at end of file