register_map.vue 854 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="content">
  3. <mi-map ref="miMap" tipText="mi-Map" @updateAddress="updateAddress">
  4. </mi-map>
  5. </view>
  6. </template>
  7. <script>
  8. import miMap from '../../components/mi-map/mi-map.vue'
  9. export default {
  10. components: {
  11. miMap
  12. },
  13. data() {
  14. return {
  15. positionObj: {},
  16. };
  17. },
  18. onNavigationBarButtonTap(e) {
  19. if (e.index == 0) {
  20. this.inBack()
  21. }
  22. },
  23. methods: {
  24. inBack() {
  25. },
  26. // 打开地图
  27. openMap() {
  28. this.mapShow = true
  29. },
  30. // 更新地址并关闭地图
  31. updateAddress(addressObj) {
  32. this.positionObj = addressObj
  33. uni.$emit("addressData", this.positionObj)
  34. uni.navigateBack({})
  35. },
  36. },
  37. }
  38. </script>
  39. <style lang="scss">
  40. .content {
  41. display: flex;
  42. flex-direction: column;
  43. align-items: center;
  44. justify-content: center;
  45. }
  46. </style>