Showing
25 changed files
with
389 additions
and
246 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 | } |
| @@ -231,19 +231,19 @@ export struct ENewspaperPageComponent { | @@ -231,19 +231,19 @@ export struct ENewspaperPageComponent { | ||
| 231 | this.calendarDialogController.open() | 231 | this.calendarDialogController.open() |
| 232 | }) | 232 | }) |
| 233 | 233 | ||
| 234 | - if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | ||
| 235 | - Image($r('app.media.icon_share')) | ||
| 236 | - .height($r('app.float.top_arrow_size')) | ||
| 237 | - .width($r('app.float.top_arrow_size')) | ||
| 238 | - .alignRules({ | ||
| 239 | - right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 240 | - center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 241 | - }) | ||
| 242 | - .id('e_newspaper_share') | ||
| 243 | - .onClick(() => { | ||
| 244 | - this.share() | ||
| 245 | - }) | ||
| 246 | - } | 234 | + // if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 235 | + // Image($r('app.media.icon_share')) | ||
| 236 | + // .height($r('app.float.top_arrow_size')) | ||
| 237 | + // .width($r('app.float.top_arrow_size')) | ||
| 238 | + // .alignRules({ | ||
| 239 | + // right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 240 | + // center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 241 | + // }) | ||
| 242 | + // .id('e_newspaper_share') | ||
| 243 | + // .onClick(() => { | ||
| 244 | + // this.share() | ||
| 245 | + // }) | ||
| 246 | + // } | ||
| 247 | } | 247 | } |
| 248 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16'), top: this.topSafeHeight + 'px' }) | 248 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16'), top: this.topSafeHeight + 'px' }) |
| 249 | .height($r('app.float.top_bar_height')) | 249 | .height($r('app.float.top_bar_height')) |
| @@ -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(); |
| @@ -258,6 +258,12 @@ export struct RmhTitle { | @@ -258,6 +258,12 @@ export struct RmhTitle { | ||
| 258 | .height(36) | 258 | .height(36) |
| 259 | .margin({ bottom: 10 }) | 259 | .margin({ bottom: 10 }) |
| 260 | .onClick(()=>{ | 260 | .onClick(()=>{ |
| 261 | + ///我的收藏 编辑状态点击 | ||
| 262 | + if (this.compDTO.isCollectionEditting) { | ||
| 263 | + this.compDTO.isSelect = this.compDTO.isSelect?false:true | ||
| 264 | + return; | ||
| 265 | + } | ||
| 266 | + | ||
| 261 | this.gotoPeopleShipHomePage() | 267 | this.gotoPeopleShipHomePage() |
| 262 | }) | 268 | }) |
| 263 | } | 269 | } |
| @@ -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 | ||
| @@ -29,8 +29,8 @@ struct MyCollectionListPage { | @@ -29,8 +29,8 @@ struct MyCollectionListPage { | ||
| 29 | isloading : boolean = false | 29 | isloading : boolean = false |
| 30 | @Provide isEditState:boolean = false | 30 | @Provide isEditState:boolean = false |
| 31 | @State isDisplayButton:boolean = false | 31 | @State isDisplayButton:boolean = false |
| 32 | - @State allDatas :ContentDTO[] = []; | ||
| 33 | - @State selectDatas :ContentDTO[] = []; | 32 | + @State allDatas :CompDTO[] = []; |
| 33 | + @State selectDatas :CompDTO[] = []; | ||
| 34 | @Provide deleteNum :number = 0; | 34 | @Provide deleteNum :number = 0; |
| 35 | @Provide isAllSelect:boolean = false | 35 | @Provide isAllSelect:boolean = false |
| 36 | 36 | ||
| @@ -77,6 +77,9 @@ struct MyCollectionListPage { | @@ -77,6 +77,9 @@ struct MyCollectionListPage { | ||
| 77 | Column(){ | 77 | Column(){ |
| 78 | CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.isDisplayButton,editCallback:()=>{ | 78 | CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.isDisplayButton,editCallback:()=>{ |
| 79 | this.allSelectDatas(false) | 79 | this.allSelectDatas(false) |
| 80 | + this.allDatas.forEach((item) =>{ | ||
| 81 | + item.isCollectionEditting = this.isEditState | ||
| 82 | + }) | ||
| 80 | this.isAllSelect = false | 83 | this.isAllSelect = false |
| 81 | this.selectDatas = [] | 84 | this.selectDatas = [] |
| 82 | this.deleteNum = 0 | 85 | this.deleteNum = 0 |
| @@ -122,7 +125,7 @@ struct MyCollectionListPage { | @@ -122,7 +125,7 @@ struct MyCollectionListPage { | ||
| 122 | } | 125 | } |
| 123 | .backgroundColor(Color.White) | 126 | .backgroundColor(Color.White) |
| 124 | .alignContent(Alignment.Top) | 127 | .alignContent(Alignment.Top) |
| 125 | - .position({y:'92%'}) | 128 | + .position({y:'94%'}) |
| 126 | .width(CommonConstants.FULL_WIDTH) | 129 | .width(CommonConstants.FULL_WIDTH) |
| 127 | .height(CommonConstants.FULL_HEIGHT) | 130 | .height(CommonConstants.FULL_HEIGHT) |
| 128 | } | 131 | } |
| @@ -136,14 +139,14 @@ struct MyCollectionListPage { | @@ -136,14 +139,14 @@ struct MyCollectionListPage { | ||
| 136 | 139 | ||
| 137 | @Builder ListLayout() { | 140 | @Builder ListLayout() { |
| 138 | List({scroller: this.scroller}) { | 141 | List({scroller: this.scroller}) { |
| 139 | - ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { | 142 | + ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => { |
| 140 | ListItem() { | 143 | ListItem() { |
| 141 | this.newCompParser(compDTO,compIndex) | 144 | this.newCompParser(compDTO,compIndex) |
| 142 | } | 145 | } |
| 143 | - }) | 146 | + }, (item: string) => DateTimeUtils.getTimeStamp().toString()) |
| 144 | // 加载更多 | 147 | // 加载更多 |
| 145 | ListItem() { | 148 | ListItem() { |
| 146 | - if (this.browSingModel.hasMore === false) NoMoreLayout() | 149 | + if (this.browSingModel.hasMore === false) NoMoreLayout().height(this.isEditState?120:80) |
| 147 | //Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | 150 | //Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); |
| 148 | } | 151 | } |
| 149 | } | 152 | } |
| @@ -160,25 +163,22 @@ struct MyCollectionListPage { | @@ -160,25 +163,22 @@ struct MyCollectionListPage { | ||
| 160 | } | 163 | } |
| 161 | 164 | ||
| 162 | @Builder | 165 | @Builder |
| 163 | - newCompParser(compDTO: ContentDTO, compIndex: number){ | 166 | + newCompParser(compDTO: CompDTO, compIndex: number){ |
| 164 | Row(){ | 167 | Row(){ |
| 165 | if (this.isEditState){ | 168 | if (this.isEditState){ |
| 166 | CustomSelectUI({ | 169 | CustomSelectUI({ |
| 167 | - isOn:compDTO.isSelect, | ||
| 168 | - selectCallback:(isOn)=>{ | ||
| 169 | - this.addCompDTO(isOn,compDTO) | ||
| 170 | - } | 170 | + data:compDTO, |
| 171 | + selectCallback:((item)=>{ | ||
| 172 | + this.addCompDTO(compDTO.isSelect,compDTO) | ||
| 173 | + }) | ||
| 171 | }).margin({right: 16}) | 174 | }).margin({right: 16}) |
| 172 | } | 175 | } |
| 173 | - Column() { | ||
| 174 | - BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) | ||
| 175 | - } | 176 | + BigPicCardComponent({compDTO:compDTO,contentDTO:compDTO.operDataList[0],pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) |
| 176 | }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 177 | }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 177 | if (isVisible && !this.isEditState) { | 178 | if (isVisible && !this.isEditState) { |
| 178 | - TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) | 179 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO.operDataList[0])) |
| 179 | } | 180 | } |
| 180 | }) | 181 | }) |
| 181 | - | ||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | 184 | ||
| @@ -216,8 +216,7 @@ struct MyCollectionListPage { | @@ -216,8 +216,7 @@ struct MyCollectionListPage { | ||
| 216 | 216 | ||
| 217 | //数据处理 | 217 | //数据处理 |
| 218 | //单个选择 | 218 | //单个选择 |
| 219 | - addCompDTO(isOn:boolean , compDTO: ContentDTO){ | ||
| 220 | - compDTO.isSelect = isOn; | 219 | + addCompDTO(isOn:boolean , compDTO: CompDTO){ |
| 221 | if (isOn === true){ | 220 | if (isOn === true){ |
| 222 | this.selectDatas.push(compDTO) | 221 | this.selectDatas.push(compDTO) |
| 223 | }else { | 222 | }else { |
| @@ -230,20 +229,18 @@ struct MyCollectionListPage { | @@ -230,20 +229,18 @@ struct MyCollectionListPage { | ||
| 230 | 229 | ||
| 231 | //全选 | 230 | //全选 |
| 232 | allSelectDatas(isOn:boolean){ | 231 | allSelectDatas(isOn:boolean){ |
| 233 | - let datas: ContentDTO[] = []; | 232 | + let datas: CompDTO[] = []; |
| 234 | for (let index = 0; index < this.allDatas.length; index++) { | 233 | for (let index = 0; index < this.allDatas.length; index++) { |
| 235 | const compDTO = this.allDatas[index]; | 234 | const compDTO = this.allDatas[index]; |
| 236 | compDTO.isSelect = isOn | 235 | compDTO.isSelect = isOn |
| 237 | datas.push(compDTO) | 236 | datas.push(compDTO) |
| 238 | } | 237 | } |
| 239 | this.selectDatas = [] | 238 | this.selectDatas = [] |
| 240 | - this.allDatas = [] | ||
| 241 | if (isOn === true) { | 239 | if (isOn === true) { |
| 242 | this.selectDatas.push(...datas) | 240 | this.selectDatas.push(...datas) |
| 243 | }else { | 241 | }else { |
| 244 | this.selectDatas.splice(0,this.deleteNum) | 242 | this.selectDatas.splice(0,this.deleteNum) |
| 245 | } | 243 | } |
| 246 | - this.allDatas.push(...datas) | ||
| 247 | this.deleteNum = this.selectDatas.length | 244 | this.deleteNum = this.selectDatas.length |
| 248 | } | 245 | } |
| 249 | 246 | ||
| @@ -269,6 +266,9 @@ struct MyCollectionListPage { | @@ -269,6 +266,9 @@ struct MyCollectionListPage { | ||
| 269 | updataUIState(){ | 266 | updataUIState(){ |
| 270 | this.isEditState = false | 267 | this.isEditState = false |
| 271 | this.isAllSelect = false | 268 | this.isAllSelect = false |
| 269 | + this.allDatas.forEach((item) =>{ | ||
| 270 | + item.isCollectionEditting = false | ||
| 271 | + }) | ||
| 272 | 272 | ||
| 273 | if (this.allDatas.length === 0) { | 273 | if (this.allDatas.length === 0) { |
| 274 | this.browSingModel.viewType = ViewType.EMPTY; | 274 | this.browSingModel.viewType = ViewType.EMPTY; |
| @@ -294,22 +294,44 @@ struct MyCollectionListPage { | @@ -294,22 +294,44 @@ struct MyCollectionListPage { | ||
| 294 | 294 | ||
| 295 | if (this.currentPage === 1) { | 295 | if (this.currentPage === 1) { |
| 296 | this.allDatas = [] | 296 | this.allDatas = [] |
| 297 | + this.isAllSelect = false | ||
| 298 | + this.selectDatas = [] | ||
| 299 | + this.deleteNum = 0 | ||
| 297 | } | 300 | } |
| 298 | 301 | ||
| 299 | for (let index = 0; index < item.list.length; index++) { | 302 | for (let index = 0; index < item.list.length; index++) { |
| 300 | - const compDTO = item.list[index]; | ||
| 301 | - compDTO.isCollection = true ///用于时间展示 | ||
| 302 | - compDTO.interactData = this.commentList[index] | 303 | + const contentDTO = item.list[index]; |
| 304 | + contentDTO.isCollection = true ///用于时间展示 | ||
| 305 | + contentDTO.interactData = this.commentList[index] | ||
| 306 | + | ||
| 307 | + let compDTO = new CompDTO() | ||
| 308 | + compDTO.operDataList.push(ContentDTO.clone(contentDTO)) | ||
| 309 | + compDTO.objectId = contentDTO.objectId | ||
| 310 | + compDTO.objectType = contentDTO.objectType | ||
| 311 | + compDTO.relType = contentDTO.relType | ||
| 312 | + compDTO.relId = contentDTO.relId | ||
| 313 | + compDTO.isCollectionEditting = this.isEditState | ||
| 303 | this.allDatas.push(compDTO) | 314 | this.allDatas.push(compDTO) |
| 304 | } | 315 | } |
| 305 | 316 | ||
| 306 | } catch (exception) { | 317 | } catch (exception) { |
| 307 | if (this.currentPage === 1) { | 318 | if (this.currentPage === 1) { |
| 308 | this.allDatas = [] | 319 | this.allDatas = [] |
| 320 | + this.isAllSelect = false | ||
| 321 | + this.selectDatas = [] | ||
| 322 | + this.deleteNum = 0 | ||
| 309 | } | 323 | } |
| 324 | + | ||
| 310 | for (let index = 0; index < item.list.length; index++) { | 325 | for (let index = 0; index < item.list.length; index++) { |
| 311 | - const compDTO = item.list[index]; | ||
| 312 | - compDTO.isCollection = true ///用于时间展示 | 326 | + const contentDTO = item.list[index]; |
| 327 | + contentDTO.isCollection = true ///用于时间展示 | ||
| 328 | + let compDTO = new CompDTO() | ||
| 329 | + compDTO.operDataList.push(ContentDTO.clone(contentDTO)) | ||
| 330 | + compDTO.objectId = contentDTO.objectId | ||
| 331 | + compDTO.objectType = contentDTO.objectType | ||
| 332 | + compDTO.relType = contentDTO.relType | ||
| 333 | + compDTO.relId = contentDTO.relId | ||
| 334 | + compDTO.isCollectionEditting = this.isEditState | ||
| 313 | this.allDatas.push(compDTO) | 335 | this.allDatas.push(compDTO) |
| 314 | } | 336 | } |
| 315 | } | 337 | } |
| 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