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
wangliang_wd
2024-04-03 17:50:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
47d35db9522d1f682fc68bffce2c17f44db4b201
47d35db9
1 parent
aeb3a4ef
feat:优化我的收藏全选逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/BrowsingHistoryPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/CustomBottomFuctionUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/BrowsingHistoryPage.ets
View file @
47d35db
...
...
@@ -23,7 +23,7 @@ struct BrowsingHistoryPage {
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
this.getData()
}
...
...
@@ -46,8 +46,8 @@ struct BrowsingHistoryPage {
if (this.isEditState){
CustomBottomFuctionUI({
selectAllCallback:(isOn)=>{
this.allSelectDatas(isOn)
selectAllCallback:(isAllSelect)=>{
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
...
...
@@ -142,6 +142,8 @@ struct BrowsingHistoryPage {
this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
this.deleteNum = this.selectDatas.length
this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
}
//全选
...
...
@@ -174,4 +176,3 @@ struct BrowsingHistoryPage {
this.isEditState = false
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
47d35db
...
...
@@ -23,7 +23,7 @@ struct MyCollectionListPage {
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
this.getData()
}
...
...
@@ -46,8 +46,8 @@ struct MyCollectionListPage {
if (this.isEditState){
CustomBottomFuctionUI({
selectAllCallback:(isOn)=>{
this.allSelectDatas(isOn)
selectAllCallback:(isAllSelect)=>{
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
...
...
@@ -142,6 +142,8 @@ struct MyCollectionListPage {
this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
this.deleteNum = this.selectDatas.length
this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
}
//全选
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/CustomBottomFuctionUI.ets
View file @
47d35db
...
...
@@ -2,7 +2,7 @@
@Component
export struct CustomBottomFuctionUI {
@Consume deleteNum: number
@
State isOn: boolean = false
@
Consume isAllSelect: boolean
selectAllCallback: (isOn: boolean) => void = () => {
}
confirmCallback: () => void = () => {
...
...
@@ -10,12 +10,12 @@ export struct CustomBottomFuctionUI {
build() {
RelativeContainer(){
Row(){
Image(this.is
On
?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
Image(this.is
AllSelect
?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
.width('20')
.height('20')
.margin({right:'31lpx' })
Text(this.is
On
?'取消':'全选')
Text(this.is
AllSelect
?'取消':'全选')
.fontColor($r('app.color.color_222222'))
.backgroundColor(Color.White)
}
...
...
@@ -26,8 +26,8 @@ export struct CustomBottomFuctionUI {
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.onClick(()=>{
this.isOn = !this.isOn;
this.selectAllCallback(this.isOn)
this.isAllSelect = !this.isAllSelect;
this.selectAllCallback(this.isAllSelect)
})
...
...
Please
register
or
login
to post a comment