feat(ECR-042): OpsCMS FeedSlot 薄写面

Admin POST/PUT 复用 admin.cms.write;C 端 GET /home/feed-slots;首页无 active 槽隐藏推荐区、失败回退展示;无新 migration。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-13 20:02:01 +08:00
co-authored by Cursor
parent 655141980a
commit 56f661748a
27 changed files with 773 additions and 25 deletions
@@ -65,6 +65,7 @@ export function useHomePage() {
gridRow2: [...homeGridRow2] as HomeTool[],
})
const feeds = ref<HomeFeed[]>([...homeFeeds])
const feedsVisible = ref(true)
onMounted(() => {
void api
@@ -101,6 +102,15 @@ export function useHomePage() {
.catch(() => {
/* keep static homeFeeds */
})
void api
.getHomeFeedSlots('home')
.then((res) => {
const items = res.items || []
feedsVisible.value = items.length > 0
})
.catch(() => {
feedsVisible.value = true
})
})
function goPlus(kind: 'inviteFill' | 'add' | 'synastry') {
@@ -128,6 +138,7 @@ export function useHomePage() {
tipsLoading,
...toRefs(grid),
feeds,
feedsVisible,
goPlus,
trackGrid,
}
+2 -1
View File
@@ -16,7 +16,7 @@
<div class="sheet reveal" style="--d: 100ms">
<HomeToolGrid :row1="gridRow1" :row2="gridRow2" @track="trackGrid" />
<HomePromoSection />
<HomeFeedSection :feeds="feeds" />
<HomeFeedSection v-if="feedsVisible" :feeds="feeds" />
</div>
</main>
</template>
@@ -38,6 +38,7 @@ const {
gridRow1,
gridRow2,
feeds,
feedsVisible,
goPlus,
trackGrid,
} = useHomePage()