修复bug
This commit is contained in:
@@ -55,37 +55,34 @@ export default {
|
||||
},
|
||||
|
||||
getLocation () {
|
||||
alert(2)
|
||||
this.injectJWeixin(['getLocation']).then(() => {
|
||||
alert(232432)
|
||||
wx.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
var lat = res.latitude
|
||||
var lng = res.longitude
|
||||
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
|
||||
if (res.code === 0) {
|
||||
const data = res.data.result
|
||||
uni.setStorageSync('address', {
|
||||
lat,
|
||||
lng,
|
||||
address: data.address,
|
||||
cityCode: `${data.ad_info.adcode}`
|
||||
})
|
||||
this.injectJWeixin(['getLocation']).then(() => {
|
||||
wx.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
var lat = res.latitude
|
||||
var lng = res.longitude
|
||||
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
|
||||
if (res.code === 0) {
|
||||
const data = res.data.result
|
||||
uni.setStorageSync('address', {
|
||||
lat,
|
||||
lng,
|
||||
address: data.address,
|
||||
cityCode: `${data.ad_info.adcode}`
|
||||
})
|
||||
|
||||
alert(JSON.stringify(data))
|
||||
alert(JSON.stringify(data))
|
||||
|
||||
this.getWeather(`${data.ad_info.adcode}`)
|
||||
}
|
||||
})
|
||||
},
|
||||
error: res => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}).catch(e => {
|
||||
alert(JSON.stringify(e))
|
||||
this.getWeather(`${data.ad_info.adcode}`)
|
||||
}
|
||||
})
|
||||
},
|
||||
error: res => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}).catch(e => {
|
||||
})
|
||||
},
|
||||
|
||||
getWeather (code) {
|
||||
|
||||
Reference in New Issue
Block a user