feat(wiki): 二十四节气详情抓取百度百科并图文展示
Publish Mini Program Dev Version / publish (push) Successful in 1m12s
Build and Publish Server / build (push) Successful in 8m24s

数据源:百度百科开放接口 BaikeLemmaCardApi(无反爬,返回结构化 JSON)
与「历史上的今天」(维基)完全解耦,维基代码原样保留可随时恢复:

服务端:
- WikiEntry 增加 image(配图)和 extra(结构化字段 JSON)字段
- 新建 BaikeTermSyncLog 独立日志表(不污染维基 WikiSyncLog)
- 新建 BaikeTermSyncService 独立同步服务(24 节气,间隔 1.2s)
- 启动时缺详情自动补齐,之后按配置间隔定时增量刷新
- 管理 API:GET/POST /admin/api/wiki/term-sync*

管理后台:
- 百科条目 Tab 顶部加节气同步卡片(X/24 + 状态 + 同步按钮)
- 条目编辑器加配图 URL(含预览)和节气扩展字段编辑

小程序:
- 百科页展开详情图文展示:配图 + 简介 + 物候/习俗/养生等分块

本地验证:24/24 节气抓取成功,image/extra 全部填充,维基数据不受影响
This commit is contained in:
gouki
2026-08-13 00:31:43 +00:00
parent 0ce1a1ef97
commit fec383f257
12 changed files with 759 additions and 6 deletions
+47
View File
@@ -51,6 +51,53 @@
line-height: 1.7;
}
/* 节气配图 */
.entry-image {
width: 100%;
border-radius: 12rpx;
margin-bottom: 16rpx;
background: #F5F0EA;
}
/* 详细简介 */
.entry-content {
display: block;
color: #4A4036;
}
/* 结构化扩展字段列表 */
.extra-list {
margin-top: 16rpx;
background: #FBF7F1;
border-radius: 12rpx;
padding: 8rpx 20rpx;
}
.extra-item {
display: flex;
padding: 12rpx 0;
border-bottom: 1rpx solid #F0E6DA;
}
.extra-item:last-child {
border-bottom: none;
}
.extra-name {
flex-shrink: 0;
width: 140rpx;
font-size: 26rpx;
color: #A08B76;
font-weight: 500;
}
.extra-value {
flex: 1;
font-size: 26rpx;
color: #4A4036;
line-height: 1.6;
}
.empty-tip {
padding: 80rpx 0;
}