index.html
1.51 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<script src="./js/common.js" type="text/javascript"></script>
<script type="text/javascript">
// function disp_confirm()
// {
// var r= confirm("Press a button")
// if (r) {
// plus.storage.setItem('privacyPolicy', 'agree');
// }
// else
// {
// // plus.runtime.quit();
// }
// }
document.addEventListener('plusready', function() {
const data = getUrlData();
if (!data) {
window.location.href = 'http://118.178.131.219:8088/loginMobile';
// showSettingPage();
} else {
showMainPage();
}
// const sPrivacyPolicy = plus.storage.getItem('privacyPolicy');
// if (sPrivacyPolicy !== "agree") {
// disp_confirm();
// }
});
function showSettingPage() {
const view = plus.webview.create('/setting.html', 'setting');
view.show("pop-in");
}
function showMainPage() {
const waitTime = 5000;
const data = getUrlData();
const url = `${data.protocol}://${data.url}:${data.port}/loginMobile`;
// window.location.href = url;
// console.log(url);
const webview = plus.webview.currentWebview();
const timerId = setTimeout(() => {
webview.loadURL('/setting.html');
}, waitTime);
webview.onloaded = () => {
clearTimeout(timerId);
};
webview.loadURL(url);
}
</script>
</head>
<body>
</body>
</html>