Commit fa516890 authored by youjie's avatar youjie

酒店

parent 556e6e34
......@@ -4,7 +4,7 @@
style="background-color: #F3F1EF">
<view class="hotelAddress row justify-center">
<text>目的地</text>
<icon @click="sure" class="hotelClear" type="clear" size="20"/>
<icon @click="close" class="hotelClear" type="clear" size="20"/>
</view>
<!-- <view class="internationalBox row-sb-n">
<view class="internationalName"
......@@ -142,6 +142,9 @@ export default {
created() {
},
methods: {
close(){
this.$emit('close')
},
sure(){
this.$emit('sure',this.parameters)
},
......
......@@ -306,8 +306,17 @@
return mealtypeName;
},
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({
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) {
......
<template>
<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="hotel-city" @click="showCity">
<!-- <u-icon name="location" :size="24" color="#000000" style="margin-right: 8rpx"></u-icon> -->
......@@ -35,6 +35,7 @@
active-color="#B99846"
inactive-color="#080A09"
title-size="28"
@open="open" @close="close"
>
<u-dropdown-item
v-model="parameters.QOrderBy"
......@@ -229,6 +230,7 @@
<destination :msg="parameters"
@sure="sureAddress"
@searchCity="clickSearchCity"
@close="closeAddress"
:PopularCities="PopularCities"></destination>
</u-popup>
......@@ -344,7 +346,30 @@
msg: {
handler (val, oldval) {
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,
......@@ -357,6 +382,7 @@
uni.setNavigationBarTitle({
title: "酒店",
});
if(!this.day){
let d1 = new Date();
let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1));
......@@ -384,11 +410,18 @@
this.endDay = obj.endDay;
this.day = obj.day;
this.dayObj = obj
}
this.getCity()
this.getSearchCondition()
// this.getLocation()
},
methods: {
open(index) {
this.$refs.uDropdown.highlight();
},
close(index) {
this.$refs.uDropdown.highlight(index);
},
FilterArea(){
if(this.regionKeyWords!=''){
this.regionList = this.regionListAll.filter((item)=>{
......@@ -451,6 +484,9 @@
}
});
},
closeAddress(){
this.showCityList = false
},
sureAddress(msg){
this.showCityList = false;
if(this.parameters.CityCode2!=msg.CityCode2){
......@@ -516,6 +552,7 @@
obj.progressBarWidth = obj._getMaxLength();
obj.minBlockLeft = 0;
obj.maxBlockLeft = obj._getMaxLength();
this.parameters.priceId = 0
this.tempRateAndPrice.priceId = 0
this.tempRateAndPrice = {
price: {
......@@ -541,6 +578,7 @@
changePrice(item) {
this.parameters.StartPrice = item.minPrice?item.minPrice:100;
this.parameters.EndPrice = item.maxPrice;
this.parameters.priceId = item.priceId
this.tempRateAndPrice.priceText = item.Name;
this.tempRateAndPrice.price = [item.minPrice?item.minPrice:100,item.maxPrice]
this.tempRateAndPrice.priceId = item.priceId
......@@ -626,18 +664,22 @@
this.apipost('dmc_post_B2BAndB2CGetHotCity',{},
(res) => {
if (res.resultCode == 1) {
if(res.data.length>0){
this.PopularCities = res.data
this.parameters.GName = this.PopularCities[0].GName
this.cityList = this.PopularCities[0].CityList
if(!this.parameters.CityCode2){
this.parameters.GName = this.PopularCities[0].GName
this.parameters.CityCode = this.PopularCities[0].CityList[0].CityCode
this.parameters.CityCode2 = this.PopularCities[0].CityList[0].CityCode
this.city = this.parameters.CityName = this.PopularCities[0].CityList[0].CityName
}
this.getRegion()
}
this.research()
}
},
(err) => {}
(err) => {
}
);
},
// 区域
......@@ -658,7 +700,7 @@
goMapHotel(){
this.closeDropdown()
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 @@
:qRoomType="qRoomTypeList"
:qMealType="qMealTypeList"></hotelRoom>
</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 style="border-radius: 15rpx 15rpx 0 0;background: #fff;overflow: hidden;">
<view class="hotelFacilitiesBox">
......@@ -529,13 +529,9 @@ export default {
},
methods: {
open(index) {
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮
// 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight();
},
close(index) {
// 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
this.$refs.uDropdown.highlight(index);
},
changeType(item,type){
......@@ -1620,11 +1616,11 @@ export default {
padding: 0 30rpx;
}
.hotelComprehensiv{
height: 78rpx;
line-height: 70rpx;
min-height: 50rpx;
font-size: 28rpx;
color: #080A09;
justify-content: space-between;
padding-bottom: 20rpx;
}
.hotelComprehensiv.active{
color: #B99846;
......
......@@ -2,7 +2,9 @@
<view class="hotel-list column" style="background: #F3F1EF;">
<view class="hotel-listHeader">
<hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch @change="change"
<hotelSearch
:msg="searchObj"
@change="change"
@getItem="getItem"></hotelSearch>
</view>
<view style="height: 1px;flex: 1;overflow: hidden;position: relative;">
......@@ -11,6 +13,8 @@
:longitude="center.longitude"
:latitude="center.latitude"
:markers="markers"
:include-points="includePoints"
:padding="padding"
@callouttap="handleCalloutClick"
>
</map>
......@@ -59,16 +63,7 @@
searchObj: {
pageIndex: 1,
pageSize: 15,
Name: "", //关键字
// StartPrice: 0,
// EndPrice: 1000,
QStartDate: "",
QEndDate: "",
// OrderByType: "1", //排序类型
// QStars: "", //星级
TagList: [], //查询标签
// City: 262, //市
// District: 0, //区
KeyWords: "", //关键字
},
day: 0,
startDay: "",
......@@ -90,8 +85,8 @@
dayObj: {},
mc: '',
center: { longitude: 116.397428, latitude: 39.90923 },
markers: [
{
markers: [],
markersObj:{
id: 1,
latitude: 39.909,
longitude: 116.39742,
......@@ -113,7 +108,6 @@
display: 'ALWAYS',
},
},
],
bubble:[
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638761641584224459.png',
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638761646347047352.png',
......@@ -152,6 +146,7 @@
prevCurrent: null,
current: 0,
nextCurrent: null,
padding: [20, 50, 20, 50],
};
},
components: {
......@@ -167,6 +162,20 @@
if (options && 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() {
uni.setNavigationBarTitle({
......@@ -194,6 +203,8 @@
day: 1,
startWeek: startWeek,
endWeek: endWeek,
startTime: `${d1.getFullYear()}-${Month1}-${Day1}`,
endTime: `${d1.getFullYear()}-${Month2}-${Day2}`
};
this.dayObj = obj;
uni.setStorage({
......@@ -205,11 +216,13 @@
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.getList();
// this.getLocation()
},
methods: {
getItem(obj) {
getItem(parameters,obj) {
this.searchObj = {
...this.searchObj,
...parameters
}
this.dayObj = {
...obj,
startTime: `${obj.year}-${obj.startDay}`,
......@@ -218,16 +231,42 @@
},
handleCalloutClick(marker) {
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() {
wx.getLocation({
type: 'wgs84', // 精度模式
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,
latitude: res.latitude
});
......@@ -244,6 +283,8 @@
changeCurrent(e) {
this.prevCurrent = this.current
this.current = e.detail.current;
this.setNewMarkers()
let length = this.HotelList.length
if((length-1)==this.current){
this.nextCurrent = 0
......@@ -268,25 +309,31 @@
...this.searchObj,
...item,
}
if(item.CityName) this.pageTitle = item.CityName
this.research();
},
//获取列表数据
getList(type) {
if(this.showLoading) return
this.showLoading = true
uni.showLoading({ title: "加载中" , mask: true});
this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
if (type == 1) {
this.HotelList = [];
}
this.request2({
url: "/api/Hotel/AppGetHotelPage",
data: this.searchObj,
},
this.markers = []
this.includePoints = []
this.apipost( "dmc_post_B2BAndB2CGetDidaHotelPage", this.searchObj,
(res) => {
if (res.resultCode == 1) {
this.showLoading = false
uni.hideLoading()
if (this.searchObj.pageIndex === 1) {
this.HotelList = res.data.pageData;
} else {
this.HotelList = this.HotelList.concat(res.data.pageData);
}
this.setMarkers()
let length = this.HotelList.length
this.prevCurrent = length-1
if((length-1)==this.current){
......@@ -294,9 +341,57 @@
}else this.nextCurrent = this.current+1
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>
......
This diff is collapsed.
......@@ -213,9 +213,6 @@
active: 1,
islike: false,
nearbyType: 0,
searchObj: {
date: {},
},
roomMsg: {
HotelId: 0,
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