| | |
| | | current[2] = distIndex; |
| | | } |
| | | // 街 |
| | | if (this.level === 4 && codes[3]) { |
| | | if (distIndex >= 0) { |
| | | range[3] = |
| | | range[2][distIndex].children || []; |
| | | const streetIndex = range[3].findIndex( |
| | | street => street.value === codes[3] |
| | | ); |
| | | if (streetIndex >= 0) { |
| | | current[3] = streetIndex; |
| | | } |
| | | if (this.level === 4) { |
| | | range[3] = |
| | | range[2][current[2]].children || []; |
| | | const streetIndex = range[3].findIndex( |
| | | street => street.value === codes[3] |
| | | ); |
| | | if (streetIndex >= 0) { |
| | | current[3] = streetIndex; |
| | | } |
| | | } |
| | | } |
| | |
| | | address.province.replace(/省|市|自治区|特别行政区/g, ''), |
| | | address.city, |
| | | address.district, |
| | | address.street, |
| | | ]; |
| | | if (this.level === 4) { |
| | | regions.push(address.street); |
| | | } |
| | | $locations.getRegionCodes(regions, codes => { |
| | | if (codes && codes.length > 0) { |
| | | $locations.getRegionNames(codes, names => { |