Authored by ccbikai

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -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);
}
});
});
}
};
... ...
... ... @@ -4,7 +4,7 @@
<template slot="right">
<a class="right-button no-intercept" href="javascript:void(0);" @click="like()">
<span class="icon icon-like" :class=""></span>
{{likeCount}}
{{likeCount ? likeCount : ''}}
</a>
<!--暂时隐藏收藏入口,下个版本使用-->
<!--<a class="right-button no-intercept" href="javascript:void(0);" @click="favorite()">-->
... ...