Browse Source

修改了storage的过程

feature/feature-compatible
wangkesi 7 years ago
parent
commit
8843e6724f
1 changed files with 30 additions and 34 deletions
  1. 64
      src/view/home.vue

64
src/view/home.vue

@ -330,46 +330,42 @@ export default {
this.addressData = res.data.allAddress;
this.flag = true;
let data = res.data;
// this.provinceId = data.userAddress.provinceId;
this.cityId = data.userAddress.cityId
? data.userAddress.cityId
: this.cityId;
this.districtId = data.userAddress.districtId
? data.userAddress.districtId
: this.districtId;
this.defaultCity = data.userAddress.districtName
? data.userAddress.districtName
: this.defaultCity;
this.merchantNo = data.userAddress.merchantNo;
if (
data.userAddress.type != 1 &&
data.userAddress.type != -1
) {
// this.addressValue = [
// this.provinceId +
// "&" +
// data.userAddress.provinceName,
// this.cityId +
// "&" +
// data.userAddress.cityName,
// this.districtId +
// "&" +
// data.userAddress.districtName +
// "&" +
// data.userAddress.merchantNo
// ];
// localStorage.setItem(
// "cityName",
// this.addressValue.slice()
// );
}
// console.log(data.userAddress)
if (data.userAddress.type == 1) {
this.address =
data.userAddress.cityName +
data.userAddress.districtName;
this.alertShow = true;
} else if (data.userAddress.type == 2) {
this.provinceId = data.userAddress.provinceId
? data.userAddress.provinceId
: this.provinceId;
this.cityId = data.userAddress.cityId
? data.userAddress.cityId
: this.cityId;
this.districtId = data.userAddress.districtId
? data.userAddress.districtId
: this.districtId;
this.defaultCity = data.userAddress.districtName
? data.userAddress.districtName
: this.defaultCity;
this.merchantNo = data.userAddress.merchantNo;
this.addressValue = [
this.provinceId +
"&" +
data.userAddress.provinceName,
this.cityId +
"&" +
data.userAddress.cityName,
this.districtId +
"&" +
data.userAddress.districtName +
"&" +
data.userAddress.merchantNo
];
localStorage.setItem(
"cityName",
this.addressValue.slice()
);
this.$vux.confirm.show({
title: "自动定位地址:",
content:

Loading…
Cancel
Save