修复了从卡片进入日历无法定位当前日期的bug。

Signed-off-by: Yang Yongquan <i@yangyq.net>
This commit is contained in:
2026-09-16 11:38:01 +08:00
parent 314ed4b75c
commit cc7523a8ec
5 changed files with 43 additions and 3 deletions
@@ -91,6 +91,7 @@ struct Widget4x4Card {
@LocalStorageProp('dayCount') dayCount: number = 0;
@LocalStorageProp('listJson') listJson: string = '[]';
@LocalStorageProp('displayStyle') displayStyle: string = 'timeline';
@LocalStorageProp('selectedDate') selectedDate: number = 0; // 卡片当前显示日 0 点毫秒
private parseBlocks(): TBlock[] {
try {
@@ -421,7 +422,8 @@ struct Widget4x4Card {
postCardAction(this, {
action: 'router',
abilityName: 'EntryAbility',
params: {}
// 携带卡片当前显示日(用户可能已翻到其他日期),进入日历时定位到这一天
params: { openDate: this.selectedDate }
});
}
@@ -90,6 +90,7 @@ struct Widget6x4Card {
@LocalStorageProp('dayCount') dayCount: number = 0;
@LocalStorageProp('listJson') listJson: string = '[]';
@LocalStorageProp('displayStyle') displayStyle: string = 'timeline';
@LocalStorageProp('selectedDate') selectedDate: number = 0; // 卡片当前显示日 0 点毫秒
private parseBlocks(): TBlock6[] {
try {
@@ -418,7 +419,8 @@ struct Widget6x4Card {
postCardAction(this, {
action: 'router',
abilityName: 'EntryAbility',
params: {}
// 携带卡片当前显示日(用户可能已翻到其他日期),进入日历时定位到这一天
params: { openDate: this.selectedDate }
});
}