|
@@ -0,0 +1,89 @@
|
|
|
+<template>
|
|
|
+ <view class="container">
|
|
|
+ <view class="content">
|
|
|
+ <map class="map" @markertap="markertap" :latitude="nowLocation.latitude" :longitude="nowLocation.longitude" :markers="covers">
|
|
|
+ </map>
|
|
|
+ </view>
|
|
|
+<!-- <view class="bottom">
|
|
|
+ <view class="title">
|
|
|
+ {{dataList.title}}
|
|
|
+ </view>
|
|
|
+ <view class="bottom-content">
|
|
|
+ {{dataList.content}}
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <u-icon name="map" size="36" class="icon"></u-icon>
|
|
|
+ <view>{{dataList.localtion}}</view>
|
|
|
+ <view>{{dataList.rice}}</view>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dataList:{
|
|
|
+ title:'中天昊元粮库中天昊元粮库',
|
|
|
+ content:'我是企业介绍我是企业介绍我是企业介绍我是企业介绍我是企业介绍…',
|
|
|
+ localtion:"辽宁省营口市鲅鱼圈区熊岳镇火车站…",
|
|
|
+ rice:'500m'
|
|
|
+
|
|
|
+ },
|
|
|
+ nowLocation: {
|
|
|
+ longitude: '',
|
|
|
+ latitude: ''
|
|
|
+ },
|
|
|
+ title: 'map',
|
|
|
+ latitude: 39.909,
|
|
|
+ longitude: 116.39742,
|
|
|
+ covers: [{
|
|
|
+ id: 0,
|
|
|
+ latitude: 39.9085,
|
|
|
+ longitude: 116.39747,
|
|
|
+ iconPath: '../../../static/img/location.png',
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.getLocation()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getLocation() {
|
|
|
+ let that = this;
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ geocode:true,
|
|
|
+ success: function(res) {
|
|
|
+ that.nowLocation.longitude = res.longitude
|
|
|
+ that.nowLocation.latitude = res.latitude
|
|
|
+ that.covers[0].longitude = res.longitude
|
|
|
+ that.covers[0].latitude = res.latitude
|
|
|
+ console.log('获取位置数据:',res);
|
|
|
+ console.log('当前位置的经度:' + res.longitude);
|
|
|
+ console.log('当前位置的纬度:' + res.latitude);
|
|
|
+ //拼接当前定位回显地址
|
|
|
+ // let _address = res.address
|
|
|
+ // this.address = _address
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .content{
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ }
|
|
|
+ .map {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .bottom{
|
|
|
+ width: 80%;
|
|
|
+ background: white;
|
|
|
+ }
|
|
|
+</style>
|