students-api.js 1.8 KB
/**
 * 学生营销接口
 * @date: 2016-08-06 14:24:04
 * @author: name<emial@yoho.cn>
 */
'use strict';

const api = global.yoho.API;

/**
 * 获取完成认证学生总数
 * @return
 */
exports.getVerifiedTotal = () => {

    return api.get('', {method: 'app.student.verifiedStudentTotal'});
};

/**
 * 获取学历层次列表
 * @return
 */
exports.getEduLevelList = () => {

    return api.get('', {method: 'app.studentMarket.getEducationLevelList'});
};

/**
 * 获取学校地区
 * @return
 */
exports.getArea = () => {
    let finalParams = {
        method: 'app.studentMarket.getAddressList'
    };

    return api.get('', finalParams);
};

/**
 * 获取学校列表
 * @return
 */
exports.getSchool = (areaCode) => {
    let finalParams = {
        method: 'app.studentMarket.getSchoolInfoList',
        areaCode: areaCode
    };

    return api.get('', finalParams);
};

/**
 * 学生专项商品
 * @return
 */
exports.getStuProducts = (params) => {
    let finalParams = {
        method: 'app.student.discount',
        order: 's_t_desc',
        limit: 15
    };

    Object.assign(finalParams, params);
    return api.get('', finalParams);
};

/**
 * 身份验证
 * @return
 */
exports.verifyIdentity = (uid, certNo, name, pageUrl) => {
    let finalParams = {
        method: 'app.student.verifyIdentity',
        uid: uid,
        cert_no: certNo,
        name: name,
        page_url: pageUrl
    };

    return api.get('', finalParams);
};

/**
 * 学籍验证
 * @return
 */
exports.verifyStudent = (uid, collegeName, educationDegree, enrollmentYear) => {
    let finalParams = {
        method: 'method=app.student.verifyStudent',
        uid: uid,
        college_name: collegeName,
        education_degree: educationDegree,
        enrollment_year: enrollmentYear
    };

    return api.get('', finalParams);
};