Commit 5e45e1c7 authored by youjie's avatar youjie

酒店

parent 1fea54c6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="hotel-list-search"> <view class="hotel-list-search">
<view class="row items-center" style="padding: 12rpx 0 0 0;"> <view class="row items-center" style="padding: 12rpx 0 0 0;">
<view class="search-box" style="width: 1px;flex: 1;"> <view class="search-box" style="width: 1px;flex: 1;">
<view class="hotel-city" @click="showCity"> <view class="hotel-city" @click="MapType?'':showCity()">
{{ city }} {{ city }}
</view> </view>
...@@ -110,13 +110,14 @@ ...@@ -110,13 +110,14 @@
">{{ tempRateAndPrice.priceText }}</view> ">{{ tempRateAndPrice.priceText }}</view>
</view> </view>
<range-slider ref="rangeslider" :width="690" :height="80" :step="10" :liveMode="true" <range-slider ref="rangeslider" :width="690" :height="80" :step="10" :liveMode="true"
background-color="#E2E2E2" :block-size="40" bar-height="12" active-color="#E2C27A" min="100" background-color="#E2E2E2" :block-size="40" bar-height="12"
active-color="#E2C27A" min="100"
:max="MaximumDatas.maxPrice" @rangechange="rangechange" :max="MaximumDatas.maxPrice" @rangechange="rangechange"
:values="tempRateAndPrice.price"></range-slider> :values="tempRateAndPrice.price"></range-slider>
</view> </view>
<view class="hotelPriceRangeBox row"> <view class="hotelPriceRangeBox row">
<view class="hotelPriceRange" v-for="(item,index) in PriceRange" :key="index" <view class="hotelPriceRange" v-for="(item,index) in PriceRange" :key="index"
:class="[tempRateAndPrice.priceId==index+1?'active':'']" @click="changePrice(item)"> :class="[tempRateAndPrice.priceId==item.priceId?'active':'']" @click="changePrice(item)">
<view> <view>
{{ item.Name }} {{ item.Name }}
</view> </view>
...@@ -187,7 +188,7 @@ ...@@ -187,7 +188,7 @@
searchCity, searchCity,
CheckDate CheckDate
}, },
props: ['isMap', 'msg', 'daysObj'], props: ['isMap', 'msg', 'daysObj','MapType'],
data() { data() {
return { return {
city: "成都", city: "成都",
...@@ -264,9 +265,7 @@ ...@@ -264,9 +265,7 @@
msg: { msg: {
handler(val, oldval) { handler(val, oldval) {
if (val) { if (val) {
this.parameters = { this.parameters = JSON.parse(JSON.stringify(val))
...val
}
if (val.QOrderBy) { if (val.QOrderBy) {
let list = this.options1.filter(x => { let list = this.options1.filter(x => {
return x.value == val.QOrderBy return x.value == val.QOrderBy
...@@ -276,16 +275,18 @@ ...@@ -276,16 +275,18 @@
if (val.CityName_CN) { if (val.CityName_CN) {
this.optionsTitle[1] = val.CityName_CN this.optionsTitle[1] = val.CityName_CN
} }
if (val.QStarRating.length > 0) { if (val.CityName) {
this.city = val.CityName
}
let num = 0 let num = 0
if (val.QStarRating.length > 0) num++ if (val.QStarRating.length > 0) num++
if (val.priceId) num++ if (val.priceId) num++
if (val.QStarRating.length > 0||val.priceId) {
this.optionsTitle[2] = `价格/星级 ${num}`; this.optionsTitle[2] = `价格/星级 ${num}`;
this.tempRateAndPrice.rate = val.QStarRating
} }
if (val.CityName) { if(this.MapType){
this.city = val.CityName this.research()
this.parameters.CityCode = val.CityCode
this.parameters.CityCode2 = val.CityCode2
} }
} }
}, },
...@@ -299,6 +300,7 @@ ...@@ -299,6 +300,7 @@
this.dayObj = val this.dayObj = val
}, },
deep: true, deep: true,
immediate: true,
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -536,13 +538,23 @@ ...@@ -536,13 +538,23 @@
}; };
this.PriceRange.push(obj); this.PriceRange.push(obj);
}); });
this.MaximumDatas = this.PriceRange[this.PriceRange.length - 1]
if(this.MapType){
this.PriceRange.forEach((item) => {
if (item.priceId == this.parameters.priceId) {
this.changePrice(item)
}
})
this.tempRateAndPrice.price = [this.parameters.StartPrice,this.parameters.EndPrice]
}else{
this.parameters.StartPrice = this.PriceRange[0].minPrice ? this.PriceRange[0] this.parameters.StartPrice = this.PriceRange[0].minPrice ? this.PriceRange[0]
.minPrice : 100; .minPrice : 100;
this.MaximumDatas = this.PriceRange[this.PriceRange.length - 1]
let temp = tempObj.PriceList[tempObj.PriceList.length - 1] let temp = tempObj.PriceList[tempObj.PriceList.length - 1]
this.parameters.EndPrice = temp.MaxPrice this.parameters.EndPrice = temp.MaxPrice
this.tempRateAndPrice.priceText = `¥${temp.MaxPrice}`; this.tempRateAndPrice.priceText = `¥${temp.MaxPrice}`;
} }
}
} }
}, (err) => { }, (err) => {
...@@ -564,7 +576,7 @@ ...@@ -564,7 +576,7 @@
} }
this.getRegion() this.getRegion()
} }
this.research() if(!this.MapType)this.research()
} }
}, },
(err) => {} (err) => {}
...@@ -572,7 +584,7 @@ ...@@ -572,7 +584,7 @@
}, },
// 区域 // 区域
getRegion() { getRegion() {
this.parameters.regionCode = '' if(!this.MapType) this.parameters.regionCode = ''
var regMsg = { var regMsg = {
CityCode: this.parameters.CityCode2, CityCode: this.parameters.CityCode2,
Name: this.parameters.CityName, Name: this.parameters.CityName,
...@@ -590,7 +602,7 @@ ...@@ -590,7 +602,7 @@
goMapHotel() { goMapHotel() {
this.closeDropdown() this.closeDropdown()
uni.navigateTo({ uni.navigateTo({
url: `/pages/hotel/mapList?msg=${encodeURIComponent(JSON.stringify(this.parameters))}&dayObj=${encodeURIComponent(JSON.stringify(this.dayObj))}` url: `/pages/hotel/mapList?msg=${encodeURIComponent(JSON.stringify(this.parameters))}&dayObj=${encodeURIComponent(JSON.stringify(this.dayObj))}&MapType=1`
}); });
} }
}, },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
@change="getRooms"></u-number-box> @change="getRooms"></u-number-box>
</view> </view>
<scroll-view :scroll-y="true" class="hotelScroll" style="max-height: 200rpx;"> <scroll-view :scroll-y="true" class="hotelScroll" style="max-height: 200rpx;">
<view style="padding: 0 10rpx;background: #fff"> <view style="padding: 0 30rpx;background: #fff">
<view class="row items-center" v-for="(item,index) in parameters.searchroomGroup" <view class="row items-center" v-for="(item,index) in parameters.searchroomGroup"
style="padding-bottom: 20rpx;"> style="padding-bottom: 20rpx;">
<view class="line-flex" style="height: 29px;margin-right: 10rpx;">房间{{ item.roomNum }}</view> <view class="line-flex" style="height: 29px;margin-right: 10rpx;">房间{{ item.roomNum }}</view>
......
...@@ -351,10 +351,7 @@ ...@@ -351,10 +351,7 @@
loading: false, loading: false,
DidaHotelRoomDetails: {}, DidaHotelRoomDetails: {},
qRoomTypeList: [], qRoomTypeList: [],
qMealTypeList: [{ qMealTypeList: [],
ID: '',
MTypeName: "全部"
}],
HotelMealTypes: [], HotelMealTypes: [],
qMsg: { qMsg: {
RoomTypeName: "", //房型筛选 RoomTypeName: "", //房型筛选
...@@ -564,7 +561,8 @@ ...@@ -564,7 +561,8 @@
console.log("dmc_post_GetDiDaPriceSearchList", tempData); console.log("dmc_post_GetDiDaPriceSearchList", tempData);
this.DidaHotelRoomDetails = tempData; this.DidaHotelRoomDetails = tempData;
this.qRoomTypeList = tempData.qRoomTypeList; this.qRoomTypeList = tempData.qRoomTypeList;
this.qRoomTypeList.unshift({ console.log("qRoomTypeList", this.qRoomTypeList);
if(this.qRoomTypeList&&this.qRoomTypeList.length>0) this.qRoomTypeList.unshift({
RoomTypeID: -1, RoomTypeID: -1,
RoomName_CN: '全部' RoomName_CN: '全部'
}) })
...@@ -582,7 +580,8 @@ ...@@ -582,7 +580,8 @@
} }
this.qMealTypeList = tempMealArray; this.qMealTypeList = tempMealArray;
this.qMealTypeList.unshift({ console.log("qMealTypeList", this.qMealTypeList);
if(this.qMealTypeList&&this.qMealTypeList.length>0) this.qMealTypeList.unshift({
MTypeName: "全部", MTypeName: "全部",
MealAmount: 0, MealAmount: 0,
MealType: 0, MealType: 0,
......
...@@ -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" :daysObj="dayObj" :isMap="1" @change="change" @getItem="getItem"> <hotelSearch
:msg="searchObj"
:daysObj="dayObj"
:isMap="1"
@change="change" @getItem="getItem">
</hotelSearch> </hotelSearch>
</view> </view>
<view style="height: 1px;flex: 1;overflow: hidden;"> <view style="height: 1px;flex: 1;overflow: hidden;">
......
...@@ -5,17 +5,25 @@ ...@@ -5,17 +5,25 @@
<hotelSearch <hotelSearch
:msg="searchObj" :msg="searchObj"
:daysObj="dayObj" :daysObj="dayObj"
:MapType="MapType"
@change="change" @change="change"
@getItem="getItem"></hotelSearch> @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"
:longitude="center.longitude"
:latitude="center.latitude"
:include-points="includePoints"
-->
<map id="map" style="width: 100%; height: 100%;" <map id="map" style="width: 100%; height: 100%;"
:longitude="center.longitude" :longitude="center.longitude"
:latitude="center.latitude" :latitude="center.latitude"
:markers="markers" :markers="markers"
:include-points="includePoints" :include-points="points"
:padding="padding"
@callouttap="handleCalloutClick" @callouttap="handleCalloutClick"
> >
</map> </map>
...@@ -59,8 +67,8 @@ ...@@ -59,8 +67,8 @@
export default { export default {
data() { data() {
return { return {
pageTitle: '成都', pageTitle: '',
city: "成都", city: "",
searchObj: { searchObj: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
...@@ -148,6 +156,12 @@ ...@@ -148,6 +156,12 @@
current: 0, current: 0,
nextCurrent: null, nextCurrent: null,
padding: [20, 50, 20, 50], padding: [20, 50, 20, 50],
MapType: 0,
includePoints: {
padding: [0, 0, 0, 0],
points: [],
},
points: [],
}; };
}, },
components: { components: {
...@@ -175,46 +189,14 @@ ...@@ -175,46 +189,14 @@
this.endDay = this.dayObj.endDay; this.endDay = this.dayObj.endDay;
this.day = this.dayObj.day; this.day = this.dayObj.day;
} }
this.MapType = options.MapType?options.MapType:0;
console.log(this.dayObj,'--------')
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "酒店", title: "酒店",
}); });
// 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,
// startTime: `${d1.getFullYear()}-${Month1}-${Day1}`,
// endTime: `${d1.getFullYear()}-${Month2}-${Day2}`
// };
// this.dayObj = obj;
// uni.setStorage({
// key: "Time",
// 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;
}, },
methods: { methods: {
getItem(parameters,obj) { getItem(parameters,obj) {
...@@ -321,7 +303,8 @@ ...@@ -321,7 +303,8 @@
this.HotelList = []; this.HotelList = [];
} }
this.markers = [] this.markers = []
this.includePoints = [] this.includePoints.points = []
this.points = []
this.apipost( "dmc_post_B2BAndB2CGetDidaHotelPage", this.searchObj, this.apipost( "dmc_post_B2BAndB2CGetDidaHotelPage", this.searchObj,
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
...@@ -347,21 +330,15 @@ ...@@ -347,21 +330,15 @@
} }
); );
}, },
includePoints(){
let list = []
for (let i = 0; i < pageData.length; i++) {
list.push({
latitude: pageData[i].latitude,
longitude: pageData[i].longitude,
})
}
return list
},
setMarkers(){ setMarkers(){
let pageData = this.HotelList let pageData = this.HotelList
if(pageData.length==0)return if(pageData.length==0)return
for (let i = 0; i < pageData.length; i++) { for (let i = 0; i < pageData.length; i++) {
this.includePoints.push({ this.includePoints.points.push({
latitude: pageData[i].latitude,
longitude: pageData[i].longitude,
})
this.points.push({
latitude: pageData[i].latitude, latitude: pageData[i].latitude,
longitude: pageData[i].longitude, longitude: pageData[i].longitude,
}) })
...@@ -399,6 +376,7 @@ ...@@ -399,6 +376,7 @@
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
.hotel-list{ .hotel-list{
height: 100vh; height: 100vh;
overflow: hidden;
} }
.hotel-listHeader{ .hotel-listHeader{
background: #F3F1EF ; background: #F3F1EF ;
......
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