Showing
24 changed files
with
376 additions
and
234 deletions
| @@ -73,6 +73,10 @@ export class CompDTO implements BaseDTO { | @@ -73,6 +73,10 @@ export class CompDTO implements BaseDTO { | ||
| 73 | sceneId: string = ''; | 73 | sceneId: string = ''; |
| 74 | traceId: string = ''; | 74 | traceId: string = ''; |
| 75 | traceInfo: string = ''; | 75 | traceInfo: string = ''; |
| 76 | + | ||
| 77 | + // 是否是我的收藏 编辑状态 | ||
| 78 | + isCollectionEditting:boolean = false; | ||
| 79 | + isSelect: boolean = false; | ||
| 76 | /** | 80 | /** |
| 77 | * 创建新的compbean对象 | 81 | * 创建新的compbean对象 |
| 78 | * @param old | 82 | * @param old |
| @@ -93,7 +93,6 @@ export class ContentDTO implements BaseDTO { | @@ -93,7 +93,6 @@ export class ContentDTO implements BaseDTO { | ||
| 93 | slideShows: slideShows[] = []; | 93 | slideShows: slideShows[] = []; |
| 94 | voiceInfo: VoiceInfoDTO = {} as VoiceInfoDTO; | 94 | voiceInfo: VoiceInfoDTO = {} as VoiceInfoDTO; |
| 95 | tagWord: number = -1; | 95 | tagWord: number = -1; |
| 96 | - isSelect: boolean = false; | ||
| 97 | rmhInfo: RmhInfoDTO = {} as RmhInfoDTO; // 人民号信息 | 96 | rmhInfo: RmhInfoDTO = {} as RmhInfoDTO; // 人民号信息 |
| 98 | photoNum: number = 0; | 97 | photoNum: number = 0; |
| 99 | corner: string = ''; | 98 | corner: string = ''; |
| @@ -148,6 +147,10 @@ export class ContentDTO implements BaseDTO { | @@ -148,6 +147,10 @@ export class ContentDTO implements BaseDTO { | ||
| 148 | // 号主页评论列表点击跳转到视频详情判断评论弹框是否展开 | 147 | // 号主页评论列表点击跳转到视频详情判断评论弹框是否展开 |
| 149 | showComment?:boolean = false; | 148 | showComment?:boolean = false; |
| 150 | 149 | ||
| 150 | + // 是否是我的收藏 编辑状态 | ||
| 151 | + isCollectionEditting:boolean = false; | ||
| 152 | + isSelect: boolean = false; | ||
| 153 | + | ||
| 151 | static clone(old: ContentDTO): ContentDTO { | 154 | static clone(old: ContentDTO): ContentDTO { |
| 152 | let content = new ContentDTO(); | 155 | let content = new ContentDTO(); |
| 153 | content.liveType = old.liveType; | 156 | content.liveType = old.liveType; |
| @@ -218,6 +221,7 @@ export class ContentDTO implements BaseDTO { | @@ -218,6 +221,7 @@ export class ContentDTO implements BaseDTO { | ||
| 218 | content.bottomNavId = old.bottomNavId; | 221 | content.bottomNavId = old.bottomNavId; |
| 219 | content.openType = old.openType; | 222 | content.openType = old.openType; |
| 220 | content.extra = old.extra; | 223 | content.extra = old.extra; |
| 224 | + content.isCollectionEditting = old.isCollectionEditting | ||
| 221 | return content; | 225 | return content; |
| 222 | } | 226 | } |
| 223 | } | 227 | } |
| @@ -72,7 +72,7 @@ export struct topicInfoView { | @@ -72,7 +72,7 @@ export struct topicInfoView { | ||
| 72 | .margin({ left: 4, right: 7 }) | 72 | .margin({ left: 4, right: 7 }) |
| 73 | } | 73 | } |
| 74 | .backgroundColor($r('app.color.color_99636363')) | 74 | .backgroundColor($r('app.color.color_99636363')) |
| 75 | - .margin({ top: 8, left: 16, right: 16, bottom: 16 }) | 75 | + .margin({ top: 8, left: 16, right: 16, bottom: 4 }) |
| 76 | .borderRadius(2) | 76 | .borderRadius(2) |
| 77 | .onClick(()=>{ | 77 | .onClick(()=>{ |
| 78 | let contentDTO :ContentDTO = new ContentDTO(); | 78 | let contentDTO :ContentDTO = new ContentDTO(); |
| @@ -243,6 +243,12 @@ export struct RmhTitle { | @@ -243,6 +243,12 @@ export struct RmhTitle { | ||
| 243 | .height(36) | 243 | .height(36) |
| 244 | .margin({ bottom: 10 }) | 244 | .margin({ bottom: 10 }) |
| 245 | .onClick(()=>{ | 245 | .onClick(()=>{ |
| 246 | + ///我的收藏 编辑状态点击 | ||
| 247 | + if (this.compDTO.isCollectionEditting) { | ||
| 248 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 249 | + return; | ||
| 250 | + } | ||
| 251 | + | ||
| 246 | this.gotoPeopleShipHomePage() | 252 | this.gotoPeopleShipHomePage() |
| 247 | }) | 253 | }) |
| 248 | } | 254 | } |
| @@ -162,6 +162,12 @@ export struct Card10Component { | @@ -162,6 +162,12 @@ export struct Card10Component { | ||
| 162 | .borderRadius($r('app.float.button_border_radius')) | 162 | .borderRadius($r('app.float.button_border_radius')) |
| 163 | .justifyContent(FlexAlign.Center) | 163 | .justifyContent(FlexAlign.Center) |
| 164 | .onClick((event: ClickEvent) => { | 164 | .onClick((event: ClickEvent) => { |
| 165 | + ///我的收藏 编辑状态点击 | ||
| 166 | + if (this.compDTO.isCollectionEditting) { | ||
| 167 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 168 | + return; | ||
| 169 | + } | ||
| 170 | + | ||
| 165 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 171 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 166 | ProcessUtils.processPage(this.contentDTO) | 172 | ProcessUtils.processPage(this.contentDTO) |
| 167 | }) | 173 | }) |
| @@ -292,6 +298,12 @@ export struct Card10ComponentTimelineItem { | @@ -292,6 +298,12 @@ export struct Card10ComponentTimelineItem { | ||
| 292 | } | 298 | } |
| 293 | .padding({ top: 10, bottom: 10 }) | 299 | .padding({ top: 10, bottom: 10 }) |
| 294 | .onClick((event: ClickEvent) => { | 300 | .onClick((event: ClickEvent) => { |
| 301 | + ///我的收藏 编辑状态点击 | ||
| 302 | + if (this.compDTO.isCollectionEditting) { | ||
| 303 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 304 | + return; | ||
| 305 | + } | ||
| 306 | + | ||
| 295 | this.isRead = true | 307 | this.isRead = true |
| 296 | persistentStorage(this.slideItem.newsId); | 308 | persistentStorage(this.slideItem.newsId); |
| 297 | 309 |
| @@ -97,6 +97,12 @@ export struct Card11Component { | @@ -97,6 +97,12 @@ export struct Card11Component { | ||
| 97 | }) | 97 | }) |
| 98 | .backgroundColor($r("app.color.white")) | 98 | .backgroundColor($r("app.color.white")) |
| 99 | .onClick((event: ClickEvent) => { | 99 | .onClick((event: ClickEvent) => { |
| 100 | + ///我的收藏 编辑状态点击 | ||
| 101 | + if (this.compDTO.isCollectionEditting) { | ||
| 102 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 103 | + return; | ||
| 104 | + } | ||
| 105 | + | ||
| 100 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 106 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 101 | if (router.getState().name !== 'MyCollectionListPage') { | 107 | if (router.getState().name !== 'MyCollectionListPage') { |
| 102 | this.clicked = true; | 108 | this.clicked = true; |
| @@ -87,6 +87,12 @@ export struct Card12Component { | @@ -87,6 +87,12 @@ export struct Card12Component { | ||
| 87 | .backgroundColor(0xffffff) | 87 | .backgroundColor(0xffffff) |
| 88 | .width(CommonConstants.FULL_WIDTH) | 88 | .width(CommonConstants.FULL_WIDTH) |
| 89 | .onClick((event: ClickEvent) => { | 89 | .onClick((event: ClickEvent) => { |
| 90 | + ///我的收藏 编辑状态点击 | ||
| 91 | + if (this.compDTO.isCollectionEditting) { | ||
| 92 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 93 | + return; | ||
| 94 | + } | ||
| 95 | + | ||
| 90 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 96 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 91 | if (router.getState().name !== 'MyCollectionListPage') { | 97 | if (router.getState().name !== 'MyCollectionListPage') { |
| 92 | this.clicked = true; | 98 | this.clicked = true; |
| @@ -108,6 +108,12 @@ export struct Card14Component { | @@ -108,6 +108,12 @@ export struct Card14Component { | ||
| 108 | .backgroundColor(0xffffff) | 108 | .backgroundColor(0xffffff) |
| 109 | .width(CommonConstants.FULL_WIDTH) | 109 | .width(CommonConstants.FULL_WIDTH) |
| 110 | .onClick((event: ClickEvent) => { | 110 | .onClick((event: ClickEvent) => { |
| 111 | + ///我的收藏 编辑状态点击 | ||
| 112 | + if (this.compDTO.isCollectionEditting) { | ||
| 113 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 114 | + return; | ||
| 115 | + } | ||
| 116 | + | ||
| 111 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 117 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 112 | if (router.getState().name !== 'MyCollectionListPage') { | 118 | if (router.getState().name !== 'MyCollectionListPage') { |
| 113 | this.clicked = true; | 119 | this.clicked = true; |
| @@ -106,6 +106,11 @@ export struct Card15Component { | @@ -106,6 +106,11 @@ export struct Card15Component { | ||
| 106 | .backgroundColor(0xffffff) | 106 | .backgroundColor(0xffffff) |
| 107 | .width(CommonConstants.FULL_WIDTH) | 107 | .width(CommonConstants.FULL_WIDTH) |
| 108 | .onClick((event: ClickEvent) => { | 108 | .onClick((event: ClickEvent) => { |
| 109 | + ///我的收藏 编辑状态点击 | ||
| 110 | + if (this.compDTO.isCollectionEditting) { | ||
| 111 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 112 | + return; | ||
| 113 | + } | ||
| 109 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 114 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 110 | if (router.getState().name !== 'MyCollectionListPage') { | 115 | if (router.getState().name !== 'MyCollectionListPage') { |
| 111 | this.clicked = true; | 116 | this.clicked = true; |
| @@ -139,6 +139,12 @@ export struct Card16Component { | @@ -139,6 +139,12 @@ export struct Card16Component { | ||
| 139 | .backgroundColor(0xffffff) | 139 | .backgroundColor(0xffffff) |
| 140 | .width(CommonConstants.FULL_WIDTH) | 140 | .width(CommonConstants.FULL_WIDTH) |
| 141 | .onClick((event: ClickEvent) => { | 141 | .onClick((event: ClickEvent) => { |
| 142 | + ///我的收藏 编辑状态点击 | ||
| 143 | + if (this.compDTO.isCollectionEditting) { | ||
| 144 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 145 | + return; | ||
| 146 | + } | ||
| 147 | + | ||
| 142 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 148 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 143 | if (router.getState().name !== 'MyCollectionListPage') { | 149 | if (router.getState().name !== 'MyCollectionListPage') { |
| 144 | this.clicked = true; | 150 | this.clicked = true; |
| @@ -123,6 +123,12 @@ export struct Card17Component { | @@ -123,6 +123,12 @@ export struct Card17Component { | ||
| 123 | .width(CommonConstants.FULL_WIDTH) | 123 | .width(CommonConstants.FULL_WIDTH) |
| 124 | .margin({ top: 8 }) | 124 | .margin({ top: 8 }) |
| 125 | .onClick((event: ClickEvent) => { | 125 | .onClick((event: ClickEvent) => { |
| 126 | + ///我的收藏 编辑状态点击 | ||
| 127 | + if (this.compDTO.isCollectionEditting) { | ||
| 128 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 129 | + return; | ||
| 130 | + } | ||
| 131 | + | ||
| 126 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 132 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 127 | if (router.getState().name !== 'MyCollectionListPage') { | 133 | if (router.getState().name !== 'MyCollectionListPage') { |
| 128 | this.clicked = true; | 134 | this.clicked = true; |
| @@ -97,6 +97,12 @@ export struct Card19Component { | @@ -97,6 +97,12 @@ export struct Card19Component { | ||
| 97 | .backgroundColor(0xffffff) | 97 | .backgroundColor(0xffffff) |
| 98 | .width(CommonConstants.FULL_WIDTH) | 98 | .width(CommonConstants.FULL_WIDTH) |
| 99 | .onClick((event: ClickEvent) => { | 99 | .onClick((event: ClickEvent) => { |
| 100 | + ///我的收藏 编辑状态点击 | ||
| 101 | + if (this.compDTO.isCollectionEditting) { | ||
| 102 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 103 | + return; | ||
| 104 | + } | ||
| 105 | + | ||
| 100 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 106 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 101 | if (router.getState().name !== 'MyCollectionListPage') { | 107 | if (router.getState().name !== 'MyCollectionListPage') { |
| 102 | this.clicked = true; | 108 | this.clicked = true; |
| @@ -104,7 +104,7 @@ export struct Card20Component { | @@ -104,7 +104,7 @@ export struct Card20Component { | ||
| 104 | }.alignContent(Alignment.TopStart) | 104 | }.alignContent(Alignment.TopStart) |
| 105 | } | 105 | } |
| 106 | if (this.contentDTO.fullColumnImgUrls[0]) { | 106 | if (this.contentDTO.fullColumnImgUrls[0]) { |
| 107 | - createImg({ contentDTO: this.contentDTO, loadImg: this.loadImg }) | 107 | + createImg({ compDTO:this.compDTO,contentDTO: this.contentDTO, loadImg: this.loadImg }) |
| 108 | } | 108 | } |
| 109 | CarderInteraction({contentDTO: this.contentDTO}) | 109 | CarderInteraction({contentDTO: this.contentDTO}) |
| 110 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 110 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| @@ -118,6 +118,12 @@ export struct Card20Component { | @@ -118,6 +118,12 @@ export struct Card20Component { | ||
| 118 | .backgroundColor(0xffffff) | 118 | .backgroundColor(0xffffff) |
| 119 | .width(CommonConstants.FULL_WIDTH) | 119 | .width(CommonConstants.FULL_WIDTH) |
| 120 | .onClick((event: ClickEvent) => { | 120 | .onClick((event: ClickEvent) => { |
| 121 | + ///我的收藏 编辑状态点击 | ||
| 122 | + if (this.compDTO.isCollectionEditting) { | ||
| 123 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 124 | + return; | ||
| 125 | + } | ||
| 126 | + | ||
| 121 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 127 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 122 | if (router.getState().name !== 'MyCollectionListPage') { | 128 | if (router.getState().name !== 'MyCollectionListPage') { |
| 123 | this.clicked = true; | 129 | this.clicked = true; |
| @@ -137,6 +143,7 @@ interface radiusType { | @@ -137,6 +143,7 @@ interface radiusType { | ||
| 137 | 143 | ||
| 138 | @Component | 144 | @Component |
| 139 | struct createImg { | 145 | struct createImg { |
| 146 | + @State compDTO: CompDTO = new CompDTO() | ||
| 140 | @Prop contentDTO: ContentDTO | 147 | @Prop contentDTO: ContentDTO |
| 141 | @Prop loadImg: boolean = true; | 148 | @Prop loadImg: boolean = true; |
| 142 | 149 | ||
| @@ -169,6 +176,12 @@ struct createImg { | @@ -169,6 +176,12 @@ struct createImg { | ||
| 169 | .align(Alignment.BottomEnd) | 176 | .align(Alignment.BottomEnd) |
| 170 | } | 177 | } |
| 171 | .onClick((event: ClickEvent) => { | 178 | .onClick((event: ClickEvent) => { |
| 179 | + ///我的收藏 编辑状态点击 | ||
| 180 | + if (this.compDTO.isCollectionEditting) { | ||
| 181 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 182 | + return; | ||
| 183 | + } | ||
| 184 | + | ||
| 172 | ProcessUtils.gotoVod(this.contentDTO) | 185 | ProcessUtils.gotoVod(this.contentDTO) |
| 173 | }) | 186 | }) |
| 174 | } else { | 187 | } else { |
| @@ -191,6 +204,12 @@ struct createImg { | @@ -191,6 +204,12 @@ struct createImg { | ||
| 191 | } | 204 | } |
| 192 | .align(Alignment.BottomEnd) | 205 | .align(Alignment.BottomEnd) |
| 193 | .onClick((event: ClickEvent) => { | 206 | .onClick((event: ClickEvent) => { |
| 207 | + ///我的收藏 编辑状态点击 | ||
| 208 | + if (this.compDTO.isCollectionEditting) { | ||
| 209 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 210 | + return; | ||
| 211 | + } | ||
| 212 | + | ||
| 194 | ProcessUtils.gotoVod(this.contentDTO) | 213 | ProcessUtils.gotoVod(this.contentDTO) |
| 195 | }) | 214 | }) |
| 196 | } | 215 | } |
| @@ -97,6 +97,12 @@ export struct Card21Component { | @@ -97,6 +97,12 @@ export struct Card21Component { | ||
| 97 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 97 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 98 | } | 98 | } |
| 99 | .onClick((event: ClickEvent) => { | 99 | .onClick((event: ClickEvent) => { |
| 100 | + ///我的收藏 编辑状态点击 | ||
| 101 | + if (this.compDTO.isCollectionEditting) { | ||
| 102 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 103 | + return; | ||
| 104 | + } | ||
| 105 | + | ||
| 100 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 106 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 101 | if (router.getState().name !== 'MyCollectionListPage') { | 107 | if (router.getState().name !== 'MyCollectionListPage') { |
| 102 | this.clicked = true; | 108 | this.clicked = true; |
| @@ -135,6 +135,12 @@ export struct Card2Component { | @@ -135,6 +135,12 @@ export struct Card2Component { | ||
| 135 | .backgroundColor(0xffffff) | 135 | .backgroundColor(0xffffff) |
| 136 | .width(CommonConstants.FULL_WIDTH) | 136 | .width(CommonConstants.FULL_WIDTH) |
| 137 | .onClick((event: ClickEvent) => { | 137 | .onClick((event: ClickEvent) => { |
| 138 | + ///我的收藏 编辑状态点击 | ||
| 139 | + if (this.compDTO.isCollectionEditting) { | ||
| 140 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 141 | + return; | ||
| 142 | + } | ||
| 143 | + | ||
| 138 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 144 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 139 | if (router.getState().name !== 'MyCollectionListPage') { | 145 | if (router.getState().name !== 'MyCollectionListPage') { |
| 140 | this.clicked = true; | 146 | this.clicked = true; |
| @@ -93,6 +93,12 @@ export struct Card3Component { | @@ -93,6 +93,12 @@ export struct Card3Component { | ||
| 93 | .backgroundColor(0xffffff) | 93 | .backgroundColor(0xffffff) |
| 94 | .width(CommonConstants.FULL_WIDTH) | 94 | .width(CommonConstants.FULL_WIDTH) |
| 95 | .onClick((event: ClickEvent) => { | 95 | .onClick((event: ClickEvent) => { |
| 96 | + ///我的收藏 编辑状态点击 | ||
| 97 | + if (this.compDTO.isCollectionEditting) { | ||
| 98 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 99 | + return; | ||
| 100 | + } | ||
| 101 | + | ||
| 96 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 102 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 97 | if (router.getState().name !== 'MyCollectionListPage') { | 103 | if (router.getState().name !== 'MyCollectionListPage') { |
| 98 | this.clicked = true; | 104 | this.clicked = true; |
| @@ -131,6 +131,12 @@ export struct Card4Component { | @@ -131,6 +131,12 @@ export struct Card4Component { | ||
| 131 | .justifyContent(FlexAlign.Start) | 131 | .justifyContent(FlexAlign.Start) |
| 132 | .alignItems(HorizontalAlign.Start) | 132 | .alignItems(HorizontalAlign.Start) |
| 133 | .onClick((event: ClickEvent) => { | 133 | .onClick((event: ClickEvent) => { |
| 134 | + ///我的收藏 编辑状态点击 | ||
| 135 | + if (this.compDTO.isCollectionEditting) { | ||
| 136 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 137 | + return; | ||
| 138 | + } | ||
| 139 | + | ||
| 134 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 140 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 135 | if (router.getState().name !== 'MyCollectionListPage') { | 141 | if (router.getState().name !== 'MyCollectionListPage') { |
| 136 | this.clicked = true; | 142 | this.clicked = true; |
| @@ -149,6 +149,11 @@ export struct Card5Component { | @@ -149,6 +149,11 @@ export struct Card5Component { | ||
| 149 | .backgroundColor(0xffffff) | 149 | .backgroundColor(0xffffff) |
| 150 | .width(CommonConstants.FULL_WIDTH) | 150 | .width(CommonConstants.FULL_WIDTH) |
| 151 | .onClick((event: ClickEvent) => { | 151 | .onClick((event: ClickEvent) => { |
| 152 | + ///我的收藏 编辑状态点击 | ||
| 153 | + if (this.compDTO.isCollectionEditting) { | ||
| 154 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 155 | + return; | ||
| 156 | + } | ||
| 152 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 157 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 153 | if (router.getState().name !== 'MyCollectionListPage') { | 158 | if (router.getState().name !== 'MyCollectionListPage') { |
| 154 | this.clicked = true; | 159 | this.clicked = true; |
| @@ -129,6 +129,11 @@ export struct Card6Component { | @@ -129,6 +129,11 @@ export struct Card6Component { | ||
| 129 | 129 | ||
| 130 | } | 130 | } |
| 131 | .onClick((event: ClickEvent) => { | 131 | .onClick((event: ClickEvent) => { |
| 132 | + ///我的收藏 编辑状态点击 | ||
| 133 | + if (this.compDTO.isCollectionEditting) { | ||
| 134 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 135 | + return; | ||
| 136 | + } | ||
| 132 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 137 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 133 | if (router.getState().name !== 'MyCollectionListPage') { | 138 | if (router.getState().name !== 'MyCollectionListPage') { |
| 134 | this.clicked = true; | 139 | this.clicked = true; |
| 1 | -import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI' | ||
| 2 | -import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | ||
| 3 | -import PageModel from '../../viewmodel/PageModel'; | ||
| 4 | -import { CommonConstants, ViewType } from 'wdConstant' | ||
| 5 | -import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' | ||
| 6 | -import { ErrorComponent } from '../view/ErrorComponent' | ||
| 7 | -import RefreshLayout from './RefreshLayout' | ||
| 8 | -import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 9 | -import { CompDTO, ContentDTO } from 'wdBean' | ||
| 10 | -import NoMoreLayout from './NoMoreLayout' | ||
| 11 | -import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 12 | -import { CustomSelectUI } from '../view/CustomSelectUI'; | ||
| 13 | -import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; | ||
| 14 | -import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 15 | - | ||
| 16 | -import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 17 | - | ||
| 18 | -@Entry | ||
| 19 | -@Component | ||
| 20 | -struct BrowsingHistoryPage { | ||
| 21 | - @State private browSingModel: PageModel = new PageModel() | ||
| 22 | - isloading : boolean = false | ||
| 23 | - @Provide isEditState:boolean = false | ||
| 24 | - @State allDatas :ContentDTO[] = []; | ||
| 25 | - @State selectDatas :ContentDTO[] = []; | ||
| 26 | - @Provide deleteNum :number = 0; | ||
| 27 | - @Provide isAllSelect:boolean = false | ||
| 28 | - private scroller: Scroller = new Scroller(); | ||
| 29 | - | ||
| 30 | - aboutToAppear(){ | ||
| 31 | - this.getData() | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - build() { | ||
| 35 | - Column(){ | ||
| 36 | - CustomTitleAndEditUI({titleName:'浏览历史',isDisplayButton:true,editCallback:()=>{ | ||
| 37 | - this.allSelectDatas(false) | ||
| 38 | - this.isAllSelect = false | ||
| 39 | - this.selectDatas = [] | ||
| 40 | - this.deleteNum = 0 | ||
| 41 | - }}) | ||
| 42 | - | ||
| 43 | - // if (this.browSingModel.viewType == ViewType.LOADING){ | ||
| 44 | - // this.LoadingLayout() | ||
| 45 | - // }else if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 46 | - // ErrorComponent() | ||
| 47 | - // }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 48 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | ||
| 49 | - // }else { | ||
| 50 | - // CustomPullToRefresh({ | ||
| 51 | - // alldata:this.allDatas, | ||
| 52 | - // scroller:this.scroller, | ||
| 53 | - // customList:()=>{ | ||
| 54 | - // this.ListLayout() | ||
| 55 | - // }, | ||
| 56 | - // onRefresh:(resolve)=>{ | ||
| 57 | - // this.browSingModel.currentPage = 0 | ||
| 58 | - // this.getData(resolve) | ||
| 59 | - // }, | ||
| 60 | - // onLoadMore:(resolve)=> { | ||
| 61 | - // this.browSingModel.currentPage++ | ||
| 62 | - // this.getData() | ||
| 63 | - // } | ||
| 64 | - // }) | ||
| 65 | - // } | ||
| 66 | - | ||
| 67 | - if (this.isEditState){ | ||
| 68 | - CustomBottomFuctionUI({ | ||
| 69 | - selectAllCallback:(isAllSelect)=>{ | ||
| 70 | - this.allSelectDatas(isAllSelect) | ||
| 71 | - }, | ||
| 72 | - confirmCallback:()=>{ | ||
| 73 | - this.deleteDatas() | ||
| 74 | - } | ||
| 75 | - }) | ||
| 76 | - .position({y:'92%'}) | ||
| 77 | - } | ||
| 78 | - } | ||
| 79 | - .width(CommonConstants.FULL_WIDTH) | ||
| 80 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - @Builder ListLayout() { | ||
| 84 | - List({scroller: this.scroller}) { | ||
| 85 | - // 下拉刷新 | ||
| 86 | - ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { | ||
| 87 | - ListItem() { | ||
| 88 | - this.newCompParser(compDTO,compIndex) | ||
| 89 | - } | ||
| 90 | - }) | ||
| 91 | - // 加载更多 | ||
| 92 | - ListItem() { | ||
| 93 | - if (this.browSingModel.hasMore) { | ||
| 94 | - // LoadMoreLayout({ | ||
| 95 | - // refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage, | ||
| 96 | - // this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight) | ||
| 97 | - // }) | ||
| 98 | - } else { | ||
| 99 | - NoMoreLayout() | ||
| 100 | - } | ||
| 101 | - } | ||
| 102 | - } | ||
| 103 | - .height(CommonConstants.FULL_PARENT) | ||
| 104 | - .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - @Builder | ||
| 108 | - newCompParser(compDTO: ContentDTO, compIndex: number){ | ||
| 109 | - Row(){ | ||
| 110 | - if (this.isEditState){ | ||
| 111 | - CustomSelectUI({ | ||
| 112 | - isOn:compDTO.isSelect, | ||
| 113 | - selectCallback:(isOn)=>{ | ||
| 114 | - this.addCompDTO(isOn,compDTO) | ||
| 115 | - } | ||
| 116 | - }) | ||
| 117 | - .margin({left:16}) | ||
| 118 | - } | ||
| 119 | - Column() { | ||
| 120 | - BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO}) | ||
| 121 | - } | ||
| 122 | - } | ||
| 123 | - } | ||
| 124 | - | ||
| 125 | - @Builder LoadingLayout() { | ||
| 126 | - CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, | ||
| 127 | - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - async getData(resolve?: (value: string | PromiseLike<string>) => void){ | ||
| 131 | - MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => { | ||
| 132 | - if(resolve) resolve('刷新成功') | ||
| 133 | - if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | ||
| 134 | - this.browSingModel.viewType = ViewType.LOADED; | ||
| 135 | - this.allDatas.push(...collectionItem.list) | ||
| 136 | - if (collectionItem.list.length === this.browSingModel.pageSize) { | ||
| 137 | - this.browSingModel.currentPage++; | ||
| 138 | - this.browSingModel.hasMore = true; | ||
| 139 | - } else { | ||
| 140 | - this.browSingModel.hasMore = false; | ||
| 141 | - } | ||
| 142 | - } else { | ||
| 143 | - this.browSingModel.viewType = ViewType.EMPTY; | ||
| 144 | - } | ||
| 145 | - }) | ||
| 146 | - } | ||
| 147 | - | ||
| 148 | - //数据处理 | ||
| 149 | - //单个选择 | ||
| 150 | - addCompDTO(isOn:boolean , compDTO: ContentDTO){ | ||
| 151 | - compDTO.isSelect = isOn; | ||
| 152 | - if (isOn === true){ | ||
| 153 | - this.selectDatas.push(compDTO) | ||
| 154 | - }else { | ||
| 155 | - this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1) | ||
| 156 | - } | ||
| 157 | - this.deleteNum = this.selectDatas.length | ||
| 158 | - | ||
| 159 | - this.isAllSelect = this.deleteNum === this.allDatas.length?true:false; | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - //全选 | ||
| 163 | - allSelectDatas(isOn:boolean){ | ||
| 164 | - let datas: ContentDTO[] = []; | ||
| 165 | - for (let index = 0; index < this.allDatas.length; index++) { | ||
| 166 | - const compDTO = this.allDatas[index]; | ||
| 167 | - compDTO.isSelect = isOn | ||
| 168 | - datas.push(compDTO) | ||
| 169 | - } | ||
| 170 | - this.selectDatas = [] | ||
| 171 | - this.allDatas = [] | ||
| 172 | - if (isOn === true) { | ||
| 173 | - this.selectDatas.push(...datas) | ||
| 174 | - }else { | ||
| 175 | - this.selectDatas.splice(0,this.deleteNum) | ||
| 176 | - } | ||
| 177 | - this.allDatas.push(...datas) | ||
| 178 | - this.deleteNum = this.selectDatas.length | ||
| 179 | - } | ||
| 180 | - | ||
| 181 | - //删除 | ||
| 182 | - deleteDatas(){ | ||
| 183 | - for (let index = 0; index < this.selectDatas.length; index++) { | ||
| 184 | - const compDTO = this.allDatas[index]; | ||
| 185 | - this.allDatas.splice(this.selectDatas.indexOf(compDTO),1) | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - //重置删除状态 | ||
| 189 | - this.isEditState = false | ||
| 190 | - this.isAllSelect = false | ||
| 191 | - } | ||
| 192 | -} | 1 | +// import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI' |
| 2 | +// import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | ||
| 3 | +// import PageModel from '../../viewmodel/PageModel'; | ||
| 4 | +// import { CommonConstants, ViewType } from 'wdConstant' | ||
| 5 | +// import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' | ||
| 6 | +// import { ErrorComponent } from '../view/ErrorComponent' | ||
| 7 | +// import RefreshLayout from './RefreshLayout' | ||
| 8 | +// import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 9 | +// import { CompDTO, ContentDTO } from 'wdBean' | ||
| 10 | +// import NoMoreLayout from './NoMoreLayout' | ||
| 11 | +// import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 12 | +// import { CustomSelectUI } from '../view/CustomSelectUI'; | ||
| 13 | +// import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; | ||
| 14 | +// import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 15 | +// | ||
| 16 | +// import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 17 | +// | ||
| 18 | +// @Entry | ||
| 19 | +// @Component | ||
| 20 | +// struct BrowsingHistoryPage { | ||
| 21 | +// @State private browSingModel: PageModel = new PageModel() | ||
| 22 | +// isloading : boolean = false | ||
| 23 | +// @Provide isEditState:boolean = false | ||
| 24 | +// @State allDatas :ContentDTO[] = []; | ||
| 25 | +// @State selectDatas :ContentDTO[] = []; | ||
| 26 | +// @Provide deleteNum :number = 0; | ||
| 27 | +// @Provide isAllSelect:boolean = false | ||
| 28 | +// private scroller: Scroller = new Scroller(); | ||
| 29 | +// | ||
| 30 | +// aboutToAppear(){ | ||
| 31 | +// this.getData() | ||
| 32 | +// } | ||
| 33 | +// | ||
| 34 | +// build() { | ||
| 35 | +// Column(){ | ||
| 36 | +// CustomTitleAndEditUI({titleName:'浏览历史',isDisplayButton:true,editCallback:()=>{ | ||
| 37 | +// this.allSelectDatas(false) | ||
| 38 | +// this.isAllSelect = false | ||
| 39 | +// this.selectDatas = [] | ||
| 40 | +// this.deleteNum = 0 | ||
| 41 | +// }}) | ||
| 42 | +// | ||
| 43 | +// // if (this.browSingModel.viewType == ViewType.LOADING){ | ||
| 44 | +// // this.LoadingLayout() | ||
| 45 | +// // }else if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 46 | +// // ErrorComponent() | ||
| 47 | +// // }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 48 | +// EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | ||
| 49 | +// // }else { | ||
| 50 | +// // CustomPullToRefresh({ | ||
| 51 | +// // alldata:this.allDatas, | ||
| 52 | +// // scroller:this.scroller, | ||
| 53 | +// // customList:()=>{ | ||
| 54 | +// // this.ListLayout() | ||
| 55 | +// // }, | ||
| 56 | +// // onRefresh:(resolve)=>{ | ||
| 57 | +// // this.browSingModel.currentPage = 0 | ||
| 58 | +// // this.getData(resolve) | ||
| 59 | +// // }, | ||
| 60 | +// // onLoadMore:(resolve)=> { | ||
| 61 | +// // this.browSingModel.currentPage++ | ||
| 62 | +// // this.getData() | ||
| 63 | +// // } | ||
| 64 | +// // }) | ||
| 65 | +// // } | ||
| 66 | +// | ||
| 67 | +// if (this.isEditState){ | ||
| 68 | +// CustomBottomFuctionUI({ | ||
| 69 | +// selectAllCallback:(isAllSelect)=>{ | ||
| 70 | +// this.allSelectDatas(isAllSelect) | ||
| 71 | +// }, | ||
| 72 | +// confirmCallback:()=>{ | ||
| 73 | +// this.deleteDatas() | ||
| 74 | +// } | ||
| 75 | +// }) | ||
| 76 | +// .position({y:'92%'}) | ||
| 77 | +// } | ||
| 78 | +// } | ||
| 79 | +// .width(CommonConstants.FULL_WIDTH) | ||
| 80 | +// .height(CommonConstants.FULL_HEIGHT) | ||
| 81 | +// } | ||
| 82 | +// | ||
| 83 | +// @Builder ListLayout() { | ||
| 84 | +// List({scroller: this.scroller}) { | ||
| 85 | +// // 下拉刷新 | ||
| 86 | +// ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { | ||
| 87 | +// ListItem() { | ||
| 88 | +// this.newCompParser(compDTO,compIndex) | ||
| 89 | +// } | ||
| 90 | +// }) | ||
| 91 | +// // 加载更多 | ||
| 92 | +// ListItem() { | ||
| 93 | +// if (this.browSingModel.hasMore) { | ||
| 94 | +// // LoadMoreLayout({ | ||
| 95 | +// // refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage, | ||
| 96 | +// // this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight) | ||
| 97 | +// // }) | ||
| 98 | +// } else { | ||
| 99 | +// NoMoreLayout() | ||
| 100 | +// } | ||
| 101 | +// } | ||
| 102 | +// } | ||
| 103 | +// .height(CommonConstants.FULL_PARENT) | ||
| 104 | +// .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 | ||
| 105 | +// } | ||
| 106 | +// | ||
| 107 | +// @Builder | ||
| 108 | +// newCompParser(compDTO: ContentDTO, compIndex: number){ | ||
| 109 | +// Row(){ | ||
| 110 | +// if (this.isEditState){ | ||
| 111 | +// CustomSelectUI({ | ||
| 112 | +// data:compDTO, | ||
| 113 | +// }) | ||
| 114 | +// .margin({left:16}) | ||
| 115 | +// } | ||
| 116 | +// Column() { | ||
| 117 | +// BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO}) | ||
| 118 | +// } | ||
| 119 | +// } | ||
| 120 | +// } | ||
| 121 | +// | ||
| 122 | +// @Builder LoadingLayout() { | ||
| 123 | +// CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, | ||
| 124 | +// $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) | ||
| 125 | +// } | ||
| 126 | +// | ||
| 127 | +// async getData(resolve?: (value: string | PromiseLike<string>) => void){ | ||
| 128 | +// MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => { | ||
| 129 | +// if(resolve) resolve('刷新成功') | ||
| 130 | +// if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | ||
| 131 | +// this.browSingModel.viewType = ViewType.LOADED; | ||
| 132 | +// this.allDatas.push(...collectionItem.list) | ||
| 133 | +// if (collectionItem.list.length === this.browSingModel.pageSize) { | ||
| 134 | +// this.browSingModel.currentPage++; | ||
| 135 | +// this.browSingModel.hasMore = true; | ||
| 136 | +// } else { | ||
| 137 | +// this.browSingModel.hasMore = false; | ||
| 138 | +// } | ||
| 139 | +// } else { | ||
| 140 | +// this.browSingModel.viewType = ViewType.EMPTY; | ||
| 141 | +// } | ||
| 142 | +// }) | ||
| 143 | +// } | ||
| 144 | +// | ||
| 145 | +// //数据处理 | ||
| 146 | +// //单个选择 | ||
| 147 | +// addCompDTO(isOn:boolean , compDTO: ContentDTO){ | ||
| 148 | +// compDTO.isSelect = isOn; | ||
| 149 | +// if (isOn === true){ | ||
| 150 | +// this.selectDatas.push(compDTO) | ||
| 151 | +// }else { | ||
| 152 | +// this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1) | ||
| 153 | +// } | ||
| 154 | +// this.deleteNum = this.selectDatas.length | ||
| 155 | +// | ||
| 156 | +// this.isAllSelect = this.deleteNum === this.allDatas.length?true:false; | ||
| 157 | +// } | ||
| 158 | +// | ||
| 159 | +// //全选 | ||
| 160 | +// allSelectDatas(isOn:boolean){ | ||
| 161 | +// let datas: ContentDTO[] = []; | ||
| 162 | +// for (let index = 0; index < this.allDatas.length; index++) { | ||
| 163 | +// const compDTO = this.allDatas[index]; | ||
| 164 | +// compDTO.isSelect = isOn | ||
| 165 | +// datas.push(compDTO) | ||
| 166 | +// } | ||
| 167 | +// this.selectDatas = [] | ||
| 168 | +// this.allDatas = [] | ||
| 169 | +// if (isOn === true) { | ||
| 170 | +// this.selectDatas.push(...datas) | ||
| 171 | +// }else { | ||
| 172 | +// this.selectDatas.splice(0,this.deleteNum) | ||
| 173 | +// } | ||
| 174 | +// this.allDatas.push(...datas) | ||
| 175 | +// this.deleteNum = this.selectDatas.length | ||
| 176 | +// } | ||
| 177 | +// | ||
| 178 | +// //删除 | ||
| 179 | +// deleteDatas(){ | ||
| 180 | +// for (let index = 0; index < this.selectDatas.length; index++) { | ||
| 181 | +// const compDTO = this.allDatas[index]; | ||
| 182 | +// this.allDatas.splice(this.selectDatas.indexOf(compDTO),1) | ||
| 183 | +// } | ||
| 184 | +// | ||
| 185 | +// //重置删除状态 | ||
| 186 | +// this.isEditState = false | ||
| 187 | +// this.isAllSelect = false | ||
| 188 | +// } | ||
| 189 | +// } |
| @@ -12,7 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent'; | @@ -12,7 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 12 | import { contentListItemParams, MyCollectionItem } from '../../model/MyCollectionModel'; | 12 | import { contentListItemParams, MyCollectionItem } from '../../model/MyCollectionModel'; |
| 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' | 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' |
| 15 | -import { NetworkUtil } from 'wdKit/Index'; | 15 | +import { DateTimeUtils, NetworkUtil } from 'wdKit/Index'; |
| 16 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 16 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| 17 | import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; | 17 | import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; |
| 18 | 18 | ||
| @@ -27,8 +27,8 @@ struct MyCollectionListPage { | @@ -27,8 +27,8 @@ struct MyCollectionListPage { | ||
| 27 | isloading : boolean = false | 27 | isloading : boolean = false |
| 28 | @Provide isEditState:boolean = false | 28 | @Provide isEditState:boolean = false |
| 29 | @State isDisplayButton:boolean = false | 29 | @State isDisplayButton:boolean = false |
| 30 | - @State allDatas :ContentDTO[] = []; | ||
| 31 | - @State selectDatas :ContentDTO[] = []; | 30 | + @State allDatas :CompDTO[] = []; |
| 31 | + @State selectDatas :CompDTO[] = []; | ||
| 32 | @Provide deleteNum :number = 0; | 32 | @Provide deleteNum :number = 0; |
| 33 | @Provide isAllSelect:boolean = false | 33 | @Provide isAllSelect:boolean = false |
| 34 | 34 | ||
| @@ -75,6 +75,9 @@ struct MyCollectionListPage { | @@ -75,6 +75,9 @@ struct MyCollectionListPage { | ||
| 75 | Column(){ | 75 | Column(){ |
| 76 | CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.isDisplayButton,editCallback:()=>{ | 76 | CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.isDisplayButton,editCallback:()=>{ |
| 77 | this.allSelectDatas(false) | 77 | this.allSelectDatas(false) |
| 78 | + this.allDatas.forEach((item) =>{ | ||
| 79 | + item.isCollectionEditting = this.isEditState | ||
| 80 | + }) | ||
| 78 | this.isAllSelect = false | 81 | this.isAllSelect = false |
| 79 | this.selectDatas = [] | 82 | this.selectDatas = [] |
| 80 | this.deleteNum = 0 | 83 | this.deleteNum = 0 |
| @@ -120,7 +123,7 @@ struct MyCollectionListPage { | @@ -120,7 +123,7 @@ struct MyCollectionListPage { | ||
| 120 | } | 123 | } |
| 121 | .backgroundColor(Color.White) | 124 | .backgroundColor(Color.White) |
| 122 | .alignContent(Alignment.Top) | 125 | .alignContent(Alignment.Top) |
| 123 | - .position({y:'92%'}) | 126 | + .position({y:'94%'}) |
| 124 | .width(CommonConstants.FULL_WIDTH) | 127 | .width(CommonConstants.FULL_WIDTH) |
| 125 | .height(CommonConstants.FULL_HEIGHT) | 128 | .height(CommonConstants.FULL_HEIGHT) |
| 126 | } | 129 | } |
| @@ -134,14 +137,14 @@ struct MyCollectionListPage { | @@ -134,14 +137,14 @@ struct MyCollectionListPage { | ||
| 134 | 137 | ||
| 135 | @Builder ListLayout() { | 138 | @Builder ListLayout() { |
| 136 | List({scroller: this.scroller}) { | 139 | List({scroller: this.scroller}) { |
| 137 | - ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { | 140 | + ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => { |
| 138 | ListItem() { | 141 | ListItem() { |
| 139 | this.newCompParser(compDTO,compIndex) | 142 | this.newCompParser(compDTO,compIndex) |
| 140 | } | 143 | } |
| 141 | - }) | 144 | + }, (item: string) => DateTimeUtils.getTimeStamp().toString()) |
| 142 | // 加载更多 | 145 | // 加载更多 |
| 143 | ListItem() { | 146 | ListItem() { |
| 144 | - if (this.browSingModel.hasMore === false) NoMoreLayout() | 147 | + if (this.browSingModel.hasMore === false) NoMoreLayout().height(this.isEditState?120:80) |
| 145 | //Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | 148 | //Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); |
| 146 | } | 149 | } |
| 147 | } | 150 | } |
| @@ -155,26 +158,22 @@ struct MyCollectionListPage { | @@ -155,26 +158,22 @@ struct MyCollectionListPage { | ||
| 155 | } | 158 | } |
| 156 | 159 | ||
| 157 | @Builder | 160 | @Builder |
| 158 | - newCompParser(compDTO: ContentDTO, compIndex: number){ | 161 | + newCompParser(compDTO: CompDTO, compIndex: number){ |
| 159 | Row(){ | 162 | Row(){ |
| 160 | if (this.isEditState){ | 163 | if (this.isEditState){ |
| 161 | CustomSelectUI({ | 164 | CustomSelectUI({ |
| 162 | - isOn:compDTO.isSelect, | ||
| 163 | - selectCallback:(isOn)=>{ | ||
| 164 | - this.addCompDTO(isOn,compDTO) | ||
| 165 | - } | 165 | + data:compDTO, |
| 166 | + selectCallback:((item)=>{ | ||
| 167 | + this.addCompDTO(compDTO.isSelect,compDTO) | ||
| 168 | + }) | ||
| 166 | }).margin({right: 16}) | 169 | }).margin({right: 16}) |
| 167 | } | 170 | } |
| 168 | - Column() { | ||
| 169 | - BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) | ||
| 170 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }); | ||
| 171 | - } | 171 | + BigPicCardComponent({compDTO:compDTO,contentDTO:compDTO.operDataList[0],pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) |
| 172 | }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 172 | }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 173 | if (isVisible && !this.isEditState) { | 173 | if (isVisible && !this.isEditState) { |
| 174 | - TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) | 174 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO.operDataList[0])) |
| 175 | } | 175 | } |
| 176 | }) | 176 | }) |
| 177 | - | ||
| 178 | } | 177 | } |
| 179 | 178 | ||
| 180 | 179 | ||
| @@ -212,8 +211,7 @@ struct MyCollectionListPage { | @@ -212,8 +211,7 @@ struct MyCollectionListPage { | ||
| 212 | 211 | ||
| 213 | //数据处理 | 212 | //数据处理 |
| 214 | //单个选择 | 213 | //单个选择 |
| 215 | - addCompDTO(isOn:boolean , compDTO: ContentDTO){ | ||
| 216 | - compDTO.isSelect = isOn; | 214 | + addCompDTO(isOn:boolean , compDTO: CompDTO){ |
| 217 | if (isOn === true){ | 215 | if (isOn === true){ |
| 218 | this.selectDatas.push(compDTO) | 216 | this.selectDatas.push(compDTO) |
| 219 | }else { | 217 | }else { |
| @@ -226,20 +224,18 @@ struct MyCollectionListPage { | @@ -226,20 +224,18 @@ struct MyCollectionListPage { | ||
| 226 | 224 | ||
| 227 | //全选 | 225 | //全选 |
| 228 | allSelectDatas(isOn:boolean){ | 226 | allSelectDatas(isOn:boolean){ |
| 229 | - let datas: ContentDTO[] = []; | 227 | + let datas: CompDTO[] = []; |
| 230 | for (let index = 0; index < this.allDatas.length; index++) { | 228 | for (let index = 0; index < this.allDatas.length; index++) { |
| 231 | const compDTO = this.allDatas[index]; | 229 | const compDTO = this.allDatas[index]; |
| 232 | compDTO.isSelect = isOn | 230 | compDTO.isSelect = isOn |
| 233 | datas.push(compDTO) | 231 | datas.push(compDTO) |
| 234 | } | 232 | } |
| 235 | this.selectDatas = [] | 233 | this.selectDatas = [] |
| 236 | - this.allDatas = [] | ||
| 237 | if (isOn === true) { | 234 | if (isOn === true) { |
| 238 | this.selectDatas.push(...datas) | 235 | this.selectDatas.push(...datas) |
| 239 | }else { | 236 | }else { |
| 240 | this.selectDatas.splice(0,this.deleteNum) | 237 | this.selectDatas.splice(0,this.deleteNum) |
| 241 | } | 238 | } |
| 242 | - this.allDatas.push(...datas) | ||
| 243 | this.deleteNum = this.selectDatas.length | 239 | this.deleteNum = this.selectDatas.length |
| 244 | } | 240 | } |
| 245 | 241 | ||
| @@ -265,6 +261,9 @@ struct MyCollectionListPage { | @@ -265,6 +261,9 @@ struct MyCollectionListPage { | ||
| 265 | updataUIState(){ | 261 | updataUIState(){ |
| 266 | this.isEditState = false | 262 | this.isEditState = false |
| 267 | this.isAllSelect = false | 263 | this.isAllSelect = false |
| 264 | + this.allDatas.forEach((item) =>{ | ||
| 265 | + item.isCollectionEditting = false | ||
| 266 | + }) | ||
| 268 | 267 | ||
| 269 | if (this.allDatas.length === 0) { | 268 | if (this.allDatas.length === 0) { |
| 270 | this.browSingModel.viewType = ViewType.EMPTY; | 269 | this.browSingModel.viewType = ViewType.EMPTY; |
| @@ -290,22 +289,44 @@ struct MyCollectionListPage { | @@ -290,22 +289,44 @@ struct MyCollectionListPage { | ||
| 290 | 289 | ||
| 291 | if (this.currentPage === 1) { | 290 | if (this.currentPage === 1) { |
| 292 | this.allDatas = [] | 291 | this.allDatas = [] |
| 292 | + this.isAllSelect = false | ||
| 293 | + this.selectDatas = [] | ||
| 294 | + this.deleteNum = 0 | ||
| 293 | } | 295 | } |
| 294 | 296 | ||
| 295 | for (let index = 0; index < item.list.length; index++) { | 297 | for (let index = 0; index < item.list.length; index++) { |
| 296 | - const compDTO = item.list[index]; | ||
| 297 | - compDTO.isCollection = true ///用于时间展示 | ||
| 298 | - compDTO.interactData = this.commentList[index] | 298 | + const contentDTO = item.list[index]; |
| 299 | + contentDTO.isCollection = true ///用于时间展示 | ||
| 300 | + contentDTO.interactData = this.commentList[index] | ||
| 301 | + | ||
| 302 | + let compDTO = new CompDTO() | ||
| 303 | + compDTO.operDataList.push(ContentDTO.clone(contentDTO)) | ||
| 304 | + compDTO.objectId = contentDTO.objectId | ||
| 305 | + compDTO.objectType = contentDTO.objectType | ||
| 306 | + compDTO.relType = contentDTO.relType | ||
| 307 | + compDTO.relId = contentDTO.relId | ||
| 308 | + compDTO.isCollectionEditting = this.isEditState | ||
| 299 | this.allDatas.push(compDTO) | 309 | this.allDatas.push(compDTO) |
| 300 | } | 310 | } |
| 301 | 311 | ||
| 302 | } catch (exception) { | 312 | } catch (exception) { |
| 303 | if (this.currentPage === 1) { | 313 | if (this.currentPage === 1) { |
| 304 | this.allDatas = [] | 314 | this.allDatas = [] |
| 315 | + this.isAllSelect = false | ||
| 316 | + this.selectDatas = [] | ||
| 317 | + this.deleteNum = 0 | ||
| 305 | } | 318 | } |
| 319 | + | ||
| 306 | for (let index = 0; index < item.list.length; index++) { | 320 | for (let index = 0; index < item.list.length; index++) { |
| 307 | - const compDTO = item.list[index]; | ||
| 308 | - compDTO.isCollection = true ///用于时间展示 | 321 | + const contentDTO = item.list[index]; |
| 322 | + contentDTO.isCollection = true ///用于时间展示 | ||
| 323 | + let compDTO = new CompDTO() | ||
| 324 | + compDTO.operDataList.push(ContentDTO.clone(contentDTO)) | ||
| 325 | + compDTO.objectId = contentDTO.objectId | ||
| 326 | + compDTO.objectType = contentDTO.objectType | ||
| 327 | + compDTO.relType = contentDTO.relType | ||
| 328 | + compDTO.relId = contentDTO.relId | ||
| 329 | + compDTO.isCollectionEditting = this.isEditState | ||
| 309 | this.allDatas.push(compDTO) | 330 | this.allDatas.push(compDTO) |
| 310 | } | 331 | } |
| 311 | } | 332 | } |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { ProcessUtils } from 'wdRouter'; | 2 | import { ProcessUtils } from 'wdRouter'; |
| 3 | import { CardParser } from '../CardParser'; | 3 | import { CardParser } from '../CardParser'; |
| 4 | +import { router } from '@kit.ArkUI'; | ||
| 4 | 5 | ||
| 5 | const TAG: string = 'BigPicCardComponent'; | 6 | const TAG: string = 'BigPicCardComponent'; |
| 6 | 7 | ||
| @@ -20,8 +21,8 @@ export struct BigPicCardComponent { | @@ -20,8 +21,8 @@ export struct BigPicCardComponent { | ||
| 20 | contentDTO: ContentDTO = new ContentDTO(); | 21 | contentDTO: ContentDTO = new ContentDTO(); |
| 21 | 22 | ||
| 22 | aboutToAppear() { | 23 | aboutToAppear() { |
| 23 | - // 取第一个数据 | ||
| 24 | - if (this.compDTO.operDataList.length > 0) { | 24 | + // 取第一个数据 ///我的收藏特殊处理 |
| 25 | + if (this.compDTO.operDataList.length > 0 && router.getState().name !== 'MyCollectionListPage') { | ||
| 25 | this.contentDTO = this.compDTO.operDataList[0]; | 26 | this.contentDTO = this.compDTO.operDataList[0]; |
| 26 | this.contentDTO.appStyle = "2"; | 27 | this.contentDTO.appStyle = "2"; |
| 27 | } | 28 | } |
| @@ -48,7 +48,7 @@ export struct CustomBottomFuctionUI { | @@ -48,7 +48,7 @@ export struct CustomBottomFuctionUI { | ||
| 48 | this.confirmCallback() | 48 | this.confirmCallback() |
| 49 | }) | 49 | }) |
| 50 | } | 50 | } |
| 51 | - .height('8%') | 51 | + .height('6%') |
| 52 | .width('100%') | 52 | .width('100%') |
| 53 | .backgroundColor(Color.White) | 53 | .backgroundColor(Color.White) |
| 54 | } | 54 | } |
| 1 | +import { CompDTO } from 'wdBean' | ||
| 1 | 2 | ||
| 2 | @Component | 3 | @Component |
| 3 | export struct CustomSelectUI { | 4 | export struct CustomSelectUI { |
| 4 | - @State isOn: boolean = false | ||
| 5 | - selectCallback: (isOn: boolean) => void = () => { | 5 | + @ObjectLink @Watch('selectChage') data:CompDTO |
| 6 | + selectCallback: (item:CompDTO) => void = () => { | ||
| 6 | } | 7 | } |
| 7 | build() { | 8 | build() { |
| 8 | Button(){ | 9 | Button(){ |
| 9 | - Image(this.isOn?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon")) | ||
| 10 | - } | 10 | + Image(this.data.isSelect?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon")) |
| 11 | + }.onClick(()=>{ | ||
| 12 | + this.data.isSelect = this.data.isSelect?false:true | ||
| 13 | + }) | ||
| 11 | .backgroundColor(Color.White) | 14 | .backgroundColor(Color.White) |
| 12 | .type(ButtonType.Normal) | 15 | .type(ButtonType.Normal) |
| 13 | .width(20) | 16 | .width(20) |
| 14 | .height(20) | 17 | .height(20) |
| 15 | - .onClick(() => { | ||
| 16 | - this.isOn = !this.isOn; | ||
| 17 | - this.selectCallback(this.isOn) | ||
| 18 | - }) | 18 | + } |
| 19 | + | ||
| 20 | + selectChage(){ | ||
| 21 | + this.selectCallback(this.data) | ||
| 19 | } | 22 | } |
| 20 | } | 23 | } |
-
Please register or login to post a comment