Authored by 周少峰

Merge branch 'release/4.9.1.0'

... ... @@ -58,10 +58,6 @@ exports.getStudentsData = (channel, req) => {
let responseData = {
module: 'product',
page: 'students',
// 头部数据
headerData: result[0],
realData: {
sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}],
... ... @@ -73,6 +69,9 @@ exports.getStudentsData = (channel, req) => {
footerTop: true
};
// 头部数据
Object.assign(responseData, result[0]);
// 资源位数据
if (result[1].code === 200) {
Object.assign(responseData.realData, stuHandler.studentResource(result[1].data));
... ...
... ... @@ -16,7 +16,7 @@
<a name="stu-rights">
<h2 class="floor-title">学生权益</h2>
</a>
<span id="rights-dia" class="floor-more">更多细则</span>
<span id="rights-dia" class="floor-more">更多细则 ></span>
</div>
<div class="commodity-list clearfix">
{{> students/stu-rights}}
... ... @@ -43,7 +43,7 @@
</a>
{{#if couponMore}}
<span class="floor-more">
<a target="_blank" href="{{couponMore.more_url}}">MORE</a>
<a target="_blank" href="{{couponMore.more_url}}">MORE ></a>
</span>
{{/if}}
</div>
... ... @@ -61,7 +61,7 @@
<h2 class="floor-title">热门单品</h2>
</a>
<span class="floor-more">
<a target="_blank" href="{{moreProducts}}" id="stu-good-more">MORE</a>
<a target="_blank" href="{{moreProducts}}" id="stu-good-more">MORE ></a>
</span>
</div>
<div class="commodity-list clearfix">
... ... @@ -80,7 +80,7 @@
</div>
<div class="commodity-list clearfix">
{{#activityItem}}
<a href="{{url}}"><img class="activity-item" src="{{image src 1150 283}}" /></a>
<a target="_blank" href="{{url}}"><img class="activity-item" src="{{image src 1150 283}}" /></a>
{{/activityItem}}
</div>
</div>
... ...
... ... @@ -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);
});
... ...
... ... @@ -25,7 +25,7 @@
li {
display: block;
position: absolute;
width: 1903px;
width: 100%;
height: 358px;
background-size: 100% 100%;
top: 0;
... ... @@ -102,6 +102,7 @@
margin-right: 20px;
text-align: center;
background-color: #fff;
border-radius: 5px;
}
.stu-rights-item img {
... ... @@ -238,6 +239,7 @@
right: 5px;
z-index: 1;
font-size: 14px;
cursor: pointer;
}
&.active .select-value {
... ... @@ -406,6 +408,7 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.good-detail-text .brand {
display: none;
}
... ... @@ -499,7 +502,7 @@
.stu-dialog {
border: 3px solid #000;
width: 500px;
width: 580px;
.content {
text-align: left;
... ...