Authored by zzzzzzz

Merge branch 'hotfix/point' into release/5.0.0

@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 </section> 14 </section>
15 {{else}} 15 {{else}}
16 <section class='s-section clearfix'> 16 <section class='s-section clearfix'>
17 - <div class='s-verify-img s-verify-fail'></div> 17 + <div class='s-verify-img s-verify-fail' prompt='{{./prompt}}'></div>
18 <p class='s-verify-title'>太遗憾了,{{./prompt}}</p> 18 <p class='s-verify-title'>太遗憾了,{{./prompt}}</p>
19 <p class='s-verify-txt'>您可以<a class='red' href='//m.yohobuy.com/activity/student/register'>重新验证 ></a></p> 19 <p class='s-verify-txt'>您可以<a class='red' href='//m.yohobuy.com/activity/student/register'>重新验证 ></a></p>
20 </section> 20 </section>
@@ -7,7 +7,7 @@ var STUDENTCOOKIES = 'STUDENTCOOKIES'; @@ -7,7 +7,7 @@ var STUDENTCOOKIES = 'STUDENTCOOKIES';
7 7
8 var C_ID, 8 var C_ID,
9 getChannel, 9 getChannel,
10 - asideSlider = new AsideSlider();//eslint-disable-line 10 + asideSlider = new AsideSlider(); //eslint-disable-line
11 11
12 var province, 12 var province,
13 school, 13 school,
@@ -86,7 +86,7 @@ function isValidate(rules, datas) { @@ -86,7 +86,7 @@ function isValidate(rules, datas) {
86 // break; 86 // break;
87 // } 87 // }
88 // } 88 // }
89 - if (rule.is !== void (0) && data !== rule.is) { 89 + if (rule.is !== void(0) && data !== rule.is) {
90 message = rule.msg; 90 message = rule.msg;
91 } 91 }
92 } else { 92 } else {
@@ -127,6 +127,20 @@ function changeSuccess() { @@ -127,6 +127,20 @@ function changeSuccess() {
127 }; 127 };
128 } 128 }
129 129
  130 +/**
  131 + * 身份信息过滤
  132 + */
  133 +function filter(data) {
  134 + return {
  135 + college_name: data.college_name,
  136 + college_province: data.provinceName,
  137 + education_degree: data.education_degree,
  138 + enrollment_year: data.enrollment_year,
  139 + sex: (Number(data.cert_no[16]) % 2 === 0) ? 2 : 1,
  140 + birth: data.cert_no.substr(6, 8),
  141 + };
  142 +}
  143 +
