103 lines
3.3 KiB
HTML
103 lines
3.3 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<title>game page</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<meta http-equiv="Expires" content="0">
|
|
<meta http-equiv="Pragma" content="no-cache">
|
|
<meta http-equiv="Cache-control" content="no-cache">
|
|
<meta http-equiv="Cache" content="no-cache">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, minimal-ui" />
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="full-screen" content="true" />
|
|
<meta name="screen-orientation" content="portrait" />
|
|
<meta name="x5-fullscreen" content="true" />
|
|
<meta name="360-fullscreen" content="true" />
|
|
<meta name="apple-mobile-web-app-title" content="WJTX">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<style>
|
|
body{background-color:#FFFFFF;padding: 20px;}
|
|
button{
|
|
padding: 10px 20px;
|
|
}
|
|
.app{
|
|
display: flex;
|
|
width: 100%;
|
|
height: 100%;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
}
|
|
.app button {
|
|
width: auto;
|
|
height: 10vh;
|
|
margin: 10px;
|
|
max-height: 50px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class='app' id='app'>
|
|
|
|
</div>
|
|
<script th:inline="javascript">
|
|
/**
|
|
* 加载外部js
|
|
*/
|
|
var loadSingleScript = function (src, isModule) {
|
|
return new Promise((resolve, reject) => {
|
|
console.log(`>> begin load script: ${src}`);
|
|
let s = document.createElement('script');
|
|
s.async = true;
|
|
if (isModule)s.type = 'module';
|
|
s.src =src;
|
|
s.addEventListener('load', function () {
|
|
console.log(`<< finish load script: ${src}`);
|
|
s.parentNode.removeChild(s);
|
|
s.removeEventListener('load', arguments.callee, false);
|
|
resolve && resolve();
|
|
}, false);
|
|
document.body.appendChild(s);
|
|
})
|
|
};
|
|
var scripts = [
|
|
'assets/scripts/libs/jcwallet.js',
|
|
'assets/scripts/libs/main.js',
|
|
'assets/scripts/libs/utils.js',
|
|
['assets/scripts/libs/native_bridge.js', 1],
|
|
'assets/scripts/libs/main_native_inject.js',
|
|
'assets/scripts/run_sample.js',
|
|
]
|
|
var loadScripts = function (list, refresh = false) {
|
|
var loaded = 0;
|
|
return new Promise((resolve, reject) => {
|
|
var loadNext = function () {
|
|
var current = list[loaded];
|
|
var src = current;
|
|
var isModule = false;
|
|
if (typeof current === 'object' && current instanceof Array) {
|
|
src = current[0];
|
|
isModule = current.length > 1 && current[1] == 1
|
|
}
|
|
|
|
if (refresh) {
|
|
src = src + (src.indexOf("?") == -1 ? "?" : "&") + "t=" + Date.now();
|
|
}
|
|
loadSingleScript(src, isModule).then(() => {
|
|
if (++loaded >= list.length) {
|
|
resolve && resolve();
|
|
} else {
|
|
return loadNext();
|
|
}
|
|
})
|
|
};
|
|
loadNext();
|
|
})
|
|
};
|
|
loadScripts(scripts, false);
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|