Authored by ccbikai(👎🏻🍜)

延迟上报时间

@@ -13,7 +13,7 @@ const iOSVersion = parseInt((u.match(/OS (\d+)_(\d+)_?(\d+)?/i) || [])[1], 10); @@ -13,7 +13,7 @@ const iOSVersion = parseInt((u.match(/OS (\d+)_(\d+)_?(\d+)?/i) || [])[1], 10);
13 13
14 const nodownload = document.getElementById('no-download'); // 页面不需要下载 14 const nodownload = document.getElementById('no-download'); // 页面不需要下载
15 const urlBlacklist = ['m.yohobuy.com/brands', 'm.yohobuy.com/passport']; 15 const urlBlacklist = ['m.yohobuy.com/brands', 'm.yohobuy.com/passport'];
16 -const blackCheck = urlBlacklist.some(function (url) { 16 +const blackCheck = urlBlacklist.some(function(url) {
17 return new RegExp(url, 'i').test(location.href); 17 return new RegExp(url, 'i').test(location.href);
18 }); 18 });
19 19
@@ -40,19 +40,21 @@ if (canOpenApp()) { @@ -40,19 +40,21 @@ if (canOpenApp()) {
40 let appPath = getAppPath(); 40 let appPath = getAppPath();
41 let ifr; 41 let ifr;
42 42
43 - if (window._yas && window._yas.sendCustomInfo) {  
44 - window._yas.sendCustomInfo({  
45 - op: 'YB_H5_AWAKE_APP',  
46 - param: JSON.stringify({  
47 - PAGE_NAME: encodeURIComponent(document.title),  
48 - PAGE_URL: encodeURIComponent(location.href)  
49 - })  
50 - }, true);  
51 - } 43 + setTimeout(function() {
  44 + if (window._yas && window._yas.sendCustomInfo) {
  45 + window._yas.sendCustomInfo({
  46 + op: 'YB_H5_AWAKE_APP',
  47 + param: JSON.stringify({
  48 + PAGE_NAME: encodeURIComponent(document.title),
  49 + PAGE_URL: encodeURIComponent(location.href)
  50 + })
  51 + }, true);
  52 + }
52 53
53 - if (window._hmt && window._hmt.push) {  
54 - window._hmt.push(['_trackEvent', 'H5唤起APP', isiOS ? 'Apple' : 'Android', document.title, location.href]);  
55 - } 54 + if (window._hmt && window._hmt.push) {
  55 + window._hmt.push(['_trackEvent', 'H5唤起APP', isiOS ? 'Apple' : 'Android', document.title, location.href]);
  56 + }
  57 + }, 2000);
56 58
57 if (isiOS) { 59 if (isiOS) {
58 window.location.href = appPath; 60 window.location.href = appPath;