From 667563d6ae12c2da2a16bf68be67a008d5bc6138 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 06 八月 2024 20:48:41 +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