Authored by 周少峰

Merge branch 'release/4.9.1.0'

@@ -58,10 +58,6 @@ exports.getStudentsData = (channel, req) => { @@ -58,10 +58,6 @@ exports.getStudentsData = (channel, req) => {
58 let responseData = { 58 let responseData = {
59 module: 'product', 59 module: 'product',
60 page: 'students', 60 page: 'students',
61 -  
62 - // 头部数据  
63 - headerData: result[0],  
64 -  
65 realData: { 61 realData: {
66 sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'}, 62 sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
67 {title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}], 63 {title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}],
@@ -73,6 +69,9 @@ exports.getStudentsData = (channel, req) => { @@ -73,6 +69,9 @@ exports.getStudentsData = (channel, req) => {
73 footerTop: true 69 footerTop: true
74 }; 70 };
75 71
  72 + // 头部数据
  73 + Object.assign(responseData, result[0]);
  74 +
76 // 资源位数据 75 // 资源位数据
77 if (result[1].code === 200) { 76 if (result[1].code === 200) {
78 Object.assign(responseData.realData, stuHandler.studentResource(result[1].data)); 77 Object.assign(responseData.realData, stuHandler.studentResource(result[1].data));
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <a name="stu-rights"> 16 <a name="stu-rights">
17 <h2 class="floor-title">学生权益</h2> 17 <h2 class="floor-title">学生权益</h2>
18 </a> 18 </a>
19 - <span id="rights-dia" class="floor-more">更多细则</span> 19 + <span id="rights-dia" class="floor-more">更多细则 ></span>
20 </div> 20 </div>
21 <div class="commodity-list clearfix"> 21 <div class="commodity-list clearfix">
22 {{> students/stu-rights}} 22 {{> students/stu-rights}}
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 </a> 43 </a>
44 {{#if couponMore}} 44 {{#if couponMore}}
45 <span class="floor-more"> 45 <span class="floor-more">
46 - <a target="_blank" href="{{couponMore.more_url}}">MORE</a> 46 + <a target="_blank" href="{{couponMore.more_url}}">MORE ></a>
47 </span> 47 </span>
48 {{/if}} 48 {{/if}}
49 </div> 49 </div>
@@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
61 <h2 class="floor-title">热门单品</h2> 61 <h2 class="floor-title">热门单品</h2>
62 </a> 62 </a>
63 <span class="floor-more"> 63 <span class="floor-more">
64 - <a target="_blank" href="{{moreProducts}}" id="stu-good-more">MORE</a> 64 + <a target="_blank" href="{{moreProducts}}" id="stu-good-more">MORE ></a>
65 </span> 65 </span>
66 </div> 66 </div>
67 <div class="commodity-list clearfix"> 67 <div class="commodity-list clearfix">
@@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
80 </div> 80 </div>
81 <div class="commodity-list clearfix"> 81 <div class="commodity-list clearfix">
82 {{#activityItem}} 82 {{#activityItem}}
83 - <a href="{{url}}"><img class="activity-item" src="{{image src 1150 283}}" /></a> 83 + <a target="_blank" href="{{url}}"><img class="activity-item" src="{{image src 1150 283}}" /></a>
84 {{/activityItem}} 84 {{/activityItem}}
85 </div> 85 </div>
86 </div> 86 </div>
@@ -60,6 +60,17 @@ identityFn = handlebars.compile($('#identity-back').html() || ''); @@ -60,6 +60,17 @@ identityFn = handlebars.compile($('#identity-back').html() || '');
60 60
61 require('../plugins/slider'); 61 require('../plugins/slider');
62 62
  63 +
  64 +function getCookie(name) {
  65 + var arr, reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
  66 +
  67 + if (arr === document.cookie.match(reg)) {
  68 + return unescape(arr[2]);
  69 + } else {
  70 + return null;
  71 + }
  72 +}
  73 +
63 /** *埋点方法***/ 74 /** *埋点方法***/
64 function givePoint(op, parameter) { 75 function givePoint(op, parameter) {
65 var CID = 1; 76 var CID = 1;
@@ -68,22 +79,24 @@ function givePoint(op, parameter) { @@ -68,22 +79,24 @@ function givePoint(op, parameter) {
68 return false; 79 return false;
69 } 80 }
70 81
71 - // 男:1,女:2,潮童:3,创意生活:4  
72 - switch (document.cookie('_Channel')) {  
73 - case 'boys':  
74 - CID = 1;  
75 - break;  
76 - case 'girls':  
77 - CID = 2;  
78 - break;  
79 - case 'kids':  
80 - CID = 3;  
81 - break;  
82 - case 'lifestyle':  
83 - CID = 4;  
84 - break;  
85 - default:  
86 - CID = 1; 82 + if (!getCookie('_Channel')) {
  83 + // 男:1,女:2,潮童:3,创意生活:4
  84 + switch (getCookie('_Channel')) {
  85 + case 'boys':
  86 + CID = 1;
  87 + break;
  88 + case 'girls':
  89 + CID = 2;
  90 + break;
  91 + case 'kids':
  92 + CID = 3;
  93 + break;
  94 + case 'lifestyle':
  95 + CID = 4;
  96 + break;
  97 + default:
  98 + CID = 1;
  99 + }
87 } 100 }
88 101
89 parameter = $.extend({ 102 parameter = $.extend({
@@ -122,6 +135,7 @@ function closeStuSelect() { @@ -122,6 +135,7 @@ function closeStuSelect() {
122 $('.ident-select-wrap .select-ul').empty(); 135 $('.ident-select-wrap .select-ul').empty();
123 } 136 }
124 137
  138 +
125 /** 139 /**
126 * 清除加载的下拉数据,还原点击状态,获取点击数据 140 * 清除加载的下拉数据,还原点击状态,获取点击数据
127 * @param 141 * @param
@@ -411,6 +425,10 @@ $stuYear.on('click', function() { @@ -411,6 +425,10 @@ $stuYear.on('click', function() {
411 } 425 }
412 }); 426 });
413 427
  428 +$('.ident-select-wrap > .arrow-down').click(function() {
  429 + $(this).next().click();
  430 +});
  431 +
414 $couponDia.on('click', function() { 432 $couponDia.on('click', function() {
415 var cont = '<h3 class="dia-title">认证协议</h3>' + 433 var cont = '<h3 class="dia-title">认证协议</h3>' +
416 '<p>(1) 全日制大学生及硕士博士研究生;</p>' + 434 '<p>(1) 全日制大学生及硕士博士研究生;</p>' +
@@ -492,75 +510,6 @@ $('#identity-Btn').on('click', function() { @@ -492,75 +510,6 @@ $('#identity-Btn').on('click', function() {
492 enrollmentYear: $('#stu-entrance-year').val() 510 enrollmentYear: $('#stu-entrance-year').val()
493 }; 511 };
494 512
495 - var $prompt = $('#prompt'),  
496 - $agreen = $('#agreen-show'),  
497 - failText = '';  
498 -  
499 - if (identData.name === '') {  
500 - failText = '真实姓名不能为空';  
501 - $prompt.html(failText);  
502 -  
503 - // xls-3埋点  
504 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
505 - return;  
506 - }  
507 - if (!/^[\u4e00-\u9fa5a-zA-Z]{2,12}$/.test(identData.name)) {  
508 - failText = '真实姓名为2~12个汉字或者英文';  
509 - $prompt.html(failText);  
510 -  
511 - // xls-3埋点  
512 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
513 - return;  
514 - }  
515 - if (identData.certNo === '') {  
516 - failText = '身份证号不能为空';  
517 - $prompt.html(failText);  
518 -  
519 - // xls-3埋点  
520 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
521 - return;  
522 - }  
523 - if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identData.certNo)) {  
524 - failText = '身份证号格式错误';  
525 - $prompt.html(failText);  
526 -  
527 - // xls-3埋点  
528 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
529 - return;  
530 - }  
531 - if (identData.collegeName === '') {  
532 - failText = '学校名称不能为空';  
533 - $prompt.html(failText);  
534 -  
535 - // xls-3埋点  
536 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
537 - return;  
538 - }  
539 - if (identData.educationDegree === '') {  
540 - failText = '学历程度不能为空';  
541 - $prompt.html(failText);  
542 -  
543 - // xls-3埋点  
544 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
545 - return;  
546 - }  
547 - if (identData.enrollmentYear === '') {  
548 - failText = '入学年份不能为空';  
549 - $prompt.html(failText);  
550 -  
551 - // xls-3埋点  
552 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
553 - return;  
554 - }  
555 - if (!$agreen.hasClass('active')) {  
556 - failText = '未同意Yoho!有货学生认证协议';  
557 - $prompt.html(failText);  
558 -  
559 - // xls-3埋点  
560 - givePoint('YB_STUDENT_ATTCT_SUBMIT', {SRC_ID: 2, SUBMIT_RES: 2, FAILURE_CAUSE: failText});  
561 - return;  
562 - }  
563 - $prompt.html('');  
564 submitIdentity(identData); 513 submitIdentity(identData);
565 }); 514 });
566 515
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 li { 25 li {
26 display: block; 26 display: block;
27 position: absolute; 27 position: absolute;
28 - width: 1903px; 28 + width: 100%;
29 height: 358px; 29 height: 358px;
30 background-size: 100% 100%; 30 background-size: 100% 100%;
31 top: 0; 31 top: 0;
@@ -102,6 +102,7 @@ @@ -102,6 +102,7 @@
102 margin-right: 20px; 102 margin-right: 20px;
103 text-align: center; 103 text-align: center;
104 background-color: #fff; 104 background-color: #fff;
  105 + border-radius: 5px;
105 } 106 }
106 107
107 .stu-rights-item img { 108 .stu-rights-item img {
@@ -238,6 +239,7 @@ @@ -238,6 +239,7 @@
238 right: 5px; 239 right: 5px;
239 z-index: 1; 240 z-index: 1;
240 font-size: 14px; 241 font-size: 14px;
  242 + cursor: pointer;
241 } 243 }
242 244
243 &.active .select-value { 245 &.active .select-value {
@@ -406,6 +408,7 @@ @@ -406,6 +408,7 @@
406 text-overflow: ellipsis; 408 text-overflow: ellipsis;
407 white-space: nowrap; 409 white-space: nowrap;
408 } 410 }
  411 +
409 .good-detail-text .brand { 412 .good-detail-text .brand {
410 display: none; 413 display: none;
411 } 414 }
@@ -499,7 +502,7 @@ @@ -499,7 +502,7 @@
499 502
500 .stu-dialog { 503 .stu-dialog {
501 border: 3px solid #000; 504 border: 3px solid #000;
502 - width: 500px; 505 + width: 580px;
503 506
504 .content { 507 .content {
505 text-align: left; 508 text-align: left;