Commit e843ef29 by zhangzhen

优化

parent 361304c6
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
key: uni.getStorageSync('tokenHeaders'), key: uni.getStorageSync('tokenHeaders'),
data: res.data.data.token data: res.data.data.token
}) })
that.$emit('success')
that.onGetUserInfoToSave() that.onGetUserInfoToSave()
that.$emit('success')
} else { } else {
uni.removeStorageSync('tokenHeaders') uni.removeStorageSync('tokenHeaders')
this.$refs.popupPhone.open(); this.$refs.popupPhone.open();
......
...@@ -1028,7 +1028,8 @@ ...@@ -1028,7 +1028,8 @@
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
day: this.dateList[this.dateIndex].readDate, day: this.dateList[this.dateIndex].readDate,
orderType: this.orderType orderType: this.orderType,
orderId: this.orderType==2? this.orderInfo.id : ""
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
this.dateIntervalList = res.data.data.map((item, index) => { this.dateIntervalList = res.data.data.map((item, index) => {
...@@ -1493,6 +1494,10 @@ ...@@ -1493,6 +1494,10 @@
let startStemp = moment(startDate).valueOf(); let startStemp = moment(startDate).valueOf();
let endStemp = startStemp + stempLong; let endStemp = startStemp + stempLong;
if(this.orderType == 2){
endStemp = endStemp + 30*60*1000
}
let nextStatus = false; let nextStatus = false;
this.dateIntervalList.forEach((item,k) =>{ this.dateIntervalList.forEach((item,k) =>{
if(nextStatus) return; if(nextStatus) return;
...@@ -1512,18 +1517,26 @@ ...@@ -1512,18 +1517,26 @@
nextStatus = true; nextStatus = true;
console.log("节点2") console.log("节点2")
} }
if( endStemp > moment(item.startHoldTime).valueOf() && endStemp <= moment(item.endHoldTime).valueOf()){ if( endStemp > moment(item.startHoldTime).valueOf() && endStemp <= moment(item.endHoldTime).valueOf()){
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
console.log("节点3") console.log("节点3")
} }
} else if(this.orderType == 2){
if( m <60 && !(startStemp >= moment(item.endHoldTime).valueOf() && endStemp < end) ){ if(startStemp <= moment(item.endHoldTime).valueOf() && endStemp >= moment(item.startHoldTime).valueOf()){
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
console.log("节点5") console.log("节点4")
}else{ }
} else if(this.orderType == 2){
// if( m <= 60 && !(startStemp >= moment(item.endHoldTime).valueOf() && endStemp < end) ){
// useStatus = true;
// nextStatus = true;
// console.log("节点5")
// }
if( startStemp > moment(item.startHoldTime).valueOf() && startStemp < moment(item.endHoldTime).valueOf()){ if( startStemp > moment(item.startHoldTime).valueOf() && startStemp < moment(item.endHoldTime).valueOf()){
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
...@@ -1535,7 +1548,13 @@ ...@@ -1535,7 +1548,13 @@
nextStatus = true; nextStatus = true;
console.log("节点3") console.log("节点3")
} }
}
if(startStemp < moment(item.endHoldTime).valueOf() && endStemp >= moment(item.startHoldTime).valueOf()){
useStatus = true;
nextStatus = true;
console.log("节点4")
}
} }
} }
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<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="onNavToOrder">房间续单</button> <button class="cu-btn block round bg-mauve lg" @tap="onCheckLogin">房间续单</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -130,6 +130,9 @@ ...@@ -130,6 +130,9 @@
<uni-popup ref="popup" type="dialog"> <uni-popup ref="popup" type="dialog">
<uni-popup-dialog mode="base" content="请确认是否退单" :duration="2000" :before-close="true" @close="close" @confirm="confirm"></uni-popup-dialog> <uni-popup-dialog mode="base" content="请确认是否退单" :duration="2000" :before-close="true" @close="close" @confirm="confirm"></uni-popup-dialog>
</uni-popup> </uni-popup>
<LoginPop ref="loginPop" @success='onNavToOrder' />
</view> </view>
</template> </template>
...@@ -141,10 +144,12 @@ ...@@ -141,10 +144,12 @@
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
import config from "@/config/index.config" import config from "@/config/index.config"
import {listSortDistance} from "@/api/store.js"; import {listSortDistance} from "@/api/store.js";
import LoginPop from "@/components/login/login"
export default { export default {
components:{ components:{
fNavbar fNavbar,
LoginPop
}, },
data() { data() {
return { return {
...@@ -332,6 +337,13 @@ ...@@ -332,6 +337,13 @@
} }
}) })
}, },
onCheckLogin(){
if(this.shareOrder){
this.$refs.loginPop.open();
}else{
this.onNavToOrder()
}
},
onNavToOrder(){ onNavToOrder(){
uni.showLoading({ uni.showLoading({
title:'加载中' title:'加载中'
......
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