Commit dc1c22b0 authored by fwz's avatar fwz

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

parent fc5d7dab
......@@ -316,6 +316,8 @@
// 2)需要当前地理位置的经纬度
// 3)小程序的key值
loadCity(longitude, latitude) {
// longitude = 113.740388
// latitude = 22.998617
const that = this
uni.request({
header: {
......@@ -343,12 +345,17 @@
that.appBo.cityName = ''
}
//区
that.appBo.countyName = addressInfo.regeocode.addressComponent.district
if (!Array.isArray(addressInfo.regeocode.addressComponent.district)){
that.appBo.countyName = addressInfo.regeocode.addressComponent.district
}
//街道
that.appBo.township = addressInfo.regeocode.addressComponent.township
if (!Array.isArray(addressInfo.regeocode.addressComponent.township)){
that.appBo.township = addressInfo.regeocode.addressComponent.township
}
//号数
that.appBo.number = addressInfo.regeocode.addressComponent.streetNumber.number
if (!Array.isArray(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)
}
} 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