Commit e843ef29 by zhangzhen

优化

parent 361304c6
......@@ -52,8 +52,8 @@
key: uni.getStorageSync('tokenHeaders'),
data: res.data.data.token
})
that.$emit('success')
that.onGetUserInfoToSave()
that.$emit('success')
} else {
uni.removeStorageSync('tokenHeaders')
this.$refs.popupPhone.open();
......
......@@ -1028,7 +1028,8 @@
storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id,
day: this.dateList[this.dateIndex].readDate,
orderType: this.orderType
orderType: this.orderType,
orderId: this.orderType==2? this.orderInfo.id : ""
}).then(res => {
uni.hideLoading()
this.dateIntervalList = res.data.data.map((item, index) => {
......@@ -1493,6 +1494,10 @@
let startStemp = moment(startDate).valueOf();
let endStemp = startStemp + stempLong;
if(this.orderType == 2){
endStemp = endStemp + 30*60*1000
}
let nextStatus = false;
this.dateIntervalList.forEach((item,k) =>{
if(nextStatus) return;
......@@ -1512,18 +1517,26 @@
nextStatus = true;
console.log("节点2")
}
if( endStemp > moment(item.startHoldTime).valueOf() && endStemp <= moment(item.endHoldTime).valueOf()){
useStatus = true;
nextStatus = true;
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;
nextStatus = true;
console.log("节点5")
}else{
console.log("节点4")
}
} 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()){
useStatus = true;
nextStatus = true;
......@@ -1535,7 +1548,13 @@
nextStatus = true;
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 @@
<button class="cu-btn block round line-pink lg" open-type="share">分享好友</button>
</view>
<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>
......@@ -130,6 +130,9 @@
<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>
<LoginPop ref="loginPop" @success='onNavToOrder' />
</view>
</template>
......@@ -141,10 +144,12 @@
import moment from "@/common/moment_zh_cn.js";
import config from "@/config/index.config"
import {listSortDistance} from "@/api/store.js";
import LoginPop from "@/components/login/login"
export default {
components:{
fNavbar
fNavbar,
LoginPop
},
data() {
return {
......@@ -332,6 +337,13 @@
}
})
},
onCheckLogin(){
if(this.shareOrder){
this.$refs.loginPop.open();
}else{
this.onNavToOrder()
}
},
onNavToOrder(){
uni.showLoading({
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