Commit 29f1b575 authored by youjie's avatar youjie

修复

parent 88690202
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
if (val.CityCode) { if (val.CityCode) {
this.parameters.CityCode = val.CityCode; this.parameters.CityCode = val.CityCode;
} }
this.parameters.KeyWords = val.KeyWords2 // this.parameters.KeyWords = val.KeyWords2
}, },
deep: true, deep: true,
}, },
...@@ -206,9 +206,9 @@ ...@@ -206,9 +206,9 @@
searchKey() { searchKey() {
if (this.parameters.KeyWords == '' || !this.parameters.KeyWords) return if (this.parameters.KeyWords == '' || !this.parameters.KeyWords) return
this.$emit('searchKey', 1, this.parameters.KeyWords) this.$emit('searchKey', 1, this.parameters.KeyWords)
this.HotelList = [] // this.HotelList = []
this.KeyCityList = [] // this.KeyCityList = []
this.parameters.KeyWords = '' // this.parameters.KeyWords = ''
}, },
searchCity() { searchCity() {
if (this.showLoading) return if (this.showLoading) return
......
...@@ -359,32 +359,36 @@ ...@@ -359,32 +359,36 @@
searchClose() { searchClose() {
this.showSearchCity = false this.showSearchCity = false
this.showCityList = false this.showCityList = false
this.parameters.hotelId = null
this.research(2) this.research(2)
}, },
searchKey(type, key, City) { searchKey(type, key, City) {
if (type == 1) { if (type == 1) {
this.parameters.hotelId = null this.parameters.hotelId = null
if (this.parameters.KeyWords != key) { if (this.parameters.KeyWords != key) {
this.parameters.KeyWords = key this.parameters.KeyWords = key
} }
} else if (type == 2) { } else if (type == 2) {
this.parameters.KeyWords = null this.parameters.KeyWords = null
this.parameters.KeyWords2 = City this.parameters.CityCode = null
// this.parameters.KeyWords2 = City
if (this.parameters.hotelId != key) { if (this.parameters.hotelId != key) {
this.parameters.hotelId = key this.parameters.hotelId = key
} }
} else if (type == 3) { } else if (type == 3) {
this.parameters.KeyWords = null this.parameters.KeyWords = null
this.parameters.hotelId = null this.parameters.hotelId = null
this.parameters.KeyWords2 = City // this.parameters.KeyWords2 = City
if (this.parameters.CityCode != key) { if (this.parameters.CityCode != key) {
this.city = this.parameters.CityName = City this.city = this.parameters.CityName = City
this.parameters.CityCode2 = key this.parameters.CityCode2 = key
this.parameters.CityCode = key this.parameters.CityCode = key
} }
} }
this.searchClose() this.showSearchCity = false
this.showCityList = false
this.parameters.pageIndex = 1
this.research(11)
this.getRegion() this.getRegion()
}, },
......
...@@ -206,7 +206,6 @@ export default { ...@@ -206,7 +206,6 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log("进入了....");
this.userDefaultDate = this.defaultDate; this.userDefaultDate = this.defaultDate;
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
:latitude="center.latitude" :latitude="center.latitude"
:include-points="includePoints.points" :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" :longitude="center.longitude"
:latitude="center.latitude" :latitude="center.latitude"
:markers="markers" :markers="markers"
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
points: [], points: [],
}, },
scale: 13, scale: 13,
mapData: {},
}; };
}, },
components: { components: {
...@@ -199,8 +200,46 @@ ...@@ -199,8 +200,46 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "酒店", title: "酒店",
}); });
}, },
methods: { 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) { getItem(parameters,obj) {
this.searchObj = parameters this.searchObj = parameters
this.dayObj = { this.dayObj = {
...@@ -318,7 +357,6 @@ ...@@ -318,7 +357,6 @@
uni.hideLoading() uni.hideLoading()
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.showLoading = false this.showLoading = false
let length = 0 let length = 0
if (this.searchObj.pageIndex === 1) { if (this.searchObj.pageIndex === 1) {
this.HotelList = res.data.pageData; this.HotelList = res.data.pageData;
...@@ -374,6 +412,20 @@ ...@@ -374,6 +412,20 @@
} }
this.markers.push(obj) 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() this.$forceUpdate()
} }
}, },
......
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
</view> </view>
<view class="LastNameBox column val" style="width: 1px;flex: 1;"> <view class="LastNameBox column val" style="width: 1px;flex: 1;">
<view class="row items-center" v-for="(sItem,i) in item.GuestInfo" :key="i"> <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.LastName" :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}姓`" />
<input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客':sItem.Age+'岁儿童'} ${i+1} 名`" /> <input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}名`" />
<!--<view class="row" style="margin-left:20rpx;"> <!--<view class="row" style="margin-left:20rpx;">
<image v-if="item.GuestInfo.length>1" <image v-if="item.GuestInfo.length>1"
style="width: 27rpx;height: 27rpx;display: block;" 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