This commit is contained in:
zhouyanli
2026-05-22 15:34:19 +08:00
22 changed files with 835 additions and 543 deletions

View File

@@ -15,12 +15,18 @@
<view class="header-container" @click="navigateToPage">
<view class="location-area">
<view class="location-icon">
<image src="https://wuyeadmin.bugtc.com/images/imgs/adress.png" style="height: 100%; width: 100%"></image>
<image
src="https://wuyeadmin.bugtc.com/images/imgs/adress.png"
style="height: 100%; width: 100%"
></image>
</view>
<view class="community-selector">
<text class="community-name">{{ currentCommunity }}</text>
<view class="community-icon">
<image src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png" style="height: 100%; width: 100%"></image>
<image
src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png"
style="height: 100%; width: 100%"
></image>
</view>
</view>
</view>
@@ -50,8 +56,11 @@
<!-- 消息通知栏 -->
<view class="noticeClass">
<view class="notice-left">
<image src="https://wuyeadmin.bugtc.com/images/imgs/notice.png" class="notice-icon"></image>
<view class="notice-line"></view>
<image
src="https://wuyeadmin.bugtc.com/images/imgs/notice.png"
class="notice-icon"
></image>
<view class="notice-line"></view>
</view>
<view class="notice-right" @click="getNoticeMore">
<uni-notice-bar
@@ -72,15 +81,15 @@
<!-- 巡检数据统计区 -->
<view class="statistics-wrap">
<view class="statistics-item" @click="goToInspectionRecord">
<text class="num">{{allCount}}</text>
<text class="num">{{ allCount }}</text>
<text class="label">全部巡检</text>
</view>
<view class="statistics-item" @click="goToDaysInspection">
<text class="num">{{pendingCount}}</text>
<text class="num">{{ pendingCount }}</text>
<text class="label">待巡检</text>
</view>
<view class="statistics-item">
<text class="num">{{InspectedCount}}</text>
<text class="num">{{ InspectedCount }}</text>
<text class="label">已巡检</text>
</view>
</view>
@@ -91,26 +100,46 @@
<!-- 第一行功能:故障上报、一键开门、工单大厅、我的工单 -->
<view class="function-row">
<view class="function-item" @click="goToReport">
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/fault-report.png" mode="aspectFit"></image>
<image
class="item-icon"
src="https://wuyeadmin.bugtc.com/images/imgs/fault-report.png"
mode="aspectFit"
></image>
<text class="item-text">故障上报</text>
</view>
<view class="function-item" @click="goToOneOpenDoor">
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/open.png" mode="aspectFit"></image>
<image
class="item-icon"
src="https://wuyeadmin.bugtc.com/images/imgs/open.png"
mode="aspectFit"
></image>
<text class="item-text">一键开门</text>
</view>
<view class="function-item" @tap="goToTicketHall">
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/work-order.png" mode="aspectFit"></image>
<image
class="item-icon"
src="https://wuyeadmin.bugtc.com/images/imgs/work-order.png"
mode="aspectFit"
></image>
<text class="item-text">工单大厅</text>
</view>
<view class="function-item" @tap="goToMyTicket">
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/my-work.png" mode="aspectFit"></image>
<image
class="item-icon"
src="https://wuyeadmin.bugtc.com/images/imgs/my-work.png"
mode="aspectFit"
></image>
<text class="item-text">我的工单</text>
</view>
</view>
<!-- 第二行 -->
<view class="function-row" style="margin-top: 2px">
<view class="function-item" @tap="goToComplaint">
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/complaint.png" mode="aspectFit"></image>
<image
class="item-icon"
src="https://wuyeadmin.bugtc.com/images/imgs/complaint.png"
mode="aspectFit"
></image>
<text class="item-text">投诉处理</text>
</view>
</view>
@@ -122,8 +151,12 @@
<script setup>
import { ref } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getCurrentVillage,getTodayInspection,getNewNoticeData,getBannarList} from '../../api/api.js'
import {
getCurrentVillage,
getTodayInspection,
getNewNoticeData,
getBannarList
} from '../../api/api.js'
// 列表数据状态
const current = ref(0)
@@ -211,22 +244,24 @@ const currentVillageData = () => {
.catch(() => {})
}
// 获取今日巡检数据
const getInspectionData = () =>{
getTodayInspection().then(res =>{
if(res.code === 200){
if(res.data){
allCount.value = res.data.totalTasks
pendingCount.value = res.data.unfinishedTasks
InspectedCount.value = res.data.completedTasks
}else{
const getInspectionData = () => {
getTodayInspection()
.then(res => {
if (res.code === 200) {
if (res.data) {
allCount.value = res.data.totalTasks
pendingCount.value = res.data.unfinishedTasks
InspectedCount.value = res.data.completedTasks
} else {
allCount.value = 0
pendingCount.value = 0
InspectedCount.value = 0
pendingCount.value = 0
InspectedCount.value = 0
}
} else {
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
}
}else{
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
}
}).catch(err => {
})
.catch(err => {
uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
})
}
@@ -243,14 +278,16 @@ const getNoticeData = () => {
.catch(() => {})
}
// 获取bannar图
function getbannarData(){
getBannarList().then(res => {
if (res.code === 200 && res.data) {
bannerList.value = res.data
}else{
bannerList.value = []
}
}).catch(() => {})
function getbannarData() {
getBannarList()
.then(res => {
if (res.code === 200 && res.data) {
bannerList.value = res.data
} else {
bannerList.value = []
}
})
.catch(() => {})
}
// 接收选择小区返回的参数
@@ -414,7 +451,7 @@ const onSwiperChange = e => {
align-items: center;
margin-right: 16rpx;
.notice-icon {
.notice-icon {
width: 48rpx;
height: 48rpx;
margin-right: 15rpx;

View File

@@ -46,15 +46,17 @@ const avatar = ref('')
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
const fetchUserInfo = () => {
getSettingInfo().then(res => {
if (res.code === 200 && res.data) {
loginName.value = res.data.nickName || ''
phoneNum.value = res.data.phonenumber || ''
avatar.value = res.data.avatar || ''
}
}).catch(err => {
uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
})
getSettingInfo()
.then(res => {
if (res.code === 200 && res.data) {
loginName.value = res.data.nickName || ''
phoneNum.value = res.data.phonenumber || ''
avatar.value = res.data.avatar || ''
}
})
.catch(err => {
uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
})
}
onShow(() => {
@@ -63,10 +65,10 @@ onShow(() => {
const onItemClick = item => {
const routes = {
'上报记录': '/pageSubPack/report-record/report-record',
'巡检记录': '/pageSubPack/inspection/inspection_record',
'仪表换新': '/pageSubPack/instrument/replacement_record',
'设置': '/pageSubPack/setting/setting'
上报记录: '/pageSubPack/report-record/report-record',
巡检记录: '/pageSubPack/inspection/inspection_record',
仪表换新: '/pageSubPack/instrument/replacement_record',
设置: '/pageSubPack/setting/setting'
}
const url = routes[item.title]
if (!url) return