Showing
18 changed files
with
107 additions
and
34 deletions
| @@ -8,6 +8,7 @@ import { Notes } from './notes'; | @@ -8,6 +8,7 @@ import { Notes } from './notes'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG = 'Card11Component'; | 13 | const TAG = 'Card11Component'; |
| 13 | 14 | ||
| @@ -26,7 +27,8 @@ export struct Card11Component { | @@ -26,7 +27,8 @@ export struct Card11Component { | ||
| 26 | 27 | ||
| 27 | async aboutToAppear(): Promise<void> { | 28 | async aboutToAppear(): Promise<void> { |
| 28 | this.titleInit(); | 29 | this.titleInit(); |
| 29 | - this.clicked = hasClicked(this.contentDTO.objectId) | 30 | + const curRouter = router.getState().name; |
| 31 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 30 | } | 32 | } |
| 31 | 33 | ||
| 32 | titleInit() { | 34 | titleInit() { |
| @@ -91,7 +93,9 @@ export struct Card11Component { | @@ -91,7 +93,9 @@ export struct Card11Component { | ||
| 91 | .backgroundColor($r("app.color.white")) | 93 | .backgroundColor($r("app.color.white")) |
| 92 | .onClick((event: ClickEvent) => { | 94 | .onClick((event: ClickEvent) => { |
| 93 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 95 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 94 | - this.clicked = true; | 96 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 97 | + this.clicked = true; | ||
| 98 | + } | ||
| 95 | persistentStorage(this.contentDTO.objectId); | 99 | persistentStorage(this.contentDTO.objectId); |
| 96 | ProcessUtils.processPage(this.contentDTO) | 100 | ProcessUtils.processPage(this.contentDTO) |
| 97 | }) | 101 | }) |
| @@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction' | @@ -7,6 +7,7 @@ import {CarderInteraction} from '../CarderInteraction' | ||
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 10 | +import router from '@ohos.router' | ||
| 10 | 11 | ||
| 11 | const TAG = 'Card12Component'; | 12 | const TAG = 'Card12Component'; |
| 12 | 13 | ||
| @@ -25,7 +26,9 @@ export struct Card12Component { | @@ -25,7 +26,9 @@ export struct Card12Component { | ||
| 25 | 26 | ||
| 26 | aboutToAppear(): void { | 27 | aboutToAppear(): void { |
| 27 | this.titleInit(); | 28 | this.titleInit(); |
| 28 | - this.clicked = hasClicked(this.contentDTO.objectId) | 29 | + |
| 30 | + const curRouter = router.getState().name; | ||
| 31 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 29 | } | 32 | } |
| 30 | 33 | ||
| 31 | titleInit() { | 34 | titleInit() { |
| @@ -84,7 +87,9 @@ export struct Card12Component { | @@ -84,7 +87,9 @@ export struct Card12Component { | ||
| 84 | }) | 87 | }) |
| 85 | .onClick((event: ClickEvent) => { | 88 | .onClick((event: ClickEvent) => { |
| 86 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 89 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 87 | - this.clicked = true; | 90 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 91 | + this.clicked = true; | ||
| 92 | + } | ||
| 88 | persistentStorage(this.contentDTO.objectId); | 93 | persistentStorage(this.contentDTO.objectId); |
| 89 | ProcessUtils.processPage(this.contentDTO) | 94 | ProcessUtils.processPage(this.contentDTO) |
| 90 | }) | 95 | }) |
| @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG = 'Card14Component'; | 13 | const TAG = 'Card14Component'; |
| 13 | 14 | ||
| @@ -27,7 +28,8 @@ export struct Card14Component { | @@ -27,7 +28,8 @@ export struct Card14Component { | ||
| 27 | 28 | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 29 | this.titleInit(); | 30 | this.titleInit(); |
| 30 | - this.clicked = hasClicked(this.contentDTO.objectId) | 31 | + const curRouter = router.getState().name; |
| 32 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | } | 34 | } |
| 33 | 35 | ||
| @@ -103,7 +105,9 @@ export struct Card14Component { | @@ -103,7 +105,9 @@ export struct Card14Component { | ||
| 103 | }) | 105 | }) |
| 104 | .onClick((event: ClickEvent) => { | 106 | .onClick((event: ClickEvent) => { |
| 105 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 107 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 106 | - this.clicked = true; | 108 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 109 | + this.clicked = true; | ||
| 110 | + } | ||
| 107 | persistentStorage(this.contentDTO.objectId); | 111 | persistentStorage(this.contentDTO.objectId); |
| 108 | ProcessUtils.processPage(this.contentDTO) | 112 | ProcessUtils.processPage(this.contentDTO) |
| 109 | }) | 113 | }) |
| @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG: string = 'Card15Component'; | 13 | const TAG: string = 'Card15Component'; |
| 13 | 14 | ||
| @@ -31,7 +32,8 @@ export struct Card15Component { | @@ -31,7 +32,8 @@ export struct Card15Component { | ||
| 31 | 32 | ||
| 32 | async aboutToAppear(): Promise<void> { | 33 | async aboutToAppear(): Promise<void> { |
| 33 | this.titleInit(); | 34 | this.titleInit(); |
| 34 | - this.clicked = hasClicked(this.contentDTO.objectId) | 35 | + const curRouter = router.getState().name; |
| 36 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 35 | this.loadImg = await onlyWifiLoadImg(); | 37 | this.loadImg = await onlyWifiLoadImg(); |
| 36 | } | 38 | } |
| 37 | 39 | ||
| @@ -100,7 +102,9 @@ export struct Card15Component { | @@ -100,7 +102,9 @@ export struct Card15Component { | ||
| 100 | }) | 102 | }) |
| 101 | .onClick((event: ClickEvent) => { | 103 | .onClick((event: ClickEvent) => { |
| 102 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 104 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 103 | - this.clicked = true; | 105 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 106 | + this.clicked = true; | ||
| 107 | + } | ||
| 104 | persistentStorage(this.contentDTO.objectId); | 108 | persistentStorage(this.contentDTO.objectId); |
| 105 | ProcessUtils.processPage(this.contentDTO) | 109 | ProcessUtils.processPage(this.contentDTO) |
| 106 | }) | 110 | }) |
| @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG = 'Card16Component'; | 13 | const TAG = 'Card16Component'; |
| 13 | 14 | ||
| @@ -33,7 +34,8 @@ export struct Card16Component { | @@ -33,7 +34,8 @@ export struct Card16Component { | ||
| 33 | 34 | ||
| 34 | async aboutToAppear(): Promise<void> { | 35 | async aboutToAppear(): Promise<void> { |
| 35 | this.titleInit(); | 36 | this.titleInit(); |
| 36 | - this.clicked = hasClicked(this.contentDTO.objectId) | 37 | + const curRouter = router.getState().name; |
| 38 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 37 | this.loadImg = await onlyWifiLoadImg(); | 39 | this.loadImg = await onlyWifiLoadImg(); |
| 38 | } | 40 | } |
| 39 | 41 | ||
| @@ -133,7 +135,9 @@ export struct Card16Component { | @@ -133,7 +135,9 @@ export struct Card16Component { | ||
| 133 | }) | 135 | }) |
| 134 | .onClick((event: ClickEvent) => { | 136 | .onClick((event: ClickEvent) => { |
| 135 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 137 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 136 | - this.clicked = true; | 138 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 139 | + this.clicked = true; | ||
| 140 | + } | ||
| 137 | persistentStorage(this.contentDTO.objectId); | 141 | persistentStorage(this.contentDTO.objectId); |
| 138 | ProcessUtils.processPage(this.contentDTO) | 142 | ProcessUtils.processPage(this.contentDTO) |
| 139 | }) | 143 | }) |
| @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG = 'Card17Component'; | 13 | const TAG = 'Card17Component'; |
| 13 | 14 | ||
| @@ -28,7 +29,8 @@ export struct Card17Component { | @@ -28,7 +29,8 @@ export struct Card17Component { | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 29 | console.log('Card17Component', JSON.stringify(this.contentDTO)) | 30 | console.log('Card17Component', JSON.stringify(this.contentDTO)) |
| 30 | this.titleInit(); | 31 | this.titleInit(); |
| 31 | - this.clicked = hasClicked(this.contentDTO.objectId) | 32 | + const curRouter = router.getState().name; |
| 33 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 32 | this.loadImg = await onlyWifiLoadImg(); | 34 | this.loadImg = await onlyWifiLoadImg(); |
| 33 | } | 35 | } |
| 34 | 36 | ||
| @@ -111,7 +113,9 @@ export struct Card17Component { | @@ -111,7 +113,9 @@ export struct Card17Component { | ||
| 111 | .width(CommonConstants.FULL_WIDTH) | 113 | .width(CommonConstants.FULL_WIDTH) |
| 112 | .onClick((event: ClickEvent) => { | 114 | .onClick((event: ClickEvent) => { |
| 113 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 115 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 114 | - this.clicked = true; | 116 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 117 | + this.clicked = true; | ||
| 118 | + } | ||
| 115 | persistentStorage(this.contentDTO.objectId); | 119 | persistentStorage(this.contentDTO.objectId); |
| 116 | let taskAction: Action = { | 120 | let taskAction: Action = { |
| 117 | type: 'JUMP_DETAIL_PAGE', | 121 | type: 'JUMP_DETAIL_PAGE', |
| @@ -7,6 +7,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -7,6 +7,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 10 | +import router from '@ohos.router' | ||
| 10 | 11 | ||
| 11 | const TAG = 'Card19Component'; | 12 | const TAG = 'Card19Component'; |
| 12 | 13 | ||
| @@ -25,7 +26,8 @@ export struct Card19Component { | @@ -25,7 +26,8 @@ export struct Card19Component { | ||
| 25 | 26 | ||
| 26 | async aboutToAppear(): Promise<void> { | 27 | async aboutToAppear(): Promise<void> { |
| 27 | this.titleInit(); | 28 | this.titleInit(); |
| 28 | - this.clicked = hasClicked(this.contentDTO.objectId) | 29 | + const curRouter = router.getState().name; |
| 30 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 29 | console.log('card19',JSON.stringify(this.contentDTO)) | 31 | console.log('card19',JSON.stringify(this.contentDTO)) |
| 30 | } | 32 | } |
| 31 | 33 | ||
| @@ -71,7 +73,9 @@ export struct Card19Component { | @@ -71,7 +73,9 @@ export struct Card19Component { | ||
| 71 | .lineHeight(25) | 73 | .lineHeight(25) |
| 72 | .onClick((event: ClickEvent) => { | 74 | .onClick((event: ClickEvent) => { |
| 73 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 75 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 74 | - this.clicked = true; | 76 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 77 | + this.clicked = true; | ||
| 78 | + } | ||
| 75 | ProcessUtils.processPage(this.contentDTO) | 79 | ProcessUtils.processPage(this.contentDTO) |
| 76 | }) | 80 | }) |
| 77 | } | 81 | } |
| @@ -89,7 +93,9 @@ export struct Card19Component { | @@ -89,7 +93,9 @@ export struct Card19Component { | ||
| 89 | }) | 93 | }) |
| 90 | .onClick((event: ClickEvent) => { | 94 | .onClick((event: ClickEvent) => { |
| 91 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 95 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 92 | - this.clicked = true; | 96 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 97 | + this.clicked = true; | ||
| 98 | + } | ||
| 93 | persistentStorage(this.contentDTO.objectId); | 99 | persistentStorage(this.contentDTO.objectId); |
| 94 | ProcessUtils.processPage(this.contentDTO) | 100 | ProcessUtils.processPage(this.contentDTO) |
| 95 | }) | 101 | }) |
| @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG = 'Card20Component'; | 13 | const TAG = 'Card20Component'; |
| 13 | 14 | ||
| @@ -26,7 +27,8 @@ export struct Card20Component { | @@ -26,7 +27,8 @@ export struct Card20Component { | ||
| 26 | 27 | ||
| 27 | aboutToAppear(): void { | 28 | aboutToAppear(): void { |
| 28 | this.titleInit(); | 29 | this.titleInit(); |
| 29 | - this.clicked = hasClicked(this.contentDTO.objectId) | 30 | + const curRouter = router.getState().name; |
| 31 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 30 | } | 32 | } |
| 31 | 33 | ||
| 32 | titleInit() { | 34 | titleInit() { |
| @@ -85,7 +87,9 @@ export struct Card20Component { | @@ -85,7 +87,9 @@ export struct Card20Component { | ||
| 85 | }) | 87 | }) |
| 86 | .onClick((event: ClickEvent) => { | 88 | .onClick((event: ClickEvent) => { |
| 87 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 89 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 88 | - this.clicked = true; | 90 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 91 | + this.clicked = true; | ||
| 92 | + } | ||
| 89 | persistentStorage(this.contentDTO.objectId); | 93 | persistentStorage(this.contentDTO.objectId); |
| 90 | ProcessUtils.processPage(this.contentDTO) | 94 | ProcessUtils.processPage(this.contentDTO) |
| 91 | }) | 95 | }) |
| @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG: string = 'Card6Component-Card13Component'; | 13 | const TAG: string = 'Card6Component-Card13Component'; |
| 13 | 14 | ||
| @@ -27,7 +28,8 @@ export struct Card21Component { | @@ -27,7 +28,8 @@ export struct Card21Component { | ||
| 27 | 28 | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 29 | this.titleInit(); | 30 | this.titleInit(); |
| 30 | - this.clicked = hasClicked(this.contentDTO.objectId) | 31 | + const curRouter = router.getState().name; |
| 32 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | } | 34 | } |
| 33 | 35 | ||
| @@ -93,7 +95,9 @@ export struct Card21Component { | @@ -93,7 +95,9 @@ export struct Card21Component { | ||
| 93 | } | 95 | } |
| 94 | .onClick((event: ClickEvent) => { | 96 | .onClick((event: ClickEvent) => { |
| 95 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 97 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 96 | - this.clicked = true; | 98 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 99 | + this.clicked = true; | ||
| 100 | + } | ||
| 97 | persistentStorage(this.contentDTO.objectId); | 101 | persistentStorage(this.contentDTO.objectId); |
| 98 | ProcessUtils.processPage(this.contentDTO) | 102 | ProcessUtils.processPage(this.contentDTO) |
| 99 | }) | 103 | }) |
| @@ -9,6 +9,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -9,6 +9,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 10 | import { InfomationCardClick } from '../../utils/infomationCardClick'; | 10 | import { InfomationCardClick } from '../../utils/infomationCardClick'; |
| 11 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 11 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 12 | +import router from '@ohos.router' | ||
| 12 | 13 | ||
| 13 | const TAG: string = 'Card2Component' | 14 | const TAG: string = 'Card2Component' |
| 14 | /** | 15 | /** |
| @@ -31,7 +32,8 @@ export struct Card2Component { | @@ -31,7 +32,8 @@ export struct Card2Component { | ||
| 31 | 32 | ||
| 32 | async aboutToAppear(): Promise<void> { | 33 | async aboutToAppear(): Promise<void> { |
| 33 | this.titleInit(); | 34 | this.titleInit(); |
| 34 | - this.clicked = hasClicked(this.contentDTO.objectId) | 35 | + const curRouter = router.getState().name; |
| 36 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 35 | this.loadImg = await onlyWifiLoadImg(); | 37 | this.loadImg = await onlyWifiLoadImg(); |
| 36 | } | 38 | } |
| 37 | 39 | ||
| @@ -143,7 +145,9 @@ export struct Card2Component { | @@ -143,7 +145,9 @@ export struct Card2Component { | ||
| 143 | }) | 145 | }) |
| 144 | .onClick((event: ClickEvent) => { | 146 | .onClick((event: ClickEvent) => { |
| 145 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 147 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 146 | - this.clicked = true; | 148 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 149 | + this.clicked = true; | ||
| 150 | + } | ||
| 147 | persistentStorage(this.contentDTO.objectId); | 151 | persistentStorage(this.contentDTO.objectId); |
| 148 | ProcessUtils.processPage(this.contentDTO) | 152 | ProcessUtils.processPage(this.contentDTO) |
| 149 | }) | 153 | }) |
| @@ -6,6 +6,7 @@ import { Notes } from './notes'; | @@ -6,6 +6,7 @@ import { Notes } from './notes'; | ||
| 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 9 | +import router from '@ohos.router' | ||
| 9 | 10 | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| @@ -24,7 +25,8 @@ export struct Card3Component { | @@ -24,7 +25,8 @@ export struct Card3Component { | ||
| 24 | 25 | ||
| 25 | async aboutToAppear(): Promise<void> { | 26 | async aboutToAppear(): Promise<void> { |
| 26 | this.titleInit(); | 27 | this.titleInit(); |
| 27 | - this.clicked = hasClicked(this.contentDTO.objectId) | 28 | + const curRouter = router.getState().name; |
| 29 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | titleInit() { | 32 | titleInit() { |
| @@ -90,7 +92,9 @@ export struct Card3Component { | @@ -90,7 +92,9 @@ export struct Card3Component { | ||
| 90 | }) | 92 | }) |
| 91 | .onClick((event: ClickEvent) => { | 93 | .onClick((event: ClickEvent) => { |
| 92 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 94 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 93 | - this.clicked = true; | 95 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 96 | + this.clicked = true; | ||
| 97 | + } | ||
| 94 | persistentStorage(this.contentDTO.objectId); | 98 | persistentStorage(this.contentDTO.objectId); |
| 95 | ProcessUtils.processPage(this.contentDTO) | 99 | ProcessUtils.processPage(this.contentDTO) |
| 96 | }) | 100 | }) |
| @@ -8,6 +8,7 @@ import { Notes } from './notes'; | @@ -8,6 +8,7 @@ import { Notes } from './notes'; | ||
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | const TAG: string = 'Card4Component'; | 13 | const TAG: string = 'Card4Component'; |
| 13 | 14 | ||
| @@ -30,7 +31,8 @@ export struct Card4Component { | @@ -30,7 +31,8 @@ export struct Card4Component { | ||
| 30 | @ObjectLink compDTO: CompDTO | 31 | @ObjectLink compDTO: CompDTO |
| 31 | 32 | ||
| 32 | async aboutToAppear(): Promise<void> { | 33 | async aboutToAppear(): Promise<void> { |
| 33 | - this.clicked = hasClicked(this.contentDTO.objectId) | 34 | + const curRouter = router.getState().name; |
| 35 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 34 | this.titleInit(); | 36 | this.titleInit(); |
| 35 | this.loadImg = await onlyWifiLoadImg(); | 37 | this.loadImg = await onlyWifiLoadImg(); |
| 36 | } | 38 | } |
| @@ -120,7 +122,9 @@ export struct Card4Component { | @@ -120,7 +122,9 @@ export struct Card4Component { | ||
| 120 | .alignItems(HorizontalAlign.Start) | 122 | .alignItems(HorizontalAlign.Start) |
| 121 | .onClick((event: ClickEvent) => { | 123 | .onClick((event: ClickEvent) => { |
| 122 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 124 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 123 | - this.clicked = true; | 125 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 126 | + this.clicked = true; | ||
| 127 | + } | ||
| 124 | persistentStorage(this.contentDTO.objectId); | 128 | persistentStorage(this.contentDTO.objectId); |
| 125 | ProcessUtils.processPage(this.contentDTO) | 129 | ProcessUtils.processPage(this.contentDTO) |
| 126 | }) | 130 | }) |
| @@ -6,6 +6,7 @@ import { Notes } from './notes'; | @@ -6,6 +6,7 @@ import { Notes } from './notes'; | ||
| 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 9 | +import router from '@ohos.router' | ||
| 9 | 10 | ||
| 10 | 11 | ||
| 11 | const TAG: string = 'Card5Component'; | 12 | const TAG: string = 'Card5Component'; |
| @@ -27,7 +28,8 @@ export struct Card5Component { | @@ -27,7 +28,8 @@ export struct Card5Component { | ||
| 27 | 28 | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 29 | console.log('Card2Component', JSON.stringify(this.compDTO)) | 30 | console.log('Card2Component', JSON.stringify(this.compDTO)) |
| 30 | - this.clicked = hasClicked(this.contentDTO.objectId) | 31 | + const curRouter = router.getState().name; |
| 32 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | 34 | ||
| 33 | this.titleInit(); | 35 | this.titleInit(); |
| @@ -128,7 +130,9 @@ export struct Card5Component { | @@ -128,7 +130,9 @@ export struct Card5Component { | ||
| 128 | }) | 130 | }) |
| 129 | .onClick((event: ClickEvent) => { | 131 | .onClick((event: ClickEvent) => { |
| 130 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 132 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 131 | - this.clicked = true; | 133 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 134 | + this.clicked = true; | ||
| 135 | + } | ||
| 132 | persistentStorage(this.contentDTO.objectId); | 136 | persistentStorage(this.contentDTO.objectId); |
| 133 | ProcessUtils.processPage(this.contentDTO) | 137 | ProcessUtils.processPage(this.contentDTO) |
| 134 | }) | 138 | }) |
| @@ -9,6 +9,7 @@ import { Logger } from 'wdKit/Index'; | @@ -9,6 +9,7 @@ import { Logger } from 'wdKit/Index'; | ||
| 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 10 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 10 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 11 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 11 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 12 | +import router from '@ohos.router' | ||
| 12 | 13 | ||
| 13 | const TAG: string = 'Card6Component-Card13Component'; | 14 | const TAG: string = 'Card6Component-Card13Component'; |
| 14 | 15 | ||
| @@ -30,7 +31,8 @@ export struct Card6Component { | @@ -30,7 +31,8 @@ export struct Card6Component { | ||
| 30 | async aboutToAppear(): Promise<void> { | 31 | async aboutToAppear(): Promise<void> { |
| 31 | this.titleInit(); | 32 | this.titleInit(); |
| 32 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 33 | - this.clicked = hasClicked(this.contentDTO.objectId) | 34 | + const curRouter = router.getState().name; |
| 35 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 34 | } | 36 | } |
| 35 | titleInit() { | 37 | titleInit() { |
| 36 | const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 38 | const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); |
| @@ -126,7 +128,9 @@ export struct Card6Component { | @@ -126,7 +128,9 @@ export struct Card6Component { | ||
| 126 | } | 128 | } |
| 127 | .onClick((event: ClickEvent) => { | 129 | .onClick((event: ClickEvent) => { |
| 128 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 130 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 129 | - this.clicked = true; | 131 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 132 | + this.clicked = true; | ||
| 133 | + } | ||
| 130 | persistentStorage(this.contentDTO.objectId); | 134 | persistentStorage(this.contentDTO.objectId); |
| 131 | ProcessUtils.processPage(this.contentDTO) | 135 | ProcessUtils.processPage(this.contentDTO) |
| 132 | }) | 136 | }) |
| @@ -8,6 +8,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | @@ -8,6 +8,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | 9 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | +import router from '@ohos.router' | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * 时间链卡--CompStyle: 09 | 14 | * 时间链卡--CompStyle: 09 |
| @@ -43,7 +44,8 @@ export struct Card9Component { | @@ -43,7 +44,8 @@ export struct Card9Component { | ||
| 43 | console.log('Card9Component', JSON.stringify(this.contentDTO)) | 44 | console.log('Card9Component', JSON.stringify(this.contentDTO)) |
| 44 | this.titleInit(); | 45 | this.titleInit(); |
| 45 | // this.loadImg = await onlyWifiLoadImg(); | 46 | // this.loadImg = await onlyWifiLoadImg(); |
| 46 | - this.clicked = hasClicked(this.contentDTO.objectId) | 47 | + const curRouter = router.getState().name; |
| 48 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 47 | } | 49 | } |
| 48 | 50 | ||
| 49 | titleInit() { | 51 | titleInit() { |
| @@ -142,7 +144,9 @@ export struct Card9Component { | @@ -142,7 +144,9 @@ export struct Card9Component { | ||
| 142 | .margin({ bottom: 8 }) | 144 | .margin({ bottom: 8 }) |
| 143 | .onClick((event: ClickEvent) => { | 145 | .onClick((event: ClickEvent) => { |
| 144 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 146 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 145 | - this.clicked = true; | 147 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 148 | + this.clicked = true; | ||
| 149 | + } | ||
| 146 | persistentStorage(this.contentDTO.objectId); | 150 | persistentStorage(this.contentDTO.objectId); |
| 147 | ProcessUtils.processPage(this.contentDTO) | 151 | ProcessUtils.processPage(this.contentDTO) |
| 148 | }) | 152 | }) |
| @@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | @@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 9 | +import router from '@ohos.router' | ||
| 10 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 9 | 11 | ||
| 10 | const TAG: string = 'Card4Component'; | 12 | const TAG: string = 'Card4Component'; |
| 11 | 13 | ||
| @@ -26,6 +28,9 @@ export struct SearchContentComponent { | @@ -26,6 +28,9 @@ export struct SearchContentComponent { | ||
| 26 | async aboutToAppear(): Promise<void> { | 28 | async aboutToAppear(): Promise<void> { |
| 27 | this.loadImg = await onlyWifiLoadImg(); | 29 | this.loadImg = await onlyWifiLoadImg(); |
| 28 | this.titleInit(); | 30 | this.titleInit(); |
| 31 | + | ||
| 32 | + const curRouter = router.getState().name; | ||
| 33 | + this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | ||
| 29 | } | 34 | } |
| 30 | 35 | ||
| 31 | titleInit() { | 36 | titleInit() { |
| @@ -66,7 +71,9 @@ export struct SearchContentComponent { | @@ -66,7 +71,9 @@ export struct SearchContentComponent { | ||
| 66 | .alignItems(HorizontalAlign.Start) | 71 | .alignItems(HorizontalAlign.Start) |
| 67 | .onClick((event: ClickEvent) => { | 72 | .onClick((event: ClickEvent) => { |
| 68 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 73 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 69 | - this.clicked = true; | 74 | + if (router.getState().name !== 'MyCollectionListPage') { |
| 75 | + this.clicked = true; | ||
| 76 | + } | ||
| 70 | ProcessUtils.processPage(this.contentDTO) | 77 | ProcessUtils.processPage(this.contentDTO) |
| 71 | }) | 78 | }) |
| 72 | //bottom 评论等信息 | 79 | //bottom 评论等信息 |
| @@ -614,7 +614,7 @@ export struct PaperSingleColumn999CardView { | @@ -614,7 +614,7 @@ export struct PaperSingleColumn999CardView { | ||
| 614 | 614 | ||
| 615 | aboutToAppear(): void { | 615 | aboutToAppear(): void { |
| 616 | this.onChangeCommentList() | 616 | this.onChangeCommentList() |
| 617 | - this.isRead = hasClicked(this.item.objectId) | 617 | + this.isRead = hasClicked(this.item.objectId, '') |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | onChangeCommentList() { | 620 | onChangeCommentList() { |
| @@ -13,10 +13,13 @@ function persistentStorage(id: string | number, type: 'add' | 'remove' | undefin | @@ -13,10 +13,13 @@ function persistentStorage(id: string | number, type: 'add' | 'remove' | undefin | ||
| 13 | AppStorage.set('clickedIds', clickedIds.join(',')); | 13 | AppStorage.set('clickedIds', clickedIds.join(',')); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | -function hasClicked(id: string | number) { | 16 | +function hasClicked(id: string | number, curRouter: string) { |
| 17 | let _clickedIds = AppStorage.get<string[]>('clickedIds'); | 17 | let _clickedIds = AppStorage.get<string[]>('clickedIds'); |
| 18 | let clickedIds = _clickedIds?.toString()?.split(',') || []; | 18 | let clickedIds = _clickedIds?.toString()?.split(',') || []; |
| 19 | let index = clickedIds.indexOf(id.toString()) | 19 | let index = clickedIds.indexOf(id.toString()) |
| 20 | + | ||
| 21 | + console.log('hasClicked-curRouter', curRouter) | ||
| 22 | + if (curRouter === 'MyCollectionListPage') return false | ||
| 20 | if (index >= 0) return true; | 23 | if (index >= 0) return true; |
| 21 | return false; | 24 | return false; |
| 22 | } | 25 | } |
-
Please register or login to post a comment