From 6e4b859a05e29eb75ff39c340e015265c3be85e9 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期日, 04 八月 2024 11:51:43 +0800 Subject: [PATCH] update 合伙人、花店端 --- pages/user/address/address.vue | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pages/user/address/address.vue b/pages/user/address/address.vue index 5deb06e..e320be3 100644 --- a/pages/user/address/address.vue +++ b/pages/user/address/address.vue @@ -219,10 +219,19 @@ }, async init_area() { if (this.regionDataPlus && this.regionDataPlus.length > 0) { - const res = await this.$http.request('get', '/api/pub/china/area/json') - this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll( - 'name', - 'text')) || [] + + }else{ + var a = this.$storage.getItem('cache_area') + if (a) { + this.regionDataPlus = JSON.parse(a) || [] + } else { + 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( + 'name', + 'text')) || [] + this.$storage.setItem('cache_area', JSON.stringify(this.regionDataPlus)) + } } }, -- Gitblit v1.9.3