Commit 9caf358d by zhangzhen

设备控制功能完善

parent 703db0c7
...@@ -7,36 +7,43 @@ ...@@ -7,36 +7,43 @@
</view> </view>
</view> </view>
<view v-for="(item,index) in list" :key="index" class="card-box"> <view v-if="list.length" v-for="(item,index) in list" :key="index" class="card-box">
<view class="store-info"> <view class="store-info" @tap="onShowDevice(index)">
<view class="flex-row"> <view class="flex-row">
<view class="part-left"> <view class="part-left">
<image class="img" :src="hostUrl+item.images" mode="heightFix"></image> <image class="img" :src="hostUrl+item.images" mode="aspectFill"></image>
</view> </view>
<view class="flex-col part-right"> <view class="flex-col part-right">
<view class="flex-between"> <view class="flex-between">
<text class="text-black text-bold text-xl">{{item.name}}</text> <text class="text-black text-bold text-xl">{{item.name}}</text>
<image :src="assetsPath+'/map_icon.png'" mode="widthFix" @tap="onNavLocation(item)"></image> <image :src="assetsPath+'/map_icon.png'" mode="widthFix" @tap="onNavLocation(item)"></image>
</view> </view>
<view class="flex-1 flex-between">
<view class="flex-row"> <view class="flex-row">
<view class="img">
<image :src="assetsPath+'/location_icon.png'" mode="widthFix"></image> <image :src="assetsPath+'/location_icon.png'" mode="widthFix"></image>
<view class=""> </view>
<view class="flex-1">
<text class="text-gray">{{item.address}}</text> <text class="text-gray">{{item.address}}</text>
</view> </view>
</view> </view>
<text>{{item.show?'收起':'展开'}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="room-box"> <view v-show="item.show" class="room-box">
<view v-for="(val,k) in item.roomVoList" :key='k' class="room-item" @tap='onNavSearch(val)'> <view v-for="(val,k) in item.roomVoList" :key='k' class="room-item" >
<view class="room-stauts"> <!-- <view class="room-stauts">
<image class="img" :src="hostUrl+val.images[0]" mode="heightFix"></image> <image class="img" :src="hostUrl+val.images[0]" mode="heightFix"></image>
</view> </view> -->
<view class="part-right"> <view class="part-right">
<view class="room-name"> <view class="room-name">
<text class="text-xxl text-pink">{{val.name}}</text> <view class="flex-row">
<text class="text-title">房间名称:</text> <text class="text-xxl text-pink">{{val.name}}</text>
</view>
<text class="text-sm" :style="{color: colorEnum[val.colorStatus]}">{{statusEnum[val.colorStatus]}}</text> <text class="text-sm" :style="{color: colorEnum[val.colorStatus]}">{{statusEnum[val.colorStatus]}}</text>
</view> </view>
<view v-if="val.deviceList" class="flex-col device-list"> <view v-if="val.deviceList" class="flex-col device-list">
...@@ -127,7 +134,7 @@ import moment from "@/common/moment"; ...@@ -127,7 +134,7 @@ import moment from "@/common/moment";
return moment(val).format("HH:mm") return moment(val).format("HH:mm")
} }
}, },
onShow() { onLoad() {
this.onGetDicts() this.onGetDicts()
}, },
methods:{ methods:{
...@@ -183,26 +190,10 @@ import moment from "@/common/moment"; ...@@ -183,26 +190,10 @@ import moment from "@/common/moment";
}):[] }):[]
} }
}) })
console.log(this.list,90909090)
} }
}) })
}, },
onNavToInfo(){
getStarOrder().then(res=>{
console.log(res,"查询保洁中的订单")
if(res.data.code === 200){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data.id
})
}else{
uni.showToast({
icon:'none',
title:res.data.msg
})
}
})
},
onNavLocation(val){ onNavLocation(val){
uni.openLocation({ uni.openLocation({
latitude: Number(val.latitude), latitude: Number(val.latitude),
...@@ -214,20 +205,18 @@ import moment from "@/common/moment"; ...@@ -214,20 +205,18 @@ import moment from "@/common/moment";
} }
}) })
}, },
onNavToList(){ onShowDevice(index){
uni.navigateTo({ if(!this.list[index].roomVoList.length){
url:"/pages/cleanRecord/index" uni.showToast({
}) icon:"none",
}, title:"当前门店暂无房间"
onNavSearch(val){
if(val.recordsStatus == 0){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
}) })
return
} }
this.list[index].show = !this.list[index].show;
this.$forceUpdate();
}, },
onDeviceRun(opType,devId){ onDeviceRun(opType,devId){
console.log(opType,devId,989898)
uni.showLoading({ uni.showLoading({
title:"请求中" title:"请求中"
}) })
...@@ -235,7 +224,6 @@ import moment from "@/common/moment"; ...@@ -235,7 +224,6 @@ import moment from "@/common/moment";
opType, opType,
devId devId
}).then(res =>{ }).then(res =>{
console.log(res)
uni.hideLoading() uni.hideLoading()
if(res.data.code ===200){ if(res.data.code ===200){
uni.showToast({ uni.showToast({
...@@ -266,6 +254,7 @@ import moment from "@/common/moment"; ...@@ -266,6 +254,7 @@ import moment from "@/common/moment";
width: 94%; width: 94%;
margin-top: 30upx; margin-top: 30upx;
box-shadow: 0 0 8upx #ff55ff; box-shadow: 0 0 8upx #ff55ff;
overflow: hidden;
} }
.title-box{ .title-box{
display: flex; display: flex;
...@@ -311,14 +300,13 @@ import moment from "@/common/moment"; ...@@ -311,14 +300,13 @@ import moment from "@/common/moment";
// margin-bottom: 12upx; // margin-bottom: 12upx;
border-radius: 20upx 20upx 0 0; border-radius: 20upx 20upx 0 0;
.part-left{ .part-left{
width: 142upx; width: 40%;
height: 128upx; height: 200upx;
border-radius: 12upx; border-radius: 12upx;
margin-right: 20upx; margin-right: 20upx;
overflow: hidden; overflow: hidden;
.img{ .img{
height: 100%; height: 100%;
max-width: 200upx;
} }
} }
.part-right{ .part-right{
...@@ -337,12 +325,15 @@ import moment from "@/common/moment"; ...@@ -337,12 +325,15 @@ import moment from "@/common/moment";
} }
.flex-row{ .flex-row{
display: flex; display: flex;
flex: 1;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
width: 80%;
.img{
width: 12px;
margin-right: 8upx;
image{ image{
width: 24upx; width: 100%;
max-height: 50upx; }
} }
} }
} }
...@@ -375,13 +366,13 @@ import moment from "@/common/moment"; ...@@ -375,13 +366,13 @@ import moment from "@/common/moment";
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
padding: 12upx 1%; padding: 18upx 20upx;
border-bottom: 1px solid rgba(0,0,0,0.2); border-bottom: 1px solid rgba(0,0,0,0.2);
.room-stauts{ .room-stauts{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
max-width: 40%; width: 36%;
height: 200upx; height: 200upx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 8rpx; border-radius: 8rpx;
...@@ -399,6 +390,9 @@ import moment from "@/common/moment"; ...@@ -399,6 +390,9 @@ import moment from "@/common/moment";
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 12upx; margin: 12upx;
.flex-row{
align-items: center;
}
} }
.device-list{ .device-list{
.part{ .part{
...@@ -410,6 +404,9 @@ import moment from "@/common/moment"; ...@@ -410,6 +404,9 @@ import moment from "@/common/moment";
} }
} }
} }
.room-item:last-child{
border-bottom: none;
}
.marginLeft{ .marginLeft{
margin-left: 0; margin-left: 0;
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<view class="flex-col content-box"> <view class="flex-col content-box">
<view class="user-action"> <view class="user-action">
<view v-for="(item,k) in userAction" :key="k" class="action-box" > <view v-for="(item,k) in userAction" :key="k" class="action-box" >
<view v-if="item.show|| userInfo.roleType =='1'" :style="{background:item.color}" class="action-item" @tap="onActionNav(item,k)"> <view v-if="item.show|| userInfo.roleType >= 1" :style="{background:item.color}" class="action-item" @tap="onActionNav(item,k)">
<view class="flex-1"> <view class="flex-1">
<text class="text-title text-lg">{{item.label}}</text> <text class="text-title text-lg">{{item.label}}</text>
</view> </view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment