邓洁 : 地图接口

This commit is contained in:
dengj
2023-11-16 12:50:58 +08:00
parent e50e90c841
commit 88dfe5760b
4 changed files with 83 additions and 31 deletions

View File

@@ -125,6 +125,8 @@
"path": "pages/index/NavBarPages/zrxx/zrxx",
"style": {
"navigationBarTitleText": "转让信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
}
},
@@ -132,6 +134,8 @@
"path": "pages/index/NavBarPages/zdxx/zdxx",
"style": {
"navigationBarTitleText": "找店信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
}
},
@@ -139,6 +143,8 @@
"path": "pages/index/NavBarPages/czxx/czxx",
"style": {
"navigationBarTitleText": "出租信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
}
},
@@ -146,6 +152,8 @@
"path": "pages/index/NavBarPages/xmzs/xmzs",
"style": {
"navigationBarTitleText": "项目招商",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
}
},
@@ -153,6 +161,8 @@
"path": "pages/index/NavBarPages/cjal/cjal",
"style": {
"navigationBarTitleText": "成交案例",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
}
},

View File

@@ -4,12 +4,7 @@
<view class="home-content">
<view class="service">
<u-image src="/static/statistics/sy_icon_lxkf.png" width="108rpx" height="108rpx" />
<button
open-type="contact"
bindcontact="handleContact"
session-from="sessionFrom"
class="service-btn"
>
<button open-type="contact" bindcontact="handleContact" session-from="sessionFrom" class="service-btn">
</button>
</view>
<HomeNavCard></HomeNavCard>
@@ -95,6 +90,8 @@
success(res) {
console.log('res.latitude', res.latitude);
console.log('res.longitude', res.longitude);
uni.setStorageSync('latitude', res.latitude);
uni.setStorageSync('longitude', res.longitude);
qqmapsdk.reverseGeocoder({
location: {
latitude: res.latitude,
@@ -176,11 +173,13 @@
.home-content {
margin: 0 10px;
.service {
position: fixed;
right: 17rpx;
top: 1109rpx;
z-index: 1;
.service-btn {
position: absolute;
top: 0;
@@ -189,6 +188,7 @@
width: 108rpx;
height: 108rpx;
}
.service-btn::after {
border: none;

View File

@@ -76,7 +76,42 @@
console.log("markerClusterCreate", e);
});
},
created() {
this.getMapList()
},
methods: {
getMapList() {
const realData = {
longitude: uni.getStorageSync('longitude'),
latitude: uni.getStorageSync('latitude'),
radius: 100
}
const mockData = {
longitude: 23.40,
latitude: 116.38,
radius: 1111111111
}
this.$api.getMap(mockData).then(res => {
console.log('getMap', res);
let obj = {}
if (res.statusCode === 200) {
// res.data.data.forEach(item => {
// obj = {
// id: parseInt(item.id),
// latitude: item.lat,
// longitude: item.lng,
// // iconPath: '../../../static/map/sp_icon_dw.png',
// width: '58rpx',
// height: '72rpx',
// rotate: 0,
// alpha: 1
// }
// })
// this.marker.push(obj)
// console.log('this.marker', this.marker);
}
})
},
// 图标点击
markerClick(e) {
console.log('标记点击', e);

View File

@@ -145,6 +145,13 @@ const apiService = {
resolve(service.post(url, data))
})
},
//地图
getMap(data) {
const url = '/home/map'
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
// 获取客服电话
getCsTel() {
const url = '/center/cfg?key=kf_phone'