Sfoglia il codice sorgente

水肥 肥料桶开关样式

zhangsijie 1 anno fa
parent
commit
e5281b0935
1 ha cambiato i file con 38 aggiunte e 34 eliminazioni
  1. 38 34
      pages/waterandfernew/details.vue

+ 38 - 34
pages/waterandfernew/details.vue

@@ -141,7 +141,7 @@
 					</view> -->
 					<!-- 桶 -->
 					<view class="colList">
-						<view class="preClo" v-for="item, index in pickBtnList"  :key="item.type">
+						<view class="preClo" v-for="item, index in pickBtnList" :key="item.type">
 							<view>
 								肥料{{ index + 1}}
 							</view>
@@ -153,9 +153,8 @@
 								v-else-if="pickBtnList.length > 1 && index == 1"></image>
 							<image src="../../static/images/waterandfernew/colCenter.png" v-else></image>
 							<view class="jiaoBtn" v-if="resultBan.length > 0">
-								<u-switch v-model="resultBan[index]['off']"
-									active-color="#14A478" inactive-color="#AEB4C2"
-									:loading="resultBan[index]['disabled']"
+								<u-switch v-model="resultBan[index]['off']" active-color="#14A478"
+									inactive-color="#AEB4C2" :loading="resultBan[index]['disabled']"
 									@change="switchchange($event, resultBan[index]['number'], resultBan[index], index)"></u-switch>
 							</view>
 							<view class="shanBox" v-if="resultBan.length > 0">
@@ -222,7 +221,7 @@
 							<image class="daoguan" src="../../static/images/waterandfernew/bottomNew.png"
 								v-if="index < 4"></image>
 							<view class="info">
-								{{item.name}}
+								{{item.e_name}}
 							</view>
 							<image class="status" v-if="item.off" src="../../static/images/waterandfernew/open.png">
 							</image>
@@ -269,17 +268,17 @@
 	export default {
 		data() {
 			return {
-				typeObj:{
-					1:'控制柜',
-					2:'灌溉泵',
-					3:'搅拌机',
-					4:'注肥泵',
-					5:'阀控器',
-					6:'施肥桶'
+				typeObj: {
+					1: '控制柜',
+					2: '灌溉泵',
+					3: '搅拌机',
+					4: '注肥泵',
+					5: '阀控器',
+					6: '施肥桶'
 				}, //阀控器类型对应
-				pickBtnList:[], // 肥料开关列表
-				resultBan:[], // 搅拌机开关列表
-				faList:[], // 发空气开关列表
+				pickBtnList: [], // 肥料开关列表
+				resultBan: [], // 搅拌机开关列表
+				faList: [], // 发空气开关列表
 				alertTipColor: {
 					color: '#1890FF',
 					fontSize: "12px"
@@ -287,7 +286,7 @@
 				device_id: '',
 				mainBengIndex: 0, // 进水泵的位置
 				mainBeng: false,
-				feiBeng: false,				
+				feiBeng: false,
 				feiBengIndex: 0, // 施肥泵的位置
 				calendarshow: false,
 				historyTime: {},
@@ -577,28 +576,28 @@
 				let faList = []; // 管道阀开关
 				this.facilityvalve.forEach(item => {
 					res.forEach((pick, index) => {
-						if(pick.e_key == item.type) {
+						if (pick.e_key == item.type) {
 							let pickObj = Object.assign(item, pick);
 							// 获取当前灌溉泵位置
-							if(pick.e_type == 2) {
+							if (pick.e_type == 2) {
 								this.mainBengIndex = pickList.length;
 								this.mainBeng = pickObj.off;
 							}
 							// 获取当前施肥泵位置
-							if(pick.e_type == 4) {
+							if (pick.e_type == 4) {
 								this.feiBengIndex = pickList.length;
 								this.feiBeng = pickObj.off;
 							}
 							// 获取肥料开关列表
-							if(pick.e_type == 6) {
+							if (pick.e_type == 6) {
 								pickBtnList.push(pickObj)
 							}
 							// 获取搅拌机开关列表
-							if(pick.e_type == 3) {
+							if (pick.e_type == 3) {
 								pickBanList.push(pickObj)
 							}
 							// 获取管道阀开关列表
-							if(pick.e_type == 1 || pick.e_type == 5) {
+							if (pick.e_type == 1 || pick.e_type == 5) {
 								faList.push(pickObj)
 							}
 							pickList.push(pickObj)
@@ -609,7 +608,7 @@
 				let resultBan = [];
 				pickBtnList.forEach(fei => {
 					pickBanList.forEach(ban => {
-						if(fei.create_time == ban.create_time) {
+						if (fei.create_time == ban.create_time) {
 							resultBan.push(ban)
 						}
 					})
@@ -1160,19 +1159,21 @@
 						transform: translateX(-50%);
 						z-index: 2;
 
-						.u-switch {
+						/deep/ .u-switch__node {
+							width: 28rpx !important;
+							height: 28rpx !important;
+							top: 2rpx !important;
+						}
+
+						/deep/ .u-switch__loading {
+							height: 20rpx !important;
+						}
+
+						/deep/ .u-switch {
 							width: 64rpx;
 							height: 32rpx;
 
-							/deep/ .u-switch__node {
-								width: 28rpx !important;
-								height: 28rpx !important;
-								top: 2rpx !important;
-							}
 
-							/deep/ .u-switch__loading {
-								height: 20rpx !important;
-							}
 						}
 
 						/deep/ .u-switch--on .u-switch__node {
@@ -1355,12 +1356,15 @@
 			view {
 				text-align: center;
 			}
-			.success{
+
+			.success {
 				color: #14A478;
 			}
-			.error{
+
+			.error {
 				color: #FF5951;
 			}
+
 			view:nth-child(1) {
 				width: 120rpx;
 				text-align: left;