From 575eaa335ea9fee79ffa1f6d6203c777f967acf4 Mon Sep 17 00:00:00 2001 From: wangkesi Date: Mon, 29 Oct 2018 20:59:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/home.vue | 64 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/view/home.vue b/src/view/home.vue index 4adea5e..47e2148 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -336,36 +336,6 @@ export default { data.userAddress.districtName; this.alertShow = true; } else if (data.userAddress.type == 2) { - this.provinceId = data.userAddress.provinceId - ? data.userAddress.provinceId - : this.provinceId; - this.cityId = data.userAddress.cityId - ? data.userAddress.cityId - : this.cityId; - this.districtId = data.userAddress.districtId - ? data.userAddress.districtId - : this.districtId; - this.defaultCity = data.userAddress.districtName - ? data.userAddress.districtName - : this.defaultCity; - this.merchantNo = data.userAddress.merchantNo; - this.addressValue = [ - this.provinceId + - "&" + - data.userAddress.provinceName, - this.cityId + - "&" + - data.userAddress.cityName, - this.districtId + - "&" + - data.userAddress.districtName + - "&" + - data.userAddress.merchantNo - ]; - localStorage.setItem( - "cityName", - this.addressValue.slice() - ); this.$vux.confirm.show({ title: "自动定位地址:", content: @@ -376,6 +346,40 @@ export default { this.show = true; }, onConfirm: () => { + this.provinceId = data.userAddress + .provinceId + ? data.userAddress.provinceId + : this.provinceId; + this.cityId = data.userAddress.cityId + ? data.userAddress.cityId + : this.cityId; + this.districtId = data.userAddress + .districtId + ? data.userAddress.districtId + : this.districtId; + this.defaultCity = data.userAddress + .districtName + ? data.userAddress.districtName + : this.defaultCity; + this.merchantNo = + data.userAddress.merchantNo; + this.addressValue = [ + this.provinceId + + "&" + + data.userAddress.provinceName, + this.cityId + + "&" + + data.userAddress.cityName, + this.districtId + + "&" + + data.userAddress.districtName + + "&" + + data.userAddress.merchantNo + ]; + localStorage.setItem( + "cityName", + this.addressValue.slice() + ); this.getGoodsList(); } });