Authored by ccbikai(👎🏻🍜)

唤起规则调整

@@ -15,12 +15,20 @@ const getAppPath = () => { @@ -15,12 +15,20 @@ const getAppPath = () => {
15 }; 15 };
16 16
17 const u = navigator.userAgent; 17 const u = navigator.userAgent;
18 -const isAndroid = u.indexOf('Android') > -1; // android终端 18 +const isFromYOHO = /m\.yohobuy\.com/i.test(document.referrer);
19 const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端 19 const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
20 -const iOSVersion = parseInt(u.match(/OS (\d+)_(\d+)_?(\d+)?/i)[1], 10);  
21 20
  21 +// const isAndroid = u.indexOf('Android') > -1; // android终端
  22 +// const iOSVersion = parseInt(u.match(/OS (\d+)_(\d+)_?(\d+)?/i)[1], 10);
22 23
23 -if (isAndroid || iOSVersion < 9) { 24 +
  25 +/*
  26 + 2.13 日要求,暂时不管通用链接,所有情况都尝试唤起 App
  27 +
  28 + isAndroid || iOSVersion < 9 将来配合 通用链接使用
  29 +*/
  30 +
  31 +if (!isFromYOHO) {
24 let appPath = getAppPath(); 32 let appPath = getAppPath();
25 let ifr; 33 let ifr;
26 34
@@ -33,4 +41,3 @@ if (isAndroid || iOSVersion < 9) { @@ -33,4 +41,3 @@ if (isAndroid || iOSVersion < 9) {
33 document.body.appendChild(ifr); 41 document.body.appendChild(ifr);
34 } 42 }
35 } 43 }
36 -