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

4 years ago
<template>
<view>
4 years ago
<map style="width: 100%; height: 100vh;position: relative;" :latitude="info.latitude" :longitude="info.longitude"
4 years ago
:markers="covers"></map>
</view>
</template>
<script>
export default {
data() {
return {
4 years ago
info: {},
covers: [],
4 years ago
}
},
onLoad() {
4 years ago
this.loadInfo(function(res) {
uni.openLocation({
latitude: res.latitude,
longitude: res.longitude,
name: res.name,
address: res.address
});
4 years ago
})
},
methods: {
4 years ago
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) {
4 years ago
4 years ago
}
})
},
4 years ago
}
}
</script>
<style>
4 years ago
</style>