Authored by 陈峰

Merge branch 'release/5.4' into 'grey'

新品到着最新排序要求不传 order 参数



See merge request !189
@@ -9,6 +9,7 @@ const co = Promise.coroutine; @@ -9,6 +9,7 @@ const co = Promise.coroutine;
9 const headerModel = require('../../../doraemon/models/header'); // 头部model 9 const headerModel = require('../../../doraemon/models/header'); // 头部model
10 const _ = require('lodash'); 10 const _ = require('lodash');
11 const productProcess = require(`${utils}/product-process`); 11 const productProcess = require(`${utils}/product-process`);
  12 +const stdntMrktModel = require('../models/student-market');
12 13
13 const userAcquireStatus = (uid, couponIds) => { 14 const userAcquireStatus = (uid, couponIds) => {
14 if (couponIds != '') { 15 if (couponIds != '') {
@@ -185,3 +186,25 @@ exports.index = (req, res, next) => { @@ -185,3 +186,25 @@ exports.index = (req, res, next) => {
185 }).catch(next); 186 }).catch(next);
186 }); 187 });
187 }; 188 };
  189 +
  190 +/**
  191 + * 新版学生营销页面
  192 + */
  193 +exports.newIndex = (req, res, next) => {
  194 + stdntMrktModel.getStudentGoods({
  195 + limit: req.query.limit || '60',
  196 + stocknumber: req.query.stocknumber || '1'
  197 + }).then(result => {
  198 + let title = '有货学生专享优惠';
  199 +
  200 + res.render('student-market-new', {
  201 + title: title,
  202 + pageHeader: headerModel.setNav({
  203 + navTitle: title,
  204 + navBtn: true
  205 + }),
  206 + page: 'student-market-new',
  207 + goods: result
  208 + });
  209 + }).catch(next);
  210 +};
  1 +/*
  2 + * @Author: Targaryen
  3 + * @Date: 2017-01-16 13:57:34
  4 + * @Last Modified by: Targaryen
  5 + * @Last Modified time: 2017-01-16 16:02:41
  6 + */
  7 +// 新版学生营销页面
  8 +
  9 +'use strict';
  10 +
  11 +const utils = '../../../utils';
  12 +const productProcess = require(`${utils}/product-process`);
  13 +const api = global.yoho.API;
  14 +const _ = require('lodash');
  15 +
  16 +const getStudentGoods = (params) => {
  17 + return api.get('', {
  18 + method: 'app.student.aggBrand',
  19 + limit: params.limit,
  20 + stocknumber: params.stocknumber,
  21 + }).then(result => {
  22 + return productProcess.processProductList(_.get(result, 'data.product_list', []));
  23 + });
  24 +};
  25 +
  26 +module.exports = {
  27 + getStudentGoods
  28 +};
@@ -72,6 +72,9 @@ router.get('/student/verify', student.isLogin, student.verifystudent); @@ -72,6 +72,9 @@ router.get('/student/verify', student.isLogin, student.verifystudent);
72 72
73 router.get('/student/detail/:type', student.getUser, student.detail); 73 router.get('/student/detail/:type', student.getUser, student.detail);
74 74
  75 +// 新版学生营销页面
  76 +router.get('/studentnew', studentMarket.newIndex);
  77 +
