Commit cef2fe61 authored by zhengke's avatar zhengke

修改酒店

parent 1fcc95e0
......@@ -851,6 +851,7 @@ export default {
this.SimilarMsg.departureDate = msgList.departureDate;
this.SimilarMsg.searchroomGroup = msgList.searchroomGroup;
this.room = msgList.room;
this.auditNum = msgList.auditNum;
this.getList();
this.getSimilar();
}
......@@ -1219,7 +1220,7 @@ export default {
},
//点击预订传递参数
bookHotel(roomOptionCd){
if(!localStorage.OpenB2BCode && !localStorage.userInfo){
if(sessionStorage.getItem('OpenB2BCode')==null && !localStorage.userInfo){
return this.Error('请登录!')
}
......
......@@ -339,7 +339,7 @@ export default {
if (url.indexOf("?") != -1) {
let str = url.split("?")[1];
let uid = str.split("uid=")[1];
localStorage.setItem("OpenB2BCode", decodeURIComponent(uid));
sessionStorage.setItem("OpenB2BCode", decodeURIComponent(uid));
}
},
methods: {
......
......@@ -1078,7 +1078,7 @@ export default {
this.PassMsg.lowrateBySetCurrency = item.lowrateBySetCurrency;
this.PassMsg.room = this.room
this.PassMsg.auditNum = this.auditNum;
sessionStorage.setItem("HotelDetail", JSON.stringify(this.PassMsg));
this.$router.push({
path:"/HotelDetail"
......
......@@ -177,7 +177,7 @@ export default {
this.TotalPrice=this.msgList.bookMoney;
this.bookingNumber=this.msgList.orderId;
}
if(localStorage.OpenB2BCode){
if(sessionStorage.getItem('OpenB2BCode')){
this.isShowBtn=false;
}
},
......
......@@ -308,6 +308,16 @@
.HS_FFEI:last-child{
visibility: hidden;
}
.cantBaoChild{
color:red;
}
.disBtn{
background-color: gray;
cursor: default;
}
.disBtn:hover{
opacity: 1;
}
</style>
......@@ -353,6 +363,7 @@
<li class="HS2_title">入住人数</li>
<li>成人 {{auditNum}}人</li>
<li>儿童 {{childNum}}人</li>
<li v-if="isBaoChild"><span class="cantBaoChild">不能报入儿童</span></li>
</ul>
</div>
<div class="HS_div2One">
......@@ -494,7 +505,7 @@
</ul>
</div>
</div>
<input type="button" class="HD_payBtn" @click="submitForm('sureMsg')" value="下单" />
<input type="button" class="HD_payBtn" :class="{'disBtn':isBaoChild}" @click="submitForm('sureMsg')" value="下单" />
</div>
<div class="HS_RightList">
<div class="HS_RightTopImg">
......@@ -718,6 +729,11 @@ export default {
//传递的图片
HotelImgUrl:'',
dataList:[],
//孩子能否报入
TotalChildCount:0,
//选了的儿童数
chekedChildCount:0,
isBaoChild:false
};
},
mounted() {
......@@ -763,6 +779,9 @@ export default {
}
this.sureMsg.totalChargeableRateInfo=0;
this.sureMsg.totalPriceJapanese=0;
console.log(this.dataList,'datalistss');
this.TotalChildCount = 0;
let rateGrouoLen = 0;
this.dataList.roomGroup.forEach(x=>{
if(Object.prototype.toString.call(x.rateGroup) == '[object Object]'){
let arr = [];
......@@ -780,27 +799,43 @@ export default {
let ChildJapanPrice = 0;
let AdultJapanCount = 0;
let childJapanCount = 0;
this.TotalChildCount+=x.roomChildCount*x.rateGroup.length;
rateGrouoLen+= x.rateGroup.length;
this.chekedChildCount = this.childNum*rateGrouoLen;
if(this.TotalChildCount<this.chekedChildCount){
this.isBaoChild=true;
}
x.rateGroup.forEach(z=>{
if(z.perAdultRateBySetCurrency){
AdultTotalPrice+=parseFloat(z.perAdultRateBySetCurrency);
childToTalPrice+=parseFloat(z.perChildRateBySetCurrency);
if(x.roomAdultCount>0){
AdultTotalPrice+=parseFloat(z.perAdultRateBySetCurrency);
}
if(x.roomChildCount>0){
childToTalPrice+=parseFloat(z.perChildRateBySetCurrency);
}
}
if(z.perAdultRate){
AdultJapanPrice+=parseFloat(z.perAdultRate);
ChildJapanPrice+=parseFloat(z.perChildRate);
}
})
AdultCount+=AdultTotalPrice*x.roomAdultCount;
childCount+=childToTalPrice*x.roomChildCount;
// AdultCount+=AdultTotalPrice*x.roomAdultCount;
// childCount+=childToTalPrice*x.roomChildCount;
AdultCount+=AdultTotalPrice;
childCount+=childToTalPrice;
this.sureMsg.totalChargeableRateInfo += parseFloat(AdultCount+childCount);
AdultJapanCount+=AdultJapanPrice*x.roomAdultCount;
childJapanCount+=ChildJapanPrice*x.roomChildCount;
// AdultJapanCount+=AdultJapanPrice*x.roomAdultCount;
// childJapanCount+=ChildJapanPrice*x.roomChildCount;
AdultJapanCount+=AdultJapanPrice;
childJapanCount+=ChildJapanPrice;
this.sureMsg.totalPriceJapanese += parseFloat(AdultJapanCount+childJapanCount);
})
} else {
this.Error(res.data.message);
}
......@@ -867,29 +902,31 @@ export default {
//提交
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.BuyHoTel();
} else {
return false;
}
});
if(!this.isBaoChild){
this.$refs[addMsg].validate(valid => {
if (valid) {
this.BuyHoTel();
} else {
return false;
}
});
}
},
//点击下单
BuyHoTel(){
if(!localStorage.OpenB2BCode && !localStorage.userInfo){
if(sessionStorage.getItem('OpenB2BCode')==null && !localStorage.userInfo){
return this.Error('请登录!')
}
//判断是否为登录状态
if(localStorage.userInfo){
localStorage.removeItem("OpenB2BCode");
sessionStorage.removeItem("OpenB2BCode");
this.sureMsg.EmployeeIdStr='';
let userInfo = this.getLocalStorage();
this.sureMsg.CustomerId = userInfo.customerId;
}
//判断是否跳过来的
if(localStorage.OpenB2BCode){
this.sureMsg.EmployeeIdStr= localStorage.getItem('OpenB2BCode');
if(sessionStorage.getItem('OpenB2BCode')){
this.sureMsg.EmployeeIdStr= sessionStorage.getItem('OpenB2BCode');
}
this.sureMsg.hotelId = this.msg.hotelId;
......
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