yinq 1 year ago
commit dd1b4b54cf

@ -1,14 +1,15 @@
<html> <html>
<head lang="zh-CN"> <head lang="zh-CN">
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]>
<script src="<%= BASE_URL %>./Model.js"></script> <script>window.location.href = '/html/ie.html';</script><![endif]-->
<style> <script src="<%= BASE_URL %>./Model.js"></script>
<style>
html, html,
body, body,
#app { #app {
@ -16,6 +17,7 @@
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
.chromeframe { .chromeframe {
margin: 0.2em 0; margin: 0.2em 0;
background: #ccc; background: #ccc;
@ -194,15 +196,15 @@
opacity: 0.5; opacity: 0.5;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<div id="loader-wrapper"> <div id="loader-wrapper">
<div id="loader"></div> <div id="loader"></div>
<div class="loader-section section-left"></div> <div class="loader-section section-left"></div>
<div class="loader-section section-right"></div> <div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div> <div class="load_title">正在加载系统资源,请耐心等待</div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

@ -34,63 +34,37 @@ export default {
appsecret: 'rXmhoLAiOPNKzbl7g2qxCV8tFwRdYuZM' appsecret: 'rXmhoLAiOPNKzbl7g2qxCV8tFwRdYuZM'
} }
const viewer = new AMRT.Viewer('container', param) const viewer = new AMRT.Viewer('container', param)
const callback = () => {
console.log('click on model')
}
const callback1 = () => {
console.log('click on model123213213')
}
let num = 0 let num = 0
viewer.loadModel('1720250797926780928', { let modelArr = [
background: false, '1720315475507941376',
onLoad: function (m) { '1720315479907766272',
num+=1 '1720315484513112064',
if(num === 5){ '1720315500866703360',
alert('加载完成'); '1720315558030872576',
} '1720315596551360512',
m.on('click', callback) '1720315644550975488',
} '1720315648946606080',
}) '1720315687114772480',
viewer.loadModel('1720250751495835648', { '1720315691422322688',
background: false, '1720315722275622912',
onLoad: function (m) { '1720315729129115648',
num+=1 '1720315768454909952',
if(num === 5){ '1720316275214913536',
alert('加载完成'); '1720316297822212096',
} ]
m.on('click', callback1) modelArr.forEach(e=>{
} viewer.loadModel(e, {
}) background: false,
viewer.loadModel('1720250742998175744', { onLoad: function (m) {
background: false, num+=1
onLoad: function (m) { if(num === modelArr.length){
num+=1 alert('加载完成');
if(num === 5){ }
alert('加载完成'); m.on('click', ()=>{alert(`${e}`)})
} }
m.on('click', callback1) })
}
})
viewer.loadModel('1720250716490174464', {
background: false,
onLoad: function (m) {
num+=1
if(num === 5){
alert('加载完成');
}
m.on('click', callback1)
}
})
viewer.loadModel('1720250709951254528', {
background: false,
onLoad: function (m) {
num+=1
if(num === 5){
alert('加载完成');
}
m.on('click', callback1)
}
}) })
viewer.controls.startAutoRotate(1)
}, },
methods: {} methods: {}
}; };

Loading…
Cancel
Save