v3.5.16小程序首页动画

This commit is contained in:
2026-08-30 15:07:58 +08:00
parent 9c8d5f2cad
commit b375fab44a
13 changed files with 546 additions and 759 deletions
+21
View File
@@ -0,0 +1,21 @@
import Taro from '@tarojs/taro';
import { HOME_SPLASH_BOTTLE_URL } from '@dukang/shared-types';
/** 冷启动会话内是否已播过首页开场(进程级,切 Tab 不重播) */
let played = false;
export function hasHomeSplashPlayed() {
return played;
}
export function markHomeSplashPlayed() {
played = true;
}
/** 冷启动预拉 OSS 开场图(仅 weappH5 的 getImageInfo 会走 CORS */
export function prefetchHomeSplashAssets() {
if (played) return;
if (process.env.TARO_ENV !== 'weapp') return;
void Taro.getImageInfo({ src: HOME_SPLASH_BOTTLE_URL }).catch(() => {});
}