Showing
2 changed files
with
14 additions
and
12 deletions
| @@ -84,7 +84,7 @@ export struct ENewspaperPageComponent { | @@ -84,7 +84,7 @@ export struct ENewspaperPageComponent { | ||
| 84 | selectDate: this.selectDate, | 84 | selectDate: this.selectDate, |
| 85 | onDateChange: (date: RMCalendarBean) => { | 85 | onDateChange: (date: RMCalendarBean) => { |
| 86 | console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date)) | 86 | console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date)) |
| 87 | - if (date.fullYear && date.month && date.date) { | 87 | + if (date?.fullYear && date?.month && date?.date) { |
| 88 | let month: number = date.month + 1 | 88 | let month: number = date.month + 1 |
| 89 | this.calendarDate = | 89 | this.calendarDate = |
| 90 | `${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}` | 90 | `${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}` |
| @@ -94,14 +94,16 @@ export struct ENewspaperPageComponent { | @@ -94,14 +94,16 @@ export struct ENewspaperPageComponent { | ||
| 94 | new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) | 94 | new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) |
| 95 | } | 95 | } |
| 96 | //日历选择点击 | 96 | //日历选择点击 |
| 97 | - TrackingContent.clickWithEvent('date_selection_click', TrackConstants.PageName.NewsPaperPage, | ||
| 98 | - TrackConstants.PageName.NewsPaperPage | ||
| 99 | - , { | ||
| 100 | - 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum, | ||
| 101 | - 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 102 | - 'currentPanelDate': this.selectDate.toDateString(), | ||
| 103 | - 'currentNumber': this.swiperIndex, | ||
| 104 | - }) | 97 | + if (this.newspaperListBean?.list) { |
| 98 | + TrackingContent.clickWithEvent('date_selection_click', TrackConstants.PageName.NewsPaperPage, | ||
| 99 | + TrackConstants.PageName.NewsPaperPage | ||
| 100 | + , { | ||
| 101 | + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum, | ||
| 102 | + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 103 | + 'currentPanelDate': this.selectDate.toDateString(), | ||
| 104 | + 'currentNumber': this.swiperIndex, | ||
| 105 | + }) | ||
| 106 | + } | ||
| 105 | } | 107 | } |
| 106 | }), | 108 | }), |
| 107 | alignment: DialogAlignment.Top, | 109 | alignment: DialogAlignment.Top, |
| @@ -22,7 +22,7 @@ export struct InteractMComponent { | @@ -22,7 +22,7 @@ export struct InteractMComponent { | ||
| 22 | 22 | ||
| 23 | Column(){ | 23 | Column(){ |
| 24 | Row(){ | 24 | Row(){ |
| 25 | - Text(this.messageModel.InteractMsubM.userName) | 25 | + Text(this.messageModel.InteractMsubM?.userName) |
| 26 | .fontSize('14fp').fontColor('#222222') | 26 | .fontSize('14fp').fontColor('#222222') |
| 27 | 27 | ||
| 28 | Text(this.buildContentString()) | 28 | Text(this.buildContentString()) |
| @@ -30,7 +30,7 @@ export struct InteractMComponent { | @@ -30,7 +30,7 @@ export struct InteractMComponent { | ||
| 30 | .margin({left:5}) | 30 | .margin({left:5}) |
| 31 | }.width('100%') | 31 | }.width('100%') |
| 32 | 32 | ||
| 33 | - Text(this.getPublishTime(this.messageModel.time,DateTimeUtils.getDateTimestamp(this.messageModel.time)+"")) | 33 | + Text(this.messageModel.time?this.getPublishTime(this.messageModel.time,DateTimeUtils.getDateTimestamp(this.messageModel.time)+""):'') |
| 34 | .margin({top:2}) | 34 | .margin({top:2}) |
| 35 | .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) | 35 | .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) |
| 36 | 36 | ||
| @@ -59,7 +59,7 @@ export struct InteractMComponent { | @@ -59,7 +59,7 @@ export struct InteractMComponent { | ||
| 59 | Image($r('app.media.MessageOriginTextIcon')) | 59 | Image($r('app.media.MessageOriginTextIcon')) |
| 60 | .width('12') | 60 | .width('12') |
| 61 | .height('12') | 61 | .height('12') |
| 62 | - Text(this.messageModel.InteractMsubM.contentTitle) | 62 | + Text(this.messageModel.InteractMsubM?.contentTitle) |
| 63 | .fontSize('12fp') | 63 | .fontSize('12fp') |
| 64 | .fontColor('#666666') | 64 | .fontColor('#666666') |
| 65 | .maxLines(1) | 65 | .maxLines(1) |
-
Please register or login to post a comment