Authored by weiqingting

埋点问题

@@ -13,7 +13,7 @@ var _weChatInterface = '//m.yohobuy.com/life/getSignPackage', @@ -13,7 +13,7 @@ var _weChatInterface = '//m.yohobuy.com/life/getSignPackage',
13 13
14 require('../common'); 14 require('../common');
15 15
16 -getChannel = function functionName() { 16 +getChannel = function() {
17 var name = window.cookie('_Channel'); 17 var name = window.cookie('_Channel');
18 18
19 return { 19 return {
@@ -25,6 +25,24 @@ getChannel = function functionName() { @@ -25,6 +25,24 @@ getChannel = function functionName() {
25 }; 25 };
26 C_ID = getChannel(); 26 C_ID = getChannel();
27 27
  28 +function uuid() {
  29 + var s = [];
  30 + var hexDigits = '0123456789abcdef';
  31 + var id = '';
  32 + var i = 0;
  33 +
  34 + for (i = 0; i < 36; i++) {
  35 + s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
  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
  39 + s[8] = s[13] = s[18] = s[23] = '-';
  40 +
  41 + id = s.join('');
  42 +
  43 + return id;
  44 +}
  45 +
28 46
29 fastclick.attach(document.body); 47 fastclick.attach(document.body);
30 lazyLoad($('img.lazy')); 48 lazyLoad($('img.lazy'));
@@ -211,6 +229,7 @@ setTimeout(function() { @@ -211,6 +229,7 @@ setTimeout(function() {
211 $('.good-info', '.goods-list').each(function() { 229 $('.good-info', '.goods-list').each(function() {
212 var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g'); 230 var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g');
213 var goodid = goodids && goodids.length === 2 ? goodids[1] : ''; 231 var goodid = goodids && goodids.length === 2 ? goodids[1] : '';
  232 +
214 ids.push(goodid); 233 ids.push(goodid);
215 }); 234 });
216 235
@@ -254,19 +273,7 @@ setTimeout(function() { @@ -254,19 +273,7 @@ setTimeout(function() {
254 }, 3000); 273 }, 3000);
255 274
256 275
257 -function uuid() {  
258 - var s = [];  
259 - var hexDigits = '0123456789abcdef';  
260 - for (var i = 0; i < 36; i++) {  
261 - s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);  
262 - }  
263 - s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010  
264 - s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01  
265 - s[8] = s[13] = s[18] = s[23] = '-';  
266 276
267 - var uuid = s.join('');  
268 - return uuid;  
269 -}  
270 277
271 278
272 $('.swiper-slide', '.banner-top').click(function() { 279 $('.swiper-slide', '.banner-top').click(function() {
@@ -309,6 +316,7 @@ $('.s-activity', '.s-section').click(function() { @@ -309,6 +316,7 @@ $('.s-activity', '.s-section').click(function() {
309 I_INDEX: index 316 I_INDEX: index
310 } 317 }
311 }; 318 };
  319 +
312 if (window._yas && window._yas.sendCustomInfo) { 320 if (window._yas && window._yas.sendCustomInfo) {
313 window._yas.sendCustomInfo(options, true); 321 window._yas.sendCustomInfo(options, true);
314 } 322 }
@@ -343,6 +351,7 @@ $('.s-renzhen').click(function() { @@ -343,6 +351,7 @@ $('.s-renzhen').click(function() {
343 SRC_ID: 1 351 SRC_ID: 1
344 } 352 }
345 }; 353 };
  354 +
346 if (window._yas && window._yas.sendCustomInfo) { 355 if (window._yas && window._yas.sendCustomInfo) {
347 window._yas.sendCustomInfo(options, true); 356 window._yas.sendCustomInfo(options, true);
348 } 357 }