...
|
...
|
@@ -106,6 +106,8 @@ function clearSelectUl($a, code) { |
|
|
* 最终提交表单
|
|
|
*/
|
|
|
function submitIdentity(json) {
|
|
|
//xls-3提交认证埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 1});
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/students/verify',
|
...
|
...
|
@@ -113,10 +115,14 @@ function submitIdentity(json) { |
|
|
}).then(function(data) {
|
|
|
if (data.code === 200) {
|
|
|
window.location.href = data.data;
|
|
|
//xls-4认证成功埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_RESULT',{SRC_ID: 5, SUBMIT_RES: 1});
|
|
|
} else {
|
|
|
$identityForm.addClass('hide');
|
|
|
$('identity-back-wrap').remove();
|
|
|
$identityWrap.append(identityFn({msg: data.message}));
|
|
|
//xls-4认证失败埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_RESULT',{SRC_ID: 5, SUBMIT_RES: 2,FAILURE_CAUSE: data.message});
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -371,6 +377,10 @@ $rightDia.on('click', function() { |
|
|
'<p>(4) 不定期学生专享活动;</p>';
|
|
|
|
|
|
createStuDialog(cont);
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-rights-box', F_NAME: '学生权益',
|
|
|
F_URL: '', F_INDEX: 2, I_INDEX: 0});
|
|
|
});
|
|
|
|
|
|
$agreenShow.on('click', function() {
|
...
|
...
|
@@ -412,6 +422,10 @@ $('.enable .info').on('click', function(e) { |
|
|
e.preventDefault();
|
|
|
requestCoupon($(this).closest('a').data('id'));
|
|
|
redirect.gunangSrc = $(this).closest('a').get(0).href;
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-coupon-box', F_NAME: '优惠券',
|
|
|
F_URL: '', F_INDEX: 4, I_INDEX: 0});
|
|
|
});
|
|
|
|
|
|
$('#identity-Btn').on('click', function() {
|
...
|
...
|
@@ -424,38 +438,63 @@ $('#identity-Btn').on('click', function() { |
|
|
};
|
|
|
|
|
|
var $prompt = $('#prompt'),
|
|
|
$agreen = $('#agreen-show');
|
|
|
$agreen = $('#agreen-show'),
|
|
|
failText = '';
|
|
|
|
|
|
if (identData.name === '') {
|
|
|
$prompt.html('真实姓名不能为空');
|
|
|
failText = '真实姓名不能为空';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (!/^[\u4e00-\u9fa5a-zA-Z]{2,12}$/.test(identData.name)) {
|
|
|
$prompt.html('真实姓名为2~12个汉字或者英文');
|
|
|
failText = '真实姓名为2~12个汉字或者英文';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.certNo === '') {
|
|
|
$prompt.html('身份证号不能为空');
|
|
|
failText = '身份证号不能为空';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identData.certNo)) {
|
|
|
$prompt.html('身份证号格式错误');
|
|
|
failText = '身份证号格式错误';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.collegeName === '') {
|
|
|
$prompt.html('学校名称不能为空');
|
|
|
failText = '学校名称不能为空';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.educationDegree === '') {
|
|
|
$prompt.html('学历程度不能为空');
|
|
|
failText = '学历程度不能为空';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.enrollmentYear === '') {
|
|
|
$prompt.html('入学年份不能为空');
|
|
|
failText = '入学年份不能为空';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (!$agreen.hasClass('active')) {
|
|
|
$prompt.html('未同意Yoho!有货学生认证协议');
|
|
|
failText = '未同意Yoho!有货学生认证协议';
|
|
|
$prompt.html(failText);
|
|
|
//xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT',{SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
$prompt.html('');
|
...
|
...
|
@@ -466,3 +505,119 @@ $('#identity-Btn').on('click', function() { |
|
|
$('.ident-select-wrap').one('click', function() {
|
|
|
$(this).removeClass('gray-p');
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function givePoint(op,parameter) {
|
|
|
var CID = 1;
|
|
|
|
|
|
if (!window._yas || !window._yas.sendCustomInfo) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
//男:1,女:2,潮童:3,创意生活:4
|
|
|
switch(cookie('_Channel')) {
|
|
|
case 'boys':
|
|
|
CID = 1;
|
|
|
break;
|
|
|
case 'girls':
|
|
|
CID = 2;
|
|
|
break;
|
|
|
case 'kids':
|
|
|
CID = 3;
|
|
|
break;
|
|
|
case 'lifestyle':
|
|
|
CID = 4;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
parameter = $.extend({
|
|
|
'REC_POSE': '',
|
|
|
'PRD_ID': '',
|
|
|
'PRD_NUM': 0,
|
|
|
'C_ID': CID,
|
|
|
'ACTION_ID': 0,
|
|
|
'page_num': 1
|
|
|
}, parameter);
|
|
|
|
|
|
if (parameter.REC_POSE === '' || parameter.PRD_ID === '') {
|
|
|
return true;
|
|
|
}
|
|
|
console.info(parameter);
|
|
|
window._yas.sendCustomInfo({
|
|
|
'op': op,
|
|
|
'uid': getUid(),
|
|
|
'param': JSON.stringify(parameter)
|
|
|
}, true);
|
|
|
}
|
|
|
/*
|
|
|
*埋点
|
|
|
*/
|
|
|
$(function(){
|
|
|
|
|
|
if ($('#identity-success').length >0) {
|
|
|
//xls-4学生认证成功埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_RESULT',{SRC_ID: 5, SUBMIT_RES: 1});
|
|
|
}
|
|
|
if ($('#identity-fail').length >0) {
|
|
|
//xls-4学生认证失败埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_RESULT',{SRC_ID: 5, SUBMIT_RES: 2,
|
|
|
FAILURE_CAUSE: $('#identity-fail-text').html()});
|
|
|
}
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_HOME',{SRC_ID: 5});
|
|
|
|
|
|
$('.banner-img').click(function(){
|
|
|
var url = $(this).children().attr('href'),
|
|
|
index = $(this).index();
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'banner', F_NAME: 'banner',
|
|
|
F_URL: url, F_INDEX: 1, I_INDEX: parseInt(index)+1});
|
|
|
});
|
|
|
|
|
|
$('#stu-coupon-more').click(function(){
|
|
|
var url = $(this).attr('href');
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-coupon-box', F_NAME: '优惠券',
|
|
|
F_URL: url, F_INDEX: 4, I_INDEX: 0});
|
|
|
});
|
|
|
|
|
|
$('#stu-good-more').click(function(){
|
|
|
var url = $(this).attr('href');
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-good-box', F_NAME: '热门单品',
|
|
|
F_URL: url, F_INDEX: 5, I_INDEX: 0});
|
|
|
});
|
|
|
|
|
|
$('.good-thumb').click(function(){
|
|
|
var url = $(this).attr('href'),
|
|
|
index = $(this).closest('.good-info').index();
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-good-box', F_NAME: '热门单品',
|
|
|
F_URL: url, F_INDEX: 5, I_INDEX: parseInt(index)+1});
|
|
|
});
|
|
|
|
|
|
$('.stu-good-detail a').click(function(){
|
|
|
var url = $(this).attr('href'),
|
|
|
index = $(this).closest('.good-info').index();
|
|
|
console.info(index);
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-good-box', F_NAME: '热门单品',
|
|
|
F_URL: url, F_INDEX: 5, I_INDEX: parseInt(index)+1});
|
|
|
});
|
|
|
|
|
|
$('.commodity-list a').click(function(){
|
|
|
var url = $(this).attr('href'),
|
|
|
index = $(this).index();
|
|
|
|
|
|
//xls-5学生营销,页面加载埋点
|
|
|
givePoint('YB_STUDENT_VIP_FLR',{F_ID: 'stu-activity-box', F_NAME: '活动推荐',
|
|
|
F_URL: url, F_INDEX: 6, I_INDEX: parseInt(index)+1});
|
|
|
});
|
|
|
}); |
...
|
...
|
|