From 097d30d9f4fe2ef1f260d2727f3b2421785489d4 Mon Sep 17 00:00:00 2001 From: wangkesi Date: Mon, 29 Oct 2018 20:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=AD=98=E5=82=A8?= =?UTF-8?q?=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 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/view/home.vue b/src/view/home.vue index 2b9ab5a..0ae03cd 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -154,7 +154,8 @@ export default { cityId: "", alertShow: false, address: "", - flag: false + flag: false, + state: 0 }; }, components: { @@ -173,13 +174,13 @@ export default { methods: { //监听地区选择的完成按钮 getName() { - console.log(1); let arr = this.addressValue[2].split("&") || ""; this.districtId = arr[0]; this.merchantNo = arr[2]; this.getGoodsList(); //加载商品列表 this.defaultCity = arr[1]; this.show = false; + console.log(this.addressValue); localStorage.setItem("cityName", this.addressValue); this.ShareWenXin(); }, @@ -206,7 +207,6 @@ export default { //获取城市名称 change(name) { if (this.flag) { - console.log(1); this.addressValue = name; } }, @@ -280,14 +280,19 @@ export default { // }, setShow() { let str = localStorage.getItem("cityName") || ""; - if (!str) { + if (!str && this.state == -1) { this.defaultCity = "天河区"; //商户编号 this.merchantNo = 2; //区id this.districtId = "440106000"; - this.addressValue = []; + this.addressValue = [ + "440000000&广东省", + "440100000&广州市", + "440106000&天河区&2" + ]; this.getGoodsList(); + this.state = 0; } this.show = false; }, @@ -381,6 +386,7 @@ export default { } else if (data.userAddress.type == 0) { this.getGoodsList(); } else if (data.userAddress.type == -1) { + this.state = -1; this.$vux.alert.show({ title: "自动定位失败", onHide: () => {