|
@@ -6,10 +6,6 @@ |
|
@@ -6,10 +6,6 @@ |
6
|
|
6
|
|
7
|
'use strict';
|
7
|
'use strict';
|
8
|
|
8
|
|
9
|
-// const utils = '../../../utils';
|
|
|
10
|
-
|
|
|
11
|
-// const logger = global.yoho.logger;
|
|
|
12
|
-// const camelCase = global.yoho.camelCase;
|
|
|
13
|
const api = global.yoho.API;
|
9
|
const api = global.yoho.API;
|
14
|
const queryString = require('querystring');
|
10
|
const queryString = require('querystring');
|
15
|
const _ = require('lodash');
|
11
|
const _ = require('lodash');
|
|
@@ -70,8 +66,12 @@ exports.getStudentsData = (channel, req) => { |
|
@@ -70,8 +66,12 @@ exports.getStudentsData = (channel, req) => { |
70
|
module: 'product',
|
66
|
module: 'product',
|
71
|
page: 'students',
|
67
|
page: 'students',
|
72
|
realData: {
|
68
|
realData: {
|
73
|
- sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
|
|
|
74
|
- {title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}],
|
69
|
+ sortItem: [
|
|
|
70
|
+ {title: '学生权益介绍', href: 'stu-rights'},
|
|
|
71
|
+ {title: '我要验证身份', href: 'stu-identity'},
|
|
|
72
|
+ {title: '学生热门单品', href: 'stu-good'},
|
|
|
73
|
+ {title: '更多活动推荐', href: 'stu-activity'}
|
|
|
74
|
+ ],
|
75
|
identityItem: {
|
75
|
identityItem: {
|
76
|
stuNum: []
|
76
|
stuNum: []
|
77
|
}
|
77
|
}
|
|
@@ -105,7 +105,7 @@ exports.getStudentsData = (channel, req) => { |
|
@@ -105,7 +105,7 @@ exports.getStudentsData = (channel, req) => { |
105
|
}
|
105
|
}
|
106
|
|
106
|
|
107
|
if (result[4]) {
|
107
|
if (result[4]) {
|
108
|
- Object.assign(responseData.realData, {verifyRusult: stuHandler.stuVerify(result[4], params)});
|
108
|
+ Object.assign(responseData.realData.identityObj, {verifyRusult: stuHandler.stuVerify(result[4], params)});
|
109
|
}
|
109
|
}
|
110
|
|
110
|
|
111
|
return responseData;
|
111
|
return responseData;
|
|
@@ -116,33 +116,21 @@ exports.getStudentsData = (channel, req) => { |
|
@@ -116,33 +116,21 @@ exports.getStudentsData = (channel, req) => { |
116
|
* 获取学校地区数据
|
116
|
* 获取学校地区数据
|
117
|
* @return Object 接口数据
|
117
|
* @return Object 接口数据
|
118
|
*/
|
118
|
*/
|
119
|
-exports.getSchoolArea = () => {
|
|
|
120
|
- return studentsApi.getArea().then(result => {
|
|
|
121
|
- return result;
|
|
|
122
|
- });
|
|
|
123
|
-};
|
119
|
+exports.getSchoolArea = studentsApi.getArea;
|
124
|
|
120
|
|
125
|
/**
|
121
|
/**
|
126
|
* 根据地区码查询学校列表
|
122
|
* 根据地区码查询学校列表
|
127
|
* @params areaCode int 地区码
|
123
|
* @params areaCode int 地区码
|
128
|
* @return Object 接口数据
|
124
|
* @return Object 接口数据
|
129
|
*/
|
125
|
*/
|
130
|
-exports.getSchoolList = (areaCode) => {
|
|
|
131
|
- return studentsApi.getSchool(areaCode).then(result => {
|
|
|
132
|
- return result;
|
|
|
133
|
- });
|
|
|
134
|
-};
|
126
|
+exports.getSchoolList = studentsApi.getSchool;
|
135
|
|
127
|
|
136
|
/**
|
128
|
/**
|
137
|
* 学历层次
|
129
|
* 学历层次
|
138
|
* @params areaCode int 地区码
|
130
|
* @params areaCode int 地区码
|
139
|
* @return Object 接口数据
|
131
|
* @return Object 接口数据
|
140
|
*/
|
132
|
*/
|
141
|
-exports.getEduLevel = () => {
|
|
|
142
|
- return studentsApi.getEduLevelList().then(result => {
|
|
|
143
|
- return result;
|
|
|
144
|
- });
|
|
|
145
|
-};
|
133
|
+exports.getEduLevel = studentsApi.getEduLevelList;
|
146
|
|
134
|
|
147
|
/**
|
135
|
/**
|
148
|
* 身份验证
|
136
|
* 身份验证
|
|
@@ -160,9 +148,7 @@ exports.verifyIdentity = (uid, params) => { |
|
@@ -160,9 +148,7 @@ exports.verifyIdentity = (uid, params) => { |
160
|
enrollmentYear: params.enrollmentYear
|
148
|
enrollmentYear: params.enrollmentYear
|
161
|
}) + '&';
|
149
|
}) + '&';
|
162
|
|
150
|
|
163
|
- return studentsApi.verifyIdentity(uid, params.certNo, params.name, pageUrl).then(result => {
|
|
|
164
|
- return result;
|
|
|
165
|
- });
|
151
|
+ return studentsApi.verifyIdentity(uid, params.certNo, params.name, pageUrl);
|
166
|
};
|
152
|
};
|
167
|
|
153
|
|
168
|
/**
|
154
|
/**
|
|
@@ -171,10 +157,7 @@ exports.verifyIdentity = (uid, params) => { |
|
@@ -171,10 +157,7 @@ exports.verifyIdentity = (uid, params) => { |
171
|
* @return Object 接口数据
|
157
|
* @return Object 接口数据
|
172
|
*/
|
158
|
*/
|
173
|
exports.verifyStudents = (params) => {
|
159
|
exports.verifyStudents = (params) => {
|
174
|
- return studentsApi.verifyStudent(params.uid, params.collegeName, params.educationDegree, params.enrollmentYear).
|
|
|
175
|
- then(result => {
|
|
|
176
|
- return result;
|
|
|
177
|
- });
|
160
|
+ return studentsApi.verifyStudent(params.uid, params.collegeName, params.educationDegree, params.enrollmentYear);
|
178
|
};
|
161
|
};
|
179
|
|
162
|
|
180
|
/**
|
163
|
/**
|
|
@@ -183,24 +166,12 @@ exports.verifyStudents = (params) => { |
|
@@ -183,24 +166,12 @@ exports.verifyStudents = (params) => { |
183
|
* @return
|
166
|
* @return
|
184
|
*/
|
167
|
*/
|
185
|
exports.userAcquireStatus = (uid, couponIds) => {
|
168
|
exports.userAcquireStatus = (uid, couponIds) => {
|
186
|
- let ids = '';
|
169
|
+ let ids = couponIds.map(coupon => crypto.decrypt(null, coupon)).join(',');
|
187
|
|
170
|
|
188
|
- for (let i = 0; i < couponIds.length; i++) {
|
|
|
189
|
- if (i === couponIds.length - 1) {
|
|
|
190
|
- ids += crypto.decrypt('yoho9646abcdefgh', couponIds[i]);
|
|
|
191
|
- } else {
|
|
|
192
|
- ids += crypto.decrypt('yoho9646abcdefgh', couponIds[i]) + ',';
|
|
|
193
|
- }
|
|
|
194
|
- }
|
|
|
195
|
-
|
|
|
196
|
- return studentsApi.userAcquireStatus(uid, ids).
|
|
|
197
|
- then(result => {
|
171
|
+ return studentsApi.userAcquireStatus(uid, ids).then(result => {
|
198
|
if (result.code === 200) {
|
172
|
if (result.code === 200) {
|
199
|
_.forEach(result.data, (value) => {
|
173
|
_.forEach(result.data, (value) => {
|
200
|
- let couponId = value.couponId.toString(),
|
|
|
201
|
- cryptoId = crypto.encryption('yoho9646abcdefgh', couponId);
|
|
|
202
|
-
|
|
|
203
|
- value.couponId = cryptoId;
|
174
|
+ value.couponId = crypto.encryption(null, value.couponId + '');
|
204
|
});
|
175
|
});
|
205
|
}
|
176
|
}
|
206
|
return result;
|
177
|
return result;
|