97 lines
3.4 KiB
HTML
97 lines
3.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-us">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Unity WebGL Player | FuZhou_FirstPage</title>
|
|
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
|
<link rel="stylesheet" href="TemplateData/style.css">
|
|
<script src="TemplateData/UnityProgress.js"></script>
|
|
<script src="Build/UnityLoader.js"></script>
|
|
<!-- <script type="module" src="./TemplateData/protocolcheck.js"></script> -->
|
|
<!-- <script type="module" >
|
|
import { openUriWithTimeoutHack } from './TemplateData/protocolcheck.js'
|
|
|
|
window.openUriWithTimeoutHack = openUriWithTimeoutHack;
|
|
</script> -->
|
|
|
|
<script >
|
|
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/APP.json", {onProgress: UnityProgress});
|
|
function OnWake(){
|
|
const href = window.location.href
|
|
const regex = /^https?:\/\/([^/:]+):?(\d+)?/i
|
|
const match = href.match(regex)
|
|
console.log('match', match)
|
|
// const dialogImageUrl = match[1]
|
|
const dialogImageUrl = '172.16.1.253'
|
|
unityInstance.SendMessage('FirstPanel','InitUnity',dialogImageUrl)
|
|
}
|
|
function StartModel(data){
|
|
console.log("data",data)
|
|
|
|
window.parent.blur(JSON.parse(data));
|
|
// blur(data)
|
|
}
|
|
// document.getElementsByTagName("a")[0].getAttribute("target")
|
|
function blur(data) {
|
|
console.log('cscs', data)
|
|
const href = window.location.href
|
|
const regex = /^https?:\/\/([^/:]+):?(\d+)?/i
|
|
const match = href.match(regex)
|
|
console.log('match', match)
|
|
// const dialogImageUrl = match[0]
|
|
// const dialogImageUrl2 = match[1]
|
|
const dialogImageUrl = 'http://172.16.1.253:4000'
|
|
const dialogImageUrl2 = '172.16.1.253'
|
|
const ModelResourcesE = encodeURIComponent(dialogImageUrl + data.ModelResources)
|
|
console.log('ModelResourcesE', ModelResourcesE)
|
|
openUriWithTimeoutHack(
|
|
'starter://' + `;${ModelResourcesE};${data.ModelResourcesPath};${data.RegistryName};${data.MONITOR_ID};${data.VersionNumber};${data.CUSTOMS_CODE};${data.ModelName};${data.TrainingSize};${dialogImageUrl2};`,
|
|
() => {
|
|
console.log('111' )
|
|
ElMessageBox.confirm('启动器未安装,启动应用前需要先安装启动器,现在去下载吗?', '提示', {
|
|
confirmButtonText: '下载',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
.then(() => {
|
|
// debugger
|
|
// 打开启动器下载路径
|
|
GetLastVersion().then((res) => {
|
|
console.log('res', res)
|
|
window.open(dialogImageUrl + res.data.LauncherResources)
|
|
}).catch(() => {
|
|
// exitApp(startParams.trainingId)
|
|
ElMessage.error('获取启动器下载路径失败')
|
|
})
|
|
})
|
|
.catch(() => {
|
|
// exitApp(startParams.trainingId)
|
|
console.log('取消下载')
|
|
})
|
|
},
|
|
() => {
|
|
console.log('已安装,自动唤起')
|
|
}
|
|
) // 调用export的方法
|
|
//
|
|
}
|
|
// 启动启动器
|
|
|
|
</script>
|
|
<script type="module">
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="webgl-content" style="height: 100%;width: 100%;" >
|
|
<div id="unityContainer" style="height: 100%;width: 100%;" ></div>
|
|
<!-- <div class="footer">
|
|
<div class="webgl-logo"></div>
|
|
<div class="fullscreen" onclick="unityInstance.SetFullscreen(1)"></div>
|
|
<div class="title">FuZhou_FirstPage</div>
|
|
</div> -->
|
|
</div>
|
|
</body>
|
|
</html>
|