99 lines
3.0 KiB
HTML
99 lines
3.0 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: flex-start;
|
|
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 (sub) {
|
|
return new Promise((resolve, reject) => {
|
|
let src = sub[0];
|
|
console.log(`>> begin load script: ${src}`);
|
|
var s = document.createElement('script');
|
|
s.async = true;
|
|
if (sub[1] == 1)s.type = 'module';
|
|
// s.src = src + (src.indexOf("?") == -1 ? "?" : "&") + "t=" + Date.now();
|
|
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/main_native_inject.js'],
|
|
['assets/scripts/run_sample.js'],
|
|
]
|
|
|
|
var loadScripts = async function (list, callback) {
|
|
var loaded = 0;
|
|
var loadNext = function () {
|
|
return new Promise((resolve, reject) => {
|
|
// list[loaded][0] = list[loaded][0] + (list[loaded][0].indexOf("?") == -1 ? "?" : "&") + "t=" + Date.now();
|
|
loadSingleScript(list[loaded]).then(() => {
|
|
loaded++;
|
|
if (loaded >= list.length) {
|
|
resolve();
|
|
} else {
|
|
return loadNext();
|
|
}
|
|
})
|
|
})
|
|
};
|
|
loadNext();
|
|
};
|
|
loadScripts(scripts, ()=> {})
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|