diff --git a/entry/src/main/ets/pages/card/FbCard4x4.ets b/entry/src/main/ets/pages/card/FbCard4x4.ets index 48f3fc6..592a55c 100644 --- a/entry/src/main/ets/pages/card/FbCard4x4.ets +++ b/entry/src/main/ets/pages/card/FbCard4x4.ets @@ -129,6 +129,18 @@ struct FbCard4x4 { 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 { postCardAction(this, { @@ -490,7 +502,10 @@ struct FbCard4x4 { .fontWeight(FontWeight.Bold) .fontColor(this.isToday ? '#A84A28' : '#2C231D') .maxLines(1) - Text(this.lunarText === '' ? this.weekday : this.lunarText) + /* ⚠️ 星期与农历**合成一行**:真机上两行时,第二行会被下面的 Divider + 切掉半截(4×4 卡高度紧,12sp+9sp 两行放不下)。一行也不会更挤 —— + 2×2 卡上就是这么排的,实测正常。 */ + Text(this.subLine()) .fontSize(9) .fontColor('#A8988A') .maxLines(1) diff --git a/entry/src/main/ets/pages/card/FbCard6x4.ets b/entry/src/main/ets/pages/card/FbCard6x4.ets index ea41982..321aa90 100644 --- a/entry/src/main/ets/pages/card/FbCard6x4.ets +++ b/entry/src/main/ets/pages/card/FbCard6x4.ets @@ -126,6 +126,18 @@ struct FbCard6x4 { 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 { postCardAction(this, { @@ -487,7 +499,8 @@ struct FbCard6x4 { .fontWeight(FontWeight.Bold) .fontColor(this.isToday ? '#A84A28' : '#2C231D') .maxLines(1) - Text(this.lunarText === '' ? this.weekday : this.lunarText) + /* ⚠️ 星期与农历**合成一行**(真机上两行时第二行会被 Divider 切掉半截) */ + Text(this.subLine()) .fontSize(9) .fontColor('#A8988A') .maxLines(1)