Showing
3 changed files
with
22 additions
and
5 deletions
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | 'use strict'; | 7 | 'use strict'; |
8 | 8 | ||
9 | const mRoot = '../models'; | 9 | const mRoot = '../models'; |
10 | +const helpers = global.yoho.helpers; | ||
10 | 11 | ||
11 | const studentsModel = require(`${mRoot}/students`); // students 页 model | 12 | const studentsModel = require(`${mRoot}/students`); // students 页 model |
12 | 13 | ||
@@ -77,6 +78,10 @@ exports.eduLevel = (req, res, next) => { | @@ -77,6 +78,10 @@ exports.eduLevel = (req, res, next) => { | ||
77 | * @return {[type]} [description] | 78 | * @return {[type]} [description] |
78 | */ | 79 | */ |
79 | exports.verify = (req, res, next) => { | 80 | exports.verify = (req, res, next) => { |
81 | + req.user.uid= 13311991; | ||
82 | + if (!req.user.uid) { | ||
83 | + res.send({code: 200, data: helpers.urlFormat('/signin.html')}); | ||
84 | + } | ||
80 | 85 | ||
81 | studentsModel.verifyIdentity(req.user.uid, req.query).then(result => { | 86 | studentsModel.verifyIdentity(req.user.uid, req.query).then(result => { |
82 | res.json(result); | 87 | res.json(result); |
@@ -32,6 +32,15 @@ const getCoupon = (data) => { | @@ -32,6 +32,15 @@ const getCoupon = (data) => { | ||
32 | 32 | ||
33 | 33 | ||
34 | /** | 34 | /** |
35 | + * 认证学生总数 | ||
36 | + * @params data array | ||
37 | + * @return Object | ||
38 | + */ | ||
39 | +exports.studentsNum = (data) => { | ||
40 | + | ||
41 | + return data; | ||
42 | +}; | ||
43 | +/** | ||
35 | * 处理学生营销资源位数据 | 44 | * 处理学生营销资源位数据 |
36 | * @params data array 资源位接口返回数据 | 45 | * @params data array 资源位接口返回数据 |
37 | * @return object | 46 | * @return object |
@@ -53,8 +53,11 @@ exports.getStudentsData = (channel) => { | @@ -53,8 +53,11 @@ exports.getStudentsData = (channel) => { | ||
53 | 53 | ||
54 | realData: { | 54 | realData: { |
55 | sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'}, | 55 | sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'}, |
56 | - {title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}] | ||
57 | - | 56 | + {title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}], |
57 | + identityItem: { | ||
58 | + sendCoin: 100, | ||
59 | + stuNum: [] | ||
60 | + } | ||
58 | }, | 61 | }, |
59 | 62 | ||
60 | footerTop: true | 63 | footerTop: true |
@@ -65,9 +68,9 @@ exports.getStudentsData = (channel) => { | @@ -65,9 +68,9 @@ exports.getStudentsData = (channel) => { | ||
65 | Object.assign(responseData.realData, stuHandler.studentResource(result[1].data)); | 68 | Object.assign(responseData.realData, stuHandler.studentResource(result[1].data)); |
66 | } | 69 | } |
67 | 70 | ||
68 | - // if (result[2].code === 200) { | ||
69 | - | ||
70 | - // } | 71 | + if (result[2].code === 200) { |
72 | + responseData.realData.identityItem.stuNum = stuHandler.studentsNum(result[2].data); | ||
73 | + } | ||
71 | 74 | ||
72 | if (result[3].code === 200) { | 75 | if (result[3].code === 200) { |
73 | Object.assign(responseData.realData, {proItem: stuHandler.stuProducts(result[3].data.product_list)}); | 76 | Object.assign(responseData.realData, {proItem: stuHandler.stuProducts(result[3].data.product_list)}); |
-
Please register or login to post a comment