Commit 73a675d1 by zhangzhen

细节优化,优化保洁相关内容

parent 59a1608b
...@@ -140,7 +140,8 @@ import moment from "@/common/moment"; ...@@ -140,7 +140,8 @@ import moment from "@/common/moment";
color:"#ff0000" color:"#ff0000"
} }
], ],
cleanStatusEnum:{} cleanStatusEnum:{},
userInfo:{}
}; };
}, },
filters:{ filters:{
...@@ -149,6 +150,7 @@ import moment from "@/common/moment"; ...@@ -149,6 +150,7 @@ import moment from "@/common/moment";
} }
}, },
onShow() { onShow() {
this.userInfo = uni.getStorageSync('userInfo')
this.onGetDicts() this.onGetDicts()
}, },
methods:{ methods:{
...@@ -169,7 +171,6 @@ import moment from "@/common/moment"; ...@@ -169,7 +171,6 @@ import moment from "@/common/moment";
}, },
onLoading(){ onLoading(){
getListStore().then(res=>{ getListStore().then(res=>{
console.log(res)
if(res.data.code ===200){ if(res.data.code ===200){
let list =res.data.data&&res.data.data.length? res.data.data:[]; let list =res.data.data&&res.data.data.length? res.data.data:[];
this.list = list.map(item=>{ this.list = list.map(item=>{
...@@ -188,7 +189,6 @@ import moment from "@/common/moment"; ...@@ -188,7 +189,6 @@ import moment from "@/common/moment";
}, },
onNavToInfo(){ onNavToInfo(){
getStarOrder().then(res=>{ getStarOrder().then(res=>{
console.log(res,"查询保洁中的订单")
if(res.data.code === 200){ if(res.data.code === 200){
uni.navigateTo({ uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data.id url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data.id
...@@ -219,7 +219,7 @@ import moment from "@/common/moment"; ...@@ -219,7 +219,7 @@ import moment from "@/common/moment";
}) })
}, },
onNavSearch(val){ onNavSearch(val){
if(val.recordsStatus == 0){ if(val.recordsStatus == 0 || val.recordsUserId === this.userInfo.id){
uni.navigateTo({ uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
}) })
......
...@@ -30,10 +30,30 @@ ...@@ -30,10 +30,30 @@
<text>{{item.startDate||'-'}}</text> <text>{{item.startDate||'-'}}</text>
</view> </view>
<view class="flex-row part-1"> <view class="flex-row part-1">
<view class="flex-1 flex-col">
<text>提交图片:</text>
<view class="flex-row bg-img-box">
<view class="bg-img" v-for="(vals,i) in item.startImage" :key="i" @tap="ViewImage(item.startImage,i)" >
<image :src="vals" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
<view class="flex-row part-1">
<text>完成时间:</text> <text>完成时间:</text>
<text>{{item.endDate||'-'}}</text> <text>{{item.endDate||'-'}}</text>
</view> </view>
<view class="flex-row part-1"> <view class="flex-row part-1">
<view class="flex-1 flex-col">
<text>提交图片:</text>
<view class="flex-row bg-img-box">
<view class="bg-img" v-for="(vals,i) in item.endImage" :key="i" @tap="ViewImage(item.endImage,i)" >
<image :src="vals" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
<view class="flex-row part-1">
<text>备注:</text> <text>备注:</text>
<text>{{item.remark||'无'}}</text> <text>{{item.remark||'无'}}</text>
</view> </view>
...@@ -90,7 +110,8 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -90,7 +110,8 @@ import NoLogin from "@/components/noLogin/noLogin"
pageSize: 10 pageSize: 10
}, },
loginStatus:true, loginStatus:true,
cleanStatusEnum:{} cleanStatusEnum:{},
userInfo:{}
}; };
}, },
onLoad() { onLoad() {
...@@ -103,9 +124,16 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -103,9 +124,16 @@ import NoLogin from "@/components/noLogin/noLogin"
} }
}, },
onShow() { onShow() {
this.userInfo = uni.getStorageSync('userInfo')
this.onGetDicts() this.onGetDicts()
}, },
methods: { methods: {
ViewImage(url,index) {
uni.previewImage({
urls: url,
current: index
});
},
onGetDicts() { onGetDicts() {
let dicts = [] let dicts = []
if (uni.getStorageSync('dicts')) { if (uni.getStorageSync('dicts')) {
...@@ -127,13 +155,20 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -127,13 +155,20 @@ import NoLogin from "@/components/noLogin/noLogin"
}) })
this.status = 'loading' this.status = 'loading'
cleanList(this.queryParams).then(res => { cleanList(this.queryParams).then(res => {
console.log(res)
uni.hideLoading() uni.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
let list = res.data.rows.map(item=>{
return {
...item,
startImage:item.startImage? item.startImage.split(','):[],
endImage: item.endImage? item.endImage.split(','):[]
}
})
if(this.queryParams.pageNum ==1){ if(this.queryParams.pageNum ==1){
this.list = res.data.rows this.list = list
}else{ }else{
this.list = [...this.list,...res.data.rows] this.list = [...this.list,...list]
} }
if(this.list.length < res.data.total){ if(this.list.length < res.data.total){
this.status = "loadmore" this.status = "loadmore"
...@@ -153,12 +188,14 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -153,12 +188,14 @@ import NoLogin from "@/components/noLogin/noLogin"
this.onLoading() this.onLoading()
}, },
onNavToOrderInfo(val){ onNavToOrderInfo(val){
if(val.consumerId === this.userInfo.id){
uni.navigateTo({ uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.id url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.id
}) })
} }
} }
} }
}
</script> </script>
<style> <style>
page{ page{
...@@ -192,4 +229,17 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -192,4 +229,17 @@ import NoLogin from "@/components/noLogin/noLogin"
} }
} }
} }
.bg-img-box{
display: flex;
flex-wrap: wrap;
.bg-img{
width: 48%;
height: 200upx;
margin: 10upx 1%;
image{
width: 100%;
height: 100%;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<text class="text-title">门禁控制</text> <text class="text-title">门禁控制</text>
<view v-if="val.deviceList.door.status ==1" class=""> <view v-if="val.deviceList.door.status ==1" class="">
<text>电量:{{val.deviceList.door.voltage}}</text> <text>电量:{{val.deviceList.door.voltage}}</text>
<button @tap="onDeviceRun(10,val.deviceList.door.devId)" class="cu-btn bg-blue margin-left-sm">开启</button> <button @tap="onDeviceRun(10,val.deviceList.door.roomId)" class="cu-btn bg-blue margin-left-sm">开启</button>
</view> </view>
<view v-else-if="val.deviceList.door.status =='0'" class=""> <view v-else-if="val.deviceList.door.status =='0'" class="">
<text>离线</text> <text>离线</text>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<view v-if="val.deviceList.el.status >=1" class=""> <view v-if="val.deviceList.el.status >=1" class="">
<!-- <button @tap="onDeviceRun(20,val.deviceList.el.devId)" class="cu-btn bg-blue margin-right-sm">开启</button> <!-- <button @tap="onDeviceRun(20,val.deviceList.el.devId)" class="cu-btn bg-blue margin-right-sm">开启</button>
<button @tap="onDeviceRun(40,val.deviceList.el.devId)" class="cu-btn bg-blue">关闭</button> --> <button @tap="onDeviceRun(40,val.deviceList.el.devId)" class="cu-btn bg-blue">关闭</button> -->
<switch data-type="door" :data-index="index" :data-k="k" :data-id="val.deviceList.el.devId" @change="onSwitchDoor" :class="val.deviceList.el.status==3?'checked':''" :checked="val.deviceList.el.status==3?true:false" color="#e54d42"></switch> <switch data-type="door" :data-index="index" :data-k="k" :data-id="val.deviceList.el.roomId" @change="onSwitchDoor" :class="val.deviceList.el.status==3?'checked':''" :checked="val.deviceList.el.status==3?true:false" color="#e54d42"></switch>
</view> </view>
<view v-else class=""> <view v-else class="">
<text>离线</text> <text>离线</text>
...@@ -134,7 +134,7 @@ import moment from "@/common/moment"; ...@@ -134,7 +134,7 @@ import moment from "@/common/moment";
cleanStatusEnum:{}, cleanStatusEnum:{},
switchDoor:true, switchDoor:true,
switchEl:true, switchEl:true,
deviceTime:{}, deviceTime:false,
optionStatus:{ optionStatus:{
10:'开门', 10:'开门',
20:'取电', 20:'取电',
...@@ -184,13 +184,15 @@ import moment from "@/common/moment"; ...@@ -184,13 +184,15 @@ import moment from "@/common/moment";
devType: item.devType, devType: item.devType,
devId:item.devId, devId:item.devId,
voltage:item.voltage, voltage:item.voltage,
status:item.status status:item.status,
roomId:val.id
} }
}else{ }else{
deviceList['el'] = { deviceList['el'] = {
devType: item.devType, devType: item.devType,
devId:item.devId, devId:item.devId,
status:item.status status:item.status,
roomId:val.id
} }
} }
...@@ -234,28 +236,25 @@ import moment from "@/common/moment"; ...@@ -234,28 +236,25 @@ import moment from "@/common/moment";
this.$forceUpdate(); this.$forceUpdate();
}, },
onSwitchDoor(e){ onSwitchDoor(e){
console.log(e,909090)
let t = e.target.value? 20: 40 let t = e.target.value? 20: 40
this.onDeviceRun(t,e.target.dataset.id) this.onDeviceRun(t,e.target.dataset.id)
}, },
onDeviceRun(opType,devId){ onDeviceRun(opType,roomId){
let that = this; let that = this;
if(this.deviceTime[devId]){ if(this.deviceTime){
uni.showToast({ uni.showToast({
icon:"none", icon:"none",
title:"操作频繁,请稍微再试" title:"操作频繁,请稍微再试"
}) })
return return
} }
this.deviceTime[devId] = true; this.deviceTime = true;
uni.showLoading({ uni.showLoading({
title:"请求中" title:"请求中"
}) })
deviceRun({ deviceRun({
opType, opType,
devId roomId
}).then(res =>{ }).then(res =>{
uni.hideLoading() uni.hideLoading()
if(res.data.code ===200){ if(res.data.code ===200){
...@@ -263,13 +262,9 @@ import moment from "@/common/moment"; ...@@ -263,13 +262,9 @@ import moment from "@/common/moment";
icon:"success", icon:"success",
title:this.optionStatus[opType]+"成功" title:this.optionStatus[opType]+"成功"
}) })
return ((id)=>{
setTimeout(()=>{ setTimeout(()=>{
that.deviceTime[id] = false; that.deviceTime = false;
},5000) },5000)
})(devId)
} }
}) })
} }
......
...@@ -143,7 +143,18 @@ ...@@ -143,7 +143,18 @@
assetsPath:config.assetsPath, assetsPath:config.assetsPath,
hostUrl: config.hostUrl, hostUrl: config.hostUrl,
userInfo:{}, userInfo:{},
userAction:[ userAction:[],
wifiData:{
name:"",
password:''
},
servicePhone:'',
userName:'',
deviceRole:false
}
},
onShow() {
this.userAction = [
{ {
label:"订单", label:"订单",
iconUrl:config.assetsPath+'/my_list_15.png', iconUrl:config.assetsPath+'/my_list_15.png',
...@@ -176,17 +187,7 @@ ...@@ -176,17 +187,7 @@
color:"#F1EEFE", color:"#F1EEFE",
show:false show:false
} }
], ];
wifiData:{
name:"",
password:''
},
servicePhone:'',
userName:'',
deviceRole:false
}
},
onShow() {
this.onCheckUserLogin(); this.onCheckUserLogin();
this.onGetSysConfig(); this.onGetSysConfig();
}, },
......
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