Commit 5e45e1c7 authored by youjie's avatar youjie

酒店

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