Showing
1 changed file
with
10 additions
and
6 deletions
@@ -11,15 +11,19 @@ var qrCheck = { | @@ -11,15 +11,19 @@ var qrCheck = { | ||
11 | 11 | ||
12 | init: function() { | 12 | init: function() { |
13 | var ifr, | 13 | var ifr, |
14 | - | ||
15 | - // time, | 14 | + u = navigator.userAgent.toLowerCase(), |
15 | + isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1, | ||
16 | qr = this.getQuery('qr'); | 16 | qr = this.getQuery('qr'); |
17 | 17 | ||
18 | if (qr) { | 18 | if (qr) { |
19 | - ifr = document.createElement('iframe'); | ||
20 | - ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr; | ||
21 | - ifr.style.display = 'none'; | ||
22 | - document.body.appendChild(ifr); | 19 | + if (isiOS) { |
20 | + window.location = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr; | ||
21 | + } else { | ||
22 | + ifr = document.createElement('iframe'); | ||
23 | + ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr; | ||
24 | + ifr.style.display = 'none'; | ||
25 | + document.body.appendChild(ifr); | ||
26 | + } | ||
23 | 27 | ||
24 | // time = Date.now(); | 28 | // time = Date.now(); |
25 | // window.setTimeout(function() { | 29 | // window.setTimeout(function() { |
-
Please register or login to post a comment