Browse Source

修改了存储流程

feature/feature-compatible
wangkesi 7 years ago
parent
commit
097d30d9f4
1 changed files with 11 additions and 5 deletions
  1. 16
      src/view/home.vue

16
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: () => {

Loading…
Cancel
Save