| | |
| | | } |
| | | }, |
| | | async init_area() { |
| | | if (this.regionDataPlus && this.regionDataPlus.length > 0) { |
| | | // debugger; |
| | | // if (this.regionDataPlus && this.regionDataPlus.length > 0) { |
| | | |
| | | } else { |
| | | var a = this.$storage.getItem('cache_area') |
| | | // } else { |
| | | // var a = this.$storage.getItem('cache_area') |
| | | var a =false |
| | | if (a) { |
| | | this.regionDataPlus = JSON.parse(a) || [] |
| | | } else { |
| | | await this.$http.request('get', '/api/pub/china/area/json/refresh') |
| | | const res = await this.$http.request('get', '/api/pub/china/area/json') |
| | | // console.log('area', JSON.parse(res.data)) |
| | | this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll( |
| | |
| | | 'text')) || [] |
| | | this.$storage.setItem('cache_area', JSON.stringify(this.regionDataPlus)) |
| | | } |
| | | } |
| | | // } |
| | | |
| | | }, |
| | | chooseLocation() { |