wangliang_wd

feat:增加早晚报已读状态

... ... @@ -7,6 +7,7 @@ import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
const TAG: string = 'CardView';
... ... @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView {
export struct PaperSingleColumn999CardView {
private item: ContentDTO = new ContentDTO();
private index: number = -1;
@State isRead: boolean = false;//已读状态
@State interactData: InteractDataDTO = {} as InteractDataDTO;
@Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
... ... @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView {
}
if (this.item?.newsSummary) {
Text(this.item?.newsSummary)
.fontColor('#6666666')
.fontColor(this.isRead ? 0x848484 : '#222222')
.fontSize(14)
.padding({ top: 10 })
.alignSelf(ItemAlign.Start)
... ... @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView {
.margin({ bottom: 10, left: 12, right: 12 })
.borderRadius(4)
.onClick(() => {
this.isRead = true
persistentStorage(this.item.objectId);
ProcessUtils.processPage(this.item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
... ... @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView {
aboutToAppear(): void {
this.onChangeCommentList()
this.isRead = hasClicked(this.item.objectId)
}
onChangeCommentList() {
... ...