Browse Source

修改了判断流程

feature/feature-compatible
wangkesi 7 years ago
parent
commit
3be5e18cfa
1 changed files with 34 additions and 2 deletions
  1. 36
      src/view/home.vue

36
src/view/home.vue

@ -97,7 +97,7 @@
<routerFooter></routerFooter> <routerFooter></routerFooter>
</div> </div>
<popup v-model="show">
<popup v-model="show" @on-hide="popup">
<div class="picke-address"> <div class="picke-address">
<div class="status-btn"> <div class="status-btn">
<a class="cel-btn" @click="setShow">取消</a> <a class="cel-btn" @click="setShow">取消</a>
@ -174,6 +174,7 @@ export default {
methods: { methods: {
// //
getName() { getName() {
this.state = 0;
let arr = this.addressValue[2].split("&") || ""; let arr = this.addressValue[2].split("&") || "";
this.districtId = arr[0]; this.districtId = arr[0];
this.merchantNo = arr[2]; this.merchantNo = arr[2];
@ -219,6 +220,7 @@ export default {
}; };
homeApi.getGoods(params).then(res => { homeApi.getGoods(params).then(res => {
this.showLoading = false; this.showLoading = false;
this.state = 0;
if (res.code == 0) { if (res.code == 0) {
this.bannerImgList = res.response.bannerImgList; this.bannerImgList = res.response.bannerImgList;
this.activityImgList = this.activityImgList =
@ -278,9 +280,35 @@ export default {
// this.getGoodsList(); // 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() { setShow() {
let str = localStorage.getItem("cityName") || ""; let str = localStorage.getItem("cityName") || "";
if (!str && this.state == -1) {
if (
!str &&
(this.state == -1 || this.state == 2 || this.state == 1)
) {
this.defaultCity = "天河区"; this.defaultCity = "天河区";
// //
this.merchantNo = 2; this.merchantNo = 2;
@ -293,6 +321,8 @@ export default {
]; ];
this.getGoodsList(); this.getGoodsList();
this.state = 0; this.state = 0;
} else if (this.state == 2 || this.state == 1) {
this.getGoodsList();
} }
this.show = false; this.show = false;
}, },
@ -344,6 +374,7 @@ export default {
cancelText: "切换地址", cancelText: "切换地址",
onCancel: () => { onCancel: () => {
this.show = true; this.show = true;
this.state == 2;
}, },
onConfirm: () => { onConfirm: () => {
this.provinceId = data.userAddress this.provinceId = data.userAddress
@ -423,6 +454,7 @@ export default {
return get(); return get();
}, },
alertHide() { alertHide() {
this.state = 1;
this.show = true; this.show = true;
} }
}, },

Loading…
Cancel
Save