fix(header): wire multi-function page-type enable like zibll
Connect header_components_show_on through aksrt_header_slide_is_show with zibll page-type matching, drop the homepage-only gate, align admin options, apply nav color, enqueue by is_show, remove dead float-btn schema, and consume footer_tabbar_single extend mode on post singles.
This commit is contained in:
1 parent
3e3a4631f0
commit
bfb64211ee
12 files changed
+445
-285
No files matched your search
@@ -5,21 +5,13 @@
|
||||
<n-card class="aksrt-section-card" style="margin-bottom:16px;">
|
||||
<template #header>
|
||||
<div class="aksrt-card-header-row">
|
||||
<strong>Hero 显示开关</strong>
|
||||
<n-button size="small" secondary @click="goHeaderComponents">顶部多功能组件(搜索/卡片/轮播参数)</n-button>
|
||||
<strong>显示范围</strong>
|
||||
<n-button size="small" secondary @click="goHeaderComponents">顶部多功能组件(页面类型/搜索/卡片)</n-button>
|
||||
</div>
|
||||
</template>
|
||||
<n-form label-placement="left" label-width="160" class="aksrt-form">
|
||||
<n-form-item label="显示首页 Hero">
|
||||
<div class="aksrt-inline-setting">
|
||||
<n-switch v-model:value="heroEnabled" :disabled="settingsLoading || settingsSaving" />
|
||||
<span class="aksrt-inline-setting__hint">关闭后,首页 Hero 区块将不再渲染。</span>
|
||||
</div>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
<div class="aksrt-inline-setting__actions">
|
||||
<n-button type="primary" :loading="settingsSaving" :disabled="settingsLoading" @click="saveHeroSettings">保存 Hero 开关</n-button>
|
||||
</div>
|
||||
<p class="aksrt-inline-setting__hint" style="margin:0;">
|
||||
幻灯片内容在此维护。页面类型启用、设备规则、搜索覆盖层与图标卡片请到「顶部多功能组件」配置;全不选页面类型即为关闭。
|
||||
</p>
|
||||
</n-card>
|
||||
|
||||
<n-spin :show="loading" style="width:100%; min-height:200px;">
|
||||
@@ -216,10 +208,7 @@ function goHeaderComponents() {
|
||||
}
|
||||
const loading = ref(true)
|
||||
const saving = ref(false)
|
||||
const settingsLoading = ref(false)
|
||||
const settingsSaving = ref(false)
|
||||
const slides = ref([])
|
||||
const heroEnabled = ref(true)
|
||||
|
||||
const modalShow = ref(false)
|
||||
const editing = ref(emptyForm())
|
||||
@@ -348,36 +337,7 @@ async function loadSlides() {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadHeroSettings() {
|
||||
settingsLoading.value = true
|
||||
try {
|
||||
const res = await api.getHomepageSettings()
|
||||
const data = res?.data || {}
|
||||
heroEnabled.value = data.homepage_module_hero_enabled !== false
|
||||
} catch (e) {
|
||||
message.error(e.message || '加载 Hero 开关失败')
|
||||
} finally {
|
||||
settingsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function saveHeroSettings() {
|
||||
settingsSaving.value = true
|
||||
try {
|
||||
const res = await api.saveHomepageSettings({
|
||||
homepage_module_hero_enabled: heroEnabled.value,
|
||||
})
|
||||
if (res?.code === 'success') {
|
||||
message.success('Hero 开关已保存')
|
||||
return
|
||||
}
|
||||
throw new Error(res?.message || '保存 Hero 开关失败')
|
||||
} catch (e) {
|
||||
message.error(e.message || '保存 Hero 开关失败')
|
||||
} finally {
|
||||
settingsSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openCreate() {
|
||||
editing.value = emptyForm()
|
||||
@@ -495,7 +455,6 @@ function handleDelete(row) {
|
||||
|
||||
onMounted(() => {
|
||||
loadSlides()
|
||||
loadHeroSettings()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user