Jelajahi Sumber

优化首页提醒

zhengkaixin 3 hari lalu
induk
melakukan
c439fbc15f
1 mengubah file dengan 77 tambahan dan 38 penghapusan
  1. 77 38
      pages/index/index.vue

+ 77 - 38
pages/index/index.vue

@@ -148,10 +148,7 @@
 			<view class="top-main">
 				<view class="title-main">
 					故障未处理记录
-					<span v-if="dataerrRecordsTotal" class="badge">
-						
-						{{dataerrRecordsTotal}}
-					</span>
+					
 
 
 
@@ -170,7 +167,7 @@
 			</view>
 
 			<view class="list">
-				<view class="item" v-for="(item,index) in dataerrList"
+				<view class="item" v-for="(item,index) in dataerrList[current1]"
 					@click="gotoUrl('/pages/task/maintenanceTaks?id='+item.id)" :key="index">
 
 					<view class="body">
@@ -226,8 +223,8 @@
 					<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
 				</view>
 
-				<u-divider color="#F44336"  :nonetop="0" :isnone="dataerrRecordsTotal==0" nonetext="暂无数据"
-					v-if="dataerrRecordsTotal==0"></u-divider>
+				<u-divider color="#F44336"  :nonetop="0" :isnone="dataerrList[current1].length==0" nonetext="暂无数据"
+					v-if="dataerrList[current1].length==0"></u-divider>
 
 
 
@@ -240,27 +237,22 @@
 			<view class="top-main">
 				<view class="title-main">
 					未巡检记录
-					<span v-if="datainsRecordsTotal" class="badge">
-						
-						{{datainsRecordsTotal}}
-					</span>
+					
 
 				</view>
 				<view class="goto-main" @click="gotoUrl('/pages/inspection/list')">
 					全部巡检记录
-
-
 					<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
 				</view>
 			</view>
 
 			<view class="top-main">
-				<u-tabs :list="tabslist"  :current="current2" @change="change2"></u-tabs>
+				<u-tabs :list="tabslist2"  :current="current2" @change="change2"></u-tabs>
 
 			</view>
 
 			<view class="list-body">
-				<view class="item" v-for="(item,index) in datainsList"
+				<view class="item" v-for="(item,index) in datainsList[current2]"
 					@click="gotoUrl('/pages/inspection/add?back=1&stationId='+item.stationId)" :key="index">
 
 
@@ -323,8 +315,8 @@
 
 				</view>
 
-				<u-divider color="#F44336" :nonetop="0" :isnone="datainsRecordsTotal==0" nonetext="暂无数据"
-					v-if="datainsRecordsTotal==0"></u-divider>
+				<u-divider color="#F44336" :nonetop="0" :isnone="datainsList[current2].length==0" nonetext="暂无数据"
+					v-if="datainsList[current2].length==0"></u-divider>
 
 
 
@@ -367,10 +359,14 @@
 				roleList: [],
 				isReadyerrList: false,
 				isReadyinsList: false,
-				dataerrList: [],
+				dataerrList: [
+					[],[]
+				],
 				dataerrRecordsTotal: 0,
 
-				datainsList: [],
+				datainsList: [
+						[],[]
+				],
 				datainsRecordsTotal: 0,
 
 				tabslist: [{
@@ -380,6 +376,14 @@
 				}, {
 					name: '电单车充电站',
 					code: "0"
+				}],
+				tabslist2: [{
+					name: '电动车充电站',
+					code: "1"
+				
+				}, {
+					name: '电单车充电站',
+					code: "0"
 				}],
 				current1: 0,
 				current2: 0,
@@ -426,19 +430,17 @@
 				}
 			},
 			getinsList() {
-				var status = 0
-				var code = this.tabslist[this.current2].code
 				
 				API.recordList({
 					pageIndex: 1,
 					pageSize: 20,
 					status: 0,
-					chargingType:code
+					chargingType:"1"
 				}).then((response) => {
-					this.datainsList = response.data.data
-					
+					this.datainsList[0] = response.data.data
+					
+					this.tabslist2[0].count=response.data.recordsTotal
 					
-					this.datainsRecordsTotal = response.data.recordsTotal
 					this.isReadyinsList = true
 				}).catch(error => {
 					uni.showToast({
@@ -446,6 +448,25 @@
 						icon: "none"
 					})
 
+				})
+				
+				API.recordList({
+					pageIndex: 1,
+					pageSize: 20,
+					status: 0,
+					chargingType:"0"
+				}).then((response) => {
+					this.datainsList[1] = response.data.data
+					
+					this.tabslist2[1].count=response.data.recordsTotal
+					
+					this.isReadyinsList = true
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				
 				})
 			},
 			getdaysDistance( time2) {
@@ -466,16 +487,16 @@
 			change1(e) {
 				this.current1 = e
 
-				this.dataerrList = []
+				//this.dataerrList = []
 
-				this.geterrList()
+				//this.geterrList()
 			},
 			change2(e) {
 				this.current2 = e
 			
-				this.datainsList = []
+				//this.datainsList = []
 			
-				this.getinsList()
+				//this.getinsList()
 			},
 			isToday(dateStr) {
 				if (!dateStr) {
@@ -525,27 +546,43 @@
 				})
 			},
 			geterrList() {
-				var status = 0
-				var code = this.tabslist[this.current1].code
 				
+			
 				API.errList({
 					pageIndex: 1,
 					pageSize: 5,
 					status: 0,
-					chargingType:code
+					chargingType:"1"
 				}).then((response) => {
-					this.dataerrList = response.data.data
-					
+					this.dataerrList[0] = response.data.data
 					
-					this.dataerrRecordsTotal = response.data.recordsTotal
+					//this.dataerrRecordsTotal = response.data.recordsTotal
+					this.tabslist[0].count=response.data.recordsTotal
 					this.isReadyerrList = true
 				}).catch(error => {
 					uni.showToast({
 						title: error,
 						icon: "none"
 					})
-
-				})
+				})
+				
+				API.errList({
+					pageIndex: 1,
+					pageSize: 5,
+					status: 0,
+					chargingType:"0"
+				}).then((response) => {
+					this.dataerrList[1] = response.data.data
+					this.tabslist[1].count=response.data.recordsTotal
+					//this.dataerrRecordsTotal = response.data.recordsTotal
+					this.isReadyerrList = true
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+				
 			},
 			getfloorStatus() {
 
@@ -904,7 +941,9 @@
 					.line1 {
 						
 						font-size: 32rpx;
-
+						.value{
+							    white-space: pre;
+						}
 
 						.status {
 							background-color: rgba(255, 61, 0, 1);