Authored by 沈志敏

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

... ... @@ -186,7 +186,7 @@ gulp.task('postcss', ['assets'], () => {
// webpack dev server
gulp.task('webpack-dev-server', () => {
const isMac = process.platform === 'darwin';
const useDashboard = process.platform === 'darwin' || process.platform === 'linux';
const devConfig = Object.assign({}, webpackConfig, {
devtool: '#inline-source-map',
vue: {
... ... @@ -204,7 +204,7 @@ gulp.task('webpack-dev-server', () => {
});
// webpackDashboardPlugin
if (isMac) {
if (useDashboard) {
const dashboard = new Dashboard();
devConfig.plugins.push(new DashboardPlugin(dashboard.setData));
... ... @@ -216,7 +216,7 @@ gulp.task('webpack-dev-server', () => {
contentBase: '.',
publicPath: '//localhost:5004/',
inline: true,
quiet: isMac,
quiet: useDashboard,
stats: {
colors: true
},
... ...
... ... @@ -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);
}
});
});
}
};
... ...