Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-05-15 10:54:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6927aa773cd7d4f5b93a2131d6fa465352f663a5
6927aa77
1 parent
0af193db
fix: 17293 功能缺陷--已读的文章刷新后置灰状态被重置
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/utils/persistentStorage.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
6927aa7
...
...
@@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card2Component';
...
...
@@ -24,6 +25,7 @@ export struct Card2Component {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
}
build() {
...
...
@@ -75,6 +77,7 @@ export struct Card2Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
6927aa7
...
...
@@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card6Component-Card13Component';
...
...
@@ -19,6 +20,7 @@ export struct Card6Component {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
}
build() {
...
...
@@ -78,6 +80,7 @@ export struct Card6Component {
}
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
.padding({
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/persistentStorage.ets
0 → 100644
View file @
6927aa7
PersistentStorage.persistProp('clickedIds', []);
function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {
let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
let index = clickedIds.indexOf(id.toString())
if (type === 'add') {
if (index >= 0) return;
clickedIds.push(id.toString());
} else if (type === 'remove') {
clickedIds.splice(index, 1);
}
AppStorage.set('clickedIds', clickedIds.join(','));
}
function hasClicked(id: string | number) {
let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
let index = clickedIds.indexOf(id.toString())
if (index >= 0) return true;
return false;
}
export { persistentStorage, hasClicked }
\ No newline at end of file
...
...
Please
register
or
login
to post a comment