mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-11-13 22:11:42 +08:00
feat: 小程序端轮播图重写,接入 Banner 归一化公开接口
- uh-swiper 组件高内聚:内部请求 banners 公开列表,去掉前 5 条 上限,日期角标显示条目 date 快照,新增作者/日期信息浮层 - home.vue 移除配置 list 与审核模式劫持组装,点击分发改为 post→文章详情(postId)、custom→banner-detail 详情页 - 新增 banner-detail 详情页:公开详情接口 + mp-html 富文本 + 外链平台条件编译(非 App 端复制链接 / App 端访问按钮) - 类型与默认配置同步清理(IBannerConfig 移除 type/list) Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
This commit is contained in:
@@ -31,8 +31,29 @@ export interface IBannerConfig {
|
||||
showIndicator?: boolean
|
||||
height?: string
|
||||
dotPosition?: string
|
||||
type?: string
|
||||
list?: unknown[]
|
||||
}
|
||||
|
||||
/** 轮播图公开条目(plugin-uni-halo Banner 归一化模型公开接口,列表脱敏不含 content) */
|
||||
export interface IBannerPublicItem {
|
||||
/** Banner 条目 metadata.name */
|
||||
name: string
|
||||
title?: string
|
||||
cover?: string
|
||||
/** 展示日期(ISO) */
|
||||
date?: string
|
||||
authorName?: string
|
||||
authorAvatar?: string
|
||||
/** 来源:post=文章快照 / custom=自定义 */
|
||||
source?: 'post' | 'custom'
|
||||
/** 文章 id(source=post 时跳转文章详情) */
|
||||
postId?: string
|
||||
link?: string
|
||||
priority?: number
|
||||
}
|
||||
|
||||
/** 轮播图公开详情(含 content 富文本 HTML) */
|
||||
export interface IBannerPublicDetail extends IBannerPublicItem {
|
||||
content?: string
|
||||
}
|
||||
|
||||
export interface IPageConfig {
|
||||
|
||||
@@ -15,6 +15,8 @@ import { getPersonalToken } from '@/store/token'
|
||||
import type {
|
||||
IAppConfig,
|
||||
IAuditDataResult,
|
||||
IBannerPublicDetail,
|
||||
IBannerPublicItem,
|
||||
ICommentWidgetConfig,
|
||||
IDoubanDetail,
|
||||
IHaloGlobalConfig,
|
||||
@@ -67,6 +69,24 @@ export function getAuditData() {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页轮播图列表(公开;按 priority 有序,脱敏不含 content)
|
||||
*/
|
||||
export function getBanners() {
|
||||
return http.Get<IResponse<IBannerPublicItem[]>>('/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/banners', {
|
||||
meta: { requestFrom: RequestFrom.Halo },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取轮播图详情(公开;含 content 富文本 HTML)
|
||||
*/
|
||||
export function getBannerDetail(name: string) {
|
||||
return http.Get<IResponse<IBannerPublicDetail>>(`/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/banners/${name}`, {
|
||||
meta: { requestFrom: RequestFrom.Halo },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Halo 全局配置信息
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user