-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·64 lines (57 loc) · 2.35 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>东风出行</title>
<script type="text/javascript">
// 获取终端的相关信息
var Terminal = {
// 辨别移动终端类型
platform: function () {
var u = navigator.userAgent, app = navigator.appVersion;
return {
// android终端或者uc浏览器
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
// 是否为iPhone或者QQHD浏览器
iPhone: u.indexOf('iPhone') > -1,
// 是否iPad
iPad: u.indexOf('iPad') > -1
};
}(),
// 辨别移动终端的语言:zh-cn、en-us、ko-kr、ja-jp...
language: (navigator.browserLanguage || navigator.language).toLowerCase()
}
// 根据不同的终端,跳转到不同的地址
var theUrl = 'https://itunes.apple.com/cn/app/id1401777858';
if (Terminal.platform.android) {//安卓端
// document.write('“XXX”安卓版APP开发中,敬请期待!');
theUrl = 'https://www.pgyer.com/dfcx';
location.href = theUrl;
} else {
if (Terminal.platform.iPhone) {//iPhone端
theUrl = 'https://itunes.apple.com/cn/app/id1401777858';
} else if (Terminal.platform.iPad) {//iPad端
// 还可以通过language,区分开多国语言版
switch (Terminal.language) {
case 'en-us'://iPad英文版APP Store地址
theUrl = 'https://itunes.apple.com/cn/app/id1401777858';
break;
case 'ko-kr'://iPad韩语版APP Store地址
theUrl = 'https://itunes.apple.com/cn/app/id1401777858';
break;
case 'ja-jp'://iPad日文版APP Store地址
theUrl = 'https://itunes.apple.com/cn/app/id1401777858';
break;
default://iPad默认APP Store地址
theUrl = 'https://itunes.apple.com/cn/app/id1401777858';
}
}
location.href = theUrl;
}
</script>
</head>
<body>
<!--
-->
</body>
</html>