TuanLocation.vue 572 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <view class="tuan-location-container" @click="handleGetUserLocation">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'TuanLocation',
  9. props: {
  10. eventName: {
  11. type: String,
  12. default: ''
  13. },
  14. free: {
  15. type: Boolean,
  16. default: false
  17. }
  18. },
  19. methods: {
  20. // 点击获取定位
  21. handleGetUserLocation() {
  22. let url = `/pages/choose-location/choose-location?eventName=${this.eventName}`
  23. if(this.free){
  24. url += '&isUnLimit=true'
  25. }
  26. uni.navigateTo({
  27. url
  28. })
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="less" scoped></style>