...
|
...
|
@@ -26,7 +26,7 @@ |
|
|
<h2 class="editorial-relate-title">相关品牌</h2>
|
|
|
<ul>
|
|
|
<li v-for="item in brands">
|
|
|
<a :href="item.brandDomain | brandUrl"><img :src="item.thumb"></a>
|
|
|
<a :href="item.url | brandUrl"><img :src="item.thumb"></a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
...
|
...
|
@@ -204,7 +204,6 @@ |
|
|
const editorialId = $('#app').data('editorialId');
|
|
|
|
|
|
this.id = editorialId;
|
|
|
let loadDeferred = null;
|
|
|
|
|
|
$.get(`/editorial/editorial_${editorialId}.json`).then(result => {
|
|
|
const article = result[0],
|
...
|
...
|
@@ -212,7 +211,7 @@ |
|
|
brands = result[2],
|
|
|
other = result[3];
|
|
|
|
|
|
let goods, prodMap = {};
|
|
|
let goods = {};
|
|
|
|
|
|
if (article && article.code === 200 && article.data) {
|
|
|
this.article = article.data;
|
...
|
...
|
@@ -237,27 +236,19 @@ |
|
|
}
|
|
|
|
|
|
// 延时读取商品价格、名称等信息
|
|
|
loadDeferred = () => {
|
|
|
if (!goods || !goods.length) {
|
|
|
return;
|
|
|
}
|
|
|
$.get('/product/search_product.json', {
|
|
|
ids: goods.map((item)=> {
|
|
|
return item.id;
|
|
|
}).join(',')
|
|
|
}).then((data)=> {
|
|
|
if (data.data) {
|
|
|
this.$set('recommendProducts', data.data.productList);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
});
|
|
|
|
|
|
$(window).on('scroll', ()=> {
|
|
|
if ($(window).scrollTop() > 100 && loadDeferred) {
|
|
|
loadDeferred();
|
|
|
loadDeferred = null;
|
|
|
if (!goods || !goods.length) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$.get('/product/search_product.json', {
|
|
|
ids: goods.map((item)=> {
|
|
|
return item.id;
|
|
|
}).join(',')
|
|
|
}).then((data) => {
|
|
|
if (data.data) {
|
|
|
this.$set('recommendProducts', data.data.productList);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
};
|
...
|
...
|
|