wkyy 1 anno fa
parent
commit
bfa6598543
1 ha cambiato i file con 4 aggiunte e 8 eliminazioni
  1. 4 8
      pages/equipmentDataMonitoring/equipmentElectricity.vue

+ 4 - 8
pages/equipmentDataMonitoring/equipmentElectricity.vue

@@ -38,7 +38,7 @@
 		</u-popup>
 		<view class="tatol-main" v-for="(m, i) in kWhList" :key="i" style="margin-bottom: 15px;">
 			<!-- 用电量合计 -->
-			<view class="total" v-if="kWhList.length > 1">
+			<view class="total" v-if="companyList.length > 2">
 			<!-- <view class="total"> -->
 				<view class="company">
 					<view class="name">
@@ -166,20 +166,15 @@
 			}
 		},
 		onLoad() {
-			this.getList();
 			this.getCompanyInfoList();
+			this.getList();
 		},
 		methods: {
 			getCompanyInfoList() {
 				this.merchantList1 = [];
 				this.merchantList2 = [];
 
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
 				API.deviceCompanyList().then((response) => {
-					uni.hideLoading();
 					this.companyList = response.data.companyInfoList;
 					var list = response.data.companyInfoList;
 					
@@ -214,7 +209,6 @@
 					companyId: this.companyId
 				};
 				API.homePageKwh(data).then((res) => {
-					uni.hideLoading()
 					var dataList = res.data.data;
 					var idList = [];
 					var list = []
@@ -243,6 +237,8 @@
 					}
 					// console.log(list)
 					this.kWhList = list;
+					
+					uni.hideLoading()
 				}).catch(error => {
 					uni.showToast({
 						title: error,