Authored by 周少峰

edu list

... ... @@ -25,7 +25,7 @@ exports.index = (req, res, next) => {
let responseData = studentsModel.getTestData(channel);
// let responseData = {};
console.info(responseData);
// console.info(responseData);
Object.assign(responseData, result);
res.render('students/index', responseData);
... ... @@ -58,3 +58,15 @@ exports.schoolList = (req, res, next) => {
res.json(result);
}).catch(next);
};
/**
* 学历层次
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.eduLevel = (req, res, next) => {
studentsModel.getEduLevel().then(result => {
res.json(result);
}).catch(next);
};
... ...
... ... @@ -20,7 +20,7 @@ exports.getVerifiedTotal = () => {
* 获取学历层次列表
* @return
*/
exports.getLevelList = () => {
exports.getEduLevelList = () => {
return api.get('', {method: 'app.studentMarket.getEducationLevelList'});
};
... ...
... ... @@ -8,6 +8,7 @@
// const helpers = global.yoho.helpers;
const _ = require('lodash');
/**
* 优惠券
* @params data array
... ... @@ -39,6 +40,9 @@ exports.studentResource = (data) => {
case 'getCoupon':
Object.assign(dest, getCoupon(value.data));
break;
case 'recommend_content_five':
Object.assign(dest, {rightsItem: getCoupon(value.data.list)});
break;
default:
break;
... ...
... ... @@ -21,7 +21,8 @@ const headerModel = require('../../../doraemon/models/header');
const serviceApi = global.yoho.ServiceAPI;
// 学生营销资源码
const studentsCode = '989396a17443bf61e3e269702e51ef04'; // h5 a83b7d55324fb65f96c1f85a3387ebd8
// const studentsCode = '989396a17443bf61e3e269702e51ef04'; // h5 a83b7d55324fb65f96c1f85a3387ebd8
const studentsCode = 'a83b7d55324fb65f96c1f85a3387ebd8'; // h5 a83b7d55324fb65f96c1f85a3387ebd8
/**
* 获取学生营销页面数据
... ... @@ -39,12 +40,19 @@ exports.getStudentsData = (channel) => {
// 头部数据
headerData: result[0],
realData: {
sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}]
},
footerTop: true
};
// 资源位数据
if (result[1].code === 200) {
Object.assign(responseData, stuHandler.studentResource(result[1].data));
Object.assign(responseData.realData, stuHandler.studentResource(result[1].data));
}
return responseData;
});
... ... @@ -183,3 +191,14 @@ exports.getSchoolList = (areaCode) => {
return result;
});
};
/**
* 学历层次
* @params areaCode int 地区码
* @return Object 接口数据
*/
exports.getEduLevel = () => {
return studentsApi.getEduLevelList().then(result => {
return result;
});
};
... ...
... ... @@ -57,5 +57,6 @@ router.post('/item/togglecollect', favorite.collectProduct); // 收藏商品
router.get('/students', students.index); // students 首页
router.get('/students/schoolArea', students.schoolArea); // 学校地区
router.get('/students/schoolList', students.schoolList); // 学校地区
router.get('/students/eduLevel', students.eduLevel); // 学校地区
module.exports = router;
... ...