text: var app = getApp()
  Page({
  
      data: {
          //默认未获取地址
          hasLocation: false
      },
  
      //获取经纬度
      getLocation: function (e) {
          console.log(e)
          var that = this
          wx.getLocation({
              success: function (res) {
                  console.log(res)
                  that.setData({
                      hasLocation: true,
                      location: {
                          longitude: res.longitude,
                          latitude: res.latitude
                      }
                  })
              }
          })
      },
      //根据经纬度在地图上显示
      openLocation: function (e) {
          console.log(e.detail)
          var value = e.detail.value
          wx.openLocation({
              longitude: Number(value.longitude),
              latitude: Number(value.latitude)
          })
      }
  })
  