...
|
...
|
@@ -60,6 +60,17 @@ identityFn = handlebars.compile($('#identity-back').html() || ''); |
|
|
|
|
|
require('../plugins/slider');
|
|
|
|
|
|
|
|
|
function getCookie(name) {
|
|
|
var arr, reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
|
|
|
|
|
|
if (arr === document.cookie.match(reg)) {
|
|
|
return unescape(arr[2]);
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/** *埋点方法***/
|
|
|
function givePoint(op, parameter) {
|
|
|
var CID = 1;
|
...
|
...
|
@@ -68,22 +79,24 @@ function givePoint(op, parameter) { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 男:1,女:2,潮童:3,创意生活:4
|
|
|
switch (document.cookie('_Channel')) {
|
|
|
case 'boys':
|
|
|
CID = 1;
|
|
|
break;
|
|
|
case 'girls':
|
|
|
CID = 2;
|
|
|
break;
|
|
|
case 'kids':
|
|
|
CID = 3;
|
|
|
break;
|
|
|
case 'lifestyle':
|
|
|
CID = 4;
|
|
|
break;
|
|
|
default:
|
|
|
CID = 1;
|
|
|
if (!getCookie('_Channel')) {
|
|
|
// 男:1,女:2,潮童:3,创意生活:4
|
|
|
switch (getCookie('_Channel')) {
|
|
|
case 'boys':
|
|
|
CID = 1;
|
|
|
break;
|
|
|
case 'girls':
|
|
|
CID = 2;
|
|
|
break;
|
|
|
case 'kids':
|
|
|
CID = 3;
|
|
|
break;
|
|
|
case 'lifestyle':
|
|
|
CID = 4;
|
|
|
break;
|
|
|
default:
|
|
|
CID = 1;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
parameter = $.extend({
|
...
|
...
|
@@ -122,6 +135,7 @@ function closeStuSelect() { |
|
|
$('.ident-select-wrap .select-ul').empty();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 清除加载的下拉数据,还原点击状态,获取点击数据
|
|
|
* @param
|
...
|
...
|
@@ -411,6 +425,10 @@ $stuYear.on('click', function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.ident-select-wrap > .arrow-down').click(function() {
|
|
|
$(this).next().click();
|
|
|
});
|
|
|
|
|
|
$couponDia.on('click', function() {
|
|
|
var cont = '<h3 class="dia-title">认证协议</h3>' +
|
|
|
'<p>(1) 全日制大学生及硕士博士研究生;</p>' +
|
...
|
...
|
@@ -492,75 +510,6 @@ $('#identity-Btn').on('click', function() { |
|
|
enrollmentYear: $('#stu-entrance-year').val()
|
|
|
};
|
|
|
|
|
|
var $prompt = $('#prompt'),
|
|
|
$agreen = $('#agreen-show'),
|
|
|
failText = '';
|
|
|
|
|
|
if (identData.name === '') {
|
|
|
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)) {
|
|
|
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 === '') {
|
|
|
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)) {
|
|
|
failText = '身份证号格式错误';
|
|
|
$prompt.html(failText);
|
|
|
|
|
|
// xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.collegeName === '') {
|
|
|
failText = '学校名称不能为空';
|
|
|
$prompt.html(failText);
|
|
|
|
|
|
// xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.educationDegree === '') {
|
|
|
failText = '学历程度不能为空';
|
|
|
$prompt.html(failText);
|
|
|
|
|
|
// xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
if (identData.enrollmentYear === '') {
|
|
|
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')) {
|
|
|
failText = '未同意Yoho!有货学生认证协议';
|
|
|
$prompt.html(failText);
|
|
|
|
|
|
// xls-3埋点
|
|
|
givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});
|
|
|
return;
|
|
|
}
|
|
|
$prompt.html('');
|
|
|
submitIdentity(identData);
|
|
|
});
|
|
|
|
...
|
...
|
|