diff --git a/src/view/home.vue b/src/view/home.vue index 47e2148..78e2fdd 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -97,7 +97,7 @@ - +
取消 @@ -174,6 +174,7 @@ export default { methods: { //监听地区选择的完成按钮 getName() { + this.state = 0; let arr = this.addressValue[2].split("&") || ""; this.districtId = arr[0]; this.merchantNo = arr[2]; @@ -219,6 +220,7 @@ export default { }; homeApi.getGoods(params).then(res => { this.showLoading = false; + this.state = 0; if (res.code == 0) { this.bannerImgList = res.response.bannerImgList; this.activityImgList = @@ -278,9 +280,35 @@ export default { // this.getGoodsList(); // }); // }, + popup() { + let str = localStorage.getItem("cityName") || ""; + if ( + !str && + (this.state == -1 || this.state == 2 || this.state == 1) + ) { + this.defaultCity = "天河区"; + //商户编号 + this.merchantNo = 2; + //区id + this.districtId = "440106000"; + this.addressValue = [ + "440000000&广东省", + "440100000&广州市", + "440106000&天河区&2" + ]; + this.getGoodsList(); + this.state = 0; + } else if (this.state == 2 || this.state == 1) { + this.getGoodsList(); + } + // this.show = false; + }, setShow() { let str = localStorage.getItem("cityName") || ""; - if (!str && this.state == -1) { + if ( + !str && + (this.state == -1 || this.state == 2 || this.state == 1) + ) { this.defaultCity = "天河区"; //商户编号 this.merchantNo = 2; @@ -293,6 +321,8 @@ export default { ]; this.getGoodsList(); this.state = 0; + } else if (this.state == 2 || this.state == 1) { + this.getGoodsList(); } this.show = false; }, @@ -344,6 +374,7 @@ export default { cancelText: "切换地址", onCancel: () => { this.show = true; + this.state == 2; }, onConfirm: () => { this.provinceId = data.userAddress @@ -423,6 +454,7 @@ export default { return get(); }, alertHide() { + this.state = 1; this.show = true; } },