index.vue 614 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="draw-map">
  3. <draw @onSubmit="onSubmit"></draw>
  4. </view>
  5. </template>
  6. <script>
  7. import Draw from '@/components/OpenLayerMap/Draw.vue';
  8. export default {
  9. components:{
  10. Draw
  11. },
  12. data(){
  13. return {
  14. eventChannel:null
  15. }
  16. },
  17. onLoad(e) {
  18. this.eventChannel = this.getOpenerEventChannel();
  19. },
  20. methods:{
  21. onSubmit(e) {
  22. this.eventChannel.emit('savePolygonCoords', {
  23. coords: e
  24. })
  25. uni.navigateBack();
  26. }
  27. }
  28. }
  29. </script>
  30. <style lang="scss">
  31. .draw-map{
  32. height: calc(100vh - var(--window-top) - 40rpx);
  33. background-color: $uni-user-page-bgc;
  34. }
  35. </style>