| | |
| | | * @author Tevin |
| | | */ |
| | | |
| | | import ChinaLocations from '@components/forms/chinaArea/ChinaLocations'; |
| | | import { $locations } from '@components/forms/chinaArea/ChinaLocations'; |
| | | import { Tools } from '@components/common/Tools'; |
| | | |
| | | export class SmartAddress { |
| | |
| | | } |
| | | this.wordData = {}; |
| | | const wordArr = this._splitWord(word); |
| | | ChinaLocations.onReady(() => { |
| | | $locations.onReady(() => { |
| | | this._checkPhone(wordArr); |
| | | this._checkCompany(wordArr); |
| | | this._checkUser(wordArr); |
| | |
| | | |
| | | _isAddress(content) { |
| | | content = content.replace('中国', ''); |
| | | const provinceNames = ChinaLocations.getLocationTree() |
| | | const provinceNames = $locations.getLocationTree() |
| | | .map(lv1 => lv1.label.replace('特别行政区', '').replace('省', '')); |
| | | for (let province of provinceNames) { |
| | | if (content.indexOf(province) >= 0) { |
| | |
| | | |
| | | _parseAddress(content) { |
| | | content = content.replace('中国', ''); |
| | | const chinaTree = ChinaLocations.getLocationTree(); |
| | | const chinaTree = $locations.getLocationTree(); |
| | | // 省份处理 --- |
| | | const provinceTailReg = /特别行政区|自治区|省|市$/; |
| | | for (let province of chinaTree) { |