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: "", cityId: "",
alertShow: false, alertShow: false,
address: "", address: "",
flag: false
flag: false,
state: 0
}; };
}, },
components: { components: {
@ -173,13 +174,13 @@ export default {
methods: { methods: {
// //
getName() { getName() {
console.log(1);
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];
this.getGoodsList(); // this.getGoodsList(); //
this.defaultCity = arr[1]; this.defaultCity = arr[1];
this.show = false; this.show = false;
console.log(this.addressValue);
localStorage.setItem("cityName", this.addressValue); localStorage.setItem("cityName", this.addressValue);
this.ShareWenXin(); this.ShareWenXin();
}, },
@ -206,7 +207,6 @@ export default {
// //
change(name) { change(name) {
if (this.flag) { if (this.flag) {
console.log(1);
this.addressValue = name; this.addressValue = name;
} }
}, },
@ -280,14 +280,19 @@ export default {
// }, // },
setShow() { setShow() {
let str = localStorage.getItem("cityName") || ""; let str = localStorage.getItem("cityName") || "";
if (!str) {
if (!str && this.state == -1) {
this.defaultCity = "天河区"; this.defaultCity = "天河区";
// //
this.merchantNo = 2; this.merchantNo = 2;
//id //id
this.districtId = "440106000"; this.districtId = "440106000";
this.addressValue = [];
this.addressValue = [
"440000000&广东省",
"440100000&广州市",
"440106000&天河区&2"
];
this.getGoodsList(); this.getGoodsList();
this.state = 0;
} }
this.show = false; this.show = false;
}, },
@ -381,6 +386,7 @@ export default {
} else if (data.userAddress.type == 0) { } else if (data.userAddress.type == 0) {
this.getGoodsList(); this.getGoodsList();
} else if (data.userAddress.type == -1) { } else if (data.userAddress.type == -1) {
this.state = -1;
this.$vux.alert.show({ this.$vux.alert.show({
title: "自动定位失败", title: "自动定位失败",
onHide: () => { onHide: () => {

Loading…
Cancel
Save