forked from natuka/web.puabadge.com
修改:点云效果优化
This commit is contained in:
1 parent
a76b181650
commit
17908ab309
7 files changed
+70
-43
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -211,6 +211,10 @@ async function onSubmit() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 清理历史本地标记(锁定状态改为仅看 orders/stat)
|
||||
try {
|
||||
sessionStorage.removeItem('douyin_order_submitted')
|
||||
} catch (_) {}
|
||||
getOrderStat()
|
||||
// 预采样 Logo 点云,进入等待页可立刻上屏
|
||||
preloadLogoCloud().catch(() => {})
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onUnmounted, reactive, ref } from 'vue'
|
||||
import { computed, onMounted, onUnmounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import * as douyinApi from '@/api/douyin'
|
||||
import { douyinConfig as config } from '@/config/douyin'
|
||||
@@ -227,6 +227,14 @@ function onCardClick(item: any) {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 桌面端 / 非移动调试模式下 van-list immediate-check 可能不触发,主动拉首屏
|
||||
if (!initialLoaded.value && !fetching.value) {
|
||||
loading.value = true
|
||||
onLoad()
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
loading.value = false
|
||||
finished.value = false
|
||||
|
||||
Reference in new issue
Block a user