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>
</div>
<popup v-model="show">
<popup v-model="show" @on-hide="popup">
<div class="picke-address">
<div class="status-btn">
<a class="cel-btn" @click="setShow">取消</a>
@ -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;
}
},

Loading…
Cancel
Save