...
|
...
|
@@ -6,10 +6,6 @@ |
|
|
|
|
|
'use strict';
|
|
|
|
|
|
// const utils = '../../../utils';
|
|
|
|
|
|
// const logger = global.yoho.logger;
|
|
|
// const camelCase = global.yoho.camelCase;
|
|
|
const api = global.yoho.API;
|
|
|
const queryString = require('querystring');
|
|
|
const _ = require('lodash');
|
...
|
...
|
@@ -70,8 +66,12 @@ exports.getStudentsData = (channel, req) => { |
|
|
module: 'product',
|
|
|
page: 'students',
|
|
|
realData: {
|
|
|
sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
|
|
|
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}],
|
|
|
sortItem: [
|
|
|
{title: '学生权益介绍', href: 'stu-rights'},
|
|
|
{title: '我要验证身份', href: 'stu-identity'},
|
|
|
{title: '学生热门单品', href: 'stu-good'},
|
|
|
{title: '更多活动推荐', href: 'stu-activity'}
|
|
|
],
|
|
|
identityItem: {
|
|
|
stuNum: []
|
|
|
}
|
...
|
...
|
@@ -105,7 +105,7 @@ exports.getStudentsData = (channel, req) => { |
|
|
}
|
|
|
|
|
|
if (result[4]) {
|
|
|
Object.assign(responseData.realData, {verifyRusult: stuHandler.stuVerify(result[4], params)});
|
|
|
Object.assign(responseData.realData.identityObj, {verifyRusult: stuHandler.stuVerify(result[4], params)});
|
|
|
}
|
|
|
|
|
|
return responseData;
|
...
|
...
|
@@ -116,33 +116,21 @@ exports.getStudentsData = (channel, req) => { |
|
|
* 获取学校地区数据
|
|
|
* @return Object 接口数据
|
|
|
*/
|
|
|
exports.getSchoolArea = () => {
|
|
|
return studentsApi.getArea().then(result => {
|
|
|
return result;
|
|
|
});
|
|
|
};
|
|
|
exports.getSchoolArea = studentsApi.getArea;
|
|
|
|
|
|
/**
|
|
|
* 根据地区码查询学校列表
|
|
|
* @params areaCode int 地区码
|
|
|
* @return Object 接口数据
|
|
|
*/
|
|
|
exports.getSchoolList = (areaCode) => {
|
|
|
return studentsApi.getSchool(areaCode).then(result => {
|
|
|
return result;
|
|
|
});
|
|
|
};
|
|
|
exports.getSchoolList = studentsApi.getSchool;
|
|
|
|
|
|
/**
|
|
|
* 学历层次
|
|
|
* @params areaCode int 地区码
|
|
|
* @return Object 接口数据
|
|
|
*/
|
|
|
exports.getEduLevel = () => {
|
|
|
return studentsApi.getEduLevelList().then(result => {
|
|
|
return result;
|
|
|
});
|
|
|
};
|
|
|
exports.getEduLevel = studentsApi.getEduLevelList;
|
|
|
|
|
|
/**
|
|
|
* 身份验证
|
...
|
...
|
@@ -160,9 +148,7 @@ exports.verifyIdentity = (uid, params) => { |
|
|
enrollmentYear: params.enrollmentYear
|
|
|
}) + '&';
|
|
|
|
|
|
return studentsApi.verifyIdentity(uid, params.certNo, params.name, pageUrl).then(result => {
|
|
|
return result;
|
|
|
});
|
|
|
return studentsApi.verifyIdentity(uid, params.certNo, params.name, pageUrl);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -171,10 +157,7 @@ exports.verifyIdentity = (uid, params) => { |
|
|
* @return Object 接口数据
|
|
|
*/
|
|
|
exports.verifyStudents = (params) => {
|
|
|
return studentsApi.verifyStudent(params.uid, params.collegeName, params.educationDegree, params.enrollmentYear).
|
|
|
then(result => {
|
|
|
return result;
|
|
|
});
|
|
|
return studentsApi.verifyStudent(params.uid, params.collegeName, params.educationDegree, params.enrollmentYear);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -183,24 +166,12 @@ exports.verifyStudents = (params) => { |
|
|
* @return
|
|
|
*/
|
|
|
exports.userAcquireStatus = (uid, couponIds) => {
|
|
|
let ids = '';
|
|
|
let ids = couponIds.map(coupon => crypto.decrypt(null, coupon)).join(',');
|
|
|
|
|
|
for (let i = 0; i < couponIds.length; i++) {
|
|
|
if (i === couponIds.length - 1) {
|
|
|
ids += crypto.decrypt('yoho9646abcdefgh', couponIds[i]);
|
|
|
} else {
|
|
|
ids += crypto.decrypt('yoho9646abcdefgh', couponIds[i]) + ',';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return studentsApi.userAcquireStatus(uid, ids).
|
|
|
then(result => {
|
|
|
return studentsApi.userAcquireStatus(uid, ids).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
_.forEach(result.data, (value) => {
|
|
|
let couponId = value.couponId.toString(),
|
|
|
cryptoId = crypto.encryption('yoho9646abcdefgh', couponId);
|
|
|
|
|
|
value.couponId = cryptoId;
|
|
|
value.couponId = crypto.encryption(null, value.couponId + '');
|
|
|
});
|
|
|
}
|
|
|
return result;
|
...
|
...
|
|