<template>
  <view>
    <button @tap="handleSelectLocation">选择位置</button>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleSelectLocation() {
      uni.chooseLocation({
        success: function(res) {
          console.log('位置名称：' + res.name);
          console.log('详细地址：' + res.address);
          console.log('纬度：' + res.latitude);
          console.log('经度：' + res.longitude);
        },
      });
    },
  },
};
</script>
