mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 21:19:37 +08:00
描述:地图
This commit is contained in:
parent
2be3c7ab11
commit
85b20d5c11
@ -1,7 +1,10 @@
|
|||||||
const app = getApp()
|
const app = getApp()
|
||||||
import {
|
import {
|
||||||
meetingRoomDetailRq
|
meetingRoomDetailRq,
|
||||||
|
selectCoordinateRq
|
||||||
} from "../../../api/meeting/meetingRoom.js"
|
} from "../../../api/meeting/meetingRoom.js"
|
||||||
|
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,19 +13,10 @@ Page({
|
|||||||
data: {
|
data: {
|
||||||
IMG_NAME: app.IMG_NAME,
|
IMG_NAME: app.IMG_NAME,
|
||||||
contentSwichFLag: true,
|
contentSwichFLag: true,
|
||||||
meetingRoomId : null,
|
meetingRoomId: null,
|
||||||
detail: {},
|
detail: {},
|
||||||
bannerList: [],
|
bannerList: [],
|
||||||
mapData: {
|
mapData: {}
|
||||||
latitude: 33.601291,
|
|
||||||
longitude: 119.031829,
|
|
||||||
markers: [{
|
|
||||||
id: 1,
|
|
||||||
latitude: 33.601291,
|
|
||||||
longitude: 119.031829,
|
|
||||||
title: '淮安茂业天地购物中心'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,6 +34,39 @@ Page({
|
|||||||
bannerList: [res.roomContent.indoorPicUrl]
|
bannerList: [res.roomContent.indoorPicUrl]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
// 获取地址信息
|
||||||
|
_this.getAddress()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取地址信息
|
||||||
|
getAddress() {
|
||||||
|
let _this = this;
|
||||||
|
selectCoordinateRq().then(res => {
|
||||||
|
_this.setData({
|
||||||
|
address: res,
|
||||||
|
mapData: {
|
||||||
|
latitude: res.lat,
|
||||||
|
longitude: res.lng,
|
||||||
|
markers: [{
|
||||||
|
id: 1,
|
||||||
|
latitude: res.lat,
|
||||||
|
longitude: res.lng,
|
||||||
|
title: res.address,
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 打开地图
|
||||||
|
openMap(e) {
|
||||||
|
console.log('openMap', e);
|
||||||
|
let _this = this;
|
||||||
|
wx.openLocation({
|
||||||
|
name: _this.data.address.address,
|
||||||
|
latitude: _this.data.address.lat,
|
||||||
|
longitude: _this.data.address.lng,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 切换内容展示
|
// 切换内容展示
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<!-- 地图 -->
|
<!-- 地图 -->
|
||||||
<view class="mapView">
|
<view class="mapView">
|
||||||
<view class="leftLineTitle">空间周边</view>
|
<view class="leftLineTitle">空间周边</view>
|
||||||
<map class="myMap" latitude="{{mapData.latitude}}" longitude="{{mapData.longitude}}" markers="{{mapData.markers}}" show-location></map>
|
<map class="myMap" latitude="{{mapData.latitude}}" longitude="{{mapData.longitude}}" markers="{{mapData.markers}}" show-location bindtap="openMap"></map>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 预约 -->
|
<!-- 预约 -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user