Authored by hongweigao

认证后结果,埋点修改

... ... @@ -126,8 +126,7 @@ exports.stuVerify = (result, params) => {
if (result.code === 200) {
data.isError = false;
data = result.data;
data.isStudent = data.isStudent === 1 ? true : false;
data.isStudent = result.data.isStudent === 1 ? true : false;
} else {
data.isError = true;
data.errorMsg = result.message;
... ...
... ... @@ -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;
... ...
... ... @@ -632,6 +632,31 @@ $(function() {
ACTION_ID: 0,
REC_ID: recId
});
if ($('#identity-success').length > 0) {
// xls-4学生认证成功埋点
givePoint('YB_STUDENT_ATTCT_RESULT', {
SRC_ID: 5,
SUBMIT_RES: 1,
ATTCT_INFO: {
birthDay: $('.identity-back-wrap .result-birthDay').html(),
sex: $('.identity-back-wrap .result-sex').html(),
collegeName: $('.identity-back-wrap .result-collegeName').html(),
educationDegree: $('.identity-back-wrap .result-educationDegree').html(),
enrollmentYear: $('.identity-back-wrap .result-enrollmentYear').html()
}
});
}
if ($('#identity-fail').length > 0) {
// xls-4学生认证失败埋点
givePoint('YB_STUDENT_ATTCT_RESULT', {
SRC_ID: 5,
SUBMIT_RES: 2,
FAILURE_CAUSE: $('#identity-fail-text').html()
});
}
clearInterval(sto);
}
}, 100);
... ... @@ -698,31 +723,6 @@ $(function() {
});
}
if ($('#identity-success').length > 0) {
// xls-4学生认证成功埋点
givePoint('YB_STUDENT_ATTCT_RESULT', {
SRC_ID: 5,
SUBMIT_RES: 1,
ATTCT_INFO: {
birthDay: $('.identity-back-wrap .result-birthDay').html(),
sex: $('.identity-back-wrap .result-sex').html(),
collegeName: $('.identity-back-wrap .result-collegeName').html(),
educationDegree: $('.identity-back-wrap .result-educationDegree').html(),
enrollmentYear: $('.identity-back-wrap .result-enrollmentYear').html()
}
});
}
if ($('#identity-fail').length > 0) {
// xls-4学生认证失败埋点
givePoint('YB_STUDENT_ATTCT_RESULT', {
SRC_ID: 5,
SUBMIT_RES: 2,
FAILURE_CAUSE: $('#identity-fail-text').html()
});
}
$('.banner-img').click(function() {
var url = $(this).children().attr('href'),
index = $(this).index();
... ...