Authored by 陈峰

Merge branch 'feature/student' into 'release/5.4'

新版学生营销页面



See merge request !190
... ... @@ -9,6 +9,7 @@ const co = Promise.coroutine;
const headerModel = require('../../../doraemon/models/header'); // 头部model
const _ = require('lodash');
const productProcess = require(`${utils}/product-process`);
const stdntMrktModel = require('../models/student-market');
const userAcquireStatus = (uid, couponIds) => {
if (couponIds != '') {
... ... @@ -185,3 +186,25 @@ exports.index = (req, res, next) => {
}).catch(next);
});
};
/**
* 新版学生营销页面
*/
exports.newIndex = (req, res, next) => {
stdntMrktModel.getStudentGoods({
limit: req.query.limit || '60',
stocknumber: req.query.stocknumber || '1'
}).then(result => {
let title = '有货学生专享优惠';
res.render('student-market-new', {
title: title,
pageHeader: headerModel.setNav({
navTitle: title,
navBtn: true
}),
page: 'student-market-new',
goods: result
});
}).catch(next);
};
... ...
/*
* @Author: Targaryen
* @Date: 2017-01-16 13:57:34
* @Last Modified by: Targaryen
* @Last Modified time: 2017-01-16 16:02:41
*/
// 新版学生营销页面
'use strict';
const utils = '../../../utils';
const productProcess = require(`${utils}/product-process`);
const api = global.yoho.API;
const _ = require('lodash');
const getStudentGoods = (params) => {
return api.get('', {
method: 'app.student.aggBrand',
limit: params.limit,
stocknumber: params.stocknumber,
}).then(result => {
return productProcess.processProductList(_.get(result, 'data.product_list', []));
});
};
module.exports = {
getStudentGoods
};
... ...
... ... @@ -72,6 +72,9 @@ router.get('/student/verify', student.isLogin, student.verifystudent);
router.get('/student/detail/:type', student.getUser, student.detail);
// 新版学生营销页面
router.get('/studentnew', studentMarket.newIndex);
// router.get('/student/getCoupons',student.getCoupons)
router.get('/live', live.index);
... ...
<div id="goods-container" class="goods-container">
<div class="default-goods container clearfix">
{{# goods}} {{> common/goods}} {{/ goods}}
</div>
</div>
\ No newline at end of file
... ...
var lazyLoad = require('yoho-jquery-lazyload');
require('../common');
lazyLoad($('img.lazy'));
... ...