v69b:大卡抬头「星期 + 农历」合成一行(真机上第二行被 Divider 切掉半截)

真机截图看到 4×4 卡的抬头是「10月20日」下面压着半截字(看着像"一十三"):
原来是 12sp 日期 + 9sp 农历**两行**,4×4 卡高度紧,
第二行被下面的 Divider 压掉了一半。

⇒ 四处统一走 `subLine()` 拼成一行(`星期二  十一`):
2×2 / 2×4 本来就是单行、真机上是正常的,大卡跟它们对齐。

守卫加 v66 ⑭(四块卡都必须走 `subLine()`,且不许退回"农历有值就吞掉星期"的写法),
反向验证加一条注入(把 4×4 改回 `Text(this.lunarText)` ⇒ 守卫变红)。
This commit is contained in:
2026-10-20 22:09:51 +08:00
parent 719c68202b
commit 15bc3c8599
2 changed files with 30 additions and 2 deletions
+16 -1
View File
@@ -129,6 +129,18 @@ struct FbCard4x4 {
return off; return off;
} }
/** 副标题:`星期二 十一`(缺哪段就少哪段) */
private subLine(): string {
const parts: string[] = [];
if (this.weekday !== '') {
parts.push(this.weekday);
}
if (this.lunarText !== '') {
parts.push(this.lunarText);
}
return parts.join(' ');
}
/** 打开应用并定位到卡片显示的那天 */ /** 打开应用并定位到卡片显示的那天 */
private openApp(): void { private openApp(): void {
postCardAction(this, { postCardAction(this, {
@@ -490,7 +502,10 @@ struct FbCard4x4 {
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
.fontColor(this.isToday ? '#A84A28' : '#2C231D') .fontColor(this.isToday ? '#A84A28' : '#2C231D')
.maxLines(1) .maxLines(1)
Text(this.lunarText === '' ? this.weekday : this.lunarText) /* ⚠️ 星期与农历**合成一行**:真机上两行时,第二行会被下面的 Divider
切掉半截(4×4 卡高度紧,12sp+9sp 两行放不下)。一行也不会更挤 ——
2×2 卡上就是这么排的,实测正常。 */
Text(this.subLine())
.fontSize(9) .fontSize(9)
.fontColor('#A8988A') .fontColor('#A8988A')
.maxLines(1) .maxLines(1)
+14 -1
View File
@@ -126,6 +126,18 @@ struct FbCard6x4 {
return off; return off;
} }
/** 副标题:`星期二 十一`(缺哪段就少哪段) */
private subLine(): string {
const parts: string[] = [];
if (this.weekday !== '') {
parts.push(this.weekday);
}
if (this.lunarText !== '') {
parts.push(this.lunarText);
}
return parts.join(' ');
}
/** 打开应用并定位到卡片显示的那天 */ /** 打开应用并定位到卡片显示的那天 */
private openApp(): void { private openApp(): void {
postCardAction(this, { postCardAction(this, {
@@ -487,7 +499,8 @@ struct FbCard6x4 {
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
.fontColor(this.isToday ? '#A84A28' : '#2C231D') .fontColor(this.isToday ? '#A84A28' : '#2C231D')
.maxLines(1) .maxLines(1)
Text(this.lunarText === '' ? this.weekday : this.lunarText) /* ⚠️ 星期与农历**合成一行**(真机上两行时第二行会被 Divider 切掉半截) */
Text(this.subLine())
.fontSize(9) .fontSize(9)
.fontColor('#A8988A') .fontColor('#A8988A')
.maxLines(1) .maxLines(1)