|
|
@ -1,7 +1,7 @@ |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div class="home"> |
|
|
<div class="home"> |
|
|
<input type="hidden" id="openedDistrict" th:value="${openedDistrict}"/> |
|
|
|
|
|
|
|
|
<!--<input type="hidden" id="openedDistrict" th:value="${openedDistrict}"/>--> |
|
|
<input type="hidden" id="merchantNo" th:value="${merchantNo}"/> <!--商户标号--> |
|
|
<input type="hidden" id="merchantNo" th:value="${merchantNo}"/> <!--商户标号--> |
|
|
<input type="hidden" id="districtId" th:value="${districtId}"/> <!--选定区县id--> |
|
|
<input type="hidden" id="districtId" th:value="${districtId}"/> <!--选定区县id--> |
|
|
<div class="page-top"> |
|
|
<div class="page-top"> |
|
|
@ -20,8 +20,8 @@ |
|
|
<div class="swiper-pagination"></div> |
|
|
<div class="swiper-pagination"></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="coupon"> |
|
|
|
|
|
<a v-if="promotionImgList" :href="promotionImgList.linkUrl"><img :src="promotionImgList.imgUrl"/></a> |
|
|
|
|
|
|
|
|
<div class="coupon" > |
|
|
|
|
|
<a v-if="promotionImgList != {}" :href="promotionImgList.linkUrl || ''"><img :src="promotionImgList.imgUrl"/></a> |
|
|
</div> |
|
|
</div> |
|
|
<div class="new-card" v-for="item in goodsList"> |
|
|
<div class="new-card" v-for="item in goodsList"> |
|
|
<div class="new-card-top"> |
|
|
<div class="new-card-top"> |
|
|
@ -88,25 +88,31 @@ |
|
|
methods: { |
|
|
methods: { |
|
|
getName (){ |
|
|
getName (){ |
|
|
let arr = this.addressValue[2].split('&') |
|
|
let arr = this.addressValue[2].split('&') |
|
|
$("#districtId").val(arr[0]) |
|
|
|
|
|
|
|
|
console.log(arr) |
|
|
|
|
|
$("#districtId").val(arr[0]) |
|
|
|
|
|
$("#merchantNo").val(arr[2]) |
|
|
this.getGoodsList() |
|
|
this.getGoodsList() |
|
|
this.defaultCity = arr[1] |
|
|
this.defaultCity = arr[1] |
|
|
this.show = false |
|
|
this.show = false |
|
|
localStorage.setItem('cityName',this.addressValue) |
|
|
localStorage.setItem('cityName',this.addressValue) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
change (name) { |
|
|
change (name) { |
|
|
this.addressValue = name |
|
|
this.addressValue = name |
|
|
}, |
|
|
}, |
|
|
getGoodsList (){ |
|
|
getGoodsList (){ |
|
|
|
|
|
|
|
|
var params = { |
|
|
var params = { |
|
|
"merchantNo": $("#merchantNo").val(), |
|
|
"merchantNo": $("#merchantNo").val(), |
|
|
"selectedDistrictId": $("#districtId").val() |
|
|
"selectedDistrictId": $("#districtId").val() |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(params) |
|
|
homeApi.getGoods(params).then(res => { |
|
|
homeApi.getGoods(params).then(res => { |
|
|
console.log(res) |
|
|
|
|
|
|
|
|
//console.log(res) |
|
|
if ( res.code == 0 ){ |
|
|
if ( res.code == 0 ){ |
|
|
this.bannerImgList = res.response.bannerImgList |
|
|
this.bannerImgList = res.response.bannerImgList |
|
|
this.promotionImgList = res.response.promotionImgList[0]; |
|
|
|
|
|
|
|
|
this.promotionImgList = res.response.promotionImgList[0] || {}; |
|
|
|
|
|
// console.log('11',this.promotionImgList) |
|
|
let goodsList = res.response.goodsList |
|
|
let goodsList = res.response.goodsList |
|
|
let arr = []; |
|
|
let arr = []; |
|
|
for(let i=0;i<goodsList.length;i++){ |
|
|
for(let i=0;i<goodsList.length;i++){ |
|
|
@ -154,7 +160,7 @@ |
|
|
getdefaultAddress (){ |
|
|
getdefaultAddress (){ |
|
|
console.log(123) |
|
|
console.log(123) |
|
|
homeApi.getdefaultAddress().then(res => { |
|
|
homeApi.getdefaultAddress().then(res => { |
|
|
console.log('默认地址信息',res) |
|
|
|
|
|
|
|
|
//console.log('默认地址信息',res) |
|
|
if ( res.code == 0 ){ |
|
|
if ( res.code == 0 ){ |
|
|
if ( !res.data ){ |
|
|
if ( !res.data ){ |
|
|
this.show = true |
|
|
this.show = true |
|
|
|