Commit 5cae7c58 by zhangzhen

细节优化

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