Commit 556e6e34 authored by youjie's avatar youjie

酒店

parent ecdaa904
...@@ -64,15 +64,26 @@ ...@@ -64,15 +64,26 @@
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotel4stars.png', 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotel4stars.png',
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotel5stars.png', 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotel5stars.png',
], ],
myDayObj:null,
} }
}, },
created() { created() {
// console.log(this.HotelList, 'hotel'); // console.log(this.HotelList, 'hotel');
}, },
watch:{
dayObj: {
handler (val, oldval) {
if(val){
this.myDayObj = val
}
},
deep: true,
immediate: true
}
},
methods:{ methods:{
goHotelDetail(id){ goHotelDetail(id){
console.log(this.dayObj,'id'); let myDayObj = JSON.stringify(this.myDayObj);
let myDayObj = JSON.stringify(this.dayObj);
uni.navigateTo({ uni.navigateTo({
url: "/pages/hotel/detail?id=" + id + '&dayObj=' + myDayObj+'&searchObj='+JSON.stringify(this.searchObj) url: "/pages/hotel/detail?id=" + id + '&dayObj=' + myDayObj+'&searchObj='+JSON.stringify(this.searchObj)
}); });
......
...@@ -107,7 +107,8 @@ ...@@ -107,7 +107,8 @@
</text> </text>
</li> </li>
</ul> --> </ul> -->
<view class="big-titleAssis2">客房信息 <view class="big-titleAssis2">
<!-- 客房信息 -->
<view class="hotelSheShitisp">酒店全部客房设施信息仅供参考,可能与您入住的房型略有差异,请知晓</view> <view class="hotelSheShitisp">酒店全部客房设施信息仅供参考,可能与您入住的房型略有差异,请知晓</view>
</view> </view>
</view> </view>
......
<template> <template>
<view> <view>
<u-dropdown ref="uDropdown"
@open="open" @close="close"
active-color="#B99846"
inactive-color="#080A09"
title-size="28"
>
<u-dropdown-item
v-model="parameters.OrderByType"
:title="optionsTitle[0]"
:options="options1">
<view
class="slot-content hotelComprehensiveBox column"
style="background-color: #FCFCFC"
>
<view class="hotelComprehensiv row items-center"
v-for="(item,index) in threeLevelList" :key="index"
:class="[item.isCheck==1?'active':'']"
@click="changeRoomType(item)">
<text>{{ item.name }}</text>
<view v-if="item.isCheck==1">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638760948784111958.png"/>
</view>
</view>
</view>
</u-dropdown-item>
<u-dropdown-item
v-model="parameters.OrderByType"
:title="optionsTitle[1]"
:options="options1">
<view
class="slot-content hotelComprehensiveBox column"
style="background-color: #FCFCFC"
>
<view class="hotelComprehensiv row items-center"
v-for="(item,index) in threeLevelList" :key="index"
:class="[item.isCheck==1?'active':'']"
@click="changeRoomType(item)">
<text>{{ item.name }}</text>
<view v-if="item.isCheck==1">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638760948784111958.png"/>
</view>
</view>
</view>
</u-dropdown-item>
<u-dropdown-item
v-model="parameters.OrderByType"
:title="optionsTitle[2]"
:options="options1">
<view
class="slot-content hotelComprehensiveBox column"
style="background-color: #FCFCFC"
>
<view class="hotelComprehensiv row items-center"
v-for="(item,index) in threeLevelList" :key="index"
:class="[item.isCheck==1?'active':'']"
@click="changeRoomType(item)">
<text>{{ item.name }}</text>
<view v-if="item.isCheck==1">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638760948784111958.png"/>
</view>
</view>
</view>
</u-dropdown-item>
</u-dropdown>
<view style="padding: 0 31rpx;"> <view style="padding: 0 31rpx;">
<view class="hotelDetailBox activeTag" <view class="hotelDetailBox activeTag"
v-for="(item,index) in RoomList" :key="index"> v-for="(item,index) in RoomList" :key="index">
<view class="hotelDetailTag"> <view class="hotelDetailTag">
热门房型 热门房型
</view> </view>
<view class="hotelDetail row"> <template v-for="(subItem,subindex) in item.RatePlanList">
<view class="hotelDetail row" v-if="!subindex">
<view class="hotelDetailL" @click="openPicture(item.images)"> <view class="hotelDetailL" @click="openPicture(item.images)">
<image mode="heightFix" :src="item.Path"/> <image mode="heightFix" :src="item.Path"/>
<view class="hotelDetailLImgs" v-if="item.images.length>1"> <view class="hotelDetailLImgs" v-if="item.images&&item.images.length>1">
{{ item.images.length }} {{ item.images.length }}
</view> </view>
</view> </view>
<view class="hotelDetailR column"> <view class="hotelDetailR column">
<view class="hotelDetailRTitle row items-center"> <view class="hotelDetailRTitle row items-center">
<view> <view>
{{ item.roomName }} <!--
{{ getRoomType(subItem.BedType) }}-->
</view> </view>
<!-- <!--
<img :src="openImg[0]" />--> <img :src="openImg[0]" />-->
</view> </view>
<view class="hotelDetailRRoom"> <view class="hotelDetailRRoom">
<!-- {{ subItem.RoomName_CN }}
Deluxe Double Room(2 beds)-->
</view> </view>
<!--
<view class="hotelDetailRCheckin">{{item.maxOccupancy}}人入住 {{item.size}}{{item.floor}}</view> <view class="hotelDetailRCheckin">{{item.maxOccupancy}}人入住 {{item.size}}{{item.floor}}</view>
-->
<view class="hotelDetailREat"> <view class="hotelDetailREat">
不含早餐 {{getMealtype(subItem.PriceList[0].MealType)}}
<text>入住当天18:00前可免费取消</text> {{subItem.PriceList[0].MealAmount>0?('×'+subItem.PriceList[0].MealAmount+'份'):''}}
<template v-if="subItem.RatePlanCancellationPolicyList && subItem.RatePlanCancellationPolicyList != null">
<!--
<text v-for="( itemCancella, index1 ) in subItem.RatePlanCancellationPolicyList" :key="index1">
<text v-if="index1==0">
{{ getformatDateStr(itemCancella.FromDate) }} 之前免费取消;
</text>
<text v-if="itemCancella.Amount==subItem.TotalPrice">
<text>
{{ getformatDateStr(itemCancella.FromDate) }}起不可取消,取消将收取订单全额费用;
</text>
</text>
<text v-else>
<text>{{ getformatDateStr(itemCancella.FromDate) }}
<text v-if="index1!=(subItem.RatePlanCancellationPolicyList.length-1)">-
{{ getformatDateStr(subItem.RatePlanCancellationPolicyList[index1+1].FromDate) }}
之间</text>
取消,收费{{subItem.Currency}}{{getPrice(itemCancella.Amount)}};
</text>
</text>
</text>-->
<text v-if="getIsCancella(subItem.RatePlanCancellationPolicyList,subItem.TotalPrice)==1">限时取消</text>
<text v-else>付费取消</text>
</template>
<text v-else>不可退改</text>
</view> </view>
<view class="hotelDetailRConfirmTag"> <view class="hotelDetailRConfirmTag" style="height: 1px;flex: 1;">
<text>立即确认</text> <text>立即确认</text>
</view> </view>
<view class="hotelDetailRPriceBox row"> <view class="hotelDetailRPriceBox row">
...@@ -103,28 +68,42 @@ ...@@ -103,28 +68,42 @@
<view class="row"> <view class="row">
<view class="column"> <view class="column">
<view class="hotelDetailRPrice"> <view class="hotelDetailRPrice">
CNY <text>399</text>起/晚 {{subItem.Currency }} <text> {{getPrice(subItem.TotalPrice)}}</text>起/晚
</view> </view>
<view class="hotelDetailRPriceT">2晚总价 <text>¥1258</text></view> <view class="hotelDetailRPriceT">{{dayObj.day}}晚总价
<text>{{subItem.Currency}}{{ getPrice(subItem.TotalPrice)*dayObj.day }}</text></view>
</view> </view>
<view class="hotelDetailRPriceBook"> <view class="hotelDetailRPriceBook" @click="goUrl(subItem)">
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="hotelDetailMXBox"> </template>
<view class="hotelDetailMXB">
查看2个价格详细 <view class="hotelDetailMXBox" v-if="item.RatePlanList.length>1">
<view class="hotelDetailMXB" @click="clickShow(item)">
查看{{item.RatePlanList.length-1}}个价格详细
<u-icon class="hotelDetailDown" name="arrow-down"></u-icon> <u-icon class="hotelDetailDown" name="arrow-down"></u-icon>
</view> </view>
<view class="hotelDetailMinXiBox"> <view class="hotelDetailMinXiBox" v-if="item.show">
<view class="hotelDetailMinXi"> <template v-for="(subItem,subindex) in item.RatePlanList">
<view class="hotelDetailMinXiTitle">无早餐</view> <view class="hotelDetailMinXi" v-if="subindex">
<view class="hotelDetailMinXiTitle"
:class="[getMealtype(subItem.PriceList[0].MealType)=='含早餐'?'active':'']">
{{getMealtype(subItem.PriceList[0].MealType)}}
{{subItem.PriceList[0].MealAmount>0?('×'+subItem.PriceList[0].MealAmount+'份'):''}}
</view>
<view class="row"> <view class="row">
<view class="hotelDetailMinXiL"> <view class="hotelDetailMinXiL">
<view class="hotelDetailMinXiLT">入住当天18:00前可免费取消</view> <view class="hotelDetailMinXiLT">
<template v-if="subItem.RatePlanCancellationPolicyList && subItem.RatePlanCancellationPolicyList != null">
<text v-if="getIsCancella(subItem.RatePlanCancellationPolicyList,subItem.TotalPrice)==1">限时取消</text>
<text v-else>付费取消</text>
</template>
<text v-else>不可退改</text>
</view>
<view class="hotelDetailMinXiLC"> <view class="hotelDetailMinXiLC">
<text>立即确认</text> <text>立即确认</text>
</view> </view>
...@@ -133,19 +112,22 @@ ...@@ -133,19 +112,22 @@
<view class="column"> <view class="column">
<view class="hotelDetailMinXiRF"> </view> <view class="hotelDetailMinXiRF"> </view>
<view class="hotelDetailMinXiRP"> <view class="hotelDetailMinXiRP">
CNY <text>399</text> {{subItem.Currency }} <text>{{getPrice(subItem.TotalPrice)}}</text>
</view> </view>
<view class="hotelDetailMinXiRT">2晚总价 <text>¥1258</text></view> <view class="hotelDetailMinXiRT">{{dayObj.day}}晚总价
<text>{{subItem.Currency}} {{ getPrice(subItem.TotalPrice)*dayObj.day }}</text></view>
</view> </view>
<view class="column hotelDetailMinXiRBBox"> <view class="column hotelDetailMinXiRBBox">
<text class="hotelDetailMinXiRS">剩2间</text> <text class="hotelDetailMinXiRS">剩2间</text>
<view class="hotelDetailMinXiRB"> <view class="hotelDetailMinXiRB" @click="goUrl(subItem)">
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>
...@@ -156,118 +138,186 @@ ...@@ -156,118 +138,186 @@
<script> <script>
export default { export default {
props: ['dataList','search','rooms'], props: ['roomMsg','dataList','search','rooms','day','qRoomType','qMealType'],
components: {}, components: {},
data() { data() {
return { return {
optionsTitle: ["房型", "床型", "餐食"], optionsTitle: ["房型", "床型", "餐食"],
searchObj:{}, searchObj:{},
threeLevelList: [ RoomList: [],
{ parameters: {},
name: "单人床", dayObj: {},
id: 1, HotelInfo:{},
isCheck: 0, HotelMealTypes: [],
HotelRoomTypes: [],
hotelMsg: {
hotelId: 0,
hotelImageSize: 5,
photoGalleryGetFlg: 1,
groupBookingFlg: 1,
}, },
{ qRoomTypeList: [],
name: "大床房", qMealTypeList: [],
id: 2, };
isCheck: 0,
}, },
{ watch:{
name: "双床房", qRoomType: {
id: 3, handler (val, oldval) {
isCheck: 0, if(val){
this.qRoomTypeList = val
}
}, },
{ deep: true,
name: "含早餐",
id: 4,
isCheck: 0,
}, },
{ qMealType: {
name: "可取消", handler (val, oldval) {
id: 5, if(val){
isCheck: 0, this.qMealTypeList = val
}
}, },
], deep: true,
isShowAll: false, },
RoomList: [], dataList: {
parameters: {}, handler (val, oldval) {
}; if(val){
this.HotelInfo = val
}
},
deep: true,
}, },
watch:{
rooms: { rooms: {
handler (val, oldval) { handler (val, oldval) {
if(val){ if(val){
this.RoomList = val this.RoomList = val
console.log(this.RoomList,'rooms');
} }
}, },
deep: true, deep: true,
}, },
search: {
handler (val, oldval) {
if(val){
this.searchObj = val
}
},
deep: true,
},
day: {
handler (val, oldval) {
if(val){
this.dayObj = val
}
},
deep: true,
},
roomMsg: {
handler (val, oldval) {
if(val){
this.hotelMsg.hotelId = val.hotelid
this.getdidaMealType()
this.getdidaBedType()
}
},
deep: true,
immediate: false,
}, },
onLoad(options) {
}, },
created() { created() {
this.searchObj = this.search
}, },
methods: { methods: {
openPicture(item) { clickShow(item){
let imgObj = JSON.stringify(item); item.show = !item.show
uni.navigateTo({ this.$forceUpdate()
url: "/pages/hotel/picture?imgObj=" + imgObj,
});
}, },
//点击过滤房间 //日期格式化
changeRoomType(obj) { getIsCancella(RatePlanCancellationPolicyList, TotalPrice) {
if (obj.isCheck == 0) { let IsCancel = 0; //不可取消
obj.isCheck = 1; let date2 = new Date(); //当前时间
RatePlanCancellationPolicyList.forEach((item, index) => {
var dt = new Date(item.FromDate); //取消时间
if (IsCancel == 0) {
if (dt > date2) {
if (item.Amount == TotalPrice) {
IsCancel = 1;
} else { } else {
obj.isCheck = 0; IsCancel = 2;
} }
this.RoomList = []; } else {
let num = 0; if (item.Amount != TotalPrice) {
this.threeLevelList.forEach((x) => { IsCancel = 2;
if (x.isCheck == 1) {
num++;
this.dataList.rooms.forEach((y) => {
if (x.id == 1 && y.BedType == 1) {
this.RoomList.push(y);
} }
if (x.id == 2 && y.BedType == 2) {
this.RoomList.push(y);
} }
if (x.id == 3 && y.BedType == 3) {
this.RoomList.push(y);
} }
if (x.id == 4 && y.BreakfastType != 4) { });
this.RoomList.push(y); return IsCancel;
},
getPrice(price) {
return Math.ceil(price);
},
//日期格式化
getformatDateStr(value) {
var dt = new Date(value);
let year = dt.getFullYear();
let month = (dt.getMonth() + 1).toString().padStart(2, "0");
let date = (dt.getDate()).toString().padStart(2, "0");
let hours = (dt.getHours()).toString().padStart(2, "0");
let minutes = (dt.getMinutes()).toString().padStart(2, "0");
let seconds = (dt.getSeconds()).toString().padStart(2, "0");
return year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds;
},
//获取道旅床类型列表
getdidaBedType() {
this.apipost('dmc_post_GetDidaBedTypeBaseInfo', this.hotelMsg, res => {
if (res.resultCode == 1) {
this.HotelRoomTypes = res.data;
} }
if (x.id == 5 && y.IsCancel == 2) { }, null)
this.RoomList.push(y); },
//获取道旅餐食类型
getdidaMealType() {
this.apipost('dmc_post_GetDidaMealType', this.hotelMsg, res => {
if (res.resultCode == 1) {
this.HotelMealTypes = res.data;
} }
}); }, null)
},
//获取房型
getRoomType(roomtypeId) {
let roomtypeName = "";
if (roomtypeId > 0) {
this.HotelRoomTypes.forEach((item) => {
if (item.ID == roomtypeId) {
roomtypeName = item.Name_CN;
} }
}); });
if (num == this.threeLevelList.length) {
this.isShowAll = true;
} else {
this.isShowAll = false;
} }
if (num == 0) { return roomtypeName;
this.RoomList = this.dataList.rooms; },
//获取餐型
getMealtype(mealtypeId) {
let mealtypeName = "";
if (mealtypeId > 0) {
this.HotelMealTypes.forEach((item) => {
if (item.ID == mealtypeId) {
mealtypeName = item.Name_CN;
}
});
} }
return mealtypeName;
}, },
open(index) { goUrl(subItem){
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮 uni.navigateTo({
// 同时内部会自动给当前展开项进行高亮 url: `/pages/hotel/order?searchObj=${JSON.stringify(this.searchObj)}&dayObj=${JSON.stringify(this.dayObj)}&HotelInfo=${JSON.stringify(this.HotelInfo)}&RoomInfo=${JSON.stringify(subItem)}`,
this.$refs.uDropdown.highlight(); });
}, },
close(index) { openPicture(item) {
// 关闭的时候,给当前项加上高亮 let imgObj = JSON.stringify(item);
// 当然,您也可以通过监听dropdown-item的@change事件进行处理 uni.navigateTo({
this.$refs.uDropdown.highlight(index); url: "/pages/hotel/picture?imgObj=" + imgObj,
});
}, },
}, },
}; };
</script> </script>
...@@ -949,6 +999,9 @@ ...@@ -949,6 +999,9 @@
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
padding: 8rpx 0 10rpx 0; padding: 8rpx 0 10rpx 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.hotelDetailRCheckin{ .hotelDetailRCheckin{
font-weight: 500; font-weight: 500;
...@@ -986,6 +1039,7 @@ ...@@ -986,6 +1039,7 @@
.hotelDetailRPrice{ .hotelDetailRPrice{
font-size: 20rpx; font-size: 20rpx;
color: #FF3166; color: #FF3166;
text-align: right;
} }
.hotelDetailRPrice text{ .hotelDetailRPrice text{
font-size:34rpx; font-size:34rpx;
...@@ -1046,6 +1100,9 @@ ...@@ -1046,6 +1100,9 @@
font-size: 32rpx; font-size: 32rpx;
color: #080A09; color: #080A09;
} }
.hotelDetailMinXiTitle.active{
color: #B99846;
}
.hotelDetailMinXiL{ .hotelDetailMinXiL{
width: 1px; width: 1px;
flex: 1; flex: 1;
...@@ -1070,9 +1127,9 @@ ...@@ -1070,9 +1127,9 @@
height: 90rpx; height: 90rpx;
} }
.hotelDetailMinXiRP{ .hotelDetailMinXiRP{
font-size: 20rpx; font-size: 20rpx;
color: #FF3166; color: #FF3166;
text-align: right;
} }
.hotelDetailMinXiRP text{ .hotelDetailMinXiRP text{
font-weight: 800; font-weight: 800;
......
...@@ -291,6 +291,14 @@ ...@@ -291,6 +291,14 @@
childrenNumberBZC:0, childrenNumberBZC:0,
peoples: 2, peoples: 2,
interCurrent: 0, interCurrent: 0,
searchroomGroup: [
{
roomNum: 1,
numberOfAdults: 2,
numberOfChildren: 0,
ChildAgeDetails: ''
}
],
}, },
day: 0, day: 0,
startDay: "", startDay: "",
...@@ -375,6 +383,7 @@ ...@@ -375,6 +383,7 @@
this.startDay = obj.startDay; this.startDay = obj.startDay;
this.endDay = obj.endDay; this.endDay = obj.endDay;
this.day = obj.day; this.day = obj.day;
this.dayObj = obj
this.getCity() this.getCity()
this.getSearchCondition() this.getSearchCondition()
// this.getLocation() // this.getLocation()
...@@ -564,6 +573,7 @@ ...@@ -564,6 +573,7 @@
this.day = obj.day; this.day = obj.day;
this.dayObj = obj; this.dayObj = obj;
this.showTimePopup = false; this.showTimePopup = false;
this.$emit('getItem',this.parameters,this.dayObj)
}, },
closeDropdown() { closeDropdown() {
this.$refs.uDropdown.close(); this.$refs.uDropdown.close();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view style="flex: 1; width: 100%; height: 1rpx"> <view style="flex: 1; width: 100%; height: 1rpx">
<canlendar @finish="chosenDateResult" title="日期和人数"></canlendar> <canlendar @finish="chosenDateResult" title="日期和人数"></canlendar>
</view> </view>
<view style="background: #ecf1f4; padding: 20rpx 0 50rpx 0;"> <view class="column" style="background: #ecf1f4; padding: 20rpx 0 50rpx 0;">
<view class="row line-flex" style="padding: 30rpx; background: #fff"> <view class="row line-flex" style="padding: 30rpx; background: #fff">
<text style="font-size: 28rpx; color: #111; font-weight: 500">房间</text> <text style="font-size: 28rpx; color: #111; font-weight: 500">房间</text>
<text style=" <text style="
...@@ -19,32 +19,59 @@ ...@@ -19,32 +19,59 @@
<u-number-box size="28" :min="1" :max="100000" v-model="parameters.rooms" <u-number-box size="28" :min="1" :max="100000" v-model="parameters.rooms"
@change="getRooms"></u-number-box> @change="getRooms"></u-number-box>
</view> </view>
<view class="row line-flex" style="padding: 30rpx; background: #fff"> <scroll-view :scroll-y="true" class="hotelScroll" style="max-height: 200rpx;">
<view style="padding: 0 10rpx;background: #fff">
<view class="row items-center" v-for="(item,index) in parameters.searchroomGroup"
style="padding-bottom: 20rpx;">
<view class="line-flex" style="height: 29px;margin-right: 10rpx;">房间{{ item.roomNum }}</view>
<view class="col">
<view class="row line-flex" style="margin-left: 20rpx;">
<view style="margin-right: 10rpx;">
<text style="font-size: 28rpx; color: #111; font-weight: 500">成人</text> <text style="font-size: 28rpx; color: #111; font-weight: 500">成人</text>
<!--
<text style=" <text style="
font-size: 22rpx; font-size: 22rpx;
color: #999; color: #999;
margin-left: 30rpx; margin-left: 30rpx;
flex: 1; flex: 1;
">18周岁以上</text> ">18周岁以上</text>-->
</view>
<u-number-box size="28" :min="1" <u-number-box size="28" :min="1"
:max="100000" :max="9"
v-model="parameters.adultsNumber" v-model="item.numberOfAdults"
@change="crChange"></u-number-box> @change="(e)=>{crChange(e,index)}"></u-number-box>
</view> </view>
<view class="row line-flex" style="padding: 30rpx; background: #fff"> <view class="row line-flex" style="margin-left: 20rpx;">
<text style="font-size: 28rpx; color: #111; font-weight: 500">儿童(占床)</text> <view style="margin-right: 10rpx;">
<text style="font-size: 28rpx; color: #111; font-weight: 500">儿童
<!--(占床)-->
</text>
<!--
<text style=" <text style="
font-size: 22rpx; font-size: 22rpx;
color: #999; color: #999;
margin-left: 30rpx; margin-left: 30rpx;
flex: 1; flex: 1;
">2-18周岁(不含)</text> ">2-18周岁(不含)</text>-->
<u-number-box size="28" :min="0" :max="100000" </view>
v-model="parameters.childrenNumberZC" <u-number-box size="28" :min="0" :max="5"
@change="etChange" v-model="item.numberOfChildren"
@change="(e)=>{etChange(e,index)}"
style="margin-right: 10rpx;"
></u-number-box> ></u-number-box>
<text style="font-size: 28rpx; color: #111; font-weight: 500;">年龄</text>
<u-number-box size="28" :min="1" :max="12"
v-model="item.ChildAgeDetails"
@change="(e)=>{ageChange(e,index)}"
style="margin-left: 10rpx;"
></u-number-box>
</view>
</view> </view>
</view>
</view>
</scroll-view>
<!-- <!--
<view class="row line-flex" style="padding: 30rpx; background: #fff"> <view class="row line-flex" style="padding: 30rpx; background: #fff">
<text style="font-size: 28rpx; color: #111; font-weight: 500">儿童(不占床)</text> <text style="font-size: 28rpx; color: #111; font-weight: 500">儿童(不占床)</text>
...@@ -89,18 +116,42 @@ export default { ...@@ -89,18 +116,42 @@ export default {
}, },
methods: { methods: {
getRooms(e){ getRooms(e){
if(e.value>this.parameters.rooms||e.value<this.parameters.rooms){
if(e.value>this.parameters.rooms){
this.parameters.searchroomGroup.push({
roomNum: e.value,
numberOfAdults: 1,
numberOfChildren: 0,
ChildAgeDetails: ''
})
}
if(e.value<this.parameters.rooms){
this.parameters.searchroomGroup.splice(e.value,1)
}
this.parameters.rooms = e.value; this.parameters.rooms = e.value;
this.peopleChange()
}
},
ageChange(e,index){
this.parameters.searchroomGroup[index].ChildAgeDetails = e.value;
}, },
etChange(e){ etChange(e,index){
this.parameters.childrenNumberZC = e.value; this.parameters.searchroomGroup[index].numberOfChildren = e.value;
this.peopleChange() this.peopleChange()
}, },
crChange(e){ crChange(e,index){
this.parameters.adultsNumber = e.value; this.parameters.searchroomGroup[index].numberOfAdults = e.value;
this.peopleChange() this.peopleChange()
}, },
peopleChange(){ peopleChange(){
this.parameters.peoples = Number(this.parameters.adultsNumber) + Number(this.parameters.childrenNumberZC) this.parameters.peoples = 0
this.parameters.adultsNumber = 0
this.parameters.childrenNumberZC = 0
this.parameters.searchroomGroup.forEach((item,index)=>{
this.parameters.peoples+= (Number(item.numberOfAdults) + Number(item.numberOfChildren))
this.parameters.adultsNumber+= Number(item.numberOfAdults)
this.parameters.childrenNumberZC+= Number(item.numberOfChildren)
})
}, },
chosenDateResult(obj) { chosenDateResult(obj) {
this.showTimePopup = false; this.showTimePopup = false;
......
...@@ -243,7 +243,6 @@ export default { ...@@ -243,7 +243,6 @@ export default {
uni.getStorage({ uni.getStorage({
key: "Time", key: "Time",
success: (res) => { success: (res) => {
console.log(res);
if (res && res.data) { if (res && res.data) {
var obj = JSON.parse(res.data); var obj = JSON.parse(res.data);
this.start = this.setDefaultDate(obj.start); this.start = this.setDefaultDate(obj.start);
...@@ -344,13 +343,11 @@ export default { ...@@ -344,13 +343,11 @@ export default {
} }
if (this.priceStauts.length > 0) { if (this.priceStauts.length > 0) {
console.log(this.lastNot);
for (var i = newVal[0]; i < this.priceStauts.length; i++) { for (var i = newVal[0]; i < this.priceStauts.length; i++) {
if (i == newVal[0]) { if (i == newVal[0]) {
for (var j = newVal[1]; j < this.priceStauts[i].length; j++) { for (var j = newVal[1]; j < this.priceStauts[i].length; j++) {
if (this.priceStauts[i][j] == -1) { if (this.priceStauts[i][j] == -1) {
this.lastNot = [i, j]; this.lastNot = [i, j];
console.log(this.lastNot);
return; return;
} }
} }
...@@ -358,7 +355,6 @@ export default { ...@@ -358,7 +355,6 @@ export default {
for (var j = 0; j < this.priceStauts[i].length; j++) { for (var j = 0; j < this.priceStauts[i].length; j++) {
if (this.priceStauts[i][j] == -1) { if (this.priceStauts[i][j] == -1) {
this.lastNot = [i, j]; this.lastNot = [i, j];
console.log(this.lastNot);
return; return;
} }
} }
...@@ -652,6 +648,7 @@ export default { ...@@ -652,6 +648,7 @@ export default {
"-" + "-" +
endDay, endDay,
day: this.day, day: this.day,
year: this.date[this.start[0]].year,
}; };
/*此处应把需要的数据进行保存,如入住离开日期...添加到vuex然后再进行跳转到上一页 /*此处应把需要的数据进行保存,如入住离开日期...添加到vuex然后再进行跳转到上一页
......
...@@ -185,8 +185,63 @@ ...@@ -185,8 +185,63 @@
</view> </view>
</view> </view>
</view> </view>
<view v-show="getQueryData.length>0">
<hotelRoom :dataList="dataList" :rooms="RoomList" :search="searchObj"></hotelRoom> <u-dropdown ref="uDropdown"
@open="open" @close="close"
active-color="#B99846"
inactive-color="#080A09"
title-size="28"
>
<u-dropdown-item
:title="optionsTitle[0]"
:options="options1">
<scroll-view :scroll-y="true" class="hotelScroll" style="height: 200px;">
<view
class="slot-content hotelComprehensiveBox column"
style="background-color: #FCFCFC"
>
<view class="hotelComprehensiv row items-center"
v-for="(item,index) in qRoomTypeList" :key="index"
:class="[qMsg.RoomTypeName==item.RoomName_CN?'active':'']"
@click="changeType(item,1)">
<text>{{ item.RoomName_CN }}</text>
<view v-if="qMsg.RoomTypeName==item.RoomName_CN">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638760948784111958.png"/>
</view>
</view>
</view>
</scroll-view>
</u-dropdown-item>
<u-dropdown-item
:title="optionsTitle[1]"
:options="options1">
<scroll-view :scroll-y="true" class="hotelScroll" style="height: 200px;">
<view
class="slot-content hotelComprehensiveBox column"
style="background-color: #FCFCFC">
<view class="hotelComprehensiv row items-center"
v-for="(item,index) in qMealTypeList" :key="index"
:class="[qMsg.MTypeName==item.MTypeName?'active':'']"
@click="changeType(item)">
<text>{{ item.MTypeName?item.MTypeName:'-' }}</text>
<view v-if="qMsg.MTypeName==item.MTypeName">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638760948784111958.png"/>
</view>
</view>
</view>
</scroll-view>
</u-dropdown-item>
</u-dropdown>
<hotelRoom
:dataList="dataList"
:rooms="getQueryData"
:roomMsg="roomMsg"
:search="searchObj"
:day="dayObj"
:qRoomType="qRoomTypeList"
:qMealType="qMealTypeList"></hotelRoom>
</view>
<u-empty v-show="getQueryData.length==0" text="暂无相关房间" mode="data" padding-top="5"></u-empty>
</view> </view>
<view style="border-radius: 15rpx 15rpx 0 0;background: #fff;overflow: hidden;"> <view style="border-radius: 15rpx 15rpx 0 0;background: #fff;overflow: hidden;">
<view class="hotelFacilitiesBox"> <view class="hotelFacilitiesBox">
...@@ -275,6 +330,7 @@ export default { ...@@ -275,6 +330,7 @@ export default {
nearbyType: 0, nearbyType: 0,
searchObj: { searchObj: {
date: {}, date: {},
searchroomGroup:[]
}, },
roomMsg: { roomMsg: {
hotelid: 0, hotelid: 0,
...@@ -328,7 +384,7 @@ export default { ...@@ -328,7 +384,7 @@ export default {
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638762717498946531.png', 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638762717498946531.png',
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638762717498917358.png' 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638762717498917358.png'
], ],
optionsTitle: ["房型", "床型", "餐食"], optionsTitle: ["房型", "餐食"],
hotelFacilities: [ hotelFacilities: [
{Name: '酒店信息',ID:1,val:'hotelInfor',top:0,}, {Name: '酒店信息',ID:1,val:'hotelInfor',top:0,},
{Name: '酒店政策',ID:2,val:'hotelPolicy',top:0,}, {Name: '酒店政策',ID:2,val:'hotelPolicy',top:0,},
...@@ -338,9 +394,71 @@ export default { ...@@ -338,9 +394,71 @@ export default {
scrollTop: 100, scrollTop: 100,
old:{ old:{
scrollTop: 0 scrollTop: 0
},
loading: false,
DidaHotelRoomDetails:{},
qRoomTypeList: [],
qMealTypeList: [
{ID: '',MTypeName: "全部" }
],
HotelMealTypes: [],
qMsg: {
RoomTypeName: "", //房型筛选
MTypeName: "", //早餐筛选
} }
}; };
}, },
computed: {
getQueryData: {
get() {
var _this = this;
var tempData = [];
_this.loading = true;
if (_this.DidaHotelRoomDetails && _this.DidaHotelRoomDetails.HotelList && _this.DidaHotelRoomDetails
.HotelList
.length > 0 && _this.DidaHotelRoomDetails.HotelList[0].GroupRoomTypeList) {
let arrList = function(list){
list.forEach(item=>{
item.show = false
})
}
arrList(_this.DidaHotelRoomDetails.HotelList[0].GroupRoomTypeList)
tempData = JSON.parse(JSON.stringify(_this.DidaHotelRoomDetails.HotelList[0].GroupRoomTypeList));
if (_this.qMsg.RoomTypeName && _this.qMsg.RoomTypeName != '') {
tempData = tempData.filter(qitem => qitem.RoomName_CN == _this.qMsg.RoomTypeName);
}
if (_this.qMsg.MTypeName && _this.qMsg.MTypeName.MTypeName != '') {
var newDataArray = [];
tempData.forEach(qitem => {
var tempRetePlanList = [];
if (qitem.RatePlanList && qitem.RatePlanList.length > 0) {
qitem.RatePlanList.forEach(pItem => {
if (pItem.PriceList && pItem.PriceList.length > 0) {
pItem.PriceList.forEach(mItem => {
var tempObj = _this.qMealTypeList.find(mtItem => mtItem.MTypeName == _this.qMsg
.MTypeName);
if (mItem.MealAmount == tempObj.MealAmount && mItem.MealType == tempObj
.MealType) {
tempRetePlanList.push(pItem)
}
})
}
})
}
qitem.RatePlanList = tempRetePlanList;
if (tempRetePlanList && tempRetePlanList.length > 0) {
newDataArray.push(qitem);
}
})
tempData = newDataArray;
}
}
_this.loading = false;
return tempData;
},
}
},
created() { created() {
this.Up = uni.getStorageSync("mall_UserInfo") this.Up = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserPageType ? uni.getStorageSync("mall_UserInfo").UserPageType
...@@ -405,9 +523,121 @@ export default { ...@@ -405,9 +523,121 @@ export default {
if (options.searchObj) { if (options.searchObj) {
this.searchObj = JSON.parse(options.searchObj); this.searchObj = JSON.parse(options.searchObj);
} }
this.getRecomHotel(); // this.getRecomHotel();
this.getHotelPrices()
this.getdidaMealType()
}, },
methods: { methods: {
open(index) {
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮
// 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight();
},
close(index) {
// 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
this.$refs.uDropdown.highlight(index);
},
changeType(item,type){
if(type){
this.optionsTitle[0] = item.RoomName_CN!='全部'?item.RoomName_CN:'房型'
this.qMsg.RoomTypeName = item.RoomName_CN!='全部'?item.RoomName_CN:'';
}else {
this.optionsTitle[1] = item.MTypeName!='全部'?item.MTypeName:'餐食'
this.qMsg.MTypeName = item.MTypeName!='全部'?item.MTypeName:'';
}
this.$refs.uDropdown.close();
},
// 获取房间价格
getHotelPrices(){
let that = this
this.apipost('dmc_post_GetDiDaPriceSearchList',{
hotelId: this.roomMsg.hotelid,
sort: 0,
displayFrom: 1,
roomOptionCd: "",
searchroomGroup: [{
roomNum: 1,
numberOfAdults: 2,
numberOfChildren: 0,
ChildAgeDetails: ""
}],
auditNum: this.searchObj.adultsNumber,
childNum: this.searchObj.childrenNumberZC,
CheckInDate: this.dayObj.startTime,
CheckOutDate: this.dayObj.endTime,
// CheckInDate: '2025-04-08',
// CheckOutDate: '2025-04-11',
},res=>{
if(res.resultCode == 1){
var tempData = res.data;
this.DidaHotelRoomDetails = tempData;
if (tempData) {
if (tempData.HotelList && tempData.HotelList.length > 0) {
tempData.HotelList.forEach(rootItem => {
if (rootItem && rootItem.GroupRoomTypeList && rootItem.GroupRoomTypeList.length > 0) {
rootItem.GroupRoomTypeList.forEach(rItem => {
if (rItem.RoomName_CN && rItem.RoomName_CN != '') {
this.qRoomTypeList.push({
RoomName_CN: rItem.RoomName_CN
});
}
})
}
this.qRoomTypeList.unshift({
RoomName_CN: '全部'
})
if (rootItem && rootItem.RatePlanList && rootItem.RatePlanList.length > 0) {
rootItem.RatePlanList.forEach(pItem => {
if (pItem && pItem.PriceList && pItem.PriceList.length > 0) {
pItem.PriceList.forEach(mItem => {
var MTypeName = that.getMealtype(mItem.MealType);
if (mItem.MealAmount > 0) {
MTypeName += mItem.MealAmount + "份";
}
var mObj = {
MTypeName: MTypeName,
MealAmount: mItem.MealAmount,
MealType: mItem.MealType
};
var qObj = that.qMealTypeList.find((qMItem) => {
return qMItem.MealType === mObj.MealType && qMItem.MealAmount == mObj
.MealAmount;
})
if (!qObj) {
that.qMealTypeList.push(mObj);
}
})
}
});
}
});
}
}
}
})
},
//获取道旅餐食类型
getdidaMealType() {
this.apipost('dmc_post_GetDidaMealType', this.hotelMsg, res => {
if (res.resultCode == 1) {
this.HotelMealTypes = res.data;
}
}, null)
},
//获取餐型
getMealtype(mealtypeId) {
let mealtypeName = "";
if (mealtypeId > 0) {
this.HotelMealTypes.forEach((item) => {
if (item.ID == mealtypeId) {
mealtypeName = item.Name_CN;
}
});
}
return mealtypeName;
},
goFacil(item){ goFacil(item){
this.current = item.ID; this.current = item.ID;
this.scrollTop = this.old.scrollTop this.scrollTop = this.old.scrollTop
...@@ -476,10 +706,16 @@ export default { ...@@ -476,10 +706,16 @@ export default {
this.roomMsg.EndDate = obj.end; this.roomMsg.EndDate = obj.end;
this.startDay = obj.startDay; this.startDay = obj.startDay;
this.endDay = obj.endDay; this.endDay = obj.endDay;
this.day = obj.day; this.day = obj.day;
this.getRoomType(); // this.getRoomType();
this.dayObj = obj; this.dayObj = {
...obj,
startTime: `${obj.year}-${obj.startDay}`,
endTime: `${obj.year}-${obj.endDay}`
}
this.showTimePopup = false; this.showTimePopup = false;
this.getHotelPrices()
}, },
//切换日期获取房型 //切换日期获取房型
getRoomType() { getRoomType() {
...@@ -639,17 +875,17 @@ export default { ...@@ -639,17 +875,17 @@ export default {
for(let i=0;i<res.data.images.length;i++){ for(let i=0;i<res.data.images.length;i++){
res.data.images[i].Path = res.data.images[i].url res.data.images[i].Path = res.data.images[i].url
} }
for(let i=0;i<res.data.rooms.length;i++){ // for(let i=0;i<res.data.rooms.length;i++){
let list = res.data.rooms[i].images.filter(x=>{ // let list = res.data.rooms[i].images.filter(x=>{
return x.isDefault // return x.isDefault
}) // })
res.data.rooms[i].images.forEach(x=>{ // res.data.rooms[i].images.forEach(x=>{
x.Path = x.url // x.Path = x.url
}) // })
if(list.length>0) res.data.rooms[i].Path = list[0].url // if(list.length>0) res.data.rooms[i].Path = list[0].url
else res.data.rooms[i].Path = res.data.rooms[i].images.length>0&&res.data.rooms[i].images[0].url?res.data.rooms[i].images[0].url:'' // else res.data.rooms[i].Path = res.data.rooms[i].images.length>0&&res.data.rooms[i].images[0].url?res.data.rooms[i].images[0].url:''
this.RoomList.push(res.data.rooms[i]) // this.RoomList.push(res.data.rooms[i])
} // }
this.hotelData.hotelid = this.dataList.hotelid; this.hotelData.hotelid = this.dataList.hotelid;
this.hotelData.name = this.dataList.name; this.hotelData.name = this.dataList.name;
// this.hotelData.Booking = this.dataList.Booking; // this.hotelData.Booking = this.dataList.Booking;
...@@ -1380,5 +1616,24 @@ export default { ...@@ -1380,5 +1616,24 @@ export default {
.hotelFacilitiesTitle.active .hotelFacilitiesTb view{ .hotelFacilitiesTitle.active .hotelFacilitiesTb view{
background: #E2AB4E; background: #E2AB4E;
} }
.hotelComprehensiveBox{
padding: 0 30rpx;
}
.hotelComprehensiv{
height: 78rpx;
line-height: 70rpx;
font-size: 28rpx;
color: #080A09;
justify-content: space-between;
}
.hotelComprehensiv.active{
color: #B99846;
font-weight: bold;
}
.hotelComprehensiv img{
width: 28rpx;
height: 28rpx;
display: block;
}
</style> </style>
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<view class="hotel-list column" style="background: #F3F1EF;"> <view class="hotel-list column" style="background: #F3F1EF;">
<view class="hotel-listHeader"> <view class="hotel-listHeader">
<hotelHeaders :title="pageTitle"></hotelHeaders> <hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch :msg="searchObj" :isMap="1" @change="change"></hotelSearch> <hotelSearch
:msg="searchObj"
:isMap="1"
@change="change"
@getItem="getItem"></hotelSearch>
<!-- <view style="padding: 9rpx 30rpx 19rpx 30rpx;"> <!-- <view style="padding: 9rpx 30rpx 19rpx 30rpx;">
<scroll-view :scroll-x="true"> <scroll-view :scroll-x="true">
<view class="ComprehensiveSortings row"> <view class="ComprehensiveSortings row">
...@@ -65,9 +69,6 @@ ...@@ -65,9 +69,6 @@
// City: 262, //市 // City: 262, //市
// District: 0, //区 // District: 0, //区
}, },
day: 0,
startDay: "",
endDay: "",
HotelList: [], //酒店数据 HotelList: [], //酒店数据
tempRateAndPrice: { tempRateAndPrice: {
price: {}, price: {},
...@@ -124,27 +125,35 @@ ...@@ -124,27 +125,35 @@
let Day2 = day2>9?day2:'0'+day2; let Day2 = day2>9?day2:'0'+day2;
var obj = { var obj = {
start: `${d1.getFullYear()}-${Month1}-${Day1}`, start: `${d1.getFullYear()}-${Month1}-${Day1}`,
end: `${d2.getFullYear()}-${Month2}-${Day2}`, end: `${d1.getFullYear()}-${Month2}-${Day2}`,
startDay: `${Month1}-${Day1}`, startDay: `${Month1}-${Day1}`,
endDay: `${Month2}-${Day2}`, endDay: `${Month2}-${Day2}`,
day: 1, day: 1,
startWeek: startWeek, startWeek: startWeek,
endWeek: endWeek, endWeek: endWeek,
startTime: `${d1.getFullYear()}-${Month1}-${Day1}`,
endTime: `${d1.getFullYear()}-${Month2}-${Day2}`
}; };
this.dayObj = obj; this.dayObj = obj;
uni.setStorage({ uni.setStorage({
key: "Time", key: "Time",
data: JSON.stringify(obj), data: JSON.stringify(obj),
}); });
// this.searchObj.QStartDate = obj.start;
// this.searchObj.QEndDate = obj.end;
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.getSearchCondition(); this.getSearchCondition();
// this.getList(); // this.getList();
}, },
methods: { methods: {
getItem(parameters,obj) {
this.searchObj = {
...this.searchObj,
...parameters
}
this.dayObj = {
...obj,
startTime: `${obj.year}-${obj.startDay}`,
endTime: `${obj.year}-${obj.endDay}`
}
},
scroll(e) { scroll(e) {
this.old.scrollTop = e.detail.scrollTop; this.old.scrollTop = e.detail.scrollTop;
}, },
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<view class="hotel-list column" style="background: #F3F1EF;"> <view class="hotel-list column" style="background: #F3F1EF;">
<view class="hotel-listHeader"> <view class="hotel-listHeader">
<hotelHeaders :title="pageTitle"></hotelHeaders> <hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch @change="change"></hotelSearch> <hotelSearch @change="change"
@getItem="getItem"></hotelSearch>
</view> </view>
<view style="height: 1px;flex: 1;overflow: hidden;position: relative;"> <view style="height: 1px;flex: 1;overflow: hidden;position: relative;">
<!-- :latitude="latitude" :longitude="longitude" :markers="covers" --> <!-- :latitude="latitude" :longitude="longitude" :markers="covers" -->
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
current==index?'active':'', current==index?'active':'',
nextCurrent==index?'activeNext':'',]"> nextCurrent==index?'activeNext':'',]">
<view class="hotelMapList"> <view class="hotelMapList">
<hotel-good :item="item" :isMap="1"></hotel-good> <hotel-good :item="item" :dayObj="dayObj" :searchObj="searchObj" :isMap="1"></hotel-good>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
...@@ -208,6 +209,13 @@ ...@@ -208,6 +209,13 @@
// this.getLocation() // this.getLocation()
}, },
methods: { methods: {
getItem(obj) {
this.dayObj = {
...obj,
startTime: `${obj.year}-${obj.startDay}`,
endTime: `${obj.year}-${obj.endDay}`
}
},
handleCalloutClick(marker) { handleCalloutClick(marker) {
console.log('点击了标记:', marker.detail); console.log('点击了标记:', marker.detail);
// 可自定义弹窗逻辑或跳转页面 // 可自定义弹窗逻辑或跳转页面
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<scroll-view scroll-y="true" style="height: 1px;flex: 1;box-sizing: border-box;"> <scroll-view scroll-y="true" style="height: 1px;flex: 1;box-sizing: border-box;">
<view class="hotel-order"> <view class="hotel-order">
<view class="o-head"> <view class="o-head">
<view class="o-head-title">成田国际花园酒店</view> <view class="o-head-title">{{ HotelInfo.name }}</view>
<view class="o-timer"> <view class="o-timer">
<view class="row-sb-n"> <view class="row-sb-n">
<view class="row items-center"> <view class="row items-center">
...@@ -18,17 +18,19 @@ ...@@ -18,17 +18,19 @@
<view class="o-detail" @click="goUrl">详情</view> <view class="o-detail" @click="goUrl">详情</view>
</view> </view>
<view class="room-dateil row items-center"> <view class="room-dateil row items-center">
<view class="room-name">{{HotelInfo.HotelName?HotelInfo.HotelName:''}}</view> <view class="room-name">{{RoomInfo.RoomName_CN?RoomInfo.RoomName_CN:''}}</view>
<view class="roomline"></view> <view class="roomline"></view>
<view class="room-remark"> <view class="room-remark">
{{RoomInfo.BreakfastTypeStr}} {{searchObj.rooms}}
<!-- | {{RoomInfo.BedTypeStr}} | <!-- | {{RoomInfo.BedTypeStr}} |
{{RoomInfo.RoomSize}}㎡ | {{RoomInfo.RoomSize}}㎡ |
{{RoomInfo.HasWindowStr}} --> {{RoomInfo.HasWindowStr}} -->
</view> </view>
<view class="roomline"></view> <view class="roomline"></view>
<view class="roomPrice"> <view class="roomPrice">
1500/人 <!-- {{ searchObj.peoples }} -->
{{RoomInfo.Currency}}{{getPrice(orderMsg.TotalPrice)}}
<!-- /人 -->
</view> </view>
</view> </view>
</view> </view>
...@@ -46,14 +48,14 @@ ...@@ -46,14 +48,14 @@
</view> </view>
</view> </view>
<view class="row-sbas-n items-center"> <view class="row-sbas-n items-center">
<view class="addPnum addPnumL" @click="orderMsg.RoomNumber>1?editNum(1):''"> <view class="addPnum addPnumL" @click="orderMsg.RoomCount>1?editNum(1):''">
<image v-if="orderMsg.RoomNumber>1" style="width: 27rpx;height: 27rpx;display: block;" <image v-if="orderMsg.RoomCount>1" style="width: 27rpx;height: 27rpx;display: block;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245939665786.png" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245939665786.png" />
<image v-else style="width: 27rpx;height: 27rpx;display: block;" <image v-else style="width: 27rpx;height: 27rpx;display: block;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638755711218891689.png" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638755711218891689.png" />
</view> </view>
<view class="col row items-center textCenter visaProductTetx"> <view class="col row items-center textCenter visaProductTetx">
{{orderMsg.RoomNumber}} {{orderMsg.RoomCount}}
</view> </view>
<view class="addPnum addPnumR" @click="editNum()"> <view class="addPnum addPnumR" @click="editNum()">
...@@ -63,12 +65,36 @@ ...@@ -63,12 +65,36 @@
</view> </view>
</view> </view>
<view> <view>
<template v-for="(item,index) in orderMsg.GuestList">
<view class="form-items row">
<view class="label">
{{ orderMsg.GuestList.length==1?'住客信息':`房间${index+1}住客` }}
</view>
<view class="LastNameBox column val" style="width: 1px;flex: 1;">
<view class="row" v-for="(sItem,i) in item.GuestInfo">
<input type="text" v-model="sItem.LastName" :placeholder="`输入住客 ${i+1} 姓`" />
<input type="text" v-model="sItem.FirstName" :placeholder="`输入住客 ${i+1} 名`" />
</view>
</view>
</view>
</template>
<view class="form-items"> <view class="form-items">
<view class="label">住客姓名</view> <view class="label">
联系姓名
</view>
<view class="val"> <view class="val">
<input type="text" v-model="orderMsg.Consignee" placeholder="若是多人,输入代表人员即可" /> <input type="text" v-model="orderMsg.guestLastName" placeholder="请输入联系人姓名" />
</view>
</view> </view>
<!--
<view class="form-items">
<view class="label">
联系人名
</view>
<view class="val">
<input type="text" v-model="orderMsg.guestFirstName" placeholder="请输入联系人名" />
</view> </view>
</view> -->
<view class="form-items"> <view class="form-items">
<view class="label">联系电话</view> <view class="label">联系电话</view>
<view class="form-itemsL row" <view class="form-itemsL row"
...@@ -78,20 +104,20 @@ ...@@ -78,20 +104,20 @@
<u-icon name="arrow-down" color="#080A09" size="20" /> <u-icon name="arrow-down" color="#080A09" size="20" />
</view> </view>
<view class="val"> <view class="val">
<input type="text" v-model="orderMsg.ConsigneeMobile" placeholder="输入电话号码" /> <input type="text" v-model="orderMsg.guestPhoneNumber" placeholder="输入电话号码" />
</view> </view>
</view> </view>
<view class="form-items"> <!--<view class="form-items">
<view class="label">预计到店</view> <view class="label">预计到店</view>
<view class="val flex form-itemsTime" @click="showtime=true"> <view class="val flex form-itemsTime" @click="showtime=true">
<view style="flex: 1;" class="f14">{{orderMsg.ArrivalTime}} 房间整晚保留</view> <view style="flex: 1;" class="f14">{{orderMsg.ArrivalTime}} 房间整晚保留</view>
<!--<u-icon name="arrow" color="#D9D9D9" size="20" />--> <u-icon name="arrow" color="#D9D9D9" size="20" />
</view>
</view> </view>
</view>-->
<view class="form-items"> <view class="form-items">
<view class="label">E-mail</view> <view class="label">E-mail</view>
<view class="val"> <view class="val">
<input type="text" v-model="orderMsg.Email" placeholder="用于接收信息" /> <input type="text" v-model="orderMsg.guestEmail" placeholder="用于接收信息" />
</view> </view>
</view> </view>
</view> </view>
...@@ -120,12 +146,12 @@ ...@@ -120,12 +146,12 @@
<view class="form" style="margin:20rpx 0 15rpx 0;padding: 0;"> <view class="form" style="margin:20rpx 0 15rpx 0;padding: 0;">
<view class="form-items PriceZaiXian"> <view class="form-items PriceZaiXian">
<view class="label"> <view class="label">
在线支付 商品总价
</view> </view>
<view class="val f14 regular" style="text-align: right;"> <view class="val f14 regular" style="text-align: right;">
<text style="margin-right: 30rpx;">{{orderMsg.RoomNumber}}</text> <text style="margin-right: 30rpx;">{{searchObj.peoples}}</text>
<text style="margin-right: 30rpx;">{{orderMsg.RoomNumber}}间房</text> <text style="margin-right: 30rpx;">{{orderMsg.RoomCount}}间房</text>
<text class="red">{{orderMsg.Final_Price}}</text> <text class="red">{{RoomInfo.Currency}}{{getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount}}</text>
</view> </view>
</view> </view>
<view class="form-items PriceMinXi" style="border-bottom: none;"> <view class="form-items PriceMinXi" style="border-bottom: none;">
...@@ -133,17 +159,26 @@ ...@@ -133,17 +159,26 @@
明细 明细
</view> </view>
</view> </view>
<view class="flex f12 grey" style="margin-bottom:40rpx;" v-for="(item,index) in priceList" :key="index">
<view style="flex:1"> <view class="flex f12 grey" style="margin-bottom: 40rpx">
<text style="margin-right: 30rpx;">{{item.DateStr}}</text> <view style="flex: 1">
<text v-if="index!=0">{{item.BreakfastTypeStr}}</text> <text style="margin-right: 30rpx">房间</text>
</view>
<view style="text-align: right">
{{orderMsg.RoomCount}}间×{{RoomInfo.Currency}}{{ getPrice(orderMsg.TotalPrice) }}
</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :style="{'color':mainColor+' !important'}" v-if="useCouponIds.length>0">
<view style="flex: 1">
<text style="margin-right: 30rpx">优惠券</text>
</view> </view>
<view style="text-align: right;" v-if="index!=priceList.length-1">{{orderMsg.RoomNumber}}间 × ¥{{$utils.getretailer()==true? item.B2BPrice:item.SalesPrice}}</view> <view style="text-align: right">
</view > -¥{{currentCoupon.discountMoney}}</view>
<view class="PriceTole row-sb-n"> </view>
<view>合计</view> <view class="flex f12">
<view style="flex: 1">小计</view>
<view> <view>
¥100 {{RoomInfo.Currency}}{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}
</view> </view>
</view> </view>
</view> </view>
...@@ -155,10 +190,24 @@ ...@@ -155,10 +190,24 @@
</view> </view>
<view class="rule"> <view class="rule">
<text class="king">此房间 <text class="king">此房间
<template v-if="RoomInfo.IsCancel==0">支持免费取消,</template>
<template v-if="RoomInfo.IsCancel==1">不可取消,</template> </text>
<text v-if="roomRateDetails&&
roomRateDetails.CancellationPolicyList &&
roomRateDetails.CancellationPolicyList.length > 0">
<template v-for="(itemCancella, index1) in roomRateDetails.CancellationPolicyList">
<template v-if="index1==0">{{ getformatDateStr(itemCancella.FromDate) }}之前免费取消</template>
<template v-if="itemCancella.Amount==roomRateDetails.TotalPrice">
<template>{{ getformatDateStr(itemCancella.FromDate) }}起不可取消,取消将收取订单全额费用;</template>
</template>
<template v-else>
<template>{{ getformatDateStr(itemCancella.FromDate) }}
<template v-if="index1!=(roomRateDetails.CancellationPolicyList.length-1)">-
{{ getformatDateStr(roomRateDetails.CancellationPolicyList[index1+1].FromDate) }} 之间</template>
取消,收费 {{DanWei}}{{getPrice(itemCancella.Amount)}};</template>
</template>
</template>
</text> </text>
<text>订单需要等待酒店或供应商确认后生效,订单确认结果我们将会通知推送到您的微信,请您在下单时同意结果订阅,以便您能正常收到消息。</text>
</view> </view>
</view> </view>
<view style="height: 27rpx"></view> <view style="height: 27rpx"></view>
...@@ -179,24 +228,22 @@ ...@@ -179,24 +228,22 @@
<view class="opera-box"> <view class="opera-box">
<view class="box flex"> <view class="box flex">
<view class="price"> <view class="price">
<text class="f11"></text> <text class="f11">{{RoomInfo.Currency}}</text>
<text>{{orderMsg.Final_Price}}</text> <text>{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}</text>
</view> </view>
<view class="sum-detail">共计 {{orderMsg.RoomNumber}}间房</view> <view class="sum-detail">共计 {{orderMsg.RoomCount}}间房</view>
<u-button :ripple="true" :hair-line="false" :custom-style="btnStyle" @click="buyRoom">立即购买</u-button> <u-button :ripple="true" :hair-line="false" :custom-style="btnStyle" @click="buyRoom" :loading="submit">立即购买</u-button>
</view> </view>
</view> </view>
<u-picker v-model="showtime" mode="time" @confirm='confirm' :params="params" :default-time='orderMsg.ArrivalTime'></u-picker> <u-picker v-model="showtime" mode="time" @confirm='confirm' :params="paramsTime" :default-time='orderMsg.ArrivalTime'></u-picker>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<u-picker mode="selector" v-model="showCountry" :default-selector="[0]" <u-picker mode="selector" v-model="showCountry" :default-selector="[0]"
:range="countrys" @confirm='(e)=>{changeDown(e,CountryType)}' :range="countrys" @confirm='(e)=>{changeDown(e,CountryType)}'
range-key="label" @input="showCountry=false"></u-picker> range-key="label" @input="showCountry=false"></u-picker>
<coupon v-if="couponList.length > 0 && showCoupon" <coupon v-if="couponList.length > 0 && showCoupon" :price="price"
:price="price" :list="couponList" :list="couponList" :current="useCouponIds" @close="closeCouponHandler"
:current="useCouponIds" :current-price="realCurrentPriceInfo" :order="orderMsg"
@close="closeCouponHandler" :numberPeople="searchObj.peoples"></coupon>
:current-price="realCurrentPriceInfo"
:order="orderMsg"></coupon>
</view> </view>
</template> </template>
...@@ -226,18 +273,42 @@ import coupon from '@/components/coupon/index'; ...@@ -226,18 +273,42 @@ import coupon from '@/components/coupon/index';
dayObj:{}, dayObj:{},
HotelInfo:{}, HotelInfo:{},
orderMsg:{ orderMsg:{
ProductId:0, //房间id // ProductId:0, //房间id
StartDate:'', // StartDate:'',
EndDate:'', // EndDate:'',
RoomNumber:1, // RoomNumber:1,
Unit_Price:'', // Unit_Price:'',
Final_Price:'', // Final_Price:'',
Consignee:'', //联系人 // Consignee:'', //联系人
ConsigneeMobile:'', //;联系电话 // ConsigneeMobile:'', //;联系电话
ArrivalTime:'14:00' //预计到达时间 // ArrivalTime:'14:00', //预计到达时间
EmployeeIdStr: "",//销售id
CheckInDate: "",//到店时间
RatePlanID: "",
CheckOutDate: "",//离店时间
RoomCount: "",//房间数量
guestLastName: "",//英文姓
guestFirstName: "",//英文名
guestAddress: "",
guestPhoneNumber: "",
guestEmail: "",//Email
BookingID: "",
HotelName: "",//酒店名称
HotelPic: "",//酒店封面
GuestList: [],
TotalPrice: 0,//总价
CustomerPayMoney: 0,
DiscountMoney: 0,//优惠
OrderSource: 2,
OrderForm: 4,//订单来源
//备注
guestRequest: "",
hotelId: '',//酒店Id
roomType: 0,
}, },
showtime:false, showtime:false,
params: { paramsTime: {
year: false, year: false,
month: false, month: false,
day: false, day: false,
...@@ -245,13 +316,6 @@ import coupon from '@/components/coupon/index'; ...@@ -245,13 +316,6 @@ import coupon from '@/components/coupon/index';
minute: true, minute: true,
second: false second: false
}, },
priceList:[], //每日价格
rMsg:{
HotelId:0,
productId:0,
StartDate:'',
EndDate:''
},
tipsText:'', tipsText:'',
showCountry: false, showCountry: false,
countrys:[], countrys:[],
...@@ -265,40 +329,159 @@ import coupon from '@/components/coupon/index'; ...@@ -265,40 +329,159 @@ import coupon from '@/components/coupon/index';
}, },
showPz:false, showPz:false,
pzCoupon:null, pzCoupon:null,
searchObj:null,
mainColor: '',
activeStyle: '',
params: {
sort: 1,
displayFrom: 1,
CheckInDate: "",
CheckOutDate: "",
searchroomGroup: [],
ratePlanID: "",
imgUrl: "",
RoomCount: 1,
ChildCount: 0,
AdultCount: 1,
OccupancyDetails: [],
hotelId: 0
},
roomRateDetails: {},
dataList: {},
customer: {},
CreateBy: 0,
submit: false,
orderInfo: null,
} }
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`;
}, },
onLoad(options) { onLoad(options) {
if(options.RoomInfo){ this.customer = uni.getStorageSync("b2b_user")
this.RoomInfo = JSON.parse(options.RoomInfo) console.log(this.customer,'------this.customer')
if(options.searchObj){
this.searchObj = JSON.parse(options.searchObj)
} }
if(options.HotelInfo){ if(options.HotelInfo){
this.HotelInfo = JSON.parse(options.HotelInfo) this.HotelInfo = JSON.parse(options.HotelInfo)
console.log(this.HotelInfo,'-----------HotelInfo')
this.orderMsg.hotelId = this.HotelInfo.hotelid;
}
if(options.RoomInfo){
this.RoomInfo = JSON.parse(options.RoomInfo)
} }
if(options.dayObj){ if(options.dayObj){
this.dayObj = JSON.parse(options.dayObj) this.dayObj = JSON.parse(options.dayObj)
} }
this.rMsg.HotelId = this.HotelInfo.HotelId; if (options.CreateBy) {
this.rMsg.productId = this.RoomInfo.ID; this.CreateBy = options.CreateBy
this.rMsg.StartDate = this.dayObj.start; }
this.rMsg.EndDate = this.dayObj.end;
this.orderMsg.ProductId = this.RoomInfo.ID; this.orderMsg.ProductId = this.RoomInfo.RoomTypeID;
this.orderMsg.Unit_Price = this.RoomInfo.B2BPrice; console.log(this.searchObj,'-----------searchObj')
this.orderMsg.StartDate = this.dayObj.start; console.log(this.RoomInfo,'-----------RoomInfo')
this.orderMsg.EndDate = this.dayObj.end;
uni.setNavigationBarTitle({ this.orderMsg.RatePlanID = this.RoomInfo.RatePlanID
title: this.HotelInfo.HotelName this.orderMsg.TotalPrice = this.getPrice(this.RoomInfo.TotalPrice);
this.orderMsg.CheckInDate = this.dayObj.start;
this.orderMsg.CheckOutDate = this.dayObj.end;
this.orderMsg.RoomCount = this.searchObj.rooms
this.orderMsg.GuestList = [];
this.searchObj.searchroomGroup.forEach((item, index) => {
var guestInfoList = [];
let allprople = item.numberOfAdults + item.numberOfChildren;
for (let i = 1; i <= allprople; i++) {
let obj = {
LastName: "",
FirstName: "",
Age: ""
};
guestInfoList.push(obj);
}
var obj = {
RoomNum: index + 1,
numberOfAdults: item.numberOfAdults,
numberOfChildren: item.numberOfChildren,
ChildAgeDetails: item.ChildAgeDetails!=''?item.ChildAgeDetails:1,
GuestInfo: guestInfoList
};
this.orderMsg.GuestList.push(obj);
}); });
console.log(this.orderMsg.GuestList)
this.params = {
sort: 1,
displayFrom: 1,
CheckInDate: this.orderMsg.CheckInDate,
CheckOutDate: this.orderMsg.CheckOutDate,
searchroomGroup: this.searchObj.searchroomGroup,
ratePlanID: this.orderMsg.RatePlanID,
imgUrl: "",
RoomCount: this.orderMsg.RoomCount,
ChildCount: this.searchObj.childrenNumberZC,
AdultCount: this.searchObj.adultsNumber,
OccupancyDetails: [],
hotelId: this.orderMsg.hotelId
}
this.CalTotalPrice(); this.CalTotalPrice();
this.getRoomPrice();
this.GetCountryInfo() this.GetCountryInfo()
this.initHotel()
}, },
methods:{ methods:{
//日期格式化
getformatDateStr(value) {
var dt = new Date(value);
let year = dt.getFullYear();
let month = (dt.getMonth() + 1).toString().padStart(2, "0");
let date = (dt.getDate()).toString().padStart(2, "0");
return year + "-" + month + "-" + date;
},
initHotel() {
uni.showLoading({
title: '加载中...',
mask: true
});
this.apipost(
"dmc_post_GetDiDaPriceConfirm",this.params,
res => {
if (res.resultCode == 1) {
uni.hideLoading();
uni.setNavigationBarTitle({
title: this.HotelInfo.HotelName
});
this.dataList = res.data.PriceDetails;
this.roomRateDetails = res.data.PriceDetails.HotelList[0];
this.orderMsg.BookingID = res.data.PriceDetails.ReferenceNo;
this.orderMsg.checkInTime = res.data.PriceDetails.CheckInDate;
this.orderMsg.HotelName = this.HotelInfo.HotelName
// this.orderMsg.TotalPrice = this.getPrice(this.roomRateDetails.TotalPrice);
if(this.roomRateDetails.RatePlanList&&this.roomRateDetails.RatePlanList.length>0){
this.orderMsg.roomType = this.roomRateDetails.RatePlanList[0].BedType
}
// this.orderMsg.HotelPic = this.HotelInfo.HotelPic
if (
Object.prototype.toString.call(this.dataList.HotelList) ==
"[object Object]"
) {
let arr = [];
arr.push(this.dataList.HotelList);
this.dataList.HotelList = arr;
}
}
});
},
getPrice(price) {
return Math.ceil(price);
},
goUrl(){ goUrl(){
uni.navigateTo({ uni.navigateTo({
url: '/pages/hotel/orderInfor' url: `/pages/hotel/orderInfor?msg=${encodeURIComponent(JSON.stringify(this.params))}&dayObj=${JSON.stringify(this.dayObj)}&searchObj=${JSON.stringify(this.searchObj)}&HotelInfo=${JSON.stringify(this.HotelInfo)}`
}) })
}, },
showCouponHandler() { showCouponHandler() {
...@@ -330,12 +513,34 @@ import coupon from '@/components/coupon/index'; ...@@ -330,12 +513,34 @@ import coupon from '@/components/coupon/index';
} }
this.showCoupon = false; this.showCoupon = false;
}, },
calcMaxCouponHandle(){
if(this.couponList && this.couponList.length>0){
let maxCouponId = 0
let discount = 0
const money = this.price
this.couponList.forEach(x=>{
if(x.couponsType==1 && x.denomination>discount&&(this.orderMsg.AdultPeopleNum>=x.orderGuestNum||!x.orderGuestNum)) {
discount=x.denomination
maxCouponId = x.id
}
if(x.couponsType==2){
let disMoney = money*(1-x.denomination)
if(discount<disMoney&&(this.orderMsg.AdultPeopleNum>=x.orderGuestNum||!x.orderGuestNum)){
discount=disMoney
maxCouponId = x.id
}
}
})
if(maxCouponId>0) this.closeCouponHandler([maxCouponId])
else this.closeCouponHandler(-1)
}
},
getUserCouponList() { getUserCouponList() {
let couponParams = { let couponParams = {
"lineId": '', //线路ID "lineId": '', //线路ID
"lineteamId": 0, //系列ID "lineteamId": 0, //系列ID
"userId": this.customer.accountId, "userId": this.customer.accountId,
"CouponsUseScope": 9, //特定使用平台(当地游=8 跟团游=2 小包团=10) "CouponsUseScope": 11, //特定使用平台(当地游=8 跟团游=2 小包团=10)
"isExpansion": 0, //是否启动膨胀金1-是 "isExpansion": 0, //是否启动膨胀金1-是
"CustomerType": 0, //客户类型 0-同行,1-直客 "CustomerType": 0, //客户类型 0-同行,1-直客
"TCID": '', "TCID": '',
...@@ -346,7 +551,8 @@ import coupon from '@/components/coupon/index'; ...@@ -346,7 +551,8 @@ import coupon from '@/components/coupon/index';
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log("coupon_post_GetUserCanUseCouponList_res", res); console.log("coupon_post_GetUserCanUseCouponList_res", res);
this.couponList = res.data this.couponList = res.data
this.calcPzCouponHandler() // this.calcPzCouponHandler()
this.calcMaxCouponHandle()
} }
}, },
(err) => { (err) => {
...@@ -394,11 +600,27 @@ import coupon from '@/components/coupon/index'; ...@@ -394,11 +600,27 @@ import coupon from '@/components/coupon/index';
}, },
editNum(type) { editNum(type) {
if (type == 1) { if (type == 1) {
if(this.orderMsg.RoomNumber>1)this.orderMsg.RoomNumber--; if(this.orderMsg.RoomCount>1){
this.orderMsg.RoomCount--;
this.orderMsg.GuestList.splice(this.orderMsg.GuestList.length-1,1)
}
}else { }else {
this.orderMsg.RoomNumber++; this.orderMsg.RoomCount++;
this.orderMsg.GuestList.push({
RoomNum: this.orderMsg.GuestList.length+1,
numberOfAdults: 1,
numberOfChildren: 0,
ChildAgeDetails: '',
GuestInfo: [
{
LastName: "",
FirstName: "",
Age: ""
}
]
})
} }
this.getRoomNumber() this.CalTotalPrice();
}, },
getDate(date){ getDate(date){
if(date){ if(date){
...@@ -415,130 +637,176 @@ import coupon from '@/components/coupon/index'; ...@@ -415,130 +637,176 @@ import coupon from '@/components/coupon/index';
confirm(val){ confirm(val){
this.orderMsg.ArrivalTime=val.hour+':'+val.minute; this.orderMsg.ArrivalTime=val.hour+':'+val.minute;
}, },
//改变房间数量
getRoomNumber(val){
this.orderMsg.RoomNumber = val.value;
this.CalTotalPrice();
},
//获取房型报价
getRoomPrice(){
this.request2({
url: '/api/Hotel/GetHotelRoomPrice',
data: this.rMsg
},
res => {
if (res.resultCode == 1) {
this.priceList = res.data;
this.CalTotalPrice();
}
}
);
},
//计算总价 //计算总价
CalTotalPrice(){ CalTotalPrice(){
this.orderMsg.Final_Price=0;
this.priceList.forEach(x=>{ },
console.log("xx",x); validate(){
if(this.$utils.getretailer()){ let email = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/
console.log("1",x.B2BPrice) let msg = ''
this.orderMsg.Final_Price += parseInt(this.orderMsg.RoomNumber)*x.B2BPrice; for(let i=0;i<this.orderMsg.GuestList.length;i++){
}else{ for(let j=0;j<this.orderMsg.GuestList[i].GuestInfo.length;j++){
console.log("2",x.SalesPrice) if(this.orderMsg.GuestList[i].GuestInfo[j].LastName==''){
this.orderMsg.Final_Price += parseInt(this.orderMsg.RoomNumber)*x.SalesPrice; return msg = '请输入住客姓'
} }
}) if(this.orderMsg.GuestList[i].GuestInfo[j].FirstName==''){
console.log(this.orderMsg.Final_Price,'this.orderMsg.Final_Price'); return msg = '请输入住客名'
}
}
}
if(this.orderMsg.guestLastName==''){
msg = '请输入姓名'
} else if(this.orderMsg.guestPhoneNumber==''){
msg = '请输入联系电话'
} else if(this.orderMsg.guestPhoneNumber&&this.orderMsg.guestPhoneNumber.length!=11){
msg = '请输入正确的电话号码'
}else if(this.orderMsg.guestEmail==''||!this.orderMsg.guestEmail){
msg = '请输入邮箱地址'
}else if (!email.test(this.orderMsg.guestEmail)) {
msg = '请输入正确的邮箱地址'
}else if (this.orderMsg.CheckInDate=='') {
msg = '入住时间不能为空'
}else if (this.orderMsg.CheckOutDate=='') {
msg = '离店时间不能为空'
}
return msg
}, },
//立即购买 //立即购买
buyRoom(){ buyRoom(){
let that = this; const error = this.validate()
if (that.orderMsg.Consignee == '') { if(error!=''){
this.$refs.uToast.show({ uni.showToast({
title: '请输入住客姓名!', icon:'none',
type: 'warning' title:error
});
return;
}
if (that.orderMsg.ConsigneeMobile == '') {
this.$refs.uToast.show({
title: '请输入联系电话!',
type: 'warning'
});
return;
}
var tempObj = uni.getStorageSync('basedata').mall.wechatmessage;
var tmplIds = [];
if(tempObj&&tempObj.length>0){
tempObj.forEach(x=>{
if(x.Name=='下单成功提醒'||x.Name=='订单取消提醒'||x.Name=='订单确认通知'){
tmplIds.push(x.MessageId)
}
}) })
return
} }
uni.requestSubscribeMessage({ if(this.submit) return;
tmplIds: tmplIds, this.submit = true;
complete(res) { let that = this;
that.request2({ var CustomerId = 0
url: '/api/Hotel/SetAppletHotelOrder', var CreateBy = 0//同行id
data: that.orderMsg var DirectCustomerId = 0 //直客id
}, // #ifdef MP-DI
DirectCustomerId = this.customer.customerId
CreateBy = this.customer.customerId
this.orderMsg.OrderSource = 7
// #endif
// #ifdef MP-AG
CreateBy = this.CreateBy
CustomerId = this.customer.customerId
this.orderMsg.OrderSource = 5
// #endif
this.orderMsg.EmployeeIdStr = CreateBy;
console.log(that.orderMsg,'-----酒店下单');
that.apipost('dmc_post_GetDiDaBookingConfirm',that.orderMsg,
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
that.queren(res.data) const tempData = res.data
// #ifdef MP-DI
this.submitB2COrderHandler(tempData.orderId)
// #endif
// #ifdef MP-AG
this.submit = false
uni.showToast({
title: '订单创建成功.',
icon: 'none'
})
uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=3`,
});
// #endif
console.log(res,'-------酒店erp下单成功')
} }
} }
); );
}
})
},
queren(OrderId){
let url='/api/WeChatPay/GetDmcPayInfo'
let GoodsName = this.RoomInfo.RoomName;
GoodsName = GoodsName.slice(0, 10)
this.request2({
url: url,
data: {
OrderId:OrderId,
GoodsName:GoodsName,
OrderPayType:1,
OpenId:uni.getStorageSync('mall_UserInfo').OpenId,
}
}, },
res => { submitB2COrderHandler(OrderId) {
this.orderInfo = JSON.parse(res.data); let userInfo = uni.getStorageSync("mall_UserInfo");
this.Pay() let guestInfo = `成人x${this.searchObj.adultsNumber}; `;
if (this.orderMsg.ChirdNeedBedNum > 0) {
guestInfo += `儿童${this.searchObj.childrenNumberZC}; `;
}
let msg = {
SurName: this.customer.SurName,
Name: this.customer.name,
ContactNumber: this.orderMsg.guestPhoneNumber,
Mailbox: this.orderMsg.guestEmail,
GoodsId: this.orderMsg.RatePlanID,
GoodsName: this.HotelInfo.name,
GoodsPic: this.HotelInfo.images[0].Path,
GoodsType: 9,
OrderMake: `${this.orderMsg.CheckInDate}入住;${this.orderMsg.CheckOutDate}离店 ${guestInfo}`,
TotalPrice: this.getPrice(this.orderMsg.TotalPrice),
PreferentialPrice: this.currentCoupon.discountMoney,
ErpOrderId: OrderId,
Country: 0,
PlatformTax: 0,
Income: 0,
Refund: 0,
MallBaseId: userInfo.MallBaseId,
CreateBy:0
};
// #ifdef MP-DI
if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){
msg.CreateBy = this.customer.salesBaseInfo.employeeId
}
// #endif
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
uni.showToast({
icon: 'none',
title: '订单创建成功'
})
this.goPayHandler(res.data.OrderNo);
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
} }
); });
}, },
Pay(){ goPayHandler(OrderNo) {
let that=this; let that = this;
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: "wxpay",
timeStamp: this.orderInfo.timeStamp, timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr, nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package, package: this.orderInfo.package,
signType: this.orderInfo.signType, signType: this.orderInfo.signType,
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function(res) {
console.log("success", res);
that.submit = false;
uni.showToast({ uni.showToast({
title: "支付成功" title: "支付成功",
}) });
setTimeout(()=>{ setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: '/pages/jiuzhai/paysuccess?PreferPrice='+that.orderMsg.Final_Price url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
(that.getPrice(that.orderMsg.TotalPrice)-that.currentCoupon.discountMoney).toFixed(2) +
"&isFrom=5",
}); });
}, 100 ) }, 100);
}, },
fail: function(err) { fail: function(err) {
console.log("fail:", err);
that.submit = false;
uni.showToast({ uni.showToast({
title: "支付失败" title: "支付失败",
}) icon: "none",
setTimeout(()=>{ });
setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: '/pages/jiuzhai/allorderList' url: "/pages/jiuzhai/jz_SureOrder?OrderNo=" + OrderNo,
}); });
}, 100 ) }, 100);
} },
}); });
}, },
} }
...@@ -605,7 +873,7 @@ import coupon from '@/components/coupon/index'; ...@@ -605,7 +873,7 @@ import coupon from '@/components/coupon/index';
padding: 10rpx 15rpx 20rpx 15rpx; padding: 10rpx 15rpx 20rpx 15rpx;
} }
.hotel-order .form .form-items .label{ .hotel-order .form .form-items .label{
width: 112rpx; width: 130rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
margin-right: 57rpx; margin-right: 57rpx;
...@@ -867,4 +1135,10 @@ import coupon from '@/components/coupon/index'; ...@@ -867,4 +1135,10 @@ import coupon from '@/components/coupon/index';
color: #1D1D20; color: #1D1D20;
line-height: 42rpx; line-height: 42rpx;
} }
.LastNameBox view{
margin-bottom: 20rpx;
}
.LastNameBox view:last-child{
margin-bottom: 0;
}
</style> </style>
<template> <template>
<view class="hotel-detail"> <view class="hotel-detail" v-if="roomRateDetails.RatePlanList&&roomRateDetails.RatePlanList.length>0">
<scroll-view <scroll-view
ref="scrollView" ref="scrollView"
scroll-y="true" scroll-y="true"
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
@click="openPicture" @click="openPicture"
> >
<u-swiper <u-swiper
:list="dataList.HotelImg" :list="HotelInfo.images"
:effect3d="false" :effect3d="false"
:height="545" :height="545"
:interval="5000" :interval="5000"
:border-radius="0" :border-radius="0"
name="Path" name="Path"
v-if="active == 1"
></u-swiper> ></u-swiper>
<!--
<view class="video-box" v-if="active == 0"> <view class="video-box" v-if="active == 0">
<video <video
id="myVideo" id="myVideo"
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
object-fit="fill" object-fit="fill"
></video> ></video>
<view @click="enlarge" class="play-btn"> <view @click="enlarge" class="play-btn">
<!-- 播放按钮 --> 播放按钮
<image <image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616471847000_345.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616471847000_345.png"
style="width: 37rpx; height: 44rpx" style="width: 37rpx; height: 44rpx"
mode="" mode=""
></image> ></image>
</view> </view>
</view> </view>-->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view <view
@click="goback" @click="goback"
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</view> </view>
<!-- #endif --> <!-- #endif -->
<view class="orderIforDiZhi"> <view class="orderIforDiZhi">
<view class="orderIforDiZhiL">成田国际花园酒店</view> <view class="orderIforDiZhiL">{{ HotelInfo.name }}</view>
<view class="orderIforDiZhiR row"> <view class="orderIforDiZhiR row">
<view class="orderIforDiZhiRImg"> <view class="orderIforDiZhiRImg">
<img <img
...@@ -64,7 +64,9 @@ ...@@ -64,7 +64,9 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766148323678002.png"/> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766148323678002.png"/>
</view> </view>
<view class="orderIforDiZhiRText"> <view class="orderIforDiZhiRText">
95 Cheongpa-ro 20-gil, 龙山区, 首尔, 首尔(及其周边地区),韩国 {{ HotelInfo.location.address }},
{{ HotelInfo.location.destination.name }},
{{ HotelInfo.location.country.name }}
</view> </view>
</view> </view>
</view> </view>
...@@ -79,7 +81,7 @@ ...@@ -79,7 +81,7 @@
style="flex: 1; margin-left: 30rpx; text-align: left" style="flex: 1; margin-left: 30rpx; text-align: left"
class="name-ali" class="name-ali"
> >
{{ dataList.HotelName }} {{ HotelInfo.name }}
</view </view
> >
</view> </view>
...@@ -87,23 +89,32 @@ ...@@ -87,23 +89,32 @@
<view class="ReservationInforTitle">预定信息</view> <view class="ReservationInforTitle">预定信息</view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">入住时间</view> <view class="ResInforL">入住时间</view>
<view class="ResInforR">2025-02-05(周二)</view> <view class="ResInforR">{{roomMsg.StartDate}}({{getWeek(roomMsg.StartDate)}})</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">离店日期</view> <view class="ResInforL">离店日期</view>
<view class="ResInforR">2025-02-05(周二)</view> <view class="ResInforR">{{roomMsg.EndDate}}({{getWeek(roomMsg.EndDate)}})</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">入住时间</view> <view class="ResInforL">入住时间</view>
<view class="ResInforR">1</view> <view class="ResInforR">{{day}}</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">房型</view> <view class="ResInforL">房型</view>
<view class="ResInforR">高级双床房(1间)</view> <view class="ResInforR">{{roomRateDetails.RatePlanList[0].RatePlanName}}({{searchObj.rooms}}间)</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">餐型</view> <view class="ResInforL">餐型</view>
<view class="ResInforR">含早餐 x2份</view> <view class="ResInforR" v-if="roomRateDetails.RatePlanList && roomRateDetails.RatePlanList.length > 0">
<template v-for="( itemp, indexp ) in roomRateDetails.RatePlanList[0].PriceList" >
<template v-if="!indexp">
{{getMealtype(itemp.MealType)}}
<template v-if="itemp.MealAmount>0">
×{{itemp.MealAmount}}
</template>
</template>
</template>
</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">窗户</view> <view class="ResInforL">窗户</view>
...@@ -111,7 +122,7 @@ ...@@ -111,7 +122,7 @@
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">人数</view> <view class="ResInforL">人数</view>
<view class="ResInforR">最多入住2</view> <view class="ResInforR">最多入住{{ roomRateDetails.RatePlanList[0].MaxOccupancy}}</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">面积</view> <view class="ResInforL">面积</view>
...@@ -127,72 +138,34 @@ ...@@ -127,72 +138,34 @@
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">取消政策</view> <view class="ResInforL">取消政策</view>
<view class="ResInforR">不可修改</view> <view class="ResInforR">
<text v-if="roomRateDetails&&
roomRateDetails.CancellationPolicyList &&
roomRateDetails.CancellationPolicyList.length > 0">
<template v-for="(itemCancella, index1) in roomRateDetails.CancellationPolicyList">
<template v-if="index1==0">{{ getformatDateStr(itemCancella.FromDate) }}之前免费取消</template>
<template v-if="itemCancella.Amount==roomRateDetails.TotalPrice">
<template>{{ getformatDateStr(itemCancella.FromDate) }}起不可取消,取消将收取订单全额费用;</template>
</template>
<template v-else>
<template>{{ getformatDateStr(itemCancella.FromDate) }}
<template v-if="index1!=(roomRateDetails.CancellationPolicyList.length-1)">
-{{ getformatDateStr(roomRateDetails.CancellationPolicyList[index1+1].FromDate) }} 之间</template>
取消,收费 {{DanWei}}{{getPrice(itemCancella.Amount)}};</template>
</template>
</template>
</text>
</view>
</view> </view>
</view> </view>
<view class="ReservationInforBox"> <view class="ReservationInforBox">
<view class="ReservationInforTitle">立即确认</view> <view class="ReservationInforTitle" @click="goback">立即确认</view>
<view class="ResInforText ResInforTtisp row-sb-n"> <view class="ResInforText ResInforTtisp row-sb-n">
<view class="ResInforTisp">订单提交后,酒店将立即确认您的订单,保障您的住房需求。</view> <view class="ResInforTisp">订单提交后,酒店将立即确认您的订单,保障您的住房需求。</view>
</view> </view>
</view> </view>
<view style="height: 36rpx;"></view> <view style="height: 36rpx;"></view>
</scroll-view> </scroll-view>
<u-popup
v-model="showTimePopup"
mode="bottom"
border-radius="20"
length="85%"
:safe-area-inset-bottom="true"
>
<view style="
width: 100%;
height: 100%;
display: flex;
flex-direction: column;">
<view style="flex: 1; width: 100%; height: 1rpx">
<canlendar @finish="chosenDateResult" title="日期和人数"></canlendar>
</view>
<view style="background: #ecf1f4; padding: 20rpx 0;margin-bottom: 80rpx;">
<view class="row line-flex" style="padding: 30rpx; background: #fff">
<text style="font-size: 28rpx; color: #111; font-weight: 500">房间</text>
<text style="
font-size: 22rpx;
color: #999;
margin-left: 30rpx;
flex: 1;
"></text>
<u-number-box size="28" :min="1" :max="100000" v-model="searchObj.rooms"></u-number-box>
</view>
<view class="row line-flex" style="padding: 30rpx; background: #fff">
<text style="font-size: 28rpx; color: #111; font-weight: 500">成人</text>
<text style="
font-size: 22rpx;
color: #999;
margin-left: 30rpx;
flex: 1;
">18周岁以上</text>
<u-number-box size="28" :min="1"
:max="100000"
v-model="searchObj.adultsNumber"
@change="crChange"></u-number-box>
</view>
<view class="row line-flex" style="padding: 30rpx; background: #fff">
<text style="font-size: 28rpx; color: #111; font-weight: 500">儿童(占床)</text>
<text style="
font-size: 22rpx;
color: #999;
margin-left: 30rpx;
flex: 1;
">2-18周岁(不含)</text>
<u-number-box size="28" :min="0" :max="100000"
v-model="searchObj.childrenNumberZC"
@change="etChange"
></u-number-box>
</view>
</view>
</view>
</u-popup>
</view> </view>
</template> </template>
...@@ -235,7 +208,6 @@ ...@@ -235,7 +208,6 @@
opacity: 0, opacity: 0,
}, },
mainColor: "", mainColor: "",
showTimePopup: false,
controls: false, controls: false,
videoUrl: "https://video.c-ctrip.com/videos/230i1r000001hxb2mEEE4.mp4", videoUrl: "https://video.c-ctrip.com/videos/230i1r000001hxb2mEEE4.mp4",
active: 1, active: 1,
...@@ -306,7 +278,11 @@ ...@@ -306,7 +278,11 @@
scrollTop: 100, scrollTop: 100,
old:{ old:{
scrollTop: 0 scrollTop: 0
} },
HotelInfo:{},
roomRateDetails:{},
params:{},
HotelMealTypes: [],
}; };
}, },
created() { created() {
...@@ -315,6 +291,14 @@ ...@@ -315,6 +291,14 @@
: 0; : 0;
}, },
onLoad(options) { onLoad(options) {
if(options.msg){
this.params = JSON.parse(decodeURIComponent(options.msg))
console.log(JSON.parse(decodeURIComponent(options.msg)))
}
if(options.HotelInfo){
this.HotelInfo = JSON.parse(options.HotelInfo)
console.log(this.HotelInfo,'酒店详情')
}
this.id = options.id; this.id = options.id;
this.roomMsg.HotelId = options.id; this.roomMsg.HotelId = options.id;
let that = this; let that = this;
...@@ -336,150 +320,65 @@ ...@@ -336,150 +320,65 @@
this.endDay = tempDay.endDay; this.endDay = tempDay.endDay;
this.day = tempDay.day; this.day = tempDay.day;
this.dayObj = tempDay; this.dayObj = tempDay;
} else {
let d1 = new Date();
let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1));
let startWeek = "周" + "日一二三四五六".charAt(new Date().getDay());
let endWeek = "周" + "日一二三四五六".charAt(new Date().getDay() + 1);
let month1 = d1.getMonth() + 1;
let day1 = d1.getDate();
let Month1 = month1>9?month1:'0'+month1;
let Day1 = day1>9?day1:'0'+day1;
let month2 = d2.getMonth() + 1;
let day2 = d2.getDate();
let Month2 = month2>9?month2:'0'+month2;
let Day2 = day2>9?day2:'0'+day2;
var obj = {
start: `${d1.getFullYear()}-${Month1}-${Day1}`,
end: `${d2.getFullYear()}-${Month2}-${Day2}`,
startDay: `${Month1}-${Day1}`,
endDay: `${Month2}-${Day2}`,
day: 1,
startWeek: startWeek,
endWeek: endWeek,
};
this.roomMsg.StartDate = obj.start;
this.roomMsg.EndDate = obj.end;
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.dayObj = obj;
}
if (this.id > 0) {
this.getHotelDetail(this.id);
} }
if (options.searchObj) { if (options.searchObj) {
this.searchObj = JSON.parse(options.searchObj); this.searchObj = JSON.parse(options.searchObj);
} }
this.getRecomHotel(); this.getdidaMealType()
this.initHotel()
}, },
methods: { methods: {
goFacil(item){ //日期格式化
this.current = item.ID; getformatDateStr(value) {
this.scrollTop = this.old.scrollTop var dt = new Date(value);
this.$nextTick(function() { let year = dt.getFullYear();
this.scrollTop = item.top let month = (dt.getMonth() + 1).toString().padStart(2, "0");
}); let date = (dt.getDate()).toString().padStart(2, "0");
}, return year + "-" + month + "-" + date;
openTime() {
this.showTimePopup = true;
},
etChange(e){
this.searchObj.childrenNumberZC = e.value;
this.peopleChange()
},
crChange(e){
this.searchObj.adultsNumber = e.value;
this.peopleChange()
},
peopleChange(){
this.searchObj.peoples = this.searchObj.adultsNumber + this.searchObj.childrenNumberZC
console.log(this.searchObj.peoples,'人数')
}, },
//获取推荐酒店 //获取道旅餐食类型
getRecomHotel() { getdidaMealType() {
this.searchObj.HotelId = this.id; this.apipost('dmc_post_GetDidaMealType', {}, res => {
this.request2(
{
url: "/api/Hotel/AppGetHotelPage",
data: this.searchObj,
},
(res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
// console.log(res, '推荐酒店'); this.HotelMealTypes = res.data;
this.HotelArr = [];
let tempHotel = res.data.pageData;
tempHotel.forEach((x) => {
if (this.HotelArr.length < 2) {
this.HotelArr.push(x);
} }
}); }, null)
},
//获取餐型
getMealtype(mealtypeId) {
let mealtypeName = "";
if (mealtypeId > 0) {
this.HotelMealTypes.forEach((item) => {
if (item.ID == mealtypeId) {
mealtypeName = item.Name_CN;
} }
});
} }
); return mealtypeName;
}, },
goMap(name, lon, lat) { initHotel() {
let newLon = parseFloat(lon); uni.showLoading({
let newLat = parseFloat(lat); title: '加载中...',
uni.openLocation({ mask: true
latitude: newLat, });
longitude: newLon, this.apipost(
scale: 18, "dmc_post_GetDiDaPriceConfirm",this.params,
name: name, res => {
address: name, if (res.resultCode == 1) {
success: (res) => {},
fail: (err) => {}, uni.hideLoading();
this.roomRateDetails = res.data.PriceDetails.HotelList[0];
console.log(this.HotelInfo.HotelName,'酒店详情')
this.dataList = res.data.PriceDetails;
}
}); });
}, },
openPicture() { openPicture() {
let imgObj = JSON.stringify(this.dataList.HotelImg); let imgObj = JSON.stringify(this.HotelInfo.images);
uni.navigateTo({ uni.navigateTo({
url: "/pages/hotel/picture?imgObj=" + imgObj, url: "/pages/hotel/picture?imgObj=" + imgObj,
}); });
}, },
openDescription() {
let hotelObj = JSON.stringify({
id: this.id,
start: this.dayObj.start,
end: this.dayObj.end,
});
uni.navigateTo({
url:
"/pages/hotel/description?hotelObj=" + encodeURIComponent(hotelObj),
});
},
chosenDateResult(obj) {
this.roomMsg.StartDate = obj.start;
this.roomMsg.EndDate = obj.end;
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.getRoomType();
this.dayObj = obj;
this.showTimePopup = false;
},
//切换日期获取房型
getRoomType() {
this.request2(
{
url: "/api/Hotel/GetHotelRoom",
data: this.roomMsg,
},
(res) => {
if (res.resultCode == 1) {
this.RoomList = res.data.RoomList;
}
}
);
},
formatMonthDay(str) {
let temp = str.split("-");
// temp[0] = temp[0] > 9 ? temp[0] : "0" + temp[0];
// temp[1] = temp[1] > 9 ? temp[1] : "0" + temp[1];
return `${temp[0]}${temp[1]}日`;
},
getMonth(date) { getMonth(date) {
let m = date.getMonth() + 1; let m = date.getMonth() + 1;
return m > 9 ? m : "0" + m; return m > 9 ? m : "0" + m;
...@@ -493,66 +392,6 @@ ...@@ -493,66 +392,6 @@
var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date
return "周" + week; return "周" + week;
}, },
changeNearbyType(t) {
this.nearbyType = t;
},
//显示全部
getAllRoom() {
this.isShowAll = !this.isShowAll;
if (this.isShowAll) {
this.threeLevelList.forEach((x) => {
x.isCheck = 1;
});
this.RoomList = this.dataList.RoomList;
} else {
this.threeLevelList.forEach((x) => {
x.isCheck = 0;
});
}
},
//点击过滤房间
changeRoomType(obj) {
if (obj.isCheck == 0) {
obj.isCheck = 1;
} else {
obj.isCheck = 0;
}
this.RoomList = [];
let num = 0;
this.threeLevelList.forEach((x) => {
if (x.isCheck == 1) {
num++;
this.dataList.RoomList.forEach((y) => {
if (x.id == 1 && y.BedType == 1) {
this.RoomList.push(y);
}
if (x.id == 2 && y.BedType == 2) {
this.RoomList.push(y);
}
if (x.id == 3 && y.BedType == 3) {
this.RoomList.push(y);
}
if (x.id == 4 && y.BreakfastType != 4) {
this.RoomList.push(y);
}
if (x.id == 5 && y.IsCancel == 2) {
this.RoomList.push(y);
}
});
}
});
if (num == this.threeLevelList.length) {
this.isShowAll = true;
} else {
this.isShowAll = false;
}
if (num == 0) {
this.RoomList = this.dataList.RoomList;
}
},
changeLike() {
this.islike = !this.islike;
},
previewImage(i) { previewImage(i) {
uni.previewImage({ uni.previewImage({
urls: this.imgsList, urls: this.imgsList,
...@@ -598,41 +437,6 @@ ...@@ -598,41 +437,6 @@
delta: 1, delta: 1,
}); });
}, },
changeHandler(i) {
this.active = i;
},
//获取酒店详情
getHotelDetail(id) {
let msg = {
HotelId: id,
StartDate: this.dayObj.start,
EndDate: this.dayObj.end,
};
this.request2(
{
url: "/api/Hotel/GetHotelInfo",
data: msg,
},
(res) => {
if (res.resultCode == 1) {
// console.log(res, '详情数据');
this.dataList = res.data;
this.RoomList = this.dataList.RoomList;
this.hotelData.HotelId = this.dataList.HotelId;
this.hotelData.HotelName = this.dataList.HotelName;
this.hotelData.Booking = this.dataList.Booking;
setTimeout(() => {
this.hotelFacilities.forEach((x)=>{
const query = uni.createSelectorQuery().select(`#${x.val}`);
query.boundingClientRect((rect) => {
x.top = rect.top+250;
}).exec();
})
}, 1000);
}
}
);
},
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
//分享朋友圈 //分享朋友圈
onShareTimeline() { onShareTimeline() {
......
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
}); });
} else if (this.isLineOrder == 3) num = '6'//签证订单 } else if (this.isLineOrder == 3) num = '6'//签证订单
else if (this.isLineOrder == 4) num = '1'//机票订单 else if (this.isLineOrder == 4) num = '1'//机票订单
else if (this.isLineOrder == 5) num = '8,9,10,11'//酒店订单
if(num){ if(num){
uni.redirectTo({ uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=${num}`, url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=${num}`,
......
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