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