xhj 1 gadu atpakaļ
vecāks
revīzija
aa09a6ee45

+ 4 - 0
.hbuilderx/launch.json

@@ -6,6 +6,10 @@
      	{
      		"launchtype" : "remote"
      	},
+     	"h5" : 
+     	{
+     		"launchtype" : "remote"
+     	},
      	"mp-alipay" : 
      	{
      		"launchtype" : "remote"

+ 10 - 6
machineAndCell/machineInfo/machineInfo.css

@@ -1,6 +1,6 @@
 .cell-item{
 	width: calc((100% - 20rpx) / 2);
-	height: 340rpx;
+	height: 410rpx;
 	margin:30rpx 20rpx 0rpx 0;
 	background: #FFFFFF;
 	box-shadow: 0rpx 8rpx 40rpx 1rpx rgba(51,51,51,0.06);
@@ -13,6 +13,7 @@
 	margin-right: 0;
 }
 .cell-item-num{
+	position: absolute;
 	font-size: 28rpx;
 	font-family: Source Han Sans CN-Bold, Source Han Sans CN;
 	font-weight: bold;
@@ -31,21 +32,23 @@
 }
 
 .cell-item-option{
+	margin: 37rpx 0rpx 0;
+	position: absolute;
+	bottom: 30rpx;
+	left: 30rpx;
+	right: 30rpx;
+}
+.cell-item-option .btn{
 	line-height: 56rpx;
 	background: #FFFFFF;
 	border-radius: 10rpx 10rpx 10rpx 10rpx;
 	opacity: 1;
 	border: 2rpx solid #EB5C20;
-	margin: 37rpx 0rpx 0;
 	font-size: 24rpx;
 	font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
 	font-weight: normal;
 	color: #EB5C20;
 	text-align: center;
-	position: absolute;
-	bottom: 30rpx;
-	left: 30rpx;
-	right: 30rpx;
 }
 .kongcang{
 	width: 112rpx;
@@ -53,6 +56,7 @@
 	opacity: 1;
 	border: 1px solid #A8A5A5;
 	margin: auto;
+	margin-top: 60rpx;
 	border-radius: 100%;
 	text-align: center;
 	line-height: 112rpx;

+ 69 - 3
machineAndCell/machineInfo/machineInfo.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view style="padding:0 30rpx;" class="ddflex">
-			<view class="cell-item" v-for="item,index in groupList">
+			<view class="cell-item" v-for="item,index in groupList" @click="jumpUrl('/machineAndCell/machineItemManage/machineItemManage?id='+item.doorId+'&devId='+id)">
 				<view class="cell-item-num">{{item.doorId?item.doorId:0}}</view>
 				<block v-if="item.boxEnable==0">
 					<view :style="(item.boxStatus==5||item.boxStatus==6)?'margin-top: 30rpx;':'margin-top: 70rpx;'"></view>
@@ -29,6 +29,14 @@
 							</view>
 							<view class="cell-item-info fflex">
 								<view class="cell-item-info-item ddflex">
+									<view>机柜状态</view>
+									<view>{{item.boxEnable==1?'启用':'禁用'}}</view>
+								</view>
+								<view class="cell-item-info-item ddflex">
+									<view>柜门</view>
+									<view>{{item.doorStatus==1?'开':item.doorStatus==0?'关':'-'}}</view>
+								</view>
+								<view class="cell-item-info-item ddflex">
 									<view>型号</view>
 									<view>{{item.model}}</view>
 								</view>
@@ -38,7 +46,15 @@
 								</view>
 								<view class="cell-item-info-item ddflex">
 									<view>电压</view>
-									<view>{{item.batVol}}V</view>
+									<view>{{item.batVol?item.batVol:'-'}}V</view>
+								</view>
+								<view class="cell-item-info-item ddflex">
+									<view>电流</view>
+									<view>{{item.chgCur?item.chgCur:'-'}}A</view>
+								</view>
+								<view class="cell-item-info-item ddflex">
+									<view>温度</view>
+									<view>{{item.batTemp?item.batTemp:'-'}}℃</view>
 								</view>
 							</view>
 						</view>
@@ -47,7 +63,10 @@
 						</view>
 					</block>
 				</block>
-				<view class="cell-item-option" @click="jumpUrl('/machineAndCell/machineItemManage/machineItemManage?id='+item.doorId+'&devId='+id)">仓位管理</view>
+				<view class="cell-item-option ddflex">
+					<view class="fflex btn" style="margin-right: 10rpx;" @click.stop="boxEnableChange(item)">{{item.boxEnable==1?'禁用':'启用'}}</view>
+					<view class="fflex btn" @click.stop="open(item)">开仓</view>
+				</view>
 			</view>
 		</view>
 		
@@ -138,6 +157,53 @@
 					}
 				)
 			},
+			
+			// 禁用
+			boxEnableChange(item){
+				let open = item.boxEnable==1?false:true
+				uni.showModal({
+					title:'提示',
+					content:open?'确定启用该仓门?':'确定禁用该仓门?',
+					success: (r) => {
+						if(r.confirm){
+							uni.showLoading({
+								title:open?'启用中':'禁用中',
+							})
+							req.postRequest('/admin/v2/cab/ableDoor',{devId:this.id,doorId:item.doorId,cabEnable:open?1:0},res=>{
+								uni.hideLoading()
+								if(res){
+									req.msg(open?'启用成功':'禁用成功')
+									// if(item.boxEnable == 1){
+									// 	item.boxEnable = 0
+									// }else{
+									// 	item.boxEnable = 1
+									// }
+									// this.groupList = JSON.parse(JSON.stringify(this.groupList))
+								}else {
+									req.msg(open?'启用失败':'禁用失败')
+								}
+								this.getDataList()
+							})
+						}
+						
+					}
+				})
+			},
+			// 开仓
+			open(item){
+				uni.showLoading({
+					title:'开门中',
+				})
+				req.postRequest('/admin/v2/cab/openDoor',{devId:this.id,doorId:item.doorId},res=>{
+					uni.hideLoading()
+					if(res){
+						req.msg('操作成功')
+					}else {
+						req.msg('操作失败')
+					}
+					this.getDataList()
+				})
+			}
 		},
 		mounted() {
 			

+ 4 - 1
pages/machine/machine.vue

@@ -24,7 +24,10 @@
 			<view class="machine-item" v-for="item,index in groupList" @click="jumpUrl('/machineAndCell/machineInfo/machineInfo?id='+item.devId)">
 				<view class="ddflex" style="justify-content: space-between;">
 					<view class="machine-title fflex tover">{{item.devName}}</view>
-					<!-- <view class="state">在线</view> -->
+					<view class="state" v-if="item.online==1">在线</view>
+					<view class="state" style="border-color: #999;color: #999;" v-if="item.online==0">离线</view>
+					<view class="state" style="border-color: #999;color: #999;" v-if="item.online==2">设备未激活</view>
+					<view class="state" style="border-color: #999;color: #999;" v-if="item.online==3">设备禁用</view>
 				</view>
 				<view class="machine-number">机柜编号:{{item.devId}}</view>
 				<view class="machine-info ddflex">

+ 1 - 1
utils/request.js

@@ -8,7 +8,7 @@ const env = {
 		apiUrl: 'https://pkapi.pikadongli.com'
 	},
 	pota: {
-		apiUrl: 'http://192.168.110.182:8098' ,//zf
+		apiUrl: 'http://192.168.110.184:8098' ,//zf
 		// apiUrl: 'http://192.168.110.180:8098' ,//wjg
 	}
 }