Showing
3 changed files
with
233 additions
and
2 deletions
@@ -77,9 +77,9 @@ public class ClickUnionRest { | @@ -77,9 +77,9 @@ public class ClickUnionRest { | ||
77 | return response; | 77 | return response; |
78 | } | 78 | } |
79 | 79 | ||
80 | - @RequestMapping("/addUnionFor") | 80 | + @RequestMapping("/addCommonUnion") |
81 | @ResponseBody | 81 | @ResponseBody |
82 | - public UnionResponse addUnionFor(HttpServletRequest httpServletRequest) { | 82 | + public UnionResponse addCommonUnion(HttpServletRequest httpServletRequest) { |
83 | log.info("addUnionForGDT with param is {}", JSON.toJSONString(httpServletRequest.getParameterMap())); | 83 | log.info("addUnionForGDT with param is {}", JSON.toJSONString(httpServletRequest.getParameterMap())); |
84 | clickUnion.info("addUnionForGDT with param is {}", JSON.toJSONString(httpServletRequest.getParameterMap())); | 84 | clickUnion.info("addUnionForGDT with param is {}", JSON.toJSONString(httpServletRequest.getParameterMap())); |
85 | ClickUnionRequestBO bo = new ClickUnionRequestBO(); | 85 | ClickUnionRequestBO bo = new ClickUnionRequestBO(); |
web/src/main/webapp/download.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <title>潮流商品 | YOHO!有货</title> | ||
6 | + <meta name="description" content=""> | ||
7 | + <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script> | ||
8 | + <script type="text/javascript"> | ||
9 | + var agent = navigator.userAgent.toLowerCase() ; | ||
10 | + var version, type, appid, td, queryString, downUrl; | ||
11 | + | ||
12 | + var jumpTypes = [110]; | ||
13 | + | ||
14 | + function isInJump(unionType) { | ||
15 | + for (var i = 0 ;i < jumpTypes.length; i++) { | ||
16 | + if (unionType == jumpTypes[i]) { | ||
17 | + return true; | ||
18 | + } | ||
19 | + } | ||
20 | + return false; | ||
21 | + } | ||
22 | + | ||
23 | + function getQueryString() { | ||
24 | + var vars = [], | ||
25 | + hash, | ||
26 | + i; | ||
27 | + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | ||
28 | + | ||
29 | + for (i = 0; i < hashes.length; i++) { | ||
30 | + hash = hashes[i].split('='); | ||
31 | + vars.push(hash[0]); | ||
32 | + vars[hash[0]] = hash[1]; | ||
33 | + } | ||
34 | + return vars; | ||
35 | + } | ||
36 | + | ||
37 | + queryString = getQueryString(); | ||
38 | + downUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | ||
39 | + //downUrl = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
40 | + var appkey = queryString.appkey; | ||
41 | + | ||
42 | + if (appkey == "yoho") { | ||
43 | + //yohonow | ||
44 | + downUrl = "http://a.app.qq.com/o/simple.jsp?pkgname=cn.yoho.magazine#opened"; | ||
45 | + } else if (appkey == "mars") { | ||
46 | + //mars | ||
47 | + downUrl = "https://itunes.apple.com/cn/app/mars-xin-xian-hao-qu-chu-yu/id1056487123?l=en&mt=8"; | ||
48 | + //downUrl = "http://yoho-apps.qiniudn.com/YohoMars.apk"; | ||
49 | + } | ||
50 | + | ||
51 | + if (agent.indexOf("like mac os x") > 0) { | ||
52 | + var regStr_saf = /os [\d._]*/gi ; | ||
53 | + var verinfo = agent.match(regStr_saf) ; | ||
54 | + | ||
55 | + version = (verinfo+'').replace(/[^0-9|_.]/ig,'').replace(/_/ig, '.'); | ||
56 | + type = 'ios'; | ||
57 | + appid = '490655927'; | ||
58 | + td = window.screen.width + '_' + window.screen.height + '_' + type + '_' + version; | ||
59 | + | ||
60 | + } else if (agent.indexOf('android') > -1 || agent.indexOf('linux') > -1) { | ||
61 | + var indextd = agent.indexOf('_td'); | ||
62 | + var index = agent.indexOf(' build'); | ||
63 | + var preString = ''; | ||
64 | + var deviceType = ''; | ||
65 | + | ||
66 | + //alert(agent); | ||
67 | + if (indextd > -1) { | ||
68 | + preString = agent.substr(0, indextd); | ||
69 | + preString = preString.substr(preString.lastIndexOf(";") + 1); | ||
70 | + preString = preString.replace(/\s+/g,'').replace(/_/ig, ''); | ||
71 | + | ||
72 | + var sansungIndex = preString.indexOf('samsung-'); | ||
73 | + if (sansungIndex > -1) { | ||
74 | + preString = preString.substr(8); | ||
75 | + } | ||
76 | + } else if (index > -1) { | ||
77 | + preString = agent.substr(0, index); | ||
78 | + preString = preString.substr(preString.lastIndexOf(";") + 1); | ||
79 | + preString = preString.replace(/\s+/g,'').replace(/_/ig, ''); | ||
80 | + //alert(preString); | ||
81 | + } | ||
82 | + deviceType = preString; | ||
83 | + version = agent.substr(agent.indexOf('android') + 8, 3); | ||
84 | + type = 'android'; | ||
85 | + appid = 'com.yoho'; | ||
86 | + | ||
87 | + td = deviceType + '_' + type + '_' + version; | ||
88 | + //downUrl = 'http://cdn.yoho.cn/app-downfiles/yohoBuy_YOHO_2953.apk'; | ||
89 | + } | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + $.ajax({ | ||
94 | + method: 'POST', | ||
95 | + url: 'http://union.yoho.cn/union/ClickUnionRest/addCommonUnion', | ||
96 | +// url: 'http://192.168.102.205:8088/union/ClickUnionRest/addUnion', | ||
97 | + data: { | ||
98 | + union_type: queryString.union_type, | ||
99 | + identify_id: queryString.identify_id, | ||
100 | + callbackurl: queryString.callbackurl, | ||
101 | + client_type: type, | ||
102 | + td: queryString.td ? queryString.td : td, | ||
103 | + appid: queryString.appid ? queryString.appid : appid, | ||
104 | + appkey: queryString.appkey | ||
105 | + }, | ||
106 | + complete: function() { | ||
107 | + | ||
108 | + /* if (!downUrl) { | ||
109 | + window.location.href = "http://m.yohobuy.com"; | ||
110 | + } else { | ||
111 | + window.location.href = downUrl; | ||
112 | + } */ | ||
113 | + window.location.href = downUrl; | ||
114 | + | ||
115 | + window.setTimeout(function() { | ||
116 | + window.location.href = "http://m.yohobuy.com"; | ||
117 | + }, 2000); | ||
118 | + } | ||
119 | + }); | ||
120 | + | ||
121 | + | ||
122 | + </script> | ||
123 | +</head> | ||
124 | +<body> | ||
125 | +</body> | ||
126 | +</html> |
web/src/main/webapp/downloadios.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <title>潮流商品 | YOHO!有货</title> | ||
6 | + <meta name="description" content=""> | ||
7 | + <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script> | ||
8 | + <script type="text/javascript"> | ||
9 | + var agent = navigator.userAgent.toLowerCase() ; | ||
10 | + var version, type, appid, td, queryString, downUrl; | ||
11 | + | ||
12 | + var jumpTypes = [110]; | ||
13 | + | ||
14 | + function isInJump(unionType) { | ||
15 | + for (var i = 0 ;i < jumpTypes.length; i++) { | ||
16 | + if (unionType == jumpTypes[i]) { | ||
17 | + return true; | ||
18 | + } | ||
19 | + } | ||
20 | + return false; | ||
21 | + } | ||
22 | + | ||
23 | + function getQueryString() { | ||
24 | + var vars = [], | ||
25 | + hash, | ||
26 | + i; | ||
27 | + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | ||
28 | + | ||
29 | + for (i = 0; i < hashes.length; i++) { | ||
30 | + hash = hashes[i].split('='); | ||
31 | + vars.push(hash[0]); | ||
32 | + vars[hash[0]] = hash[1]; | ||
33 | + } | ||
34 | + return vars; | ||
35 | + } | ||
36 | + | ||
37 | + downUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | ||
38 | + //downUrl = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
39 | + | ||
40 | + if (agent.indexOf("like mac os x") > 0) { | ||
41 | + var regStr_saf = /os [\d._]*/gi ; | ||
42 | + var verinfo = agent.match(regStr_saf) ; | ||
43 | + | ||
44 | + version = (verinfo+'').replace(/[^0-9|_.]/ig,'').replace(/_/ig, '.'); | ||
45 | + type = 'ios'; | ||
46 | + appid = '490655927'; | ||
47 | + td = window.screen.width + '_' + window.screen.height + '_' + type + '_' + version; | ||
48 | + downUrl = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
49 | + } else if (agent.indexOf('android') > -1 || agent.indexOf('linux') > -1) { | ||
50 | + var indextd = agent.indexOf('_td'); | ||
51 | + var index = agent.indexOf(' build'); | ||
52 | + var preString = ''; | ||
53 | + var deviceType = ''; | ||
54 | + | ||
55 | + //alert(agent); | ||
56 | + if (indextd > -1) { | ||
57 | + preString = agent.substr(0, indextd); | ||
58 | + preString = preString.substr(preString.lastIndexOf(";") + 1); | ||
59 | + preString = preString.replace(/\s+/g,'').replace(/_/ig, ''); | ||
60 | + | ||
61 | + var sansungIndex = preString.indexOf('samsung-'); | ||
62 | + if (sansungIndex > -1) { | ||
63 | + preString = preString.substr(8); | ||
64 | + } | ||
65 | + } else if (index > -1) { | ||
66 | + preString = agent.substr(0, index); | ||
67 | + preString = preString.substr(preString.lastIndexOf(";") + 1); | ||
68 | + preString = preString.replace(/\s+/g,'').replace(/_/ig, ''); | ||
69 | + //alert(preString); | ||
70 | + } | ||
71 | + deviceType = preString; | ||
72 | + version = agent.substr(agent.indexOf('android') + 8, 3); | ||
73 | + type = 'android'; | ||
74 | + appid = 'com.yoho'; | ||
75 | + | ||
76 | + td = deviceType + '_' + type + '_' + version; | ||
77 | + downUrl = 'http://cdn.yoho.cn/app-downfiles/yohoBuy_YOHO_2953.apk'; | ||
78 | + } | ||
79 | + | ||
80 | + queryString = getQueryString(); | ||
81 | + | ||
82 | + | ||
83 | + $.ajax({ | ||
84 | + method: 'POST', | ||
85 | + //url: 'http://testservice.yoho.cn:28077/union/ClickUnionRest/addUnion', | ||
86 | + url: 'http://union.yoho.cn/union/ClickUnionRest/addUnionFor', | ||
87 | + data: { | ||
88 | + union_type: queryString.union_type, | ||
89 | + identify_id: queryString.identify_id, | ||
90 | + callbackurl: queryString.callbackurl, | ||
91 | + client_type: type, | ||
92 | + td: td, | ||
93 | + appid: appid | ||
94 | + }, | ||
95 | + complete: function() { | ||
96 | + window.location.href = downUrl; | ||
97 | + } | ||
98 | + }); | ||
99 | + | ||
100 | + | ||
101 | + </script> | ||
102 | +</head> | ||
103 | +<body> | ||
104 | +</body> | ||
105 | +</html> |
-
Please register or login to post a comment