Authored by ccbikai

Merge branch 'feature/sale' into release/4.8

@@ -182,6 +182,14 @@ let search = (req, res, next) => { @@ -182,6 +182,14 @@ let search = (req, res, next) => {
182 let params = Object.assign({}, req.query); 182 let params = Object.assign({}, req.query);
183 let uid = req.user.uid || 0; 183 let uid = req.user.uid || 0;
184 184
  185 + // 断码区域必须传尺码
  186 + if (params.saleType === '1' && (!params.breakSort || !params.breakSize)) {
  187 + return res.render('sale/product', {
  188 + layout: false,
  189 + params: params
  190 + });
  191 + }
  192 +
185 saleModel.getSearchData(params, uid).then((result) => { 193 saleModel.getSearchData(params, uid).then((result) => {
186 let vipLevel = result[1].curLevel; 194 let vipLevel = result[1].curLevel;
187 let vipObj = {}; 195 let vipObj = {};
@@ -523,6 +523,7 @@ $(window).scroll(function() { @@ -523,6 +523,7 @@ $(window).scroll(function() {
523 $(function() { 523 $(function() {
524 var type = window.queryString.type; 524 var type = window.queryString.type;
525 var selector; 525 var selector;
  526 + var $selectNav;
526 527
527 // type 1: 上装, 3:下装, 6: 鞋装 528 // type 1: 上装, 3:下装, 6: 鞋装
528 if (type && type !== '1') { 529 if (type && type !== '1') {
@@ -530,13 +531,14 @@ $(function() { @@ -530,13 +531,14 @@ $(function() {
530 } else { 531 } else {
531 selector = '.coat'; 532 selector = '.coat';
532 } 533 }
533 - $('#list-nav').find(selector).addClass('active').siblings().removeClass('active'); 534 + $selectNav = $('#list-nav').find(selector);
  535 + $selectNav.addClass('active').siblings().removeClass('active');
534 search([{ 536 search([{
535 type: 'breakSort', 537 type: 'breakSort',
536 - id: $(selector).data('id') 538 + id: $selectNav.data('id')
537 }, { 539 }, {
538 type: 'breakSize', 540 type: 'breakSize',
539 - id: $(selector).data('allsub') 541 + id: $selectNav.data('allsub')
540 }]); 542 }]);
541 }); 543 });
542 544