调整history和3d
This commit is contained in:
@@ -18,15 +18,15 @@
|
||||
<div class="heard">
|
||||
<div class="text">Technical sketch</div>
|
||||
<div class="switch">
|
||||
back
|
||||
<a-switch v-model:checked="isFront" />
|
||||
front
|
||||
<a-switch v-model:checked="isFront" />
|
||||
back
|
||||
</div>
|
||||
</div>
|
||||
<div class="modelBox">
|
||||
<div v-show="!imgOrThree" class="img">
|
||||
<img v-show="isFront" :src="selectModel.threeDLayoutList?.[0]?.url" alt="">
|
||||
<img v-show="!isFront" :src="selectModel.threeDLayoutList?.[1]?.url" alt="">
|
||||
<img v-show="!isFront" :src="selectModel.threeDLayoutList?.[0]?.url" alt="">
|
||||
<img v-show="isFront" :src="selectModel.threeDLayoutList?.[1]?.url" alt="">
|
||||
</div>
|
||||
<threeBox v-if="imgOrThree" ref="threeBox"></threeBox>
|
||||
</div>
|
||||
@@ -81,7 +81,7 @@ export default defineComponent({
|
||||
const setSelectModel = (item:any)=>{
|
||||
data.isShowMark = true
|
||||
const value = {
|
||||
threeDSimpleId:item.id,
|
||||
threeDSimpleId:item.threeDSimpleId,
|
||||
}
|
||||
Https.axiosPost(Https.httpUrls.getLayoutDetail,{},{params:value}).then((res:any)=>{
|
||||
data.selectModel = res
|
||||
@@ -244,8 +244,10 @@ export default defineComponent({
|
||||
align-items: center;
|
||||
> .modelBox{
|
||||
width: 100%;
|
||||
height: 20rem;
|
||||
height: 75rem;
|
||||
// height: 20rem;
|
||||
// height: 75rem;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
margin: auto;
|
||||
>.img{
|
||||
width: 100%;
|
||||
|
||||
@@ -229,7 +229,6 @@ export default defineComponent({
|
||||
metalness: .2, // 金属质感 (0-1)
|
||||
side: THREE.DoubleSide // 双面渲染
|
||||
});
|
||||
console.log(child)
|
||||
// 6. 替换原有材质
|
||||
child.material = newMaterial;
|
||||
|
||||
@@ -242,7 +241,6 @@ export default defineComponent({
|
||||
}
|
||||
data.load.state = false
|
||||
},(xhr:any) => { // 加载进度回调
|
||||
console.log(xhr.loaded , xhr.total)
|
||||
const percent = xhr.total == 0?100:(xhr.loaded / xhr.total * 100).toFixed(2);
|
||||
data.load.progress = percent
|
||||
// updateProgressBar(Number(percent));
|
||||
@@ -274,9 +272,7 @@ export default defineComponent({
|
||||
data.group.add(scene);
|
||||
resolve('')
|
||||
},(xhr:any) => { // 加载进度回调
|
||||
console.log(xhr.loaded , xhr.total)
|
||||
const percent = xhr.total == 0?100:(xhr.loaded / xhr.total * 100).toFixed(2);
|
||||
console.log(`模型加载进度: ${percent}%`);
|
||||
data.load.progress = percent
|
||||
// updateProgressBar(Number(percent));
|
||||
},(error:any) => { // 加载失败回调
|
||||
@@ -296,7 +292,6 @@ export default defineComponent({
|
||||
// init()
|
||||
// }
|
||||
const getModelUrl = (value:any)=>{
|
||||
console.log(12314343)
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// Https.axiosGet(Https.httpUrls.getThreeDGlb,{params:{threeDSimpleId:value.id},env:{binary:true}}).then((rv)=>{
|
||||
|
||||
Reference in New Issue
Block a user