register_map.vue 927 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. // mapShow: false,
  16. positionObj: {},
  17. };
  18. },
  19. onNavigationBarButtonTap(e) {
  20. if (e.index == 0) {
  21. this.inBack()
  22. }
  23. },
  24. methods: {
  25. inBack() {
  26. },
  27. // 打开地图
  28. openMap() {
  29. this.mapShow = true
  30. },
  31. // 更新地址并关闭地图
  32. updateAddress(addressObj) {
  33. this.positionObj = addressObj
  34. uni.$emit("addressData", this.positionObj)
  35. uni.navigateBack({})
  36. },
  37. },
  38. }
  39. </script>
  40. <style lang="scss">
  41. .content {
  42. display: flex;
  43. flex-direction: column;
  44. align-items: center;
  45. justify-content: center;
  46. }
  47. .address{
  48. // margin-top: 1rem;
  49. }
  50. </style>