Commit 73a675d1 by zhangzhen

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

parent 59a1608b
......@@ -140,7 +140,8 @@ import moment from "@/common/moment";
color:"#ff0000"
}
],
cleanStatusEnum:{}
cleanStatusEnum:{},
userInfo:{}
};
},
filters:{
......@@ -149,6 +150,7 @@ import moment from "@/common/moment";
}
},
onShow() {
this.userInfo = uni.getStorageSync('userInfo')
this.onGetDicts()
},
methods:{
......@@ -169,7 +171,6 @@ import moment from "@/common/moment";
},
onLoading(){
getListStore().then(res=>{
console.log(res)
if(res.data.code ===200){
let list =res.data.data&&res.data.data.length? res.data.data:[];
this.list = list.map(item=>{
......@@ -188,7 +189,6 @@ import moment from "@/common/moment";
},
onNavToInfo(){
getStarOrder().then(res=>{
console.log(res,"查询保洁中的订单")
if(res.data.code === 200){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+res.data.data.id
......@@ -219,7 +219,7 @@ import moment from "@/common/moment";
})
},
onNavSearch(val){
if(val.recordsStatus == 0){
if(val.recordsStatus == 0 || val.recordsUserId === this.userInfo.id){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
})
......
......@@ -30,10 +30,30 @@
<text>{{item.startDate||'-'}}</text>
</view>
<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>{{item.endDate||'-'}}</text>
</view>
<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>{{item.remark||'无'}}</text>
</view>
......@@ -90,7 +110,8 @@ import NoLogin from "@/components/noLogin/noLogin"
pageSize: 10
},
loginStatus:true,
cleanStatusEnum:{}
cleanStatusEnum:{},
userInfo:{}
};
},
onLoad() {
......@@ -103,9 +124,16 @@ import NoLogin from "@/components/noLogin/noLogin"
}
},
onShow() {
this.userInfo = uni.getStorageSync('userInfo')
this.onGetDicts()
},
methods: {
ViewImage(url,index) {
uni.previewImage({
urls: url,
current: index
});
},
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
......@@ -127,13 +155,20 @@ import NoLogin from "@/components/noLogin/noLogin"
})
this.status = 'loading'
cleanList(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
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){
this.list = res.data.rows
this.list = list
}else{
this.list = [...this.list,...res.data.rows]
this.list = [...this.list,...list]
}
if(this.list.length < res.data.total){
this.status = "loadmore"
......@@ -153,12 +188,14 @@ import NoLogin from "@/components/noLogin/noLogin"
this.onLoading()
},
onNavToOrderInfo(val){
if(val.consumerId === this.userInfo.id){
uni.navigateTo({
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.id
})
}
}
}
}
</script>
<style>
page{
......@@ -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>
\ No newline at end of file
......@@ -51,7 +51,7 @@
<text class="text-title">门禁控制</text>
<view v-if="val.deviceList.door.status ==1" class="">
<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 v-else-if="val.deviceList.door.status =='0'" class="">
<text>离线</text>
......@@ -62,7 +62,7 @@
<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(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 v-else class="">
<text>离线</text>
......@@ -134,7 +134,7 @@ import moment from "@/common/moment";
cleanStatusEnum:{},
switchDoor:true,
switchEl:true,
deviceTime:{},
deviceTime:false,
optionStatus:{
10:'开门',
20:'取电',
......@@ -184,13 +184,15 @@ import moment from "@/common/moment";
devType: item.devType,
devId:item.devId,
voltage:item.voltage,
status:item.status
status:item.status,
roomId:val.id
}
}else{
deviceList['el'] = {
devType: item.devType,
devId:item.devId,
status:item.status
status:item.status,
roomId:val.id
}
}
......@@ -234,28 +236,25 @@ import moment from "@/common/moment";
this.$forceUpdate();
},
onSwitchDoor(e){
console.log(e,909090)
let t = e.target.value? 20: 40
this.onDeviceRun(t,e.target.dataset.id)
},
onDeviceRun(opType,devId){
onDeviceRun(opType,roomId){
let that = this;
if(this.deviceTime[devId]){
if(this.deviceTime){
uni.showToast({
icon:"none",
title:"操作频繁,请稍微再试"
})
return
}
this.deviceTime[devId] = true;
this.deviceTime = true;
uni.showLoading({
title:"请求中"
})
deviceRun({
opType,
devId
roomId
}).then(res =>{
uni.hideLoading()
if(res.data.code ===200){
......@@ -263,13 +262,9 @@ import moment from "@/common/moment";
icon:"success",
title:this.optionStatus[opType]+"成功"
})
return ((id)=>{
setTimeout(()=>{
that.deviceTime[id] = false;
that.deviceTime = false;
},5000)
})(devId)
}
})
}
......
......@@ -143,7 +143,18 @@
assetsPath:config.assetsPath,
hostUrl: config.hostUrl,
userInfo:{},
userAction:[
userAction:[],
wifiData:{
name:"",
password:''
},
servicePhone:'',
userName:'',
deviceRole:false
}
},
onShow() {
this.userAction = [
{
label:"订单",
iconUrl:config.assetsPath+'/my_list_15.png',
......@@ -176,17 +187,7 @@
color:"#F1EEFE",
show:false
}
],
wifiData:{
name:"",
password:''
},
servicePhone:'',
userName:'',
deviceRole:false
}
},
onShow() {
];
this.onCheckUserLogin();
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