1. 礼物特效

This commit is contained in:
李琦
2026-08-03 13:01:08 +08:00
parent 06c57a0754
commit abcb53b88e
3 changed files with 121 additions and 2 deletions

View File

@@ -571,6 +571,22 @@
<a-input v-model:value="posterCfg.invitePath" placeholder="/" />
</a-form-item>
</div>
<a-form-item label="背景音乐">
<a-select
v-model:value="posterCfg.musicUrl"
allow-clear
show-search
option-filter-prop="label"
placeholder="不播放(从已有曲目选择)"
:options="posterMusicSelectOptions"
:loading="posterMusicLoading"
/>
<div class="text-[11px] text-[#8A8680] mt-1">
曲目来自背景音乐清空则该海报不播放可到
<a class="text-[#a88c6b] cursor-pointer" @click="activeTab = 'music'">背景音乐</a>
上传管理
</div>
</a-form-item>
<a-form-item label="页面标题(浏览器标签 / 分享)">
<a-input
v-model:value="posterCfg.pageTitle"
@@ -1066,6 +1082,9 @@ const resizeProgress = ref('')
const uploadConfigSaving = ref(false)
const posterSaving = ref(false)
const posterLoading = ref(false)
const posterMusicLoading = ref(false)
/** 海报选曲用:独立缓存请柬 musicList避免依赖是否打开过音乐页 */
const posterMusicOptions = ref([])
const tabLoading = ref(false)
const rsvpLoading = ref(false)
const rsvpList = ref([])
@@ -1128,6 +1147,20 @@ const uploadCfg = reactive(defaultUploadConfig())
const posterSideTab = ref('1')
const posterBundle = reactive(defaultPosterBundle())
const posterCfg = computed(() => posterBundle[sideKey(posterSideTab.value)] || posterBundle['1'])
const posterMusicSelectOptions = computed(() => {
const list = Array.isArray(posterMusicOptions.value) ? posterMusicOptions.value : []
const opts = list
.filter((t) => t && t.url)
.map((t, i) => ({
value: t.url,
label: t.name || `曲目 ${i + 1}`,
}))
const cur = posterCfg.value?.musicUrl
if (cur && !opts.some((o) => o.value === cur)) {
opts.unshift({ value: cur, label: `(原曲目)${cur.slice(0, 36)}${cur.length > 36 ? '…' : ''}` })
}
return opts
})
const currentPosterSide = computed(() => posterSideMeta(posterSideTab.value))
const posterNameLabels = computed(() => {
const s = sideKey(posterSideTab.value)
@@ -1578,6 +1611,27 @@ async function onSaveUploadConfig() {
}
}
async function loadPosterMusicOptions() {
posterMusicLoading.value = true
try {
const res = await getConfigSection('music')
const list = res.data?.musicList
if (Array.isArray(list) && list.length) {
posterMusicOptions.value = list.filter((t) => t && t.url)
} else if (Array.isArray(cfg.musicList) && cfg.musicList.length) {
posterMusicOptions.value = cfg.musicList.filter((t) => t && t.url)
} else {
posterMusicOptions.value = []
}
} catch {
posterMusicOptions.value = Array.isArray(cfg.musicList)
? cfg.musicList.filter((t) => t && t.url)
: []
} finally {
posterMusicLoading.value = false
}
}
async function loadPosterConfig() {
posterLoading.value = true
try {
@@ -1884,7 +1938,7 @@ async function onTabActivate(tab) {
return
}
if (tab === 'poster') {
await loadPosterConfig()
await Promise.all([loadPosterConfig(), loadPosterMusicOptions()])
return
}
if (tab === 'rsvp') {