main.vue 1007 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!--
  2. 【微信消息 - 定位】
  3. -->
  4. <template>
  5. <div>
  6. <el-link type="primary" target="_blank" :href="'https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=' + locationY + '&pointy=' + locationX + '&name=' + label + '&ref=yudao'">
  7. <img :src="'https://apis.map.qq.com/ws/staticmap/v2/?zoom=10&markers=color:blue|label:A|' + locationX + ',' + locationY + '&key=' + qqMapKey + '&size=250*180'">
  8. <p/><i class="el-icon-map-location"></i>{{label}}
  9. </el-link>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: "wxLocation",
  15. props: {
  16. locationX: {
  17. required: true,
  18. type: Number
  19. },
  20. locationY: {
  21. required: true,
  22. type: Number
  23. },
  24. label: { // 地名
  25. required: true,
  26. type: String
  27. },
  28. qqMapKey: { // QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
  29. required: false,
  30. type: String,
  31. default: 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E' // 需要自定义
  32. }
  33. }
  34. };
  35. </script>