130 function setFormByCookes(item) { 144 function setFormByCookes(item) {
131 var msg; 145 var msg;
132 146
@@ -243,7 +257,7 @@ Filter.prototype = { @@ -243,7 +257,7 @@ Filter.prototype = {
243 if (data[name].length > 0) { 257 if (data[name].length > 0) {
244 data[name].forEach(function(item) { 258 data[name].forEach(function(item) {
245 html.push('<div class=\'s-item close\' data-obj=\'' + 259 html.push('<div class=\'s-item close\' data-obj=\'' +
246 - JSON.stringify(item) + '\'>' + item[that.__feild__] + '</div>'); 260 + JSON.stringify(item) + '\'>' + item[that.__feild__] + '</div>');
247 }); 261 });
248 } 262 }
249 } 263 }
@@ -346,7 +360,7 @@ window.JI_bilibili = function($el) { @@ -346,7 +360,7 @@ window.JI_bilibili = function($el) {
346 360
347 } else { 361 } else {
348 362
349 - // $("[data-aslider-in='school|fade']").attr("aslider-isshow","false") 363 + // $("[data-aslider-in='school|fade']").attr("aslider-isshow","false")
350 } 364 }
351 } 365 }
352 }; 366 };
@@ -365,7 +379,7 @@ window.JI_getselectvalue = function(type, value) { @@ -365,7 +379,7 @@ window.JI_getselectvalue = function(type, value) {
365 }; 379 };
366 380
367 $('.s-blue').click(function() { 381 $('.s-blue').click(function() {
368 - localStorage.setItem(STUDENTCOOKIES, JSON.stringify(changeSuccess().data)); 382 + localStorage.setItem(STUDENTCOOKIES, JSON.stringify(filter(changeSuccess().data)));
369 }); 383 });
370 $(function() { 384 $(function() {
371 try { 385 try {
@@ -407,13 +421,12 @@ $(document).on('click', '.s-submit', function() { @@ -407,13 +421,12 @@ $(document).on('click', '.s-submit', function() {
407 var $that = $(this); 421 var $that = $(this);
408 422
409 // 存cookie 记录状态 423 // 存cookie 记录状态
410 - localStorage.setItem(STUDENTCOOKIES, JSON.stringify(obj.data)); 424 + localStorage.setItem(STUDENTCOOKIES, JSON.stringify(filter(obj.data)));
411 425
412 if ($that.data('isClick') === false) { 426 if ($that.data('isClick') === false) {
413 return; 427 return;
414 } 428 }
415 $that.data('isClick', false); 429 $that.data('isClick', false);
416 -  
417 if (!obj.msg) { 430 if (!obj.msg) {
418 $.ajax({ 431 $.ajax({
419 url: '/activity/student/join', 432 url: '/activity/student/join',
@@ -424,15 +437,26 @@ $(document).on('click', '.s-submit', function() { @@ -424,15 +437,26 @@ $(document).on('click', '.s-submit', function() {
424 if (window._yas && window._yas.sendCustomInfo) { 437 if (window._yas && window._yas.sendCustomInfo) {
425 window._yas.sendCustomInfo({ 438 window._yas.sendCustomInfo({
426 op: 'YB_STUDENT_ATTCT_SUBMIT', 439 op: 'YB_STUDENT_ATTCT_SUBMIT',
427 - param: { 440 + param: JSON.stringify({
428 C_ID: C_ID, 441 C_ID: C_ID,
429 SRC_ID: 5, 442 SRC_ID: 5,
430 SUBMIT_RES: 1 443 SUBMIT_RES: 1
431 - } 444 + }),
432 }, true); 445 }, true);
433 } 446 }
434 location.href = data.data; 447 location.href = data.data;
435 } else { 448 } else {
  449 + if (window._yas && window._yas.sendCustomInfo) {
  450 + window._yas.sendCustomInfo({
  451 + op: 'YB_STUDENT_ATTCT_SUBMIT',
  452 + param: JSON.stringify({
  453 + C_ID: C_ID,
  454 + SRC_ID: 5,
  455 + SUBMIT_RES: 2,
  456 + FAILURE_CAUSE: 3,
  457 + }),
  458 + }, true);
  459 + }
436 $that.data('isClick', true); 460 $that.data('isClick', true);
437 tip.show(data.message); 461 tip.show(data.message);
438 } 462 }
@@ -450,12 +474,12 @@ $(document).on('click', '.s-submit', function() { @@ -450,12 +474,12 @@ $(document).on('click', '.s-submit', function() {
450 if (window._yas && window._yas.sendCustomInfo) { 474 if (window._yas && window._yas.sendCustomInfo) {
451 window._yas.sendCustomInfo({ 475 window._yas.sendCustomInfo({
452 op: 'YB_STUDENT_ATTCT_SUBMIT', 476 op: 'YB_STUDENT_ATTCT_SUBMIT',
453 - param: { 477 + param: JSON.stringify({
454 C_ID: C_ID, 478 C_ID: C_ID,
455 SRC_ID: 5, 479 SRC_ID: 5,
456 SUBMIT_RES: 2, 480 SUBMIT_RES: 2,
457 FAILURE_CAUSE: FAILURE_CAUSE 481 FAILURE_CAUSE: FAILURE_CAUSE
458 - } 482 + }),
459 }, true); 483 }, true);
460 } 484 }
461 485
@@ -34,8 +34,8 @@ function uuid() { @@ -34,8 +34,8 @@ function uuid() {
34 for (i = 0; i < 36; i++) { 34 for (i = 0; i < 36; i++) {
35 s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); 35 s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
36 } 36 }
37 - s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010  
38 - s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 37 + s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
  38 + s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
39 s[8] = s[13] = s[18] = s[23] = '-'; 39 s[8] = s[13] = s[18] = s[23] = '-';
40 40
41 id = s.join(''); 41 id = s.join('');
@@ -64,13 +64,13 @@ if ($('.banner-swiper').find('li').size() > 1) { @@ -64,13 +64,13 @@ if ($('.banner-swiper').find('li').size() > 1) {
64 // 获取url中的参数 64 // 获取url中的参数
65 function getUrlParam(name) { 65 function getUrlParam(name) {
66 66
67 - // 构造一个含有目标参数的正则表达式对象 67 + // 构造一个含有目标参数的正则表达式对象
68 var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); 68 var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
69 69
70 - // 匹配目标参数 70 + // 匹配目标参数
71 var r = window.location.search.substr(1).match(reg); 71 var r = window.location.search.substr(1).match(reg);
72 72
73 - // 返回参数值 73 + // 返回参数值
74 if (r !== null) { 74 if (r !== null) {
75 return r[2]; 75 return r[2];
76 } 76 }
@@ -141,64 +141,64 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { @@ -141,64 +141,64 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() {
141 */ 141 */
142 if (typeof wx !== 'undefined') { 142 if (typeof wx !== 'undefined') {
143 $.getJSON(_weChatInterface + '?pageurl=' + 143 $.getJSON(_weChatInterface + '?pageurl=' +
144 - encodeURIComponent(location.href.split('#')[0]) + '&callback=?',  
145 - function(json) {  
146 - var _appId,  
147 - _timestamp,  
148 - _nonceStr,  
149 - _signature;  
150 -  
151 - if (json) {  
152 - _appId = json.appId.toString();  
153 - _timestamp = json.timestamp;  
154 - _nonceStr = json.nonceStr.toString();  
155 - _signature = json.signature.toString();  
156 -  
157 - wx.config({  
158 - debug: false,  
159 - appId: _appId,  
160 - timestamp: _timestamp,  
161 - nonceStr: _nonceStr,  
162 - signature: _signature,  
163 - jsApiList: [  
164 - 'checkJsApi',  
165 - 'onMenuShareTimeline',  
166 - 'onMenuShareAppMessage',  
167 - 'onMenuShareQQ',  
168 - 'onMenuShareWeibo',  
169 - 'hideMenuItems',  
170 - 'showMenuItems',  
171 - 'hideAllNonBaseMenuItem',  
172 - 'showAllNonBaseMenuItem',  
173 - 'translateVoice',  
174 - 'startRecord',  
175 - 'stopRecord',  
176 - 'onRecordEnd',  
177 - 'playVoice',  
178 - 'pauseVoice',  
179 - 'stopVoice',  
180 - 'uploadVoice',  
181 - 'downloadVoice',  
182 - 'chooseImage',  
183 - 'previewImage',  
184 - 'uploadImage',  
185 - 'downloadImage',  
186 - 'getNetworkType',  
187 - 'openLocation',  
188 - 'getLocation',  
189 - 'hideOptionMenu',  
190 - 'showOptionMenu',  
191 - 'closeWindow',  
192 - 'scanQRCode',  
193 - 'chooseWXPay',  
194 - 'openProductSpecificView',  
195 - 'addCard',  
196 - 'chooseCard',  
197 - 'openCard'  
198 - ]  
199 - });  
200 - }  
201 - }); 144 + encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
  145 + function(json) {
  146 + var _appId,
  147 + _timestamp,
  148 + _nonceStr,
  149 + _signature;
  150 +
  151 + if (json) {
  152 + _appId = json.appId.toString();
  153 + _timestamp = json.timestamp;
  154 + _nonceStr = json.nonceStr.toString();
  155 + _signature = json.signature.toString();
  156 +
  157 + wx.config({
  158 + debug: false,
  159 + appId: _appId,
  160 + timestamp: _timestamp,
  161 + nonceStr: _nonceStr,
  162 + signature: _signature,
  163 + jsApiList: [
  164 + 'checkJsApi',
  165 + 'onMenuShareTimeline',
  166 + 'onMenuShareAppMessage',
  167 + 'onMenuShareQQ',
  168 + 'onMenuShareWeibo',
  169 + 'hideMenuItems',
  170 + 'showMenuItems',
  171 + 'hideAllNonBaseMenuItem',
  172 + 'showAllNonBaseMenuItem',
  173 + 'translateVoice',
  174 + 'startRecord',
  175 + 'stopRecord',
  176 + 'onRecordEnd',
  177 + 'playVoice',
  178 + 'pauseVoice',
  179 + 'stopVoice',
  180 + 'uploadVoice',
  181 + 'downloadVoice',
  182 + 'chooseImage',
  183 + 'previewImage',
  184 + 'uploadImage',
  185 + 'downloadImage',
  186 + 'getNetworkType',
  187 + 'openLocation',
  188 + 'getLocation',
  189 + 'hideOptionMenu',
  190 + 'showOptionMenu',
  191 + 'closeWindow',
  192 + 'scanQRCode',
  193 + 'chooseWXPay',
  194 + 'openProductSpecificView',
  195 + 'addCard',
  196 + 'chooseCard',
  197 + 'openCard'
  198 + ]
  199 + });
  200 + }
  201 + });
202 202
203 wx.ready(function() { 203 wx.ready(function() {
204 var shareData = { 204 var shareData = {
@@ -208,16 +208,16 @@ if (typeof wx !== 'undefined') { @@ -208,16 +208,16 @@ if (typeof wx !== 'undefined') {
208 link: 'https://m.yohobuy.com/activity/student' 208 link: 'https://m.yohobuy.com/activity/student'
209 }; 209 };
210 210
211 - // 分享给朋友 211 + // 分享给朋友
212 wx.onMenuShareAppMessage(shareData); 212 wx.onMenuShareAppMessage(shareData);
213 213
214 - // 分享到朋友圈 214 + // 分享到朋友圈
215 wx.onMenuShareTimeline(shareData); 215 wx.onMenuShareTimeline(shareData);
216 216
217 - // 分享到QQ 217 + // 分享到QQ
218 wx.onMenuShareQQ(shareData); 218 wx.onMenuShareQQ(shareData);
219 219
220 - // 分享到微博 220 + // 分享到微博
221 wx.onMenuShareWeibo(shareData); 221 wx.onMenuShareWeibo(shareData);
222 }); 222 });
223 } 223 }
@@ -225,6 +225,7 @@ if (typeof wx !== 'undefined') { @@ -225,6 +225,7 @@ if (typeof wx !== 'undefined') {
225 setTimeout(function() { 225 setTimeout(function() {
226 var len = $('.good-info', '.goods-list').length; 226 var len = $('.good-info', '.goods-list').length;
227 var ids = []; 227 var ids = [];
  228 + var check = location.pathname.indexOf('quanyi') === -1;
228 229
229 $('.good-info', '.goods-list').each(function() { 230 $('.good-info', '.goods-list').each(function() {
230 var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g'); 231 var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g');
@@ -233,41 +234,55 @@ setTimeout(function() { @@ -233,41 +234,55 @@ setTimeout(function() {
233 ids.push(goodid); 234 ids.push(goodid);
234 }); 235 });
235 236
236 - if (window._yas && window._yas.sendCustomInfo) { 237 + if (check && window._yas && window._yas.sendCustomInfo) {
237 window._yas.sendCustomInfo({ 238 window._yas.sendCustomInfo({
238 op: 'YB_STUDENT_VIP_GDS_LIST', 239 op: 'YB_STUDENT_VIP_GDS_LIST',
239 - param: { 240 + param: JSON.stringify({
240 C_ID: C_ID, 241 C_ID: C_ID,
241 PRD_NUM: len, 242 PRD_NUM: len,
242 PRD_ID: ids.join(','), 243 PRD_ID: ids.join(','),
243 ACTION_ID: 0, 244 ACTION_ID: 0,
244 SORT_TYPE: 4, 245 SORT_TYPE: 4,
245 REC_ID: uuid(40) + '0000' 246 REC_ID: uuid(40) + '0000'
246 - } 247 + }),
247 }, true); 248 }, true);
248 } 249 }
249 if ($('.s-verify-fail').size()) { 250 if ($('.s-verify-fail').size()) {
250 if (window._yas && window._yas.sendCustomInfo) { 251 if (window._yas && window._yas.sendCustomInfo) {
251 window._yas.sendCustomInfo({ 252 window._yas.sendCustomInfo({
252 op: 'YB_STUDENT_ATTCT_RESULT', 253 op: 'YB_STUDENT_ATTCT_RESULT',
253 - param: { 254 + param: JSON.stringify({
254 C_ID: C_ID, 255 C_ID: C_ID,
255 SRC_ID: 5, 256 SRC_ID: 5,
256 - ATTCT_RES: 1,  
257 - FAILURE_CAUSE: ''  
258 - } 257 + ATTCT_RES: 2,
  258 + FAILURE_CAUSE: $('.s-verify-fail').attr('prompt'),
  259 + }),
259 }, true); 260 }, true);
260 } 261 }
261 - } else {  
262 - // 埋点 学生营销宣传首页 262 + } else if ($('.s-verify-success').size()) {
263 if (window._yas && window._yas.sendCustomInfo) { 263 if (window._yas && window._yas.sendCustomInfo) {
264 window._yas.sendCustomInfo({ 264 window._yas.sendCustomInfo({
265 - op: 'YB_STUDENT_HOME',  
266 - param: {  
267 - C_ID: C_ID  
268 - } 265 + op: 'YB_STUDENT_ATTCT_RESULT',
  266 + param: JSON.stringify({
  267 + C_ID: C_ID,
  268 + SRC_ID: 5,
  269 + ATTCT_RES: 1,
  270 + FAILURE_CAUSE: '',
  271 + ATTCT_INFO: '{{info}}',
  272 + }).replace('{{info}}', localStorage.STUDENTCOOKIES),
269 }, true); 273 }, true);
270 } 274 }
  275 + } else {
  276 +
  277 + // 埋点 学生营销宣传首页
  278 + // if (window._yas && window._yas.sendCustomInfo) {
  279 + // window._yas.sendCustomInfo({
  280 + // op: 'YB_STUDENT_HOME',
  281 + // param: JSON.stringify({
  282 + // C_ID: C_ID
  283 + // }),
  284 + // }, true);
  285 + // }
271 } 286 }
272 287
273 }, 3000); 288 }, 3000);
@@ -284,14 +299,14 @@ $('.swiper-slide', '.banner-top').click(function() { @@ -284,14 +299,14 @@ $('.swiper-slide', '.banner-top').click(function() {
284 299
285 options = { 300 options = {
286 op: 'YB_STUDENT_VIP_FLR', 301 op: 'YB_STUDENT_VIP_FLR',
287 - param: { 302 + param: JSON.stringify({
288 C_ID: C_ID, 303 C_ID: C_ID,
289 F_ID: tid || 1, 304 F_ID: tid || 1,
290 F_NAME: '焦点图', 305 F_NAME: '焦点图',
291 - F_URL: url, 306 + F_URL: encodeURIComponent(url),
292 F_INDEX: 1, 307 F_INDEX: 1,
293 I_INDEX: index 308 I_INDEX: index
294 - } 309 + }),
295 }; 310 };
296 if (window._yas && window._yas.sendCustomInfo) { 311 if (window._yas && window._yas.sendCustomInfo) {
297 window._yas.sendCustomInfo(options, true); 312 window._yas.sendCustomInfo(options, true);
@@ -299,24 +314,47 @@ $('.swiper-slide', '.banner-top').click(function() { @@ -299,24 +314,47 @@ $('.swiper-slide', '.banner-top').click(function() {
299 314
300 // return false; 315 // return false;
301 }); 316 });
302 -$('.s-activity', '.s-section').click(function() { 317 +
  318 +// 学生活动页楼层埋点
  319 +$('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function() {
303 var options; 320 var options;
304 var url = $(this).attr('href'); 321 var url = $(this).attr('href');
305 var index = $(this).index(); 322 var index = $(this).index();
306 var tid = $(this).parents('.s-section').data('template-id'); 323 var tid = $(this).parents('.s-section').data('template-id');
  324 + var obj = {
  325 + 's-activity': {
  326 + fname: '学生专属活动',
  327 + findex: 4,
  328 + iindex: index,
  329 + },
  330 + 'more iconfont': {
  331 + fname: '领券中心',
  332 + findex: 3,
  333 + iindex: 0,
  334 + },
  335 + 'main-left': {
  336 + fname: '领券中心',
  337 + findex: 3,
  338 + iindex: $(this).parent().parent().index(),
  339 + },
  340 + 'more s-quan': {
  341 + fname: '学生权益',
  342 + findex: 2,
  343 + iindex: 0,
  344 + },
  345 + }[$(this).attr('class')];
307 346
308 options = { 347 options = {
309 op: 'YB_STUDENT_VIP_FLR', 348 op: 'YB_STUDENT_VIP_FLR',
310 - param: { 349 + param: JSON.stringify({
311 C_ID: C_ID, 350 C_ID: C_ID,
312 F_ID: tid, 351 F_ID: tid,
313 - F_NAME: '学生专属活动',  
314 - F_URL: url,  
315 - F_INDEX: 3,  
316 - I_INDEX: index  
317 - } 352 + F_NAME: obj.fname,
  353 + F_URL: encodeURIComponent(url),
  354 + F_INDEX: obj.findex,
  355 + I_INDEX: obj.iindex,
  356 + }),
318 }; 357 };
319 -  
320 if (window._yas && window._yas.sendCustomInfo) { 358 if (window._yas && window._yas.sendCustomInfo) {
321 window._yas.sendCustomInfo(options, true); 359 window._yas.sendCustomInfo(options, true);
322 } 360 }
@@ -330,14 +368,13 @@ $('.good-info', '.goods-list').click(function() { @@ -330,14 +368,13 @@ $('.good-info', '.goods-list').click(function() {
330 368
331 options = { 369 options = {
332 op: 'YB_STUDENT_VIP_GDS_LIST', 370 op: 'YB_STUDENT_VIP_GDS_LIST',
333 - param: { 371 + param: JSON.stringify({
334 C_ID: C_ID, 372 C_ID: C_ID,
335 PRD_NUM: index, 373 PRD_NUM: index,
336 PRD_ID: goodid, 374 PRD_ID: goodid,
337 ACTION_ID: 1, 375 ACTION_ID: 1,
338 - SORT_TYPE: 4,  
339 REC_ID: uuid(40) + '0000' 376 REC_ID: uuid(40) + '0000'
340 - } 377 + }),
341 }; 378 };
342 if (window._yas && window._yas.sendCustomInfo) { 379 if (window._yas && window._yas.sendCustomInfo) {
343 window._yas.sendCustomInfo(options, true); 380 window._yas.sendCustomInfo(options, true);
@@ -345,16 +382,14 @@ $('.good-info', '.goods-list').click(function() { @@ -345,16 +382,14 @@ $('.good-info', '.goods-list').click(function() {
345 }); 382 });
346 $('.s-renzhen').click(function() { 383 $('.s-renzhen').click(function() {
347 var options = { 384 var options = {
348 - op: 'YB_STUDENT_ATTCT_SUBMIT',  
349 - param: { 385 + op: 'YB_STUDENT_ATTCT_INFO',
  386 + param: JSON.stringify({
350 C_ID: C_ID, 387 C_ID: C_ID,
351 SRC_ID: 1 388 SRC_ID: 1
352 - } 389 + }),
353 }; 390 };
354 391
355 if (window._yas && window._yas.sendCustomInfo) { 392 if (window._yas && window._yas.sendCustomInfo) {
356 window._yas.sendCustomInfo(options, true); 393 window._yas.sendCustomInfo(options, true);
357 } 394 }
358 }); 395 });
359 -  
360 -