|
| xqd
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="map">
|
|
|
- <MyNav title="IHG地图" bgColor="" :backIcon="false"></MyNav>
|
|
|
+ <MyNav title="IHG西区地图" bgColor="" :backIcon="false"></MyNav>
|
|
|
<!-- 查询 -->
|
|
|
<view class="search" v-if="true">
|
|
|
<view class="search-top" style="padding: 16rpx 30rpx 0rpx;margin-bottom: 20rpx;">
|
|
| xqd
@@ -77,7 +77,7 @@
|
|
|
<image v-else style=" width: 20rpx; height: 12rpx; " src="/static/icon/down02.png"
|
|
|
mode=""></image>
|
|
|
</view>
|
|
|
- <view class="partner-main" v-if="search.partner==item.id">
|
|
|
+ <view class="partner-main" v-if="index >= 2 && search.partner==item.id">
|
|
|
<uni-data-checkbox multiple
|
|
|
:value="search.selected"
|
|
|
@input="syncSelected"
|
|
| xqd
@@ -105,7 +105,7 @@
|
|
|
<view style="height:1232rpx;">
|
|
|
<hch-position ref="map" :markers="hotelList" @moveToMarkId="moveToMarkId"/>
|
|
|
</view>
|
|
|
- <view class="address-nav" style="overflow-x: visible; height:318rpx;">
|
|
|
+ <view class="address-nav" style="overflow-x: visible; height:159px;">
|
|
|
<!-- 遮挡地图修正
|
|
|
<view class="address-nav-btn">
|
|
|
<view class="" @click="goLocation">
|
|
| xqd
@@ -120,8 +120,9 @@
|
|
|
style="width: 100%; overflow-x: scroll; display: none;align-items: center;justify-content: space-between;">
|
|
|
</view>
|
|
|
<!-- @scroll="bottomScroll" -->
|
|
|
- <scroll-view style="width: calc(100% + 16px);height:318rpx;white-space: nowrap;margin-left: -8px;z-index:10"
|
|
|
- @scrolltolower="scrollTolower"
|
|
|
+ <scroll-view style="width: calc(100% + 16px);height:159px;white-space: nowrap;margin-left: -8px;z-index:10"
|
|
|
+ @scrolltolower="scrollTolower(hotelList.length-1)"
|
|
|
+ @scrolltoupper="scrollTolower(0)"
|
|
|
@scroll="bottomScroll"
|
|
|
:scroll-x="true"
|
|
|
:scroll-left="scrolls.scrollX"
|
|
| xqd
@@ -130,9 +131,8 @@
|
|
|
>
|
|
|
<view style="width: 8px;display: inline-block;"></view>
|
|
|
<view class="address-detail" v-for="(item,index) in hotelList" :key="index">
|
|
|
- <view class="mark">
|
|
|
- <image style=""
|
|
|
- :src="item.bg_img" mode="aspectFill"></image>
|
|
|
+ <view class="mark" style="overflow: hidden;">
|
|
|
+ <image :src="item.bg_img" mode="aspectFill"></image>
|
|
|
</view>
|
|
|
<view class="inner">
|
|
|
<view class="address-detail-main">
|
|
| xqd
@@ -152,7 +152,7 @@
|
|
|
<text>预订</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="address-detail-position">
|
|
|
+ <view class="address-detail-position" v-if="item.distanceToMe">
|
|
|
<image style="width: 18rpx;height: 22rpx;" src="/static/icon/address02.png" mode="">
|
|
|
</image>
|
|
|
<text style="margin-left:4rpx ;">{{item.distanceToMe}}km</text>
|
|
| xqd
@@ -196,7 +196,7 @@
|
|
|
<text>预订</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="address-detail-position">
|
|
|
+ <view class="address-detail-position" v-if="item.distanceToMe">
|
|
|
<image style="width: 18rpx;height: 22rpx;" src="/static/icon/address02.png" mode=""></image>
|
|
|
<text style="margin-left:4rpx ;">{{item.distanceToMe}}km</text>
|
|
|
</view>
|
|
| xqd
@@ -320,7 +320,6 @@
|
|
|
this.search.selected = Array.from(new Set([...this.search.selected, ...e]));
|
|
|
}
|
|
|
this.search.checkedselected = e;
|
|
|
- console.log(this.search.selected)
|
|
|
},
|
|
|
checked(id) {
|
|
|
if(this.search.selected.includes(id)){
|
|
| xqd
@@ -422,11 +421,10 @@
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
- this.hotelList.map(item=>{
|
|
|
- item.distanceToMe=this.$utils.calcDistance(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
|
|
|
- return item;
|
|
|
- })
|
|
|
-
|
|
|
+ })
|
|
|
+ tempHotelList.map(item=>{
|
|
|
+ item.distanceToMe=this.$utils.calcDistance(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
|
|
|
+ return item;
|
|
|
})
|
|
|
this.hotelList.push(...tempHotelList)
|
|
|
if(res.data.data.length >= 15){
|
|
| xqd
@@ -482,7 +480,7 @@
|
|
|
}
|
|
|
})
|
|
|
if(res.data.data.length <= 0) return;
|
|
|
- this.hotelList.map(item=>{
|
|
|
+ this.hotelList.map((item,index)=>{
|
|
|
item.distanceToMe=this.$utils.calcDistance(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
|
|
|
return item;
|
|
|
})
|
|
| xqd
@@ -494,11 +492,11 @@
|
|
|
}
|
|
|
setTimeout(()=>{
|
|
|
if(!this.beginConfig.hotel_id){
|
|
|
- this.$refs.map.markertap({markerId: this.hotelList[0].id},true,this.search.isSearch)
|
|
|
+ this.$refs.map.markertap({markerId: this.hotelList[0].id,index:0},true,this.search.isSearch)
|
|
|
this.beginConfig.hotel_id = 0
|
|
|
this.search.isSearch = false
|
|
|
}else{
|
|
|
- this.localToMark(this.beginConfig.hotel_id);
|
|
|
+ this.localToMark(this.beginConfig.hotel_id,index);
|
|
|
// this.$refs.map.markertap({markerId: this.beginConfig.hotel_id})
|
|
|
this.beginConfig.hotel_id = 0
|
|
|
}
|
|
| xqd
@@ -546,45 +544,38 @@
|
|
|
this.isSelectSift = !this.isSelectSift
|
|
|
},
|
|
|
//下面酒店位移
|
|
|
- moveToMarkId(markId){
|
|
|
- this.hotelList.forEach((item,index) => {
|
|
|
- if(markId == item.id){
|
|
|
- this.scrollData.spa = true;
|
|
|
- this.scrolls.scrollX = (256 * index) - (this.screenWidth-256)/2 + 'px';
|
|
|
- setTimeout(()=>{
|
|
|
- this.scrollData.spa = false
|
|
|
- },500)
|
|
|
- return;
|
|
|
- }
|
|
|
- })
|
|
|
+ moveToMarkId(index){
|
|
|
+ this.scrollData.spa = true;
|
|
|
+ this.scrolls.scrollX = (256 * index) - (this.screenWidth-256)/2 + 'px';
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.scrollData.spa = false
|
|
|
+ },500)
|
|
|
},
|
|
|
- localToMark(markId){
|
|
|
+ localToMark(markId,index){
|
|
|
// this.moveToMarkId(markId)
|
|
|
- this.$refs.map.markertap({markerId: markId}, true)
|
|
|
+ this.$refs.map.markertap({markerId: markId,index:index}, true)
|
|
|
},
|
|
|
bottomScroll(e){
|
|
|
if(this.scrollData.spa) return;
|
|
|
const moveX = e.detail.scrollLeft;
|
|
|
this.scrollData.activeIndex = Math.floor((moveX + this.screenWidth) / 256) - 1;
|
|
|
if(this.$refs.map.isActiveMarker == this.hotelList[this.scrollData.activeIndex].id) return;
|
|
|
- this.$refs.map.markertap({markerId: this.hotelList[this.scrollData.activeIndex].id}, false)
|
|
|
+ this.$refs.map.markertap({markerId: this.hotelList[this.scrollData.activeIndex].id,index: this.scrollData.activeIndex}, false)
|
|
|
this.scrollData.spa = true;
|
|
|
setTimeout(()=>{
|
|
|
this.scrollData.spa = false;
|
|
|
- }, 10)
|
|
|
+ }, 300)
|
|
|
},
|
|
|
moveToTabX(e){
|
|
|
- console.log(this.scrolls.scrollX)
|
|
|
this.scrollData.spa = true;
|
|
|
this.scrolls.scrollX = (256 * this.scrollData.activeIndex+1) - (this.screenWidth-256)/2 + 'px';
|
|
|
|
|
|
- console.log(this.scrolls.scrollX)
|
|
|
setTimeout(()=>{
|
|
|
this.scrollData.spa = false;
|
|
|
}, 500)
|
|
|
},
|
|
|
- scrollTolower(){
|
|
|
- this.$refs.map.markertap({markerId: this.hotelList[this.hotelList.length-1].id}, false)
|
|
|
+ scrollTolower(index){
|
|
|
+ this.$refs.map.markertap({index:index}, false)
|
|
|
this.scrollData.spa = true;
|
|
|
setTimeout(()=>{
|
|
|
this.scrollData.spa = false;
|
|
| xqd
@@ -593,17 +584,14 @@
|
|
|
//获取当前页面路径
|
|
|
getPageUrl() {
|
|
|
const pages = getCurrentPages();
|
|
|
- console.log(pages,'--------->pages')
|
|
|
if(pages.length==1){
|
|
|
const currentPage = pages[0];
|
|
|
let pageUrl = `/${currentPage.route}`;
|
|
|
return pageUrl
|
|
|
- console.log('当前页面url:', pageUrl);
|
|
|
}else{
|
|
|
const currentPage = pages[pages.length - 1];
|
|
|
let pageUrl = `/${currentPage.route}`;
|
|
|
return pageUrl
|
|
|
- console.log('当前页面url:', pageUrl);
|
|
|
}
|
|
|
},
|
|
|
// 跳转其他小程序
|
|
| xqd
@@ -624,7 +612,6 @@
|
|
|
} else {
|
|
|
user_id = 0
|
|
|
}
|
|
|
- console.log('成功', page)
|
|
|
_this.$api.my.userMemberAdd({
|
|
|
user_id,
|
|
|
page,
|