wangliang_wd

feat:增加早晚报已读状态

@@ -7,6 +7,7 @@ import { TrackConstants, @@ -7,6 +7,7 @@ import { TrackConstants,
7 TrackingButton, 7 TrackingButton,
8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; 8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
9 import { WDShare } from 'wdShare/Index'; 9 import { WDShare } from 'wdShare/Index';
  10 +import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
10 11
11 const TAG: string = 'CardView'; 12 const TAG: string = 'CardView';
12 13
@@ -393,6 +394,7 @@ export struct MasonryLayout01CardView { @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView {
393 export struct PaperSingleColumn999CardView { 394 export struct PaperSingleColumn999CardView {
394 private item: ContentDTO = new ContentDTO(); 395 private item: ContentDTO = new ContentDTO();
395 private index: number = -1; 396 private index: number = -1;
  397 + @State isRead: boolean = false;//已读状态
396 @State interactData: InteractDataDTO = {} as InteractDataDTO; 398 @State interactData: InteractDataDTO = {} as InteractDataDTO;
397 @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] 399 @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
398 400
@@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView { @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView {
533 } 535 }
534 if (this.item?.newsSummary) { 536 if (this.item?.newsSummary) {
535 Text(this.item?.newsSummary) 537 Text(this.item?.newsSummary)
536 - .fontColor('#6666666') 538 + .fontColor(this.isRead ? 0x848484 : '#222222')
537 .fontSize(14) 539 .fontSize(14)
538 .padding({ top: 10 }) 540 .padding({ top: 10 })
539 .alignSelf(ItemAlign.Start) 541 .alignSelf(ItemAlign.Start)
@@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView { @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView {
599 .margin({ bottom: 10, left: 12, right: 12 }) 601 .margin({ bottom: 10, left: 12, right: 12 })
600 .borderRadius(4) 602 .borderRadius(4)
601 .onClick(() => { 603 .onClick(() => {
  604 + this.isRead = true
  605 + persistentStorage(this.item.objectId);
602 ProcessUtils.processPage(this.item) 606 ProcessUtils.processPage(this.item)
603 TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item)) 607 TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
604 }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 608 }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
@@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView { @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView {
610 614
611 aboutToAppear(): void { 615 aboutToAppear(): void {
612 this.onChangeCommentList() 616 this.onChangeCommentList()
  617 + this.isRead = hasClicked(this.item.objectId)
613 } 618 }
614 619
615 onChangeCommentList() { 620 onChangeCommentList() {