Commit 47a6aefa authored by zhanglw's avatar zhanglw

首页地区排名

parent 2b3f44fd
...@@ -215,21 +215,10 @@ export default { ...@@ -215,21 +215,10 @@ export default {
}).then((res) => { }).then((res) => {
this.topSuppliers = res.data.topSuppliers this.topSuppliers = res.data.topSuppliers
this.topProducts = res.data.topProducts this.topProducts = res.data.topProducts
})
HttpReq.webClientApi.homePageGetPartners({
preview: false
}).then((res) => {
this.partners = res.data.partners
})
HttpReq.webClientApi.homePageGetSupplier({
preview: false
}).then((res) => {
this.showcaseSuppliers = res.data.showcaseSuppliers
})
const random = (min, max) => { const random = (min, max) => {
return Math.floor(Math.random() * (max - min)) + min return Math.floor(Math.random() * (max - min)) + min
} }
const arr = ['北京', '上海', '广州', '深圳', '青岛', '南京', '杭州', '天津', '石家庄', '济南', '烟台', '威海', '大连', '连云港', '潍坊'] const arr = res.data.topArea[0].topArea
arr.forEach((item, index) => { arr.forEach((item, index) => {
this.topAreas.push({ this.topAreas.push({
name: item, name: item,
...@@ -241,6 +230,17 @@ export default { ...@@ -241,6 +230,17 @@ export default {
this.topAreas[0].top = '180px' this.topAreas[0].top = '180px'
this.topAreas[0].left = '120px' this.topAreas[0].left = '120px'
}) })
HttpReq.webClientApi.homePageGetPartners({
preview: false
}).then((res) => {
this.partners = res.data.partners
})
HttpReq.webClientApi.homePageGetSupplier({
preview: false
}).then((res) => {
this.showcaseSuppliers = res.data.showcaseSuppliers
})
})
}, },
methods: { methods: {
onDictReady(dict) { onDictReady(dict) {
......
...@@ -158,7 +158,11 @@ export default { ...@@ -158,7 +158,11 @@ export default {
}).then((res) => { }).then((res) => {
this.informationList = res.data.information.data this.informationList = res.data.information.data
this.total = res.data.information.total this.total = res.data.information.total
this.promotionObj = res.data.advertisement.data[0] || { imgSrc: '', url: '' } if (res.data.advertisement.data) {
this.promotionObj = res.data.advertisement.data[0]
} else {
this.promotionObj = { imgSrc: '', url: '' }
}
if (this.page === 1) { if (this.page === 1) {
this.topList = [] this.topList = []
if (this.informationList[0]) { if (this.informationList[0]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment