陈剑华

fix: 17293 功能缺陷--已读的文章刷新后置灰状态被重置

@@ -6,7 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; @@ -6,7 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
6 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 6 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
7 import { Notes } from './notes'; 7 import { Notes } from './notes';
8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
9 -import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; 9 +// import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
10 10
11 const TAG: string = 'Card2Component'; 11 const TAG: string = 'Card2Component';
12 12
@@ -25,7 +25,7 @@ export struct Card2Component { @@ -25,7 +25,7 @@ export struct Card2Component {
25 25
26 async aboutToAppear(): Promise<void> { 26 async aboutToAppear(): Promise<void> {
27 this.loadImg = await onlyWifiLoadImg(); 27 this.loadImg = await onlyWifiLoadImg();
28 - this.clicked = hasClicked(this.contentDTO.objectId) 28 + // this.clicked = hasClicked(this.contentDTO.objectId)
29 } 29 }
30 30
31 build() { 31 build() {
@@ -77,7 +77,7 @@ export struct Card2Component { @@ -77,7 +77,7 @@ export struct Card2Component {
77 }) 77 })
78 .onClick((event: ClickEvent) => { 78 .onClick((event: ClickEvent) => {
79 this.clicked = true; 79 this.clicked = true;
80 - persistentStorage(this.contentDTO.objectId); 80 + // persistentStorage(this.contentDTO.objectId);
81 ProcessUtils.processPage(this.contentDTO) 81 ProcessUtils.processPage(this.contentDTO)
82 }) 82 })
83 } 83 }
@@ -5,7 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; @@ -5,7 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
6 import { Notes } from './notes'; 6 import { Notes } from './notes';
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
8 -import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; 8 +// import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
9 9
10 const TAG: string = 'Card6Component-Card13Component'; 10 const TAG: string = 'Card6Component-Card13Component';
11 11
@@ -20,7 +20,7 @@ export struct Card6Component { @@ -20,7 +20,7 @@ export struct Card6Component {
20 20
21 async aboutToAppear(): Promise<void> { 21 async aboutToAppear(): Promise<void> {
22 this.loadImg = await onlyWifiLoadImg(); 22 this.loadImg = await onlyWifiLoadImg();
23 - this.clicked = hasClicked(this.contentDTO.objectId) 23 + // this.clicked = hasClicked(this.contentDTO.objectId)
24 } 24 }
25 25
26 build() { 26 build() {
@@ -80,7 +80,7 @@ export struct Card6Component { @@ -80,7 +80,7 @@ export struct Card6Component {
80 } 80 }
81 .onClick((event: ClickEvent) => { 81 .onClick((event: ClickEvent) => {
82 this.clicked = true; 82 this.clicked = true;
83 - persistentStorage(this.contentDTO.objectId); 83 + // persistentStorage(this.contentDTO.objectId);
84 ProcessUtils.processPage(this.contentDTO) 84 ProcessUtils.processPage(this.contentDTO)
85 }) 85 })
86 .padding({ 86 .padding({
1 -PersistentStorage.persistProp('clickedIds', []);  
2 -  
3 -function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {  
4 - let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];  
5 - let index = clickedIds.indexOf(id.toString())  
6 - if (type === 'add') {  
7 - if (index >= 0) return;  
8 - clickedIds.push(id.toString());  
9 - } else if (type === 'remove') {  
10 - clickedIds.splice(index, 1);  
11 - }  
12 - AppStorage.set('clickedIds', clickedIds.join(','));  
13 -}  
14 -  
15 -function hasClicked(id: string | number) {  
16 - let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];  
17 - let index = clickedIds.indexOf(id.toString())  
18 - if (index >= 0) return true;  
19 - return false;  
20 -}  
21 -  
22 -export { persistentStorage, hasClicked }  
  1 +// PersistentStorage.persistProp('clickedIds', []);
  2 +//
  3 +// function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {
  4 +// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
  5 +// let index = clickedIds.indexOf(id.toString())
  6 +// if (type === 'add') {
  7 +// if (index >= 0) return;
  8 +// clickedIds.push(id.toString());
  9 +// } else if (type === 'remove') {
  10 +// clickedIds.splice(index, 1);
  11 +// }
  12 +// AppStorage.set('clickedIds', clickedIds.join(','));
  13 +// }
  14 +//
  15 +// function hasClicked(id: string | number) {
  16 +// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
  17 +// let index = clickedIds.indexOf(id.toString())
  18 +// if (index >= 0) return true;
  19 +// return false;
  20 +// }
  21 +//
  22 +// export { persistentStorage, hasClicked }