Commit 1f44c1fd by zhangzhen

细节优化

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