Showing
1 changed file
with
13 additions
and
10 deletions
@@ -18,8 +18,6 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), | @@ -18,8 +18,6 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), | ||
18 | 18 | ||
19 | var $cart = $('.cart-bar'); | 19 | var $cart = $('.cart-bar'); |
20 | 20 | ||
21 | -var limitSaleHammer = (limitSaleHammer = document.getElementById('limit-sale')) && new Hammer(limitSaleHammer); | ||
22 | - | ||
23 | var appUrl = $('input[name="limitCodeUrl"]').val(); | 21 | var appUrl = $('input[name="limitCodeUrl"]').val(); |
24 | 22 | ||
25 | var dialog = require('../../me/dialog'); | 23 | var dialog = require('../../me/dialog'); |
@@ -84,6 +82,7 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { | @@ -84,6 +82,7 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { | ||
84 | 82 | ||
85 | $('#limit-sale').on('touchend', function(e) { | 83 | $('#limit-sale').on('touchend', function(e) { |
86 | var loginUrl = $('#loginUrl').val(), | 84 | var loginUrl = $('#loginUrl').val(), |
85 | + time, | ||
87 | ifr; | 86 | ifr; |
88 | 87 | ||
89 | e.stopPropagation(); | 88 | e.stopPropagation(); |
@@ -97,15 +96,19 @@ $('#limit-sale').on('touchend', function(e) { | @@ -97,15 +96,19 @@ $('#limit-sale').on('touchend', function(e) { | ||
97 | rightBtnText: '打开Yoho!Buy有货APP' | 96 | rightBtnText: '打开Yoho!Buy有货APP' |
98 | } | 97 | } |
99 | }, function() { | 98 | }, function() { |
100 | - ifr = document.createElement('iframe'); | ||
101 | - ifr.src = appUrl; | ||
102 | - ifr.style.display = 'none'; | ||
103 | - document.body.appendChild(ifr); | ||
104 | - window.location.href = appUrl; | ||
105 | - window.setTimeout(function(){ | ||
106 | - document.body.removeChild(ifr); | 99 | + ifr = document.createElement('iframe'); |
100 | + ifr.src = appUrl; | ||
101 | + ifr.style.display = 'none'; | ||
102 | + document.body.appendChild(ifr); | ||
103 | + window.location.href = appUrl; | ||
104 | + | ||
105 | + time = Date.now(); | ||
106 | + window.setTimeout(function() { | ||
107 | + document.body.removeChild(ifr); | ||
108 | + if (Date.now()- time < 3200) { | ||
107 | window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho'; | 109 | window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho'; |
108 | - },3000); | 110 | + } |
111 | + }, 3000); | ||
109 | 112 | ||
110 | }, undefined, true); | 113 | }, undefined, true); |
111 | 114 |
-
Please register or login to post a comment