修改:点云效果优化
continuous-integration/drone/push Build was killed
continuous-integration/drone/promote/prod Build is passing

This commit is contained in:
Linzm committed 2026-10-20 16:46:01 +08:00
1 parent a76b181650
commit 17908ab309
7 files changed
+70 -43

No files matched your search

+10 -33
View File
@@ -28,12 +28,7 @@
@handoff="onHandoff"
/>
</div>
<img
v-if="resultUrl"
class="stage-layer result-layer"
:src="resultUrl"
alt=""
>
<!-- 效果图点云阶段不叠底图,等揭示后再进预览页展示 -->
</div>
</div>
<div v-if="errorTip" class="error-tip">{{ errorTip }}</div>
@@ -154,12 +149,13 @@ const ordering = ref(false)
const errorTip = ref('')
const showConfirmModal = ref(false)
/** 红框正方形边长:首屏即算好,不依赖 CSS min() */
/** 红框正方形边长:按 app-shell 实际宽度算,避免桌面端用整窗宽导致偏大/错位 */
function calcStageSide() {
if (typeof window === 'undefined') return 280
const w = window.innerWidth || 375
const shell = document.querySelector('.app-shell') as HTMLElement | null
const w = shell?.clientWidth || Math.min(window.innerWidth || 375, 540)
const h = window.innerHeight || 667
// 约屏宽 72%、屏高 40%,上限 320,贴近预览卡片区域
// 约容器宽 72%、屏高 40%,上限 320,贴近预览卡片区域
return Math.max(180, Math.round(Math.min(w * 0.72, h * 0.4, 320)))
}
@@ -297,24 +293,13 @@ function onHandoff() {
}
function startSoftProgress() {
// 固定节奏:每 300ms +1%,效果图就绪后冲到 96%,预览前再动画到 100%
softTimer = setInterval(() => {
if (showResult.value) return
// 效果图已到:快速冲到 96%,留给揭示动画收尾到 100%
if (resultUrl.value) {
if (progress.value < 96) {
progress.value = Math.min(96, progress.value + 3.2)
}
return
}
const cap = config.poll.softCap
const cap = resultUrl.value ? 96 : config.poll.softCap
if (progress.value >= cap) return
// 整体加快:前段更快,后段仍有余量
let step = 2.4
if (progress.value >= 35) step = 1.4
if (progress.value >= 60) step = 0.85
if (progress.value >= 75) step = 0.45
progress.value = Math.min(cap, progress.value + step)
}, 280)
progress.value = Math.min(cap, progress.value + 1)
}, 300)
}
function startMaskFetch() {
@@ -516,7 +501,7 @@ onUnmounted(() => {
flex-direction: column;
align-items: center;
width: max-content;
max-width: calc(100vw - 32px);
max-width: calc(100% - 32px);
}
.stage-shell {
@@ -545,14 +530,6 @@ onUnmounted(() => {
height: 100% !important;
}
.result-layer {
object-fit: contain;
opacity: 0.35;
z-index: 2;
pointer-events: none;
background: transparent;
}
.error-tip {
margin-top: 12px;
max-width: 280px;