diff --git a/src/App.vue b/src/App.vue index aecafc9..5d50caa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -62,9 +62,24 @@ onMounted(() => { + + diff --git a/src/app.css b/src/app.css index ebb50db..fec32cc 100644 --- a/src/app.css +++ b/src/app.css @@ -22,7 +22,8 @@ top: 50%!important; max-width: 100vw!important; } -canvas { +/* 仅 AR 全屏画布;勿用全局 canvas(会把点云 WebGL 拉成 100vw 导致偏左) */ +.fullscreen-canvas { position: fixed; left: 0; top: 0; diff --git a/src/app.less b/src/app.less index 5bf141f..379a231 100644 --- a/src/app.less +++ b/src/app.less @@ -1,6 +1,16 @@ +html, +body { + margin: 0; + padding: 0; + width: 100%; + min-height: 100%; + background-color: #eff2f5; +} + #app { - // height: 100%; - // overflow-x: hidden; + width: 100%; + min-height: 100vh; + min-height: 100dvh; } *, @@ -37,7 +47,8 @@ // height: 100vh; } -canvas { +/* 仅 AR 全屏画布;勿用全局 canvas(会把点云 WebGL 拉成 100vw 导致偏左) */ +.fullscreen-canvas { position: fixed; left: 0; top: 0; diff --git a/src/views/douyin/components/ImagePointCloud.vue b/src/views/douyin/components/ImagePointCloud.vue index e2de931..b484c4c 100644 --- a/src/views/douyin/components/ImagePointCloud.vue +++ b/src/views/douyin/components/ImagePointCloud.vue @@ -389,8 +389,18 @@ onUnmounted(() => { } .ipc-webgl { + position: relative !important; + left: auto !important; + top: auto !important; + right: auto !important; + bottom: auto !important; display: block; flex-shrink: 0; + /* 覆盖全局/历史 fullscreen canvas 规则,保证正方形居中 */ + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; opacity: 0; transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1); } @@ -404,12 +414,13 @@ onUnmounted(() => { } .ipc-scale { - position: absolute; - width: 1px; - height: 1px; + position: absolute !important; + width: 1px !important; + height: 1px !important; opacity: 0; pointer-events: none; - left: -9999px; + left: -9999px !important; + top: auto !important; } .ipc-fallback { diff --git a/src/views/douyin/generating.vue b/src/views/douyin/generating.vue index 29a6602..76832ca 100644 --- a/src/views/douyin/generating.vue +++ b/src/views/douyin/generating.vue @@ -28,12 +28,7 @@ @handoff="onHandoff" /> - +
{{ errorTip }}
@@ -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; diff --git a/src/views/douyin/index.vue b/src/views/douyin/index.vue index 41e4598..844402d 100644 --- a/src/views/douyin/index.vue +++ b/src/views/douyin/index.vue @@ -211,6 +211,10 @@ async function onSubmit() { } onMounted(() => { + // 清理历史本地标记(锁定状态改为仅看 orders/stat) + try { + sessionStorage.removeItem('douyin_order_submitted') + } catch (_) {} getOrderStat() // 预采样 Logo 点云,进入等待页可立刻上屏 preloadLogoCloud().catch(() => {}) diff --git a/src/views/douyin/records.vue b/src/views/douyin/records.vue index 7198122..2888329 100644 --- a/src/views/douyin/records.vue +++ b/src/views/douyin/records.vue @@ -91,7 +91,7 @@