Commit fa516890 authored by youjie's avatar youjie

酒店

parent 556e6e34
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
style="background-color: #F3F1EF"> style="background-color: #F3F1EF">
<view class="hotelAddress row justify-center"> <view class="hotelAddress row justify-center">
<text>目的地</text> <text>目的地</text>
<icon @click="sure" class="hotelClear" type="clear" size="20"/> <icon @click="close" class="hotelClear" type="clear" size="20"/>
</view> </view>
<!-- <view class="internationalBox row-sb-n"> <!-- <view class="internationalBox row-sb-n">
<view class="internationalName" <view class="internationalName"
...@@ -142,6 +142,9 @@ export default { ...@@ -142,6 +142,9 @@ export default {
created() { created() {
}, },
methods: { methods: {
close(){
this.$emit('close')
},
sure(){ sure(){
this.$emit('sure',this.parameters) this.$emit('sure',this.parameters)
}, },
......
...@@ -306,8 +306,17 @@ ...@@ -306,8 +306,17 @@
return mealtypeName; return mealtypeName;
}, },
goUrl(subItem){ goUrl(subItem){
let HotelInfo = {
hotelid: this.HotelInfo.hotelid,
name: this.HotelInfo.name,
location: this.HotelInfo.location,
address: this.HotelInfo.address,
destination: this.HotelInfo.destination,
country: this.HotelInfo.country,
images: this.HotelInfo.images,
}
uni.navigateTo({ 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)}`, url: `/pages/hotel/order?searchObj=${JSON.stringify(this.searchObj)}&dayObj=${JSON.stringify(this.dayObj)}&HotelInfo=${JSON.stringify(HotelInfo)}&RoomInfo=${JSON.stringify(subItem)}`,
}); });
}, },
openPicture(item) { openPicture(item) {
......
<template> <template>
<view class="hotel-list-search"> <view class="hotel-list-search">
<view class="row items-center" style="padding: 12rpx 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="showCity">
<!-- <u-icon name="location" :size="24" color="#000000" style="margin-right: 8rpx"></u-icon> --> <!-- <u-icon name="location" :size="24" color="#000000" style="margin-right: 8rpx"></u-icon> -->
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
active-color="#B99846" active-color="#B99846"
inactive-color="#080A09" inactive-color="#080A09"
title-size="28" title-size="28"
@open="open" @close="close"
> >
<u-dropdown-item <u-dropdown-item
v-model="parameters.QOrderBy" v-model="parameters.QOrderBy"
...@@ -229,6 +230,7 @@ ...@@ -229,6 +230,7 @@
<destination :msg="parameters" <destination :msg="parameters"
@sure="sureAddress" @sure="sureAddress"
@searchCity="clickSearchCity" @searchCity="clickSearchCity"
@close="closeAddress"
:PopularCities="PopularCities"></destination> :PopularCities="PopularCities"></destination>
</u-popup> </u-popup>
...@@ -344,7 +346,30 @@ ...@@ -344,7 +346,30 @@
msg: { msg: {
handler (val, oldval) { handler (val, oldval) {
if(val){ if(val){
this.parameters.KeyWords = val.KeyWords // this.parameters.KeyWords = val.KeyWords
this.parameters = {
...val
}
if(val.QOrderBy){
let list = this.options1.filter(x=>{
return x.value==val.QOrderBy
})
this.optionsTitle[0] = list[0].label
}
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
}
} }
}, },
deep: true, deep: true,
...@@ -357,38 +382,46 @@ ...@@ -357,38 +382,46 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "酒店", title: "酒店",
}); });
let d1 = new Date(); if(!this.day){
let d = new Date(); let d1 = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1)); let d = new Date();
let startWeek = "周" + "日一二三四五六".charAt(new Date().getDay()); let d2 = new Date(d.setDate(d.getDate() + 1));
let endWeek = "周" + "日一二三四五六".charAt(new Date().getDay() + 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 = d1.getMonth() + 1;
let Month1 = month1>9?month1:'0'+month1; let day1 = d1.getDate();
let Day1 = day1>9?day1:'0'+day1; let Month1 = month1>9?month1:'0'+month1;
let month2 = d2.getMonth() + 1; let Day1 = day1>9?day1:'0'+day1;
let day2 = d2.getDate(); let month2 = d2.getMonth() + 1;
let Month2 = month2>9?month2:'0'+month2; let day2 = d2.getDate();
let Day2 = day2>9?day2:'0'+day2; let Month2 = month2>9?month2:'0'+month2;
var obj = { let Day2 = day2>9?day2:'0'+day2;
start: `${d1.getFullYear()}-${Month1}-${Day1}`, var obj = {
end: `${d2.getFullYear()}-${Month2}-${Day2}`, start: `${d1.getFullYear()}-${Month1}-${Day1}`,
startDay: `${Month1}-${Day1}`, end: `${d2.getFullYear()}-${Month2}-${Day2}`,
endDay: `${Month2}-${Day2}`, startDay: `${Month1}-${Day1}`,
day: 1, endDay: `${Month2}-${Day2}`,
startWeek: startWeek, day: 1,
endWeek: endWeek, startWeek: startWeek,
}; endWeek: endWeek,
this.startDay = obj.startDay; };
this.endDay = obj.endDay; this.startDay = obj.startDay;
this.day = obj.day; this.endDay = obj.endDay;
this.dayObj = obj this.day = obj.day;
this.dayObj = obj
}
this.getCity() this.getCity()
this.getSearchCondition() this.getSearchCondition()
// this.getLocation() // this.getLocation()
}, },
methods: { methods: {
open(index) {
this.$refs.uDropdown.highlight();
},
close(index) {
this.$refs.uDropdown.highlight(index);
},
FilterArea(){ FilterArea(){
if(this.regionKeyWords!=''){ if(this.regionKeyWords!=''){
this.regionList = this.regionListAll.filter((item)=>{ this.regionList = this.regionListAll.filter((item)=>{
...@@ -451,6 +484,9 @@ ...@@ -451,6 +484,9 @@
} }
}); });
}, },
closeAddress(){
this.showCityList = false
},
sureAddress(msg){ sureAddress(msg){
this.showCityList = false; this.showCityList = false;
if(this.parameters.CityCode2!=msg.CityCode2){ if(this.parameters.CityCode2!=msg.CityCode2){
...@@ -516,6 +552,7 @@ ...@@ -516,6 +552,7 @@
obj.progressBarWidth = obj._getMaxLength(); obj.progressBarWidth = obj._getMaxLength();
obj.minBlockLeft = 0; obj.minBlockLeft = 0;
obj.maxBlockLeft = obj._getMaxLength(); obj.maxBlockLeft = obj._getMaxLength();
this.parameters.priceId = 0
this.tempRateAndPrice.priceId = 0 this.tempRateAndPrice.priceId = 0
this.tempRateAndPrice = { this.tempRateAndPrice = {
price: { price: {
...@@ -541,6 +578,7 @@ ...@@ -541,6 +578,7 @@
changePrice(item) { changePrice(item) {
this.parameters.StartPrice = item.minPrice?item.minPrice:100; this.parameters.StartPrice = item.minPrice?item.minPrice:100;
this.parameters.EndPrice = item.maxPrice; this.parameters.EndPrice = item.maxPrice;
this.parameters.priceId = item.priceId
this.tempRateAndPrice.priceText = item.Name; this.tempRateAndPrice.priceText = item.Name;
this.tempRateAndPrice.price = [item.minPrice?item.minPrice:100,item.maxPrice] this.tempRateAndPrice.price = [item.minPrice?item.minPrice:100,item.maxPrice]
this.tempRateAndPrice.priceId = item.priceId this.tempRateAndPrice.priceId = item.priceId
...@@ -626,18 +664,22 @@ ...@@ -626,18 +664,22 @@
this.apipost('dmc_post_B2BAndB2CGetHotCity',{}, this.apipost('dmc_post_B2BAndB2CGetHotCity',{},
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.PopularCities = res.data if(res.data.length>0){
this.parameters.GName = this.PopularCities[0].GName this.PopularCities = res.data
this.cityList = this.PopularCities[0].CityList this.cityList = this.PopularCities[0].CityList
this.parameters.GName = this.PopularCities[0].GName if(!this.parameters.CityCode2){
this.parameters.CityCode = this.PopularCities[0].CityList[0].CityCode this.parameters.GName = this.PopularCities[0].GName
this.parameters.CityCode2 = this.PopularCities[0].CityList[0].CityCode this.parameters.CityCode = this.PopularCities[0].CityList[0].CityCode
this.city = this.parameters.CityName = this.PopularCities[0].CityList[0].CityName this.parameters.CityCode2 = this.PopularCities[0].CityList[0].CityCode
this.getRegion() this.city = this.parameters.CityName = this.PopularCities[0].CityList[0].CityName
}
this.getRegion()
}
this.research() this.research()
} }
}, },
(err) => {} (err) => {
}
); );
}, },
// 区域 // 区域
...@@ -658,7 +700,7 @@ ...@@ -658,7 +700,7 @@
goMapHotel(){ goMapHotel(){
this.closeDropdown() this.closeDropdown()
uni.navigateTo({ uni.navigateTo({
url: "/pages/hotel/mapList" url: `/pages/hotel/mapList?msg=${encodeURIComponent(JSON.stringify(this.parameters))}?dayObj=${JSON.stringify(this.dayObj)}`
}); });
} }
}, },
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
:qRoomType="qRoomTypeList" :qRoomType="qRoomTypeList"
:qMealType="qMealTypeList"></hotelRoom> :qMealType="qMealTypeList"></hotelRoom>
</view> </view>
<u-empty v-show="getQueryData.length==0" text="暂无相关房间" mode="data" padding-top="5"></u-empty> <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">
...@@ -529,13 +529,9 @@ export default { ...@@ -529,13 +529,9 @@ export default {
}, },
methods: { methods: {
open(index) { open(index) {
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮
// 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight(); this.$refs.uDropdown.highlight();
}, },
close(index) { close(index) {
// 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
this.$refs.uDropdown.highlight(index); this.$refs.uDropdown.highlight(index);
}, },
changeType(item,type){ changeType(item,type){
...@@ -1620,11 +1616,11 @@ export default { ...@@ -1620,11 +1616,11 @@ export default {
padding: 0 30rpx; padding: 0 30rpx;
} }
.hotelComprehensiv{ .hotelComprehensiv{
height: 78rpx; min-height: 50rpx;
line-height: 70rpx;
font-size: 28rpx; font-size: 28rpx;
color: #080A09; color: #080A09;
justify-content: space-between; justify-content: space-between;
padding-bottom: 20rpx;
} }
.hotelComprehensiv.active{ .hotelComprehensiv.active{
color: #B99846; color: #B99846;
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<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
:msg="searchObj"
@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;">
...@@ -11,6 +13,8 @@ ...@@ -11,6 +13,8 @@
:longitude="center.longitude" :longitude="center.longitude"
:latitude="center.latitude" :latitude="center.latitude"
:markers="markers" :markers="markers"
:include-points="includePoints"
:padding="padding"
@callouttap="handleCalloutClick" @callouttap="handleCalloutClick"
> >
</map> </map>
...@@ -59,16 +63,7 @@ ...@@ -59,16 +63,7 @@
searchObj: { searchObj: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
Name: "", //关键字 KeyWords: "", //关键字
// StartPrice: 0,
// EndPrice: 1000,
QStartDate: "",
QEndDate: "",
// OrderByType: "1", //排序类型
// QStars: "", //星级
TagList: [], //查询标签
// City: 262, //市
// District: 0, //区
}, },
day: 0, day: 0,
startDay: "", startDay: "",
...@@ -90,30 +85,29 @@ ...@@ -90,30 +85,29 @@
dayObj: {}, dayObj: {},
mc: '', mc: '',
center: { longitude: 116.397428, latitude: 39.90923 }, center: { longitude: 116.397428, latitude: 39.90923 },
markers: [ markers: [],
{ markersObj:{
id: 1, id: 1,
latitude: 39.909, latitude: 39.909,
longitude: 116.39742, longitude: 116.39742,
iconPath: '', iconPath: '',
title: '', title: '',
alpha: 0, alpha: 0,
callout:{ callout:{
content:'¥ 99999起', content:'¥ 99999起',
bgColor: '#FF3166', bgColor: '#FF3166',
borderWidth: 1, borderWidth: 1,
borderColor: '#E2D5D2', borderColor: '#E2D5D2',
color: '#fff', color: '#fff',
fontSize: '12px', fontSize: '12px',
fontWeight: 'bold', fontWeight: 'bold',
anchorX: 0, anchorX: 0,
anchorY: 0, anchorY: 0,
borderRadius: 7, borderRadius: 7,
padding: 5, padding: 5,
display: 'ALWAYS', display: 'ALWAYS',
}, },
}, },
],
bubble:[ bubble:[
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638761641584224459.png', 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638761641584224459.png',
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638761646347047352.png', 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638761646347047352.png',
...@@ -152,6 +146,7 @@ ...@@ -152,6 +146,7 @@
prevCurrent: null, prevCurrent: null,
current: 0, current: 0,
nextCurrent: null, nextCurrent: null,
padding: [20, 50, 20, 50],
}; };
}, },
components: { components: {
...@@ -167,6 +162,20 @@ ...@@ -167,6 +162,20 @@
if (options && options.Name) { if (options && options.Name) {
this.searchObj.Name = options.Name; this.searchObj.Name = options.Name;
} }
if (options && options.msg) {
this.searchObj = {
...this.searchObj,
...JSON.parse(decodeURIComponent(options.msg))
};
console.log(JSON.parse(decodeURIComponent(options.msg)),'--------')
this.pageTitle = this.searchObj.CityName
}
if(options && options.dayObj){
this.dayObj = JSON.parse(options.dayObj)
this.startDay = this.dayObj.startDay;
this.endDay = this.dayObj.endDay;
this.day = this.dayObj.day;
}
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -194,6 +203,8 @@ ...@@ -194,6 +203,8 @@
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({
...@@ -205,11 +216,13 @@ ...@@ -205,11 +216,13 @@
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.getList();
// this.getLocation()
}, },
methods: { methods: {
getItem(obj) { getItem(parameters,obj) {
this.searchObj = {
...this.searchObj,
...parameters
}
this.dayObj = { this.dayObj = {
...obj, ...obj,
startTime: `${obj.year}-${obj.startDay}`, startTime: `${obj.year}-${obj.startDay}`,
...@@ -218,19 +231,45 @@ ...@@ -218,19 +231,45 @@
}, },
handleCalloutClick(marker) { handleCalloutClick(marker) {
console.log('点击了标记:', marker.detail); console.log('点击了标记:', marker.detail);
// 可自定义弹窗逻辑或跳转页面 this.current = marker.detail.markerId-1
console.log(this.current,'----')
this.setNewMarkers()
}, },
setNewMarkers(){
for (let i = 0; i < this.markers.length; i++) {
if(i==this.current){
this.center = {
longitude: this.markers[i].longitude,
latitude: this.markers[i].latitude,
}
this.markers[this.current] ={
...this.markers[i],
callout:{
...this.markers[i].callout,
...this.editCallout1,
}
}
}else{
this.markers[i] ={
...this.markers[i],
callout:{
...this.markers[i].callout,
...this.editCallout2,
}
}
}
}
this.$forceUpdate()
},
getLocation() { getLocation() {
wx.getLocation({ wx.getLocation({
type: 'wgs84', // 精度模式 type: 'wgs84', // 精度模式
success: (res) => { success: (res) => {
this.longitude = res.longitude;
this.latitude = res.latitude;
// 更新地图中心点 // 更新地图中心点
this.$refs.map.moveToLocation({ if(this.$refs.map)this.$refs.map.moveToLocation({
longitude: res.longitude, longitude: res.longitude,
latitude: res.latitude latitude: res.latitude
}); });
}, },
fail: (err) => { fail: (err) => {
console.error('定位失败', err); console.error('定位失败', err);
...@@ -244,6 +283,8 @@ ...@@ -244,6 +283,8 @@
changeCurrent(e) { changeCurrent(e) {
this.prevCurrent = this.current this.prevCurrent = this.current
this.current = e.detail.current; this.current = e.detail.current;
this.setNewMarkers()
let length = this.HotelList.length let length = this.HotelList.length
if((length-1)==this.current){ if((length-1)==this.current){
this.nextCurrent = 0 this.nextCurrent = 0
...@@ -268,25 +309,31 @@ ...@@ -268,25 +309,31 @@
...this.searchObj, ...this.searchObj,
...item, ...item,
} }
if(item.CityName) this.pageTitle = item.CityName
this.research(); this.research();
}, },
//获取列表数据 //获取列表数据
getList(type) { getList(type) {
if(this.showLoading) return
this.showLoading = true
uni.showLoading({ title: "加载中" , mask: true});
this.searchObj.QStars = this.tempRateAndPrice.rate.toString(); this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
if (type == 1) { if (type == 1) {
this.HotelList = []; this.HotelList = [];
} }
this.request2({ this.markers = []
url: "/api/Hotel/AppGetHotelPage", this.includePoints = []
data: this.searchObj, this.apipost( "dmc_post_B2BAndB2CGetDidaHotelPage", this.searchObj,
},
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.showLoading = false
uni.hideLoading()
if (this.searchObj.pageIndex === 1) { if (this.searchObj.pageIndex === 1) {
this.HotelList = res.data.pageData; this.HotelList = res.data.pageData;
} else { } else {
this.HotelList = this.HotelList.concat(res.data.pageData); this.HotelList = this.HotelList.concat(res.data.pageData);
} }
this.setMarkers()
let length = this.HotelList.length let length = this.HotelList.length
this.prevCurrent = length-1 this.prevCurrent = length-1
if((length-1)==this.current){ if((length-1)==this.current){
...@@ -294,9 +341,57 @@ ...@@ -294,9 +341,57 @@
}else this.nextCurrent = this.current+1 }else this.nextCurrent = this.current+1
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
} }
},
(err) => {
this.showLoading = false
uni.hideLoading()
} }
); );
}, },
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({
latitude: pageData[i].latitude,
longitude: pageData[i].longitude,
})
let obj = JSON.parse(JSON.stringify(this.markersObj))
obj = {
...obj,
id: i+1,
latitude: pageData[i].latitude,
longitude: pageData[i].longitude,
callout:{
...obj.callout,
content: `CNY ${pageData[i].unitprice}起`,
...this.editCallout2
}
}
if(i==0){
obj.callout = {
...obj.callout,
...this.editCallout1
}
this.center = {
longitude: pageData[0].longitude,
latitude: pageData[0].latitude,
}
}
this.markers.push(obj)
}
this.$forceUpdate()
}
}, },
}; };
</script> </script>
......
This diff is collapsed.
...@@ -213,9 +213,6 @@ ...@@ -213,9 +213,6 @@
active: 1, active: 1,
islike: false, islike: false,
nearbyType: 0, nearbyType: 0,
searchObj: {
date: {},
},
roomMsg: { roomMsg: {
HotelId: 0, HotelId: 0,
StartDate: "", StartDate: "",
......
This diff is collapsed.
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