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:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user