1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-09-12 16:40:40 +08:00

feat: 实现全站布局偏好系统,支持多页面独立配置

本次提交完成了完整的偏好设置体系重构:
1. 新增preferences.md文档说明布局偏好设计与映射规则
2. 重构布局配置结构,按页面分组管理列表布局与卡片样式
3. 实现后端preferences字段到本地配置的自动映射转换
4. 完成首页、文章列表、归档页的布局动态切换逻辑
5. 重构投票组件样式绑定,改用unocss类名实现样式分离
6. 新增偏好设置页面,支持按页面配置布局参数
7. 兼容旧版布局参数的自动归一化转换
8. 补充完整的单元测试用例覆盖新旧数据迁移场景
This commit is contained in:
小莫唐尼
2026-09-09 14:48:55 +08:00
parent 004bac175e
commit beaf2c39ca
15 changed files with 319 additions and 135 deletions
+6 -2
View File
@@ -93,6 +93,9 @@
const globalAppSettings = computed(() => settingStore.settings)
/** 首页列表布局(偏好设置驱动:single=单列 / double=双列) */
const homeListLayout = computed(() => settingStore.settings.layout.home.listLayout)
/* ---------------- 数据加载 ---------------- */
async function handleQuery() {
handleGetArticleList()
@@ -243,9 +246,10 @@
min-height="36vh" @refresh="handleQuery" />
<block v-else>
<view class="box-border flex flex-col gap-y-3 p-3 pt-0" :class="globalAppSettings.layout.home">
<view class="box-border p-3 pt-0"
:class="homeListLayout === 'double' ? 'grid grid-cols-2 gap-3' : 'flex flex-col gap-y-3'">
<uh-article-card v-for="(article, index) in articleList" :key="index" from="home" :article="article"
:audit-mode="calcAuditModeEnabled" layout="image_bottom"/>
:audit-mode="calcAuditModeEnabled" />
</view>
<view class="mt-3 box-border pb-5 text-center text-xs text-gray-400">
{{ loadMoreText }}