75 // router.get('/student/getCoupons',student.getCoupons) 78 // router.get('/student/getCoupons',student.getCoupons)
76 79
77 router.get('/live', live.index); 80 router.get('/live', live.index);
  1 +<div id="goods-container" class="goods-container">
  2 + <div class="default-goods container clearfix">
  3 + {{# goods}} {{> common/goods}} {{/ goods}}
  4 + </div>
  5 +</div>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="filter-nav-wrap" data-sticky> 3 <div class="filter-nav-wrap" data-sticky>
4 {{> common/filter-nav 4 {{> common/filter-nav
5 firstOrderName='最新' 5 firstOrderName='最新'
6 - firstOrderValue='s_t_desc'}} 6 + firstOrderValue=''}}
7 <div id="js-filter"></div> 7 <div id="js-filter"></div>
8 </div> 8 </div>
9 9
  1 +var lazyLoad = require('yoho-jquery-lazyload');
  2 +
  3 +require('../common');
  4 +lazyLoad($('img.lazy'));
@@ -822,7 +822,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -822,7 +822,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
822 } 822 }
823 823
824 } 824 }
825 - 825 + return false; // 阻止加入购物车按钮冒泡
826 }); 826 });
827 827
828 $('.close').on('click', function() { 828 $('.close').on('click', function() {
@@ -61,6 +61,7 @@ plusstar = { @@ -61,6 +61,7 @@ plusstar = {
61 if (!window._yas || !window._yas.sendCustomInfo) { 61 if (!window._yas || !window._yas.sendCustomInfo) {
62 return; 62 return;
63 } 63 }
  64 +
64 // 点击潮流优选上方的TAB按钮时 65 // 点击潮流优选上方的TAB按钮时
65 window._yas.sendCustomInfo({ 66 window._yas.sendCustomInfo({
66 op: 'YB_FASHION_TAB_C', 67 op: 'YB_FASHION_TAB_C',
@@ -135,7 +136,7 @@ plusstar = { @@ -135,7 +136,7 @@ plusstar = {
135 F_NAME: '焦点图', 136 F_NAME: '焦点图',
136 F_URL: encodeURIComponent($dom.find('a').attr('href').replace(/\"/g, '\\"')), 137 F_URL: encodeURIComponent($dom.find('a').attr('href').replace(/\"/g, '\\"')),
137 F_INDEX: 1, 138 F_INDEX: 1,
138 - I_INDEX: index % 2 + 1// banner,li是双倍的 139 + I_INDEX: index
139 }) 140 })
140 }, true); 141 }, true);
141 } else if ($(event.target).closest('.speck-title-image a').length > 0) { 142 } else if ($(event.target).closest('.speck-title-image a').length > 0) {
@@ -211,6 +212,7 @@ plusstar = { @@ -211,6 +212,7 @@ plusstar = {
211 success: function(data) { 212 success: function(data) {
212 resourcesTp[tabId] = data; 213 resourcesTp[tabId] = data;
213 execResData(data); 214 execResData(data);
  215 +
214 // 页面中下拉曝光 216 // 页面中下拉曝光
215 setTimeout(function() { 217 setTimeout(function() {
216 if (window._yas && window._yas.sendAppLogs) { 218 if (window._yas && window._yas.sendAppLogs) {
@@ -252,12 +254,16 @@ plusstar = { @@ -252,12 +254,16 @@ plusstar = {
252 } 254 }
253 }, 255 },
254 resInit: function() { 256 resInit: function() {
  257 + var that = this,
  258 + productSkns = '',
  259 + tabId;
  260 +
255 // 头部banner轮播 261 // 头部banner轮播
256 if ($('.banner-swiper').find('li').size() > 1) { 262 if ($('.banner-swiper').find('li').size() > 1) {
257 new Swiper('.banner-swiper', { 263 new Swiper('.banner-swiper', {
258 lazyLoading: true, 264 lazyLoading: true,
259 lazyLoadingInPrevNext: true, 265 lazyLoadingInPrevNext: true,
260 - loop: true, 266 + loop: false,
261 autoplay: 3000, 267 autoplay: 3000,
262 autoplayDisableOnInteraction: false, 268 autoplayDisableOnInteraction: false,
263 paginationClickable: true, 269 paginationClickable: true,
@@ -267,16 +273,15 @@ plusstar = { @@ -267,16 +273,15 @@ plusstar = {
267 } 273 }
268 274
269 $('.plusstar-resources').find('img.lazy').lazyload(); 275 $('.plusstar-resources').find('img.lazy').lazyload();
270 - var productSkns = '';  
271 productSkns = $('.product-skns').val(); 276 productSkns = $('.product-skns').val();
  277 +
272 if (productSkns) { 278 if (productSkns) {
273 this.common.productSkns = productSkns.split(','); 279 this.common.productSkns = productSkns.split(',');
274 } 280 }
275 281
276 this.common.pageTotal = Math.ceil(this.common.productSkns.length / this.common.pagesize); 282 this.common.pageTotal = Math.ceil(this.common.productSkns.length / this.common.pagesize);
277 283
278 - var that = this;  
279 - var tabId = that.ParentLiDom.index() + 1; 284 + tabId = that.ParentLiDom.index() + 1;
280 setTimeout(function() { 285 setTimeout(function() {
281 $.ajax({ 286 $.ajax({
282 type: 'POST', 287 type: 'POST',
@@ -71,7 +71,7 @@ let searchView = function() { @@ -71,7 +71,7 @@ let searchView = function() {
71 * see: search-process.js 71 * see: search-process.js
72 */ 72 */
73 let searchParams = { 73 let searchParams = {
74 - order: 's_t_desc', 74 + // order: 's_t_desc',
75 filter: { 75 filter: {
76 }, 76 },
77 page: { 77 page: {
@@ -693,7 +693,7 @@ @@ -693,7 +693,7 @@
693 top: 46px; 693 top: 46px;
694 694
695 &.call-by-fix { 695 &.call-by-fix {
696 - top: 80px; 696 + top: 41PX;
697 position: fixed; 697 position: fixed;
698 left: 0; 698 left: 0;
699 } 699 }