<template>
<view class="main">
<iframe id="mapPage" width="100%" height="100%" frameborder=0
src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=PQ7BZ-OWKRU-4WNVE-4UQSS-6CKRV-Y5BGN&referer=myapp">
</iframe>
</view>
</template>

<script>
export default {
data(){
return {

}
},
onLoad(){
this.listen()
},
methods:{
listen(){
var that=this
// #ifdef H5
window.addEventListener('message', event=> {
// 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
var loc = event.data;
if (loc && loc.module == 'locationPicker') {
that.bus.$emit("shopCreated",loc)
uni.navigateBack({});
}
}, false);
// #endif
}
}
}
</script>

<style lang="scss" scoped>
.main{
width:100vm;
height:100vh;
margin: 0;
padding: 0;
}
</style>

posted on 2021-04-26 10:22  空*幻  阅读(54)  评论(0编辑  收藏  举报