解决冲突
This commit is contained in:
@@ -124,6 +124,7 @@ import { ref } from 'vue'
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app'
|
||||
import { getCurrentVillage,getTodayInspection,getNewNoticeData,getBannarList} from '../../api/api.js'
|
||||
|
||||
|
||||
// 列表数据状态
|
||||
const current = ref(0)
|
||||
const currentCommunity = ref('请选择小区')
|
||||
@@ -134,17 +135,16 @@ const pendingCount = ref(0) //待巡检
|
||||
const InspectedCount = ref(0) //已巡检
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
|
||||
// =======方法=======
|
||||
// 跳转小区
|
||||
const navigateToPage = () => {
|
||||
const curVillageId = uni.getStorageSync('currentVillage')
|
||||
let villageId = ''
|
||||
if(curVillageId){
|
||||
try{
|
||||
villageId = JSON.parse(curVillageId).villageId || JSON.parse(curVillageId).id || ''
|
||||
}catch(e){}
|
||||
}
|
||||
const curVillageId = uni.getStorageSync('currentVillage')
|
||||
let villageId = ''
|
||||
if (curVillageId) {
|
||||
try {
|
||||
villageId = JSON.parse(curVillageId).villageId || JSON.parse(curVillageId).id || ''
|
||||
} catch (e) {}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pageSubPack/notice-list/select-community?villageId=${villageId}`
|
||||
})
|
||||
@@ -199,14 +199,16 @@ const goToReport = () => {
|
||||
}
|
||||
// 获取当前小区
|
||||
const currentVillageData = () => {
|
||||
getCurrentVillage().then(res => {
|
||||
const data = res.data
|
||||
if (data) {
|
||||
currentCommunity.value = data.villageName
|
||||
uni.setStorageSync('currentVillage', JSON.stringify(data))
|
||||
getNoticeData()
|
||||
}
|
||||
}).catch(() => {})
|
||||
getCurrentVillage()
|
||||
.then(res => {
|
||||
const data = res.data
|
||||
if (data) {
|
||||
currentCommunity.value = data.villageName
|
||||
uni.setStorageSync('currentVillage', JSON.stringify(data))
|
||||
getNoticeData()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
// 获取今日巡检数据
|
||||
const getInspectionData = () =>{
|
||||
@@ -217,24 +219,28 @@ const getInspectionData = () =>{
|
||||
pendingCount.value = res.data.unfinishedTasks
|
||||
InspectedCount.value = res.data.completedTasks
|
||||
}else{
|
||||
allCount.value = 0
|
||||
allCount.value = 0
|
||||
pendingCount.value = 0
|
||||
InspectedCount.value = 0
|
||||
}
|
||||
}else{
|
||||
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||
}
|
||||
}).catch(err =>{
|
||||
uni.showToast({title:err.msg || '获取失败',icon:'none'})
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
|
||||
})
|
||||
}
|
||||
// 获取消息通知
|
||||
const getNoticeData = () => {
|
||||
getNewNoticeData().then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
noticeText.value = res.data.notice || ''
|
||||
}else{
|
||||
noticeText.value = '暂无公告'
|
||||
}
|
||||
}).catch(() => {})
|
||||
getNewNoticeData()
|
||||
.then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
noticeText.value = res.data.notice || ''
|
||||
} else {
|
||||
noticeText.value = '暂无公告'
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
// 获取bannar图
|
||||
function getbannarData(){
|
||||
@@ -380,7 +386,6 @@ const clickItem = index => {
|
||||
}
|
||||
|
||||
.inspectionClass {
|
||||
// margin-top: 20rpx;
|
||||
background: linear-gradient(to right, #7b87fa, #4d5dfa);
|
||||
border-radius: 16rpx;
|
||||
box-sizing: border-box;
|
||||
@@ -406,10 +411,10 @@ const clickItem = index => {
|
||||
margin-right: 16rpx;
|
||||
|
||||
.notice-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.notice-line {
|
||||
width: 1rpx;
|
||||
|
||||
Reference in New Issue
Block a user