You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.1 KiB

<template>
<view>
<map style="width: 100%; height: 100vh;position: relative;" :latitude="info.latitude" :longitude="info.longitude"
:markers="covers"></map>
</view>
</template>
<script>
export default {
data() {
return {
info: {},
covers: [],
}
},
onLoad() {
this.loadInfo(function(res) {
uni.openLocation({
latitude: res.latitude,
longitude: res.longitude,
name: res.name,
address: res.address
});
})
},
methods: {
loadInfo(cb) {
var that = this;
this.util.request({
api: '/api/mobile/visit/introduce',
utilSuccess: function(res) {
res.latitude = parseFloat(res.latitude);
res.longitude = parseFloat(res.longitude);
that.info = res;
that.covers.push({
latitude: res.latitude,
longitude: res.longitude,
width: 70,
height: 70,
iconPath: '/static/img/location.png'
});
cb(res);
},
utilFail: function(res) {
}
})
},
}
}
</script>
<style>
</style>