陈剑华

fix: 18018 我的收藏>收藏列表,不需要已读置灰

Showing 18 changed files with 107 additions and 34 deletions
... ... @@ -8,6 +8,7 @@ import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card11Component';
... ... @@ -26,7 +27,8 @@ export struct Card11Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
... ... @@ -91,7 +93,9 @@ export struct Card11Component {
.backgroundColor($r("app.color.white"))
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card12Component';
... ... @@ -25,7 +26,9 @@ export struct Card12Component {
aboutToAppear(): void {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
... ... @@ -84,7 +87,9 @@ export struct Card12Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card14Component';
... ... @@ -27,7 +28,8 @@ export struct Card14Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -103,7 +105,9 @@ export struct Card14Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG: string = 'Card15Component';
... ... @@ -31,7 +32,8 @@ export struct Card15Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -100,7 +102,9 @@ export struct Card15Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card16Component';
... ... @@ -33,7 +34,8 @@ export struct Card16Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -133,7 +135,9 @@ export struct Card16Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card17Component';
... ... @@ -28,7 +29,8 @@ export struct Card17Component {
async aboutToAppear(): Promise<void> {
console.log('Card17Component', JSON.stringify(this.contentDTO))
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -111,7 +113,9 @@ export struct Card17Component {
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
... ...
... ... @@ -7,6 +7,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card19Component';
... ... @@ -25,7 +26,8 @@ export struct Card19Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
console.log('card19',JSON.stringify(this.contentDTO))
}
... ... @@ -71,7 +73,9 @@ export struct Card19Component {
.lineHeight(25)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
ProcessUtils.processPage(this.contentDTO)
})
}
... ... @@ -89,7 +93,9 @@ export struct Card19Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG = 'Card20Component';
... ... @@ -26,7 +27,8 @@ export struct Card20Component {
aboutToAppear(): void {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
... ... @@ -85,7 +87,9 @@ export struct Card20Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG: string = 'Card6Component-Card13Component';
... ... @@ -27,7 +28,8 @@ export struct Card21Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -93,7 +95,9 @@ export struct Card21Component {
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -9,6 +9,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG: string = 'Card2Component'
/**
... ... @@ -31,7 +32,8 @@ export struct Card2Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -143,7 +145,9 @@ export struct Card2Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -6,6 +6,7 @@ import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
/**
... ... @@ -24,7 +25,8 @@ export struct Card3Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
... ... @@ -90,7 +92,9 @@ export struct Card3Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG: string = 'Card4Component';
... ... @@ -30,7 +31,8 @@ export struct Card4Component {
@ObjectLink compDTO: CompDTO
async aboutToAppear(): Promise<void> {
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -120,7 +122,9 @@ export struct Card4Component {
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -6,6 +6,7 @@ import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG: string = 'Card5Component';
... ... @@ -27,7 +28,8 @@ export struct Card5Component {
async aboutToAppear(): Promise<void> {
console.log('Card2Component', JSON.stringify(this.compDTO))
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
this.titleInit();
... ... @@ -128,7 +130,9 @@ export struct Card5Component {
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -9,6 +9,7 @@ import { Logger } from 'wdKit/Index';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
const TAG: string = 'Card6Component-Card13Component';
... ... @@ -30,7 +31,8 @@ export struct Card6Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
... ... @@ -126,7 +128,9 @@ export struct Card6Component {
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -8,6 +8,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
/**
* 时间链卡--CompStyle: 09
... ... @@ -43,7 +44,8 @@ export struct Card9Component {
console.log('Card9Component', JSON.stringify(this.contentDTO))
this.titleInit();
// this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
... ... @@ -142,7 +144,9 @@ export struct Card9Component {
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card4Component';
... ... @@ -26,6 +28,9 @@ export struct SearchContentComponent {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.titleInit();
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
... ... @@ -66,7 +71,9 @@ export struct SearchContentComponent {
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
if (router.getState().name !== 'MyCollectionListPage') {
this.clicked = true;
}
ProcessUtils.processPage(this.contentDTO)
})
//bottom 评论等信息
... ...
... ... @@ -614,7 +614,7 @@ export struct PaperSingleColumn999CardView {
aboutToAppear(): void {
this.onChangeCommentList()
this.isRead = hasClicked(this.item.objectId)
this.isRead = hasClicked(this.item.objectId, '')
}
onChangeCommentList() {
... ...
... ... @@ -13,10 +13,13 @@ function persistentStorage(id: string | number, type: 'add' | 'remove' | undefin
AppStorage.set('clickedIds', clickedIds.join(','));
}
function hasClicked(id: string | number) {
function hasClicked(id: string | number, curRouter: string) {
let _clickedIds = AppStorage.get<string[]>('clickedIds');
let clickedIds = _clickedIds?.toString()?.split(',') || [];
let index = clickedIds.indexOf(id.toString())
console.log('hasClicked-curRouter', curRouter)
if (curRouter === 'MyCollectionListPage') return false
if (index >= 0) return true;
return false;
}
... ...