Commit 1f44c1fd by zhangzhen

细节优化

parent ad47109d
......@@ -84,7 +84,7 @@
</view>
<view class="open-door-btn">
<button class="cu-btn block bg-pink margin-tb-sm lg" type="" @tap="onOpenDoorByCleaner">开门</button>
<button class="cu-btn block margin-tb-sm lg" type="" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoorByCleaner">开门</button>
</view>
</view>
......@@ -104,7 +104,8 @@
orderInfo:{},
cleanStatusEnum:{},
orderId:'',
openDoor:false
openDoor:false,
openDoorStatus:false
};
},
onLoad(option) {
......@@ -131,7 +132,6 @@
onLoading(){
this.imgList = []
getInfoById(this.orderId).then(res=>{
console.log(res,90909090)
if(res.data.code === 200){
this.orderInfo = {
...res.data.data,
......@@ -201,6 +201,20 @@
this.textareaBValue = e.detail.value
},
onOpenDoorByCleaner(){
if(this.openDoorStatus){
uni.showToast({
icon:"none",
title:"请勿频繁进行开门操作"
})
return
}
uni.showLoading({
title:"开门中..."
})
this.openDoorStatus = true;
openDoorByCleaner({
roomId: this.orderInfo.roomId
}).then(res=>{
......@@ -211,6 +225,9 @@
icon:'success',
title:'开门成功'
})
setTimeout(()=>{
this.openDoorStatus = false;
},5000)
}
})
},
......
......@@ -86,7 +86,7 @@
</view>
<view class="flex-between btn-box">
<view class="part">
<button class="cu-btn block round bg-pink lg" @tap="onOpenDoor">进店开门</button>
<button class="cu-btn block round bg-pink lg" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoor">进店开门</button>
</view>
<view class="part">
<button class="cu-btn block round line-pink lg" @tap="onNavToShare">分享好友</button>
......@@ -144,7 +144,8 @@
assetsPath: config.assetsPath,
hostUrl:config.hostUrl,
orderStatusEnum:{},
roomTypeEnum:{}
roomTypeEnum:{},
openDoorStatus:false
};
},
onLoad(option) {
......@@ -200,18 +201,28 @@
},
onOpenDoor(){
if(this.orderInfo.status <=1){
if(this.openDoorStatus){
uni.showToast({
icon:"none",
title:"请勿频繁进行开门操作"
})
return
}
uni.showLoading({
title:"开门中..."
})
this.openDoorStatus = true;
openDoor(this.orderNo).then(res=>{
uni.hideLoading()
uni.showToast({
icon:"none",
title:res.data.msg
})
setTimeout(()=>{
this.openDoorStatus = false;
},5000)
})
}
},
onNavToMap() {
uni.openLocation({
......
......@@ -17,7 +17,7 @@
<view class="flex-between btn-box">
<view class="part">
<button class="cu-btn block round bg-white lg" @tap="onOpenDoor">进店开门</button>
<button class="cu-btn block round bg-white lg" :class="openDoorStatus?'bg-gray':'bg-white'" @tap="onOpenDoor">进店开门</button>
</view>
<view class="part">
<button class="cu-btn block round line-white lg" @tap="onNavToMap">门店导航</button>
......@@ -60,6 +60,7 @@
colorLight: '#ffffff',
orderNo: '',
orderInfo: '',
openDoorStatus:false
};
},
filters:{
......@@ -110,15 +111,26 @@
this.qrPath = r;
},
onOpenDoor(){
if(this.openDoorStatus){
uni.showToast({
icon:"none",
title:"请勿频繁进行开门操作"
})
return
}
uni.showLoading({
title:"开门中..."
})
this.openDoorStatus = true;
openDoor(this.orderNo).then(res=>{
uni.hideLoading()
uni.showToast({
icon:"none",
title:res.data.msg
})
setTimeout(()=>{
this.openDoorStatus = false
},5000)
})
},
onNavToMap() {
......
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