Commit 5cae7c58 by zhangzhen

细节优化

parent 10559ee4
......@@ -112,44 +112,27 @@
onGetOrderByAvailable(i){
getOrderByAvailable().then(res=>{
if(res.data.code === 200){
if(res.data.data&&res.data.data.length===1){
this.orderInfo = res.data.data[0];
if(i === 3){
if(this.orderInfo.status ==1){
// 去续单
if(res.data.data&&res.data.data.length){
let arr = res.data.data.filter(item => item.status);
if(arr.length && arr.length ==1){
this.orderInfo = arr[0];
if( i==3 ){
// 续单
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
url:`/pages/order/order?orderNo=${this.orderInfo.orderNo}`
})
}else{
uni.showToast({
icon:"none",
title:"无使用中的订单,无法续单哦!"
})
}
}else{
// 去开门
this.onOpenDoor()
}
}else if(res.data.data&&res.data.data.length > 1){
let list = res.data.data.filter(item=> item.status ==1)
if(list.length ===1){
this.orderInfo = list[0];
if(i === 3){
// 去续单
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else{
// 去开门
} else{
// 开门
this.onOpenDoor()
}
}else{
} else if(arr.length && arr.length >1){
uni.switchTab({
url:"/pages/orderRecord/orderRecord"
url:"/pages/orderRecord/orderRecord?index=2"
})
}else{
uni.showToast({
icon:"none",
title:"暂无可用的订单,请先下单预约哦!"
})
}
}else{
......
......@@ -182,7 +182,10 @@ import NoLogin from "@/components/noLogin/noLogin"
listBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
onLoad() {
onLoad(option) {
if(option.index){
this.statusIndex = option.index
}
// 隐藏原生的tabbar
uni.hideTabBar();
},
......
......@@ -101,7 +101,7 @@
<view class="part">
<button class="cu-btn block round line-pink lg" open-type="share">分享好友</button>
</view>
<view v-if="continStatus || orderInfo.status ==1" class="part">
<view v-if=" continStatus || orderInfo.status ==1 " class="part">
<button class="cu-btn block round bg-mauve lg" @tap="onCheckLogin">房间续单</button>
</view>
</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