Merge branch 'feature/student' into 'release/5.4'
新版学生营销页面 See merge request !190
Showing
5 changed files
with
63 additions
and
0 deletions
@@ -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 | +}; |
apps/activity/models/student-market.js
0 → 100644
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); |
-
Please register or login to post a comment