Authored by zhangxiaoru

首屏为24

@@ -228,12 +228,6 @@ const search = (req, res, next) => { @@ -228,12 +228,6 @@ const search = (req, res, next) => {
228 228
229 searchModel.getSearchData(params).then((result) => { 229 searchModel.getSearchData(params).then((result) => {
230 230
231 - if (result && result.list &&  
232 - parseInt(params.page, 10) === 1 && parseInt(params.start, 10) > 0) {  
233 - // 首屏渲染时,使用 'start' 参数裁减已渲染数据  
234 - result.list = result.list.slice(params.start || 0);  
235 - }  
236 -  
237 if (result.list && result.list.length > 0) { 231 if (result.list && result.list.length > 0) {
238 res.render('search/page', { 232 res.render('search/page', {
239 layout: false, 233 layout: false,
@@ -138,7 +138,7 @@ const _searchGoods = (params) => { @@ -138,7 +138,7 @@ const _searchGoods = (params) => {
138 } 138 }
139 139
140 params = _.assign({ 140 params = _.assign({
141 - limit: '60', 141 + limit: '24',
142 status: 1, 142 status: 1,
143 sales: 'Y', 143 sales: 'Y',
144 stocknumber: 1, 144 stocknumber: 1,
@@ -47,6 +47,7 @@ require('common'); @@ -47,6 +47,7 @@ require('common');
47 47
48 // 首屏加载标志 48 // 首屏加载标志
49 let firstScreen = $('.firstscreen-goods').children().size() > 0; 49 let firstScreen = $('.firstscreen-goods').children().size() > 0;
  50 +
50 let isRecYas = window.queryString.needSuggestion === 'Y' || $('.word-content').length ? 'Y' : 'N'; // 是否是关键词 51 let isRecYas = window.queryString.needSuggestion === 'Y' || $('.word-content').length ? 'Y' : 'N'; // 是否是关键词
51 52
52 let $listNav = $('#list-nav'), 53 let $listNav = $('#list-nav'),
@@ -425,6 +426,10 @@ function search(opt) { @@ -425,6 +426,10 @@ function search(opt) {
425 return; 426 return;
426 } 427 }
427 428
  429 + if (page === 1 && navType === 'default' && firstScreen) {
  430 + page = 2;
  431 + }
  432 +
428 params = { 433 params = {
429 type: navType, 434 type: navType,
430 order: nav.order, 435 order: nav.order,
@@ -524,11 +529,6 @@ function search(opt) { @@ -524,11 +529,6 @@ function search(opt) {
524 params.students = students; 529 params.students = students;
525 } 530 }
526 531
527 - if (firstScreen) {  
528 - // 如果首屏加载了,则去掉12条记录  
529 - params.start = 12;  
530 - }  
531 -  
532 if (couponId) { 532 if (couponId) {
533 params.coupon_id = couponId; 533 params.coupon_id = couponId;
534 } 534 }