Commit 29f1b575 authored by youjie's avatar youjie

修复

parent 88690202
......@@ -112,7 +112,7 @@
if (val.CityCode) {
this.parameters.CityCode = val.CityCode;
}
this.parameters.KeyWords = val.KeyWords2
// this.parameters.KeyWords = val.KeyWords2
},
deep: true,
},
......@@ -206,9 +206,9 @@
searchKey() {
if (this.parameters.KeyWords == '' || !this.parameters.KeyWords) return
this.$emit('searchKey', 1, this.parameters.KeyWords)
this.HotelList = []
this.KeyCityList = []
this.parameters.KeyWords = ''
// this.HotelList = []
// this.KeyCityList = []
// this.parameters.KeyWords = ''
},
searchCity() {
if (this.showLoading) return
......
......@@ -359,32 +359,36 @@
searchClose() {
this.showSearchCity = false
this.showCityList = false
this.parameters.hotelId = null
this.research(2)
},
searchKey(type, key, City) {
if (type == 1) {
this.parameters.hotelId = null
if (this.parameters.KeyWords != key) {
this.parameters.KeyWords = key
}
} else if (type == 2) {
this.parameters.KeyWords = null
this.parameters.KeyWords2 = City
this.parameters.CityCode = null
// this.parameters.KeyWords2 = City
if (this.parameters.hotelId != key) {
this.parameters.hotelId = key
}
} else if (type == 3) {
this.parameters.KeyWords = null
this.parameters.hotelId = null
this.parameters.KeyWords2 = City
// this.parameters.KeyWords2 = City
if (this.parameters.CityCode != key) {
this.city = this.parameters.CityName = City
this.parameters.CityCode2 = key
this.parameters.CityCode = key
}
}
this.searchClose()
this.showSearchCity = false
this.showCityList = false
this.parameters.pageIndex = 1
this.research(11)
this.getRegion()
},
......
......@@ -206,7 +206,6 @@ export default {
};
},
mounted() {
console.log("进入了....");
this.userDefaultDate = this.defaultDate;
uni.getSystemInfo({
success: (res) => {
......
......@@ -18,7 +18,7 @@
:latitude="center.latitude"
:include-points="includePoints.points"
-->
<map id="map" style="width: 100%; height: 100%;"
<map id="myMap" ref="myMapRef" style="width: 100%; height: 100%;"
:longitude="center.longitude"
:latitude="center.latitude"
:markers="markers"
......@@ -162,6 +162,7 @@
points: [],
},
scale: 13,
mapData: {},
};
},
components: {
......@@ -199,8 +200,46 @@
uni.setNavigationBarTitle({
title: "酒店",
});
},
methods: {
calculateBounds(markers) {
if (markers.length === 0) return null;
let minLat = markers[0].lat;
let maxLat = markers[0].lat;
let minLng = markers[0].lng;
let maxLng = markers[0].lng;
markers.forEach(marker => {
minLat = Math.min(minLat, marker.lat);
maxLat = Math.max(maxLat, marker.lat);
minLng = Math.min(minLng, marker.lng);
maxLng = Math.max(maxLng, marker.lng);
});
return {
southWest: this.mapData.LatLng(minLat, minLng),
northEast: this.mapData.LatLng(maxLat, maxLng)
};
},
adjustMapToFitMarkers(markers) {
const bounds = this.calculateBounds(markers);
if (!bounds) return;
// 创建 LatLngBounds 对象
const latLngBounds = this.mapData.LatLngBounds(
bounds.southWest,
bounds.northEast
);
// 调整地图视图
map.fitBounds(latLngBounds);
// 可选:添加动画效果
map.panToBounds(latLngBounds);
},
getItem(parameters,obj) {
this.searchObj = parameters
this.dayObj = {
......@@ -318,7 +357,6 @@
uni.hideLoading()
if (res.resultCode == 1) {
this.showLoading = false
let length = 0
if (this.searchObj.pageIndex === 1) {
this.HotelList = res.data.pageData;
......@@ -374,6 +412,20 @@
}
this.markers.push(obj)
}
setTimeout(()=>{
let that = this
// const query = wx.createSelectorQuery().in(this);
// query.select('#myMap').fields({
// node: true,
// size: true
// }, (res) => {
// const mapContext = res.node.getMapContext();
// mapContext.moveToLocation();
// that.mapData = res.node.getMapContext()
// that.adjustMapToFitMarkers(that.markers)
// }).exec();
},300)
this.$forceUpdate()
}
},
......
......@@ -74,8 +74,8 @@
</view>
<view class="LastNameBox column val" style="width: 1px;flex: 1;">
<view class="row items-center" v-for="(sItem,i) in item.GuestInfo" :key="i">
<input type="text" v-model="sItem.LastName" :placeholder="`${sItem.IsAdult?'住客':sItem.Age+'岁儿童'} ${i+1} 姓`" />
<input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客':sItem.Age+'岁儿童'} ${i+1} 名`" />
<input type="text" v-model="sItem.LastName" :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}姓`" />
<input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}名`" />
<!--<view class="row" style="margin-left:20rpx;">
<image v-if="item.GuestInfo.length>1"
style="width: 27rpx;height: 27rpx;display: block;"
......
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