Authored by zhangxiaoru

首屏为24

... ... @@ -228,12 +228,6 @@ const search = (req, res, next) => {
searchModel.getSearchData(params).then((result) => {
if (result && result.list &&
parseInt(params.page, 10) === 1 && parseInt(params.start, 10) > 0) {
// 首屏渲染时,使用 'start' 参数裁减已渲染数据
result.list = result.list.slice(params.start || 0);
}
if (result.list && result.list.length > 0) {
res.render('search/page', {
layout: false,
... ...
... ... @@ -138,7 +138,7 @@ const _searchGoods = (params) => {
}
params = _.assign({
limit: '60',
limit: '24',
status: 1,
sales: 'Y',
stocknumber: 1,
... ...
... ... @@ -47,6 +47,7 @@ require('common');
// 首屏加载标志
let firstScreen = $('.firstscreen-goods').children().size() > 0;
let isRecYas = window.queryString.needSuggestion === 'Y' || $('.word-content').length ? 'Y' : 'N'; // 是否是关键词
let $listNav = $('#list-nav'),
... ... @@ -425,6 +426,10 @@ function search(opt) {
return;
}
if (page === 1 && navType === 'default' && firstScreen) {
page = 2;
}
params = {
type: navType,
order: nav.order,
... ... @@ -524,11 +529,6 @@ function search(opt) {
params.students = students;
}
if (firstScreen) {
// 如果首屏加载了,则去掉12条记录
params.start = 12;
}
if (couponId) {
params.coupon_id = couponId;
}
... ...