index.js 358 B

12345678910111213141516171819202122232425
  1. export default () => {
  2. const key = '6ZCBZ-I2GC4-BBIUZ-DNZVG-DXJA3-7WBS5'
  3. const url = 'https://apis.map.qq.com/ws/geocoder/v1/'
  4. return {
  5. address(address) {
  6. return uni.request({
  7. url,
  8. data: {
  9. address,
  10. key
  11. }
  12. })
  13. },
  14. location(location){
  15. return uni.request({
  16. url,
  17. data: {
  18. location,
  19. key
  20. }
  21. })
  22. }
  23. }
  24. }