Browse Source

feat(market): 添加企业地图功能

- 在 firm_info.vue 中新增企业地图展示模块
- 添加地图组件,显示企业位置信息
- 更新 manifest.json,增加地图相关权限和配置
master
liutong 10 months ago
parent
commit
5b5044454d
  1. 10
      manifest.json
  2. 48
      pages/market/my/firm_info.vue
  3. BIN
      static/icon-img/ding_wei.png

10
manifest.json

@ -72,6 +72,9 @@
"permission" : { "permission" : {
"scope.userFuzzyLocation" : { "scope.userFuzzyLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示" "desc" : "你的位置信息将用于小程序位置接口的效果展示"
},
"scope.userLocation" : {
"desc" : "用于获取当前所在城市信息"
} }
}, },
"requiredPrivateInfos" : [ "getLocation", "chooseLocation" ] "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ]
@ -92,6 +95,13 @@
"router" : { "router" : {
"base" : "./", "base" : "./",
"mode" : "history" "mode" : "history"
},
"sdkConfigs" : {
"maps" : {
"tencent" : {
"key" : "AKTBZ-OGICT-E5NXQ-LGEGK-H5AJ5-M2BOX"
}
}
} }
} }
} }

48
pages/market/my/firm_info.vue

@ -29,8 +29,24 @@
</view> </view>
</view> </view>
<view class="title_section">企业介绍</view>
<view class="title_section">企业地图</view>
<view class="section_3"> <view class="section_3">
<view class="map_box">
<map
:id="`shopMap_${k}`"
:latitude="v.campus_coordinates_arr.lat"
:longitude="v.campus_coordinates_arr.lng"
:markers="getMarkers(k,v)"
:scale="15"
:show-location="false"
style="width: 90%; height: 400rpx;"
></map>
</view>
</view>
<view class="title_section">企业介绍</view>
<view class="section_4">
<view class="html" v-html="v. <view class="html" v-html="v.
campus_introduction"></view> campus_introduction"></view>
</view> </view>
@ -64,6 +80,14 @@ import apiRoute from '@/api/apiRoute.js';
}, },
// //
tableList:[], tableList:[],
//
//
mapControls:{
position:{
},
}
} }
}, },
onShow(){ onShow(){
@ -106,6 +130,17 @@ import apiRoute from '@/api/apiRoute.js';
console.log(123,this.tableList) console.log(123,this.tableList)
}, },
//
getMarkers(id,item) {
return [{
id: id,
latitude: item.campus_coordinates_arr.lat,
longitude: item.campus_coordinates_arr.lng,
name: item.campus_address,
iconPath: '/static/icon-img/ding_wei.png'
}];
},
} }
} }
</script> </script>
@ -147,6 +182,17 @@ import apiRoute from '@/api/apiRoute.js';
} }
} }
.section_3{ .section_3{
padding: 20rpx 22rpx;
.html{
color: #fff;
}
.map_box{
color: #fff;
display: flex;
justify-content: center;
}
}
.section_4{
padding: 20rpx 22rpx; padding: 20rpx 22rpx;
padding-bottom: 250rpx; padding-bottom: 250rpx;
.html{ .html{

BIN
static/icon-img/ding_wei.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Loading…
Cancel
Save