-
Notifications
You must be signed in to change notification settings - Fork 93
/
index.html
96 lines (92 loc) · 2.92 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="misapplication-tap-highlight" content="no"/>
<meta name="HandheldFriendly" content="true"/>
<meta name="MobileOptimized" content="320"/>
<link href="https://cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet">
<title>okhelper</title>
<script type=text/javascript charset=utf-8>
window.localStorage.setItem("hasShow","false");
//取消浏览器的所有事件,使得active的样式在手机上正常生效
document.addEventListener('touchstart', function() {
return false;
}, true);
// 禁止选择
document.oncontextmenu = function() {
return false;
};
// H5 plus事件处理
function plusReady() {
// 隐藏滚动条
plus.webview.currentWebview().setStyle({
scrollIndicator: 'none'
});
// Android处理返回键
plus.key.addEventListener('backbutton', function() {
//有没关闭的组件
if(localStorage.getItem("hasShow")==="true"){
return;
}else{
if('iOS' == plus.os.name) {
plus.nativeUI.confirm('确认退出?', function(e) {
if(e.index > 0) {
plus.runtime.quit();
}
}, 'OK帮', ['取消', '确定']);
} else {
if(location.hash === '#/home' || location.hash === '#/user/login') {
if(confirm('确认退出?')) {
plus.runtime.quit()
}
} else {
history.back();
}
}
}
}, false);
compatibleAdjust();
}
if(window.plus) {
plusReady();
} else {
document.addEventListener('plusready', plusReady, false);
}
// DOMContentLoaded事件处理
var _domReady = false;
document.addEventListener('DOMContentLoaded', function() {
_domReady = true;
compatibleAdjust();
}, false);
// 兼容性样式调整
var _adjust = false;
function compatibleAdjust() {
if(_adjust || !window.plus || !_domReady) {
return;
}
_adjust = true;
// iOS平台特效
if('iOS' == plus.os.name) {
document.getElementById('content').className = 'scontent'; // 使用div的滚动条
if(navigator.userAgent.indexOf('StreamApp') >= 0) { // 在流应用模式下显示返回按钮
document.getElementById('back').style.visibility = 'visible';
}
}
// 预创建二级窗口
// preateWebviews();
// 关闭启动界面
plus.navigator.setStatusBarBackground('#C20C0C');
setTimeout(function() {
plus.navigator.closeSplashscreen();
}, 2000);
}
</script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>