对接上报记录、bannar

This commit is contained in:
zhouyanli
2026-05-18 17:20:14 +08:00
parent eb7d4da5e3
commit 616bfdfd90
13 changed files with 172 additions and 90 deletions

View File

@@ -39,7 +39,7 @@
<swiper class="swiper-box" :current="current" autoplay>
<swiper-item v-for="(item, index) in bannerList" :key="index">
<view class="swiper-item">
<image :src="item.img" style="width: 100%; height: 100%"></image>
<image :src="item.url" style="width: 100%; height: 100%"></image>
</view>
</swiper-item>
</swiper>
@@ -124,12 +124,12 @@
<script setup>
import { ref } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getCurrentVillage,getTodayInspection,getNewNoticeData } from '../../api/api.js'
import { getCurrentVillage,getTodayInspection,getNewNoticeData,getBannarList} from '../../api/api.js'
// 列表数据状态
const current = ref(0)
const currentCommunity = ref('请选择小区')
const bannerList = ref([{ img: 'https://wuyeadmin.bugtc.com/images/imgs/banner1.png' }])
const bannerList = ref([])
const noticeText = ref('暂无公告')
const allCount = ref(0) // 全部巡检
const pendingCount = ref(0) //待巡检
@@ -237,6 +237,16 @@ const getNoticeData = () => {
}
}).catch(() => {})
}
// 获取bannar图
function getbannarData(){
getBannarList().then(res => {
if (res.code === 200 && res.data) {
bannerList.value = res.data
}else{
bannerList.value = []
}
}).catch(() => {})
}
// 接收选择小区返回的参数
const slelctHomeData = data => {
@@ -251,6 +261,7 @@ onLoad(() => {
// 优先调用接口获取当前小区,失败时再读缓存
currentVillageData()
getInspectionData()
getbannarData()
})
onUnload(() => {