Browse Source

自动获取位置字段修改

dev
liujiangyong 2 years ago
parent
commit
1a90abc72b
  1. 5
      weapp/src/packages/patrol/index.jsx

5
weapp/src/packages/patrol/index.jsx

@ -124,8 +124,9 @@ const Index = () => {
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=${key}`,
success: function (res) {
// res
let addresscity = res.data.result.address_component.province + res.data.result.address_component.city + res.data.result.address_component.district
setAddress(addresscity + res.data.result.address_component.street_number)
// let addresscity = res.data.result.address_component.province + res.data.result.address_component.city + res.data.result.address_component.district
// console.log(res, 'res')
setAddress(res.data.result.formatted_addresses.standard_address)
}
})
}

Loading…
Cancel
Save