所有户渲染

main
许宏杰 6 months ago
parent f9b877efa6
commit 577667a380

@ -3,7 +3,13 @@
<u-navbar back-text="" :title="title" :is-back="isBack" :is-fixed="true" :background="background" <u-navbar back-text="" :title="title" :is-back="isBack" :is-fixed="true" :background="background"
title-color="#fff" back-icon-color="#fff" :back-text-style="{ title-color="#fff" back-icon-color="#fff" :back-text-style="{
color:'#fff' color:'#fff'
}"></u-navbar> }">
<template v-slot:right>
<slot name="right"></slot>
</template>
</u-navbar>
<slot></slot> <slot></slot>
</view> </view>
</template> </template>

@ -1,20 +1,42 @@
<template> <template>
<navigation-general :title="title"> <navigation-general :title="title">
<view class="building-list" > <template v-slot:right>
<view class="nav-right">
<view class="right-item">{{totalHouse}}</view>
<view class="right-item">未排查{{weiPaimo}}</view>
</view>
</template>
<view class="building-list">
<view class="house-c"> <view class="house-c">
<view class="c-item" v-for="(item,index) in buildingInfo.floor" :key="index">{{buildingInfo.floor - index}}</view> <view class="c-item" v-for="(item,index) in buildingInfo.floor" :key="index">
{{buildingInfo.floor - index}}
</view>
<view class="c-item">单元</view>
</view> </view>
<scroll-view class="house-list" scroll-x="true" scroll-left="120"> <scroll-view class="house-list" scroll-x="true" scroll-left="120">
<view class="list-scroll-x" :style="handlerWidth"> <view class="list-scroll-x" :style="handlerWidth">
<view class="color-rows" v-for="(item,index) in groupedRooms" :key="index"> <view class="color-rows" v-for="(item,index) in groupedRooms" :key="index">
<color-item :showBuildingName="true" :showColorName="false" :item="house" v-for="house in item" :key="house.id"></color-item> <color-item :showBuildingName="true" :showColorName="false" :item="house" v-for="house in item"
:key="house.id"></color-item>
</view>
<view class="color-rows">
<view class="unitItem" v-for="unitItem in buildingInfo.unit" :key="unitItem">
{{unitItem}} 单元
</view> </view>
</view> </view>
</view>
</scroll-view> </scroll-view>
</view> </view>
<u-mask :show="show">
<view class="loading-css">
<u-loading mode="flower" size="50"></u-loading>
<view class="loading-text">加载中</view>
</view>
</u-mask>
</navigation-general> </navigation-general>
</template> </template>
@ -31,6 +53,7 @@
export default { export default {
data() { data() {
return { return {
show: true,
boxTop: 0, boxTop: 0,
queryParams: { queryParams: {
buildingId: undefined buildingId: undefined
@ -39,24 +62,26 @@
buildingInfo: {}, buildingInfo: {},
newHouseList: [], newHouseList: [],
totalHouse: 0, totalHouse: 0,
weiPaimo: 0
}; };
}, },
computed: { computed: {
handlerWidth(){ handlerWidth() {
return{ return {
width: (this.buildingInfo.house+1) * 122 + 'rpx' width: (this.buildingInfo.house + 1) * 122 + 'rpx'
} }
}, },
groupedRooms() { groupedRooms() {
if (this.newHouseList.length == 0) return if (this.newHouseList.length == 0) return
this.weiPaimo = 0
// //
let floors = Array.from({ let floors = Array.from({
length: this.buildingInfo.floor length: this.buildingInfo.floor
}, () => []) }, () => [])
// //
this.newHouseList.forEach((room) => { this.newHouseList.forEach((room) => {
if (room.daycount > 0) this.weiPaimo = this.weiPaimo + 1
// //
let floor = (parseInt(room.name) / 100) | 0 let floor = (parseInt(room.name) / 100) | 0
// //
@ -69,7 +94,7 @@
floors.forEach((floorRooms) => { floors.forEach((floorRooms) => {
floorRooms.sort((a, b) => parseInt(a.name) - parseInt(b.name)) floorRooms.sort((a, b) => parseInt(a.name) - parseInt(b.name))
}) })
uni.hideLoading() this.show = false
return floors.reverse() return floors.reverse()
}, },
}, },
@ -90,10 +115,7 @@
}, },
// //
async getAllHouse() { async getAllHouse() {
uni.showLoading({ this.show = true
title: '加载中',
mask:true,
})
let res = await getNumNew({ let res = await getNumNew({
buildingId: this.queryParams.buildingId buildingId: this.queryParams.buildingId
}) })
@ -104,50 +126,101 @@
} }
</script> </script>
<style lang="scss"> <style lang="scss">
page{ page {
background: #113666; background: #113666;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.nav-right {
margin-right: 14rpx;
display: flex;
flex-direction: column;
align-items: center;
.right-item {
box-sizing: border-box;
padding: 0 6rpx;
font-size: 22rpx;
background: #fff;
color: red;
}
.right-item:last-child {
margin-top: 4rpx;
background-color: red;
color: #fff;
}
}
.building-list { .building-list {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
// / // /
.house-c{ .house-c {
background: linear-gradient(to bottom,
.c-item{ rgba(149, 18, 58, 0.4) 10%,
#95123a 70%,
rgba(149, 18, 58, 0.4) 90%);
.c-item {
width: 120rpx; width: 120rpx;
text-align: center; text-align: center;
line-height: 60rpx; line-height: 60rpx;
height: 60rpx; height: 60rpx;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
background-color: rgb(64, 158, 255); // background-color: rgb(64, 158, 255);
border-bottom: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.1);
} }
} }
// //
.house-list{ .house-list {
background: #113666; background: #113666;
height: 100%; height: 100%;
.list-scroll-x{
.list-scroll-x {
height: 100%; height: 100%;
color: #fff; color: #fff;
.color-rows{
.color-rows {
width: 100%; width: 100%;
display: flex; display: flex;
height: 60rpx; height: 60rpx;
align-items: center; align-items: center;
.color-item{
.color-item {
width: 100rpx; width: 100rpx;
margin-left: 20rpx; margin-left: 20rpx;
} }
.unitItem {
font-size: 28rpx;
flex: 1;
height: 100%;
line-height: 60rpx;
text-align: center;
}
} }
} }
} }
}
/deep/ .loading-css {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.loading-text {
color: #fff;
font-size: 28rpx;
margin-top: 10rpx;
}
} }
</style> </style>

@ -53,7 +53,7 @@
globalConfig: getApp().globalData.config, globalConfig: getApp().globalData.config,
loginForm: { loginForm: {
username: "景瑞网格1", username: "景瑞网格1",
password: "Tc123@456", password: "Tc123@456***",
code: "", code: "",
uuid: '' uuid: ''
} }

Loading…
Cancel
Save