index.html
6.24 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vStore 下载</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
/>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
body {
background: #fff;
position: relative;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.container {
flex: 1;
}
.footer {
width: 100%;
margin: 14px 0;
text-align: center;
font-weight: 400;
font-size: 14px;
color: #90949d;
line-height: 28rpx;
}
.i-logo {
position: absolute;
top: 20px;
left: 20px;
width: 89px;
}
.device-selector {
width: 100%;
display: flex;
justify-content: center;
margin-top: 56px;
gap: 20px;
}
.device-selector .device-btn {
width: 140px;
height: 40px;
background: #4084f5;
color: #fff;
border: 1px solid #4084f5;
border-radius: 6px;
display: flex;
gap: 10px;
align-items: center;
justify-content: center;
font-size: 16px;
cursor: pointer;
transition: background 0.3s;
}
.device-selector .device-btn:last-child {
background: #fff;
color: #4084f5;
}
.wechat-mask {
display: none;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.8);
}
.wechat-mask .tip-box {
width: 100%;
height: 100%;
display: flex;
justify-content: flex-end;
padding-right: 20px;
}
.wechat-mask .tip-box .t-text {
width: 150px;
margin-top: 30px;
font-size: 16px;
color: #fff;
text-align: center;
line-height: 32px;
}
</style>
</head>
<body>
<div class="container">
<img
src="https://store.keliuyun.com/download/app/index-bg.png"
style="width: 100%"
alt=""
/>
<img
src="https://store.keliuyun.com/download/app/index-logo.png"
class="i-logo"
alt=""
/>
<div class="device-selector">
<button class="device-btn" id="iosBtn">
<i class="fab fa-apple"></i> iPhone 下载
</button>
<button class="device-btn" id="androidBtn">
<i class="fab fa-android"></i> Android 下载
</button>
</div>
</div>
<div class="footer">
<p>版权所有@ 北京文安智能技术股份有限公司</p>
</div>
<!-- 微信引导层 -->
<div class="wechat-mask" id="wechatMask">
<div class="tip-box">
<div class="t-text">请点击右上角选择“浏览器中打开”</div>
<img
src="https://store.keliuyun.com/download/app/index-arrow.png"
alt=""
style="width: 50px; height: 40px"
/>
<!-- <button class="open-btn" id="openInBrowser">点击跳转浏览器</button> -->
</div>
</div>
<script>
// 检测是否在微信浏览器中
function isWeChatBrowser() {
const ua = navigator.userAgent.toLowerCase();
return ua.indexOf("micromessenger") !== -1;
}
// 检测设备类型
function getDeviceType() {
const ua = navigator.userAgent;
if (ua.match(/Android/i)) return "android";
if (ua.match(/iPhone|iPad|iPod/i)) return "ios";
return "other";
}
// 下载函数
function downloadApp() {
const device = getDeviceType();
if (device === "android") {
// 使用用户交互事件触发下载
window.location.href =
"https://store.keliuyun.com/download/app/vStore.apk";
} else if (device === "ios") {
// 跳转到App Store
window.location.href = "https://apps.apple.com/cn/app/6746431848";
} else {
alert("无法识别您的设备类型,请手动选择下载");
}
}
// 跳转到外部浏览器
function openInBrowser() {
const device = getDeviceType();
let url = "";
if (device === "android") {
url = "https://store.keliuyun.com/download/app/vStore.apk";
} else if (device === "ios") {
url = "https://apps.apple.com/cn/app/6746431848";
} else {
alert("无法识别您的设备类型,请手动选择下载");
return;
}
// 创建隐藏的a标签触发跳转
const link = document.createElement("a");
link.href = url;
link.target = "_blank";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
// 页面加载时执行检测
window.addEventListener("DOMContentLoaded", function () {
const wechatMask = document.getElementById("wechatMask");
const androidBtn = document.getElementById("androidBtn");
const iosBtn = document.getElementById("iosBtn");
const openInBrowserBtn = document.getElementById("openInBrowser");
// 检测是否在微信中打开
if (isWeChatBrowser()) {
wechatMask.style.display = "block";
// 添加跳转按钮事件
openInBrowserBtn.addEventListener("click", openInBrowser);
} else {
// 非微信环境,添加按钮事件
androidBtn.addEventListener("click", function () {
window.location.href =
"https://store.keliuyun.com/download/app/vStore.apk";
});
iosBtn.addEventListener("click", function () {
window.location.href = "https://apps.apple.com/cn/app/6746431848";
});
// 自动检测设备并跳转
const device = getDeviceType();
if (device === "android" || device === "ios") {
// 添加延迟让用户看到页面内容
setTimeout(downloadApp, 1000);
}
}
});
</script>
</body>
</html>