Commit 9caf358d by zhangzhen

设备控制功能完善

parent 703db0c7
......@@ -7,36 +7,43 @@
</view>
</view>
<view v-for="(item,index) in list" :key="index" class="card-box">
<view class="store-info">
<view v-if="list.length" v-for="(item,index) in list" :key="index" class="card-box">
<view class="store-info" @tap="onShowDevice(index)">
<view class="flex-row">
<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 class="flex-col part-right">
<view class="flex-between">
<text class="text-black text-bold text-xl">{{item.name}}</text>
<image :src="assetsPath+'/map_icon.png'" mode="widthFix" @tap="onNavLocation(item)"></image>
</view>
<view class="flex-1 flex-between">
<view class="flex-row">
<view class="img">
<image :src="assetsPath+'/location_icon.png'" mode="widthFix"></image>
<view class="">
</view>
<view class="flex-1">
<text class="text-gray">{{item.address}}</text>
</view>
</view>
<text>{{item.show?'收起':'展开'}}</text>
</view>
</view>
</view>
</view>
<view class="room-box">
<view v-for="(val,k) in item.roomVoList" :key='k' class="room-item" @tap='onNavSearch(val)'>
<view class="room-stauts">
<view v-show="item.show" class="room-box">
<view v-for="(val,k) in item.roomVoList" :key='k' class="room-item" >
<!-- <view class="room-stauts">
<image class="img" :src="hostUrl+val.images[0]" mode="heightFix"></image>
</view>
</view> -->
<view class="part-right">
<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>
</view>
<view v-if="val.deviceList" class="flex-col device-list">
......@@ -127,7 +134,7 @@ import moment from "@/common/moment";
return moment(val).format("HH:mm")
}
},
onShow() {
onLoad() {
this.onGetDicts()
},
methods:{
......@@ -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){
uni.openLocation({
latitude: Number(val.latitude),
......@@ -214,20 +205,18 @@ import moment from "@/common/moment";
}
})
},
onNavToList(){
uni.navigateTo({
url:"/pages/cleanRecord/index"
})
},
onNavSearch(val){
if(val.recordsStatus == 0){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
onShowDevice(index){
if(!this.list[index].roomVoList.length){
uni.showToast({
icon:"none",
title:"当前门店暂无房间"
})
return
}
this.list[index].show = !this.list[index].show;
this.$forceUpdate();
},
onDeviceRun(opType,devId){
console.log(opType,devId,989898)
uni.showLoading({
title:"请求中"
})
......@@ -235,7 +224,6 @@ import moment from "@/common/moment";
opType,
devId
}).then(res =>{
console.log(res)
uni.hideLoading()
if(res.data.code ===200){
uni.showToast({
......@@ -266,6 +254,7 @@ import moment from "@/common/moment";
width: 94%;
margin-top: 30upx;
box-shadow: 0 0 8upx #ff55ff;
overflow: hidden;
}
.title-box{
display: flex;
......@@ -311,14 +300,13 @@ import moment from "@/common/moment";
// margin-bottom: 12upx;
border-radius: 20upx 20upx 0 0;
.part-left{
width: 142upx;
height: 128upx;
width: 40%;
height: 200upx;
border-radius: 12upx;
margin-right: 20upx;
overflow: hidden;
.img{
height: 100%;
max-width: 200upx;
}
}
.part-right{
......@@ -337,12 +325,15 @@ import moment from "@/common/moment";
}
.flex-row{
display: flex;
flex: 1;
flex-direction: row;
align-items: center;
width: 80%;
.img{
width: 12px;
margin-right: 8upx;
image{
width: 24upx;
max-height: 50upx;
width: 100%;
}
}
}
}
......@@ -375,13 +366,13 @@ import moment from "@/common/moment";
flex-direction: row;
justify-content: center;
width: 100%;
padding: 12upx 1%;
padding: 18upx 20upx;
border-bottom: 1px solid rgba(0,0,0,0.2);
.room-stauts{
display: flex;
flex-direction: column;
align-items: center;
max-width: 40%;
width: 36%;
height: 200upx;
background: #FFFFFF;
border-radius: 8rpx;
......@@ -399,6 +390,9 @@ import moment from "@/common/moment";
display: flex;
justify-content: space-between;
margin: 12upx;
.flex-row{
align-items: center;
}
}
.device-list{
.part{
......@@ -410,6 +404,9 @@ import moment from "@/common/moment";
}
}
}
.room-item:last-child{
border-bottom: none;
}
.marginLeft{
margin-left: 0;
}
......
......@@ -44,7 +44,7 @@
<view class="flex-col content-box">
<view class="user-action">
<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">
<text class="text-title text-lg">{{item.label}}</text>
</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