Showing
2 changed files
with
431 additions
and
12 deletions
@@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
49 | 49 | ||
50 | 50 | ||
51 | <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/5.3.20/common.css"> | 51 | <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/5.3.20/common.css"> |
52 | - <link rel="stylesheet" media="all" href="/app-downloads.html/cdn.yoho.cn/m-yohobuy-node/5.3.20/activity.app-downloads.css"> | 52 | + <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/5.3.20/activity.app-downloads.css"> |
53 | <link rel="apple-touch-icon-precomposed" | 53 | <link rel="apple-touch-icon-precomposed" |
54 | href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png"> | 54 | href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png"> |
55 | <link rel="apple-touch-startup-image" sizes="640x920" | 55 | <link rel="apple-touch-startup-image" sizes="640x920" |
@@ -217,10 +217,6 @@ | @@ -217,10 +217,6 @@ | ||
217 | var openTime = +new Date(); | 217 | var openTime = +new Date(); |
218 | 218 | ||
219 | window.setTimeout(function () { | 219 | window.setTimeout(function () { |
220 | - if(document.hidden) { | ||
221 | - return false; | ||
222 | - } | ||
223 | - | ||
224 | if (ifr) { | 220 | if (ifr) { |
225 | document.body.removeChild(ifr); | 221 | document.body.removeChild(ifr); |
226 | } | 222 | } |
@@ -242,14 +238,12 @@ | @@ -242,14 +238,12 @@ | ||
242 | 238 | ||
243 | if (isiOS) { | 239 | if (isiOS) { |
244 | window.location.href = appPath; | 240 | window.location.href = appPath; |
241 | + } else { | ||
242 | + ifr = document.createElement('iframe'); | ||
243 | + ifr.src = appPath; | ||
244 | + ifr.style.display = 'none'; | ||
245 | + document.body.appendChild(ifr); | ||
245 | } | 246 | } |
246 | - | ||
247 | - // else { | ||
248 | - // ifr = document.createElement('iframe'); | ||
249 | - // ifr.src = appPath; | ||
250 | - // ifr.style.display = 'none'; | ||
251 | - // document.body.appendChild(ifr); | ||
252 | - // } | ||
253 | } | 247 | } |
254 | 248 | ||
255 | //1: 男生,2-女生,3-潮童,4-创意生活 | 249 | //1: 男生,2-女生,3-潮童,4-创意生活 |
web/src/main/webapp/app-downloadss.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <title>Yoho!Buy有货|年轻人潮流购物中心,中国潮流购物风向标</title> | ||
6 | + <meta name="keywords" | ||
7 | + content="Yoho!Buy有货 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> | ||
8 | + <meta name="description" content="Yoho!Buy有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。"> | ||
9 | + <meta name="viewport" | ||
10 | + content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
11 | + <meta http-equiv="cleartype" content="on"> | ||
12 | + <meta name="apple-mobile-web-app-status-bar-style" content="black"/> | ||
13 | + <meta content="telephone=no" name="format-detection"/> | ||
14 | + <meta content="email=no" name="format-detection"/> | ||
15 | + <link rel="dns-prefetch" href="//cdn.yoho.cn"> | ||
16 | + <link rel="dns-prefetch" href="//static.yohobuy.com"> | ||
17 | + <link rel="dns-prefetch" href="//img10.static.yhbimg.com"> | ||
18 | + <link rel="dns-prefetch" href="//img11.static.yhbimg.com"> | ||
19 | + <link rel="dns-prefetch" href="//img12.static.yhbimg.com"> | ||
20 | + <link rel="dns-prefetch" href="//img13.static.yhbimg.com"> | ||
21 | + <link rel="dns-prefetch" href="//analytics.m.yohobuy.com"> | ||
22 | + <link rel="dns-prefetch" href="//search.m.yohobuy.com"> | ||
23 | + <link rel="dns-prefetch" href="//list.m.yohobuy.com"> | ||
24 | + <link rel="dns-prefetch" href="//guang.m.yohobuy.com"> | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + <script type="text/javascript"> | ||
29 | + (function (d, c) { | ||
30 | + var e = d.documentElement, a = "orientationchange" in window ? "orientationchange" : "resize", b = function () { | ||
31 | + var f = e.clientWidth; | ||
32 | + if (!f) { | ||
33 | + return | ||
34 | + } | ||
35 | + if (f >= 640) { | ||
36 | + e.style.fontSize = "40px" | ||
37 | + } else { | ||
38 | + e.style.fontSize = 40 * (f / 640) + "px" | ||
39 | + } | ||
40 | + }; | ||
41 | + if (!d.addEventListener) { | ||
42 | + return | ||
43 | + } | ||
44 | + b(); | ||
45 | + c.addEventListener(a, b, false); | ||
46 | + d.addEventListener("DOMContentLoaded", b, false) | ||
47 | + })(document, window); | ||
48 | + </script> | ||
49 | + | ||
50 | + | ||
51 | + <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/5.3.20/common.css"> | ||
52 | + <link rel="stylesheet" media="all" href="/app-downloadss.html/cdn.yoho.cn/m-yohobuy-node/5.3.20/activity.app-downloads.css"> | ||
53 | + <link rel="apple-touch-icon-precomposed" | ||
54 | + href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png"> | ||
55 | + <link rel="apple-touch-startup-image" sizes="640x920" | ||
56 | + href="//static.yohobuy.com/m/v1/img/startup/startup-retina.png" | ||
57 | + media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)"> | ||
58 | + <link rel="apple-touch-startup-image" sizes="320x460" href="//static.yohobuy.com/m/v1/img/startup/startup.png" | ||
59 | + media="screen and (max-device-width: 320)"> | ||
60 | +</head> | ||
61 | +<body class=" "> | ||
62 | +<div class="main-wrap" id="main-wrap"> | ||
63 | + | ||
64 | + | ||
65 | + <div class="container"> | ||
66 | + <div id="no-download"></div> | ||
67 | + <div class="banner"></div> | ||
68 | + <div class="main"> | ||
69 | + <div class="slide-box"> | ||
70 | + <div class="swiper-wrapper clearfix"> | ||
71 | + <div class="yohobuy" tag="0"> | ||
72 | + <div class="swiper-yohobuy bg"></div> | ||
73 | + <div class="ewm-area"> | ||
74 | + <img src="//cdn.yoho.cn/yohocn/160315/images/ewm-yohobuy.png"/> | ||
75 | + <div class="ewm-info"></div> | ||
76 | + </div> | ||
77 | + <span id="download" class="download-btn" onclick="evokeDown();">点击下载 · Yoho!Buy有货</span> | ||
78 | + </div> | ||
79 | + </div> | ||
80 | + </div> | ||
81 | + <div class="slide-pagination clearfix"> | ||
82 | + </div> | ||
83 | + </div> | ||
84 | + <div class="footer"> | ||
85 | + CopyRight © 2007-2017 YOHO!新力传媒 | ||
86 | + </div> | ||
87 | + <div class="mask"> | ||
88 | + <div class="wx-img1"></div> | ||
89 | + <div class="wx-img2"></div> | ||
90 | + <div class="wx-img3"></div> | ||
91 | + </div> | ||
92 | + </div> | ||
93 | + | ||
94 | + | ||
95 | +</div> | ||
96 | + | ||
97 | +<script>var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/m-yohobuy-node/assets';</script> | ||
98 | +<script src="//cdn.yoho.cn/m-yohobuy-node/5.3.20/libs.js"></script> | ||
99 | +<!--<script src="//cdn.yoho.cn/m-yohobuy-node/5.3.20/activity.app-downloads.js"></script>--> | ||
100 | +<script type="text/javascript"> | ||
101 | + function cookie(name) { | ||
102 | + var cookies = document.cookie, | ||
103 | + cookieVal; | ||
104 | + | ||
105 | + if (cookies) { | ||
106 | + cookies = cookies.split(';'); | ||
107 | + cookies.forEach(function (c) { | ||
108 | + if (c.indexOf(name) > -1) { | ||
109 | + cookieVal = decodeURIComponent($.trim(c.replace(name + '=', ''))); | ||
110 | + return; | ||
111 | + } | ||
112 | + }); | ||
113 | + } | ||
114 | + | ||
115 | + return cookieVal; | ||
116 | + } | ||
117 | + | ||
118 | + function queryString() { | ||
119 | + var vars = {}, | ||
120 | + hash, | ||
121 | + i; | ||
122 | + var hashes = window.location.search.slice(1).split('&'); | ||
123 | + | ||
124 | + for (i = 0; i < hashes.length; i++) { | ||
125 | + hash = hashes[i].split('='); | ||
126 | + vars[hash[0]] = hash[1]; | ||
127 | + } | ||
128 | + return vars; | ||
129 | + } | ||
130 | + | ||
131 | + | ||
132 | + function xhrGet(url, cb) { | ||
133 | + var conn = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); | ||
134 | + conn.onreadystatechange = function () { | ||
135 | + if (conn.readyState == 4 && conn.status == 200) { | ||
136 | + cb(conn.responseText) | ||
137 | + } | ||
138 | + }; | ||
139 | + conn.open("GET", url, true); | ||
140 | + conn.send(); | ||
141 | + } | ||
142 | + | ||
143 | + window.cookie = cookie; | ||
144 | + | ||
145 | + var params = queryString(); | ||
146 | + | ||
147 | + var openbyYohobuy = decodeURIComponent(params['openby:yohobuy'] || '') || '{"action":"go.home","params":{"gender":"1","channel":"2"}}'; | ||
148 | + | ||
149 | + var url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy=' + openbyYohobuy; | ||
150 | + var isWechat = /micromessenger/i.test(navigator.userAgent || ''); | ||
151 | + | ||
152 | + if(isWechat){ | ||
153 | + url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | ||
154 | + location.href = url; | ||
155 | + } | ||
156 | + | ||
157 | + var u = navigator.userAgent.toLowerCase(); | ||
158 | + var isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1; | ||
159 | + | ||
160 | + var androidExp = new RegExp('MQQBrowser');//安卓QQ内置浏览器正则 | ||
161 | + var isAndroidQQ = androidExp.test(navigator.userAgent); //判断是不是QQ内置浏览器 | ||
162 | + | ||
163 | + var version, type, appid, td; | ||
164 | + | ||
165 | + var isApp = /yohobuy/i.test(navigator.userAgent); | ||
166 | + | ||
167 | + if(params.union_type){ | ||
168 | + url = 'yohobuy://yohobuy.com/goapp?ct='+params.union_type+'&openby:yohobuy=' + openbyYohobuy; | ||
169 | + } | ||
170 | + | ||
171 | + if (isiOS) { | ||
172 | + var regStr_saf = /os [\d._]*/gi; | ||
173 | + var verinfo = u.match(regStr_saf); | ||
174 | + | ||
175 | + version = (verinfo + '').replace(/[^0-9|_.]/ig, '').replace(/_/ig, '.'); | ||
176 | + type = 'ios'; | ||
177 | + appid = '490655927'; | ||
178 | + td = window.screen.width + '_' + window.screen.height + '_' + type + '_' + version; | ||
179 | + | ||
180 | + } else if (u.indexOf('android') > -1 || u.indexOf('linux') > -1) { | ||
181 | + type = 'android'; | ||
182 | + appid = 'com.yoho'; | ||
183 | + try { | ||
184 | + var indextd = u.indexOf('_td'); | ||
185 | + var index = u.indexOf(' build'); | ||
186 | + var preString = ''; | ||
187 | + | ||
188 | + if (indextd > -1) { | ||
189 | + preString = u.substr(0, indextd); | ||
190 | + preString = preString.substr(preString.lastIndexOf(";") + 1); | ||
191 | + preString = preString.replace(/\s+/g, '').replace(/_/ig, ''); | ||
192 | + | ||
193 | + var sansungIndex = preString.indexOf('samsung-'); | ||
194 | + if (sansungIndex > -1) { | ||
195 | + preString = preString.substr(8); | ||
196 | + } | ||
197 | + } else if (index > -1) { | ||
198 | + preString = u.substr(0, index); | ||
199 | + preString = preString.substr(preString.lastIndexOf(";") + 1); | ||
200 | + preString = preString.replace(/\s+/g, '').replace(/_/ig, ''); | ||
201 | + //alert(preString); | ||
202 | + } | ||
203 | + deviceType = preString; | ||
204 | + version = u.substr(u.indexOf('android') + 8, 3); | ||
205 | + td = deviceType + '_' + type + '_' + version; | ||
206 | + } catch (e) { | ||
207 | + | ||
208 | + } | ||
209 | + } | ||
210 | + | ||
211 | + | ||
212 | + var appPath = url; | ||
213 | + var ifr; | ||
214 | + | ||
215 | + function evokeDown() { | ||
216 | + //记录唤醒时间 | ||
217 | + var openTime = +new Date(); | ||
218 | + | ||
219 | + window.setTimeout(function () { | ||
220 | + if(document.hidden) { | ||
221 | + return false; | ||
222 | + } | ||
223 | + | ||
224 | + if (ifr) { | ||
225 | + document.body.removeChild(ifr); | ||
226 | + } | ||
227 | + | ||
228 | + //如果setTimeout 回调超过2500ms,则弹出下载 | ||
229 | + if ((+new Date()) - openTime > 500 && !isApp) { | ||
230 | + if (isiOS) { | ||
231 | + url = '//itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8'; | ||
232 | + } else { | ||
233 | + url = '//yoho-apps.qiniudn.com/YohoBuy_YOHO.apk'; | ||
234 | + } | ||
235 | + | ||
236 | + unionClick(); | ||
237 | + | ||
238 | + location.href = url; | ||
239 | + // window.open(url); | ||
240 | + } | ||
241 | + }, 1000); | ||
242 | + | ||
243 | + if (isiOS) { | ||
244 | + window.location.href = appPath; | ||
245 | + } | ||
246 | + | ||
247 | + // else { | ||
248 | + // ifr = document.createElement('iframe'); | ||
249 | + // ifr.src = appPath; | ||
250 | + // ifr.style.display = 'none'; | ||
251 | + // document.body.appendChild(ifr); | ||
252 | + // } | ||
253 | + } | ||
254 | + | ||
255 | + //1: 男生,2-女生,3-潮童,4-创意生活 | ||
256 | + var CHANNELS = { | ||
257 | + boys: 1, | ||
258 | + girls: 2, | ||
259 | + kids: 3, | ||
260 | + lifestyle: 4 | ||
261 | + }; | ||
262 | + | ||
263 | + function downloadApp() { | ||
264 | + var url; | ||
265 | + var channel = window.cookie('_Channel'); | ||
266 | + | ||
267 | + if(isWechat){ | ||
268 | + url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | ||
269 | + }else{ | ||
270 | + if (isiOS) { | ||
271 | + url = '//itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8'; | ||
272 | + } else { | ||
273 | + if(isAndroidQQ){ //安卓qq处理方式同微信,也进入应用宝下载 | ||
274 | + url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | ||
275 | + }else{ | ||
276 | + url = '//yoho-apps.qiniudn.com/YohoBuy_YOHO.apk'; | ||
277 | + } | ||
278 | + } | ||
279 | + } | ||
280 | + | ||
281 | + // 上报 nginx 数据 | ||
282 | + xhrGet('//m.yohobuy.com/activitylog.json?download2', function () { | ||
283 | + }); | ||
284 | + | ||
285 | + // 上报 yas 数据 | ||
286 | + if (typeof _yas !== 'undefined') { | ||
287 | + _yas.sendCustomInfo && _yas.sendCustomInfo({ | ||
288 | + op: 'YB_DOWNLOAD_C', | ||
289 | + param: JSON.stringify({ | ||
290 | + C_ID: CHANNELS[channel], | ||
291 | + TO_URL: encodeURIComponent(url) | ||
292 | + }) | ||
293 | + }, true); | ||
294 | + } | ||
295 | + | ||
296 | + // 联盟点击 | ||
297 | + if (params.union_type) { | ||
298 | + unionClick(); | ||
299 | + } | ||
300 | + | ||
301 | + location.href = url; | ||
302 | + } | ||
303 | + | ||
304 | + function unionClick() { | ||
305 | + var unionUrl = 'https://union.yoho.cn/union/ClickUnionRest/addUnion?client_type=' + type; | ||
306 | +// var unionUrl = 'http://127.0.0.1:8088/union/ClickUnionRest/addUnion?client_type=' + type; | ||
307 | + if (params.union_type) { | ||
308 | + unionUrl += '&union_type=' + params.union_type; | ||
309 | + } | ||
310 | + if (params.identify_id) { | ||
311 | + unionUrl += '&identify_id=' + params.identify_id; | ||
312 | + } | ||
313 | + if (params.callbackurl) { | ||
314 | + unionUrl += '&callbackurl=' + params.callbackurl; | ||
315 | + } | ||
316 | + if (params.td) { | ||
317 | + unionUrl += '&td=' + params.td; | ||
318 | + } else { | ||
319 | + unionUrl += '&td=' + td; | ||
320 | + } | ||
321 | + if (params.appid) { | ||
322 | + unionUrl += '&appid=' + params.appid; | ||
323 | + } else { | ||
324 | + unionUrl += '&appid=' + appid; | ||
325 | + } | ||
326 | + if (params.idfa) { | ||
327 | + unionUrl += '&idfa=' + params.idfa; | ||
328 | + } else if (params.IDFA) { | ||
329 | + unionUrl += '&idfa=' + params.IDFA; | ||
330 | + } | ||
331 | + if (params.imei) { | ||
332 | + unionUrl += '&imei=' + params.imei; | ||
333 | + } else if (params.IMEI) { | ||
334 | + unionUrl += '&imei=' + params.IMEI; | ||
335 | + } | ||
336 | + if(params.invite_code){ | ||
337 | + unionUrl += '&invite_code=' + params.invite_code; | ||
338 | + } | ||
339 | + xhrGet(unionUrl, function () { | ||
340 | + }); | ||
341 | + } | ||
342 | +</script> | ||
343 | +<script> | ||
344 | + (function (w, d, s, j, f) { | ||
345 | + var a = d.createElement(s); | ||
346 | + var m = d.getElementsByTagName(s)[0]; | ||
347 | + | ||
348 | + w.YohoAcquisitionObject = f; | ||
349 | + | ||
350 | + w[f] = function () { | ||
351 | + w[f].p = arguments; | ||
352 | + }; | ||
353 | + | ||
354 | + a.async = 1; | ||
355 | + a.src = j; | ||
356 | + m.parentNode.insertBefore(a, m); | ||
357 | + }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.2.1/yas.js', '_yas')); | ||
358 | + | ||
359 | + var _hmt = _hmt || []; | ||
360 | + | ||
361 | + (function () { | ||
362 | + function getUid() { | ||
363 | + var uid, | ||
364 | + name = '_UID', | ||
365 | + cookies = (document.cookie && document.cookie.split(';')) || []; | ||
366 | + | ||
367 | + cookies.forEach(function (c) { | ||
368 | + if (c.indexOf(name) > -1) { | ||
369 | + uid = decodeURIComponent(c.replace(name + '=', '').trim()); | ||
370 | + return; | ||
371 | + } | ||
372 | + }); | ||
373 | + | ||
374 | + if (!uid) return 0; | ||
375 | + | ||
376 | + uid = uid.split('::'); | ||
377 | + if (!uid || uid.length < 4) { | ||
378 | + return 0; | ||
379 | + } | ||
380 | + return uid[1]; | ||
381 | + } | ||
382 | + | ||
383 | +// function queryString() { | ||
384 | +// var vars = {}, | ||
385 | +// hash, | ||
386 | +// i; | ||
387 | +// var hashes = window.location.search.slice(1).split('&'); | ||
388 | +// | ||
389 | +// for (i = 0; i < hashes.length; i++) { | ||
390 | +// hash = hashes[i].split('='); | ||
391 | +// vars[hash[0]] = hash[1]; | ||
392 | +// } | ||
393 | +// return vars; | ||
394 | +// } | ||
395 | + | ||
396 | + var uid = getUid() || params.uid; | ||
397 | + | ||
398 | + uid = uid === 0 ? '' : uid; | ||
399 | + window._ozuid = uid; // 暴露ozuid | ||
400 | + if (window._yas) { | ||
401 | + window._yas(1 * new Date(), '2.2.1', 'yohobuy_m', uid, '', ''); | ||
402 | + } | ||
403 | + | ||
404 | + // 非登录状态,加载百度统计 | ||
405 | + if (!uid) { | ||
406 | + setTimeout(function () { | ||
407 | + (function () { | ||
408 | + var hm = document.createElement("script"); | ||
409 | + hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841"; | ||
410 | + var s = document.getElementsByTagName("script")[0]; | ||
411 | + s.parentNode.insertBefore(hm, s); | ||
412 | + })(); | ||
413 | + (function () { | ||
414 | + var hm = document.createElement("script"); | ||
415 | + hm.src = "https://hm.baidu.com/hm.js?e5b83a487a4458aa5abca43f5779b764"; | ||
416 | + var s = document.getElementsByTagName("script")[0]; | ||
417 | + s.parentNode.insertBefore(hm, s); | ||
418 | + })(); | ||
419 | + }, 1000); | ||
420 | + } | ||
421 | + }()); | ||
422 | +</script> | ||
423 | + | ||
424 | +</body> | ||
425 | +</html> |
-
Please register or login to post a comment