|
|
|
@ -109,9 +109,7 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// swiper() { |
|
|
|
// return this.$refs.mySwiper.swiper |
|
|
|
// } |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getName (){ |
|
|
|
@ -124,6 +122,20 @@ |
|
|
|
localStorage.setItem('cityName',this.addressValue) |
|
|
|
|
|
|
|
}, |
|
|
|
getCityName (){ |
|
|
|
let name = localStorage.getItem("cityName")||'' |
|
|
|
console.log(name) |
|
|
|
if(!name){ |
|
|
|
this.merchantNo = 2 |
|
|
|
return |
|
|
|
} |
|
|
|
let arr = name.split(',') |
|
|
|
this.addressValue = arr |
|
|
|
let cityNameArr = arr[2].split('&') |
|
|
|
let cityName = cityNameArr[1] |
|
|
|
this.defaultCity = cityName |
|
|
|
this.merchantNo = cityNameArr[2] |
|
|
|
}, |
|
|
|
change (name) { |
|
|
|
this.addressValue = name |
|
|
|
}, |
|
|
|
@ -185,7 +197,7 @@ |
|
|
|
//获取默认地址信息 |
|
|
|
getdefaultAddress (){ |
|
|
|
homeApi.getdefaultAddress().then(res => { |
|
|
|
// console.log('默认地址信息',res) |
|
|
|
console.log('默认地址信息',res) |
|
|
|
if ( res.code == 0 ){ |
|
|
|
if ( !res.data ){ |
|
|
|
this.show = true |
|
|
|
@ -202,8 +214,8 @@ |
|
|
|
} else { |
|
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
|
} |
|
|
|
console.log(this.merchantNo) |
|
|
|
this.getGoodsList() |
|
|
|
this.getCityName () |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -211,21 +223,6 @@ |
|
|
|
//异步加载 |
|
|
|
this.getdefaultAddress() |
|
|
|
this.getAddress() |
|
|
|
|
|
|
|
// window.onscroll = function() { |
|
|
|
// |
|
|
|
// var top = $(window).scrollTop() |
|
|
|
// console.log(top); |
|
|
|
// if(top > 20){ |
|
|
|
// $('#top-nav').css({ |
|
|
|
// 'position': 'fixed' |
|
|
|
// }) |
|
|
|
// }else { |
|
|
|
// $('#top-nav').css({ |
|
|
|
// 'position': 'relative' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }; |
|
|
|
|
|
|
|
}, |
|
|
|
destroyed () { |
|
|
|
|