更新页面效果

This commit is contained in:
李琦
2026-07-31 10:29:14 +08:00
parent 5f00b644cf
commit 3c4347128d
73 changed files with 1558 additions and 183 deletions

View File

@@ -0,0 +1,14 @@
// 相册边框样式定义:供前台 PhotoGallery 渲染与后台 AdminEditor 配置/预览共用
export const BORDER_STYLES = [
{ value: 'none', label: '无边框' },
{ value: 'thin', label: '细金线' },
{ value: 'mat', label: '白卡纸' },
{ value: 'rounded', label: '柔圆角' },
{ value: 'double', label: '双线框' },
{ value: 'gold', label: '古典金框' },
]
export function borderClass(style) {
const v = BORDER_STYLES.some((b) => b.value === style) ? style : 'mat'
return 'gf-frame gf-' + v
}

View File

@@ -62,6 +62,18 @@ export function useAudio() {
}
const play = () => playUrl(activeUrl.value)
// 尝试自动播放,返回是否成功(被浏览器拦截则返回 false由调用方决定是否弹授权框
const attemptAutoplay = async () => {
if (!activeUrl.value) return false
try {
await playUrl(activeUrl.value)
return isPlaying.value
} catch (e) {
return false
}
}
const pause = () => {
if (audio) audio.pause()
isPlaying.value = false
@@ -98,5 +110,5 @@ export function useAudio() {
}
})
return { isPlaying, isReady, tracks, activeUrl, currentName, setTracks, setActive, play, pause, toggle, armAutoplay }
return { isPlaying, isReady, tracks, activeUrl, currentName, setTracks, setActive, play, pause, toggle, attemptAutoplay, armAutoplay }
}