|
|
@ -1,8 +1,8 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="map-container"> |
|
|
|
<view class="map-container"> |
|
|
|
<!-- #ifdef H5 --> |
|
|
|
<!-- #ifdef H5 --> |
|
|
|
<map style="width: 100%; height: 10vh;" :style="{height:mapheight}" :latitude="latitude" :longitude="longitude" |
|
|
|
<map id="myMap" style="width: 100%; height: 10vh;" :style="{height:mapheight}" :latitude="latitude" |
|
|
|
:markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'> |
|
|
|
:longitude="longitude" :markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'> |
|
|
|
<cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap"> |
|
|
|
<cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap"> |
|
|
|
<cover-image class="cover-image" src="../../../static/img/dispos.png"></cover-image> |
|
|
|
<cover-image class="cover-image" src="../../../static/img/dispos.png"></cover-image> |
|
|
|
</cover-view> |
|
|
|
</cover-view> |
|
|
@ -107,8 +107,8 @@ |
|
|
|
<!-- #endif --> |
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef MP --> |
|
|
|
<!-- #ifdef MP --> |
|
|
|
<map style="width: 100%; height: 10vh;" :style="{height:mapheight}" :latitude="latitude" :longitude="longitude" |
|
|
|
<map id="myMap" style="width: 100%; height: 10vh;" :style="{height:mapheight}" :latitude="latitude" |
|
|
|
:markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'> |
|
|
|
:longitude="longitude" :markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'> |
|
|
|
<cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap"> |
|
|
|
<cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap"> |
|
|
|
<cover-image class="cover-image" src="../../../static/img/dispos.png"></cover-image> |
|
|
|
<cover-image class="cover-image" src="../../../static/img/dispos.png"></cover-image> |
|
|
|
</cover-view> |
|
|
|
</cover-view> |
|
|
@ -123,10 +123,10 @@ |
|
|
|
<view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;"> |
|
|
|
<view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;"> |
|
|
|
<!-- :class="[selectFirst == 1? 'onchange' : '']" --> |
|
|
|
<!-- :class="[selectFirst == 1? 'onchange' : '']" --> |
|
|
|
<view class="font14 width30w fotct onchange text1" @click="changeChilerType()">{{selectFirstName}} |
|
|
|
<view class="font14 width30w fotct onchange text1" @click="changeChilerType()">{{selectFirstName}} |
|
|
|
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image> |
|
|
|
<image mode="aspectFit" class="margle" style="width: 8px;height:8px;" :src="imagewxUrl+imgadres2"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="font14 width30w onchange" @click="changeChilerdistance()">{{distanceName}} |
|
|
|
<view class="font14 width30w onchange" @click="changeChilerdistance()">{{distanceName}} |
|
|
|
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image> |
|
|
|
<image mode="aspectFit" class="margle" style="width: 8px;height:8px;" :src="imagewxUrl+imgadres2"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="font14 width30w"> |
|
|
|
<view class="font14 width30w"> |
|
|
|
<!-- 全部 |
|
|
|
<!-- 全部 |
|
|
@ -222,13 +222,14 @@ |
|
|
|
return { |
|
|
|
return { |
|
|
|
latitude: '', //纬度 |
|
|
|
latitude: '', //纬度 |
|
|
|
longitude: '', //经度 |
|
|
|
longitude: '', //经度 |
|
|
|
|
|
|
|
mapContext: null, |
|
|
|
scale: 13, //缩放级别 |
|
|
|
scale: 13, //缩放级别 |
|
|
|
bottomData: false, |
|
|
|
bottomData: false, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imgadres2: 'xiala.png', |
|
|
|
imgadres2: 'xiala.png', |
|
|
|
imgadres3: 'noorder.png', |
|
|
|
imgadres3: 'noorder.png', |
|
|
|
imgadres4: 'dh.png', |
|
|
|
imgadres4: 'dh.png', |
|
|
|
marker: '', //商户 |
|
|
|
marker: [], //商户 |
|
|
|
typeid: 99999999, //选择分类 |
|
|
|
typeid: 99999999, //选择分类 |
|
|
|
isSelected: 1, //是否选择下拉 |
|
|
|
isSelected: 1, //是否选择下拉 |
|
|
|
selectFirst: '99999999', //筛选是否有值 |
|
|
|
selectFirst: '99999999', //筛选是否有值 |
|
|
@ -282,11 +283,17 @@ |
|
|
|
typeplat: 1 //手机类型 |
|
|
|
typeplat: 1 //手机类型 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
this.onControltap(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReady() { |
|
|
|
|
|
|
|
this.mapContext = uni.createMapContext('myMap'); |
|
|
|
|
|
|
|
console.log(this.mapContext) |
|
|
|
|
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
// this.latitude = app.globalData.latitude; |
|
|
|
// this.latitude = app.globalData.latitude; |
|
|
|
// this.longitude = app.globalData.longitude; |
|
|
|
// this.longitude = app.globalData.longitude; |
|
|
|
this.onControltap(); |
|
|
|
/* this.onControltap(); */ |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
mapheight() { |
|
|
|
mapheight() { |
|
|
@ -359,10 +366,24 @@ |
|
|
|
getMapStore(datas).then(res => { |
|
|
|
getMapStore(datas).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
this.marker = res.return_data |
|
|
|
this.marker = res.return_data; |
|
|
|
|
|
|
|
// console.log(this.marker,"marker") |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.marker = []; |
|
|
|
this.marker = []; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.marker.push({ |
|
|
|
|
|
|
|
id: 0, |
|
|
|
|
|
|
|
latitude: this.latitude, |
|
|
|
|
|
|
|
longitude: this.longitude, |
|
|
|
|
|
|
|
iconPath: '/static/img/location.png', |
|
|
|
|
|
|
|
rotate: 1, |
|
|
|
|
|
|
|
alpha: 1, |
|
|
|
|
|
|
|
width: 40, |
|
|
|
|
|
|
|
height: 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
//选择二级分类数据 |
|
|
|
//选择二级分类数据 |
|
|
@ -379,27 +400,26 @@ |
|
|
|
this.selectChilerdistance = 2; |
|
|
|
this.selectChilerdistance = 2; |
|
|
|
this.getMapStore(); |
|
|
|
this.getMapStore(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//地图点击事件 |
|
|
|
//地图点击事件,点击标记点时触发 |
|
|
|
markertap(e) { |
|
|
|
markertap(e) { |
|
|
|
// #ifdef H5 |
|
|
|
// console.log(e,"点击标记点时触发"); |
|
|
|
let markerId = e.detail.markerId; |
|
|
|
let markerId = e.detail.markerId; |
|
|
|
|
|
|
|
if(markerId == 0) return; /* 点击当前自己定位的标记点*/ |
|
|
|
for (var i = 0; i < this.marker.length; i++) { |
|
|
|
for (var i = 0; i < this.marker.length; i++) { |
|
|
|
if (markerId == this.marker[i].id) { |
|
|
|
if (markerId == this.marker[i].id) { |
|
|
|
this.seeloaction(this.marker[i]); |
|
|
|
this.seeloaction(this.marker[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// #endif |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
//地图点击事件 |
|
|
|
//地图点击事件,点击标记点对应的气泡时触发, |
|
|
|
callouttap(e) { |
|
|
|
callouttap(e) { |
|
|
|
// #ifdef MP |
|
|
|
// console.log(e, "点击标记点对应的气泡") |
|
|
|
let markerId = e.markerId; |
|
|
|
let markerId = e.detail.markerId; |
|
|
|
for (var i = 0; i < this.marker.length; i++) { |
|
|
|
for (var i = 0; i < this.marker.length; i++) { |
|
|
|
if (markerId == this.marker[i].id) { |
|
|
|
if (markerId == this.marker[i].id) { |
|
|
|
this.seeloaction(this.marker[i]); |
|
|
|
this.seeloaction(this.marker[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// #endif |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
postionIng() { |
|
|
|
postionIng() { |
|
|
@ -523,6 +543,18 @@ |
|
|
|
// console.log(res, '获取当前位置') |
|
|
|
// console.log(res, '获取当前位置') |
|
|
|
this.longitude = res.longitude; |
|
|
|
this.longitude = res.longitude; |
|
|
|
this.latitude = res.latitude; |
|
|
|
this.latitude = res.latitude; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.mapContext){ |
|
|
|
|
|
|
|
this.mapContext.moveToLocation({ |
|
|
|
|
|
|
|
latitude: this.latitude, |
|
|
|
|
|
|
|
longitude: this.longitude, |
|
|
|
|
|
|
|
success(res){ |
|
|
|
|
|
|
|
// console.log(res,"成功") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.longitude, this.latitude, "this.longitude,this.latitude") |
|
|
|
this.getIndustry(); |
|
|
|
this.getIndustry(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail() { |
|
|
|
fail() { |
|
|
@ -585,18 +617,26 @@ |
|
|
|
this.isSelected = item; |
|
|
|
this.isSelected = item; |
|
|
|
}, |
|
|
|
}, |
|
|
|
seeloaction(item) { |
|
|
|
seeloaction(item) { |
|
|
|
// #ifdef H5 |
|
|
|
console.log(item,"item"); |
|
|
|
|
|
|
|
uni.openLocation({ |
|
|
|
|
|
|
|
latitude: parseFloat(item.latitude), //目的地的定位 |
|
|
|
|
|
|
|
longitude: parseFloat(item.longitude), //目的地的定位 |
|
|
|
|
|
|
|
name: item.callout.content, |
|
|
|
|
|
|
|
address: item.callout.address |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
window.location.href = |
|
|
|
window.location.href = |
|
|
|
`http://apis.map.qq.com/uri/v1/marker?marker=coord:(${item.latitude},${item.longitude})&addr:${item.address}`; |
|
|
|
`http://apis.map.qq.com/uri/v1/marker?marker=coord:(${item.latitude},${item.longitude})&addr:${item.address}`; |
|
|
|
// #endif |
|
|
|
|
|
|
|
// #ifdef MP |
|
|
|
|
|
|
|
uni.openLocation({ |
|
|
|
uni.openLocation({ |
|
|
|
latitude: Number(item.latitude), //目的地的定位 |
|
|
|
latitude: Number(item.latitude), //目的地的定位 |
|
|
|
longitude: Number(item.longitude), //目的地的定位 |
|
|
|
longitude: Number(item.longitude), //目的地的定位 |
|
|
|
name: item.store_name, |
|
|
|
name: item.store_name, |
|
|
|
address: item.address |
|
|
|
address: item.address |
|
|
|
}) |
|
|
|
}) |
|
|
|
// #endif |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|