Commit dc1c22b0 authored by fwz's avatar fwz

区,街道,号数判断不是数组才传给后端

parent fc5d7dab
...@@ -316,6 +316,8 @@ ...@@ -316,6 +316,8 @@
// 2)需要当前地理位置的经纬度 // 2)需要当前地理位置的经纬度
// 3)小程序的key值 // 3)小程序的key值
loadCity(longitude, latitude) { loadCity(longitude, latitude) {
// longitude = 113.740388
// latitude = 22.998617
const that = this const that = this
uni.request({ uni.request({
header: { header: {
...@@ -343,12 +345,17 @@ ...@@ -343,12 +345,17 @@
that.appBo.cityName = '' that.appBo.cityName = ''
} }
//区 //区
if (!Array.isArray(addressInfo.regeocode.addressComponent.district)){
that.appBo.countyName = addressInfo.regeocode.addressComponent.district that.appBo.countyName = addressInfo.regeocode.addressComponent.district
}
//街道 //街道
if (!Array.isArray(addressInfo.regeocode.addressComponent.township)){
that.appBo.township = addressInfo.regeocode.addressComponent.township that.appBo.township = addressInfo.regeocode.addressComponent.township
}
//号数 //号数
if (!Array.isArray(addressInfo.regeocode.addressComponent.streetNumber.number)){
that.appBo.number = addressInfo.regeocode.addressComponent.streetNumber.number that.appBo.number = addressInfo.regeocode.addressComponent.streetNumber.number
}
//console.log("当前位置: " + that.appBo.detailInfo + " " + that.appBo.provinceName + " " + " " + that.appBo.cityName + " " + that.appBo.countyName) //console.log("当前位置: " + that.appBo.detailInfo + " " + that.appBo.provinceName + " " + " " + that.appBo.cityName + " " + that.appBo.countyName)
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment