fix: 尝试安卓优化

This commit is contained in:
2026-08-02 21:41:43 +08:00
parent 19627b72fb
commit c4ce8d2116
3 changed files with 112 additions and 56 deletions

View File

@@ -628,7 +628,7 @@ import { toast } from '@/composables/useToast'
import { pickMusicUrl, rememberMusicPick } from '@/utils/musicPick'
import { getClientId } from '@/utils/clientId'
import { sendVisitBeacon } from '@/utils/visitBeacon'
import { optimizeImageUrl } from '@/composables/useAndroidOptimize'
import { optimizeImageUrl, isIOS } from '@/composables/useAndroidOptimize'
import { DANMAKU_COLORS, DANMAKU_GRADIENT_COLORS, DEFAULT_DANMAKU_COLOR, BLESSING_STYLES } from '@/utils/danmakuColors'
import { parseLrc, formatAudioTime, findLrcIndex } from '@/utils/parseLrc'
import CanvasEffects from '@/components/CanvasEffects.vue'
@@ -748,9 +748,10 @@ const likeBusy = ref(false)
let likePulseTimer = null
const previewVisible = ref(false), previewIndex = ref(0), albumLoaded = ref(false)
const albumPreviewImages = ref([])
/** 九宫格 / 一大五小:进视口中线后停滚再串行加载 */
/** 九宫格 / 一大五小:进视口中线后停滚再串行加载
* iOS 性能足够,跳过停滚,让组件进视口自动挂载(保留滚动连续性) */
const HOLD_GALLERY_TYPES = new Set(['nine-grid', 'one-large-five-small'])
const isHoldGalleryType = (type) => HOLD_GALLERY_TYPES.has(type)
const isHoldGalleryType = (type) => !isIOS && HOLD_GALLERY_TYPES.has(type)
const galleryActivate = reactive({})
const galleryHold = ref(false)
const rsvpForm = reactive({ name: '', guest_count: '1', wishes: '' })
@@ -1047,8 +1048,9 @@ const beginGalleryGate = (pIdx) => {
}
const onGalleryReady = (pIdx) => {
if (!galleryDone.has(pIdx)) return
// iOS 跳过 hold但仍需刷新文档高度图挂载后 scrollMax 可能变化)
refreshScrollMax()
if (!galleryDone.has(pIdx)) return
clearTimeout(galleryRevealTimer)
galleryRevealTimer = setTimeout(() => {
galleryHold.value = false
@@ -1066,7 +1068,7 @@ const bindGalleryHoldObserver = () => {
galleryObserver = new IntersectionObserver(
(entries) => {
const vh = window.innerHeight || 1
const lineY = vh * (1 - 0.75) // 从下往上 75%
const lineY = vh * (1 - 0.9) // 从下往上 75%
for (const entry of entries) {
if (!entry.isIntersecting) continue
const rect = entry.boundingClientRect