Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: 直播回看列表及分页加载处理。 feat:1)电子报骨架屏添加;2)bug列表缺陷修改(直播详情/电子报) 竖屏直播入口 竖屏直播入口 feat(动态详情):UI绘制 兴趣询问卡ui feat:1)直播详情直播状态UI修改优化;2)直播和预约直播接口状态添加;3)直播列表跳转事件添加 feat: 骨架屏 注释未支持组件的占位 feat: 骨架屏提示 feat: 骨架屏
Showing
57 changed files
with
1102 additions
and
183 deletions
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | * ResponseDTO | 2 | * ResponseDTO |
| 3 | */ | 3 | */ |
| 4 | export interface ResponseDTO<T = string> { | 4 | export interface ResponseDTO<T = string> { |
| 5 | - success:boolean; | 5 | + success: boolean; |
| 6 | 6 | ||
| 7 | // 服务请求响应值/微服务响应状态码” | 7 | // 服务请求响应值/微服务响应状态码” |
| 8 | code: number; | 8 | code: number; |
| @@ -12,6 +12,7 @@ export interface ResponseDTO<T = string> { | @@ -12,6 +12,7 @@ export interface ResponseDTO<T = string> { | ||
| 12 | 12 | ||
| 13 | // 响应结果 | 13 | // 响应结果 |
| 14 | data?: T; | 14 | data?: T; |
| 15 | + totalCount?: number; | ||
| 15 | 16 | ||
| 16 | // 请求响应时间戳(unix格式) | 17 | // 请求响应时间戳(unix格式) |
| 17 | timestamp?: number; | 18 | timestamp?: number; |
| @@ -43,6 +43,7 @@ export class WDRouterPage { | @@ -43,6 +43,7 @@ export class WDRouterPage { | ||
| 43 | static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); | 43 | static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); |
| 44 | // 直播详情页 | 44 | // 直播详情页 |
| 45 | static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); | 45 | static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); |
| 46 | + static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage"); | ||
| 46 | // 多图(图集)详情页 | 47 | // 多图(图集)详情页 |
| 47 | static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); | 48 | static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); |
| 48 | // 音乐详情页 | 49 | // 音乐详情页 |
| @@ -167,16 +167,19 @@ export interface LiveDetailsBean { | @@ -167,16 +167,19 @@ export interface LiveDetailsBean { | ||
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | export interface LiveInfo { | 169 | export interface LiveInfo { |
| 170 | - //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 170 | + //直播新闻-直播状态 wait 待开播 running 直播中 end 已结束cancel已取消paused暂停 |
| 171 | liveState: string | 171 | liveState: string |
| 172 | //2024-04-12 15:00:00 直播开始时间 | 172 | //2024-04-12 15:00:00 直播开始时间 |
| 173 | planStartTime: string | 173 | planStartTime: string |
| 174 | + liveStyle: number; | ||
| 174 | vlive: Array<Vlive> | 175 | vlive: Array<Vlive> |
| 175 | - mlive:MLive | 176 | + mlive: MLive |
| 176 | } | 177 | } |
| 178 | + | ||
| 177 | export interface MLive { | 179 | export interface MLive { |
| 178 | - mliveId:string | 180 | + mliveId: string |
| 179 | } | 181 | } |
| 182 | + | ||
| 180 | export interface FullColumnImgUrls { | 183 | export interface FullColumnImgUrls { |
| 181 | url: string | 184 | url: string |
| 182 | } | 185 | } |
| @@ -63,3 +63,5 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi | @@ -63,3 +63,5 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi | ||
| 63 | 63 | ||
| 64 | export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" | 64 | export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" |
| 65 | 65 | ||
| 66 | +export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" | ||
| 67 | + |
| @@ -58,9 +58,9 @@ export struct CardParser { | @@ -58,9 +58,9 @@ export struct CardParser { | ||
| 58 | } | 58 | } |
| 59 | else { | 59 | else { |
| 60 | // todo:组件未实现 / Component Not Implemented | 60 | // todo:组件未实现 / Component Not Implemented |
| 61 | - Text(contentDTO.appStyle) | ||
| 62 | - .width(CommonConstants.FULL_PARENT) | ||
| 63 | - .padding(10) | 61 | + // Text(contentDTO.appStyle) |
| 62 | + // .width(CommonConstants.FULL_PARENT) | ||
| 63 | + // .padding(10) | ||
| 64 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle | 64 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle |
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| @@ -66,9 +66,9 @@ export struct CompParser { | @@ -66,9 +66,9 @@ export struct CompParser { | ||
| 66 | } | 66 | } |
| 67 | else { | 67 | else { |
| 68 | // todo:组件未实现 / Component Not Implemented | 68 | // todo:组件未实现 / Component Not Implemented |
| 69 | - Text(compDTO.compStyle) | ||
| 70 | - .width(CommonConstants.FULL_PARENT) | ||
| 71 | - .padding(10) | 69 | + // Text(compDTO.compStyle) |
| 70 | + // .width(CommonConstants.FULL_PARENT) | ||
| 71 | + // .padding(10) | ||
| 72 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle | 72 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| @@ -35,63 +35,63 @@ export struct DynamicDetailComponent { | @@ -35,63 +35,63 @@ export struct DynamicDetailComponent { | ||
| 35 | //logo、日期 | 35 | //logo、日期 |
| 36 | Row() { | 36 | Row() { |
| 37 | Image($r('app.media.ic_article_rmh')) | 37 | Image($r('app.media.ic_article_rmh')) |
| 38 | - .width(80) | ||
| 39 | - .height(28) | ||
| 40 | - .margin({ left: 16 }) | 38 | + .width($r('app.float.margin_80')) |
| 39 | + .height($r('app.float.margin_28')) | ||
| 40 | + .margin({ left: $r('app.float.margin_16') }) | ||
| 41 | Blank() | 41 | Blank() |
| 42 | Text("2023年03月14日 08:16") | 42 | Text("2023年03月14日 08:16") |
| 43 | .fontColor($r('app.color.color_B0B0B0')) | 43 | .fontColor($r('app.color.color_B0B0B0')) |
| 44 | - .fontSize(12) | ||
| 45 | - .lineHeight(28) | ||
| 46 | - .margin({ right: 16 }) | 44 | + .fontSize($r('app.float.font_size_12')) |
| 45 | + .lineHeight($r('app.float.margin_28')) | ||
| 46 | + .margin({ right: $r('app.float.margin_16') }) | ||
| 47 | } | 47 | } |
| 48 | - .height(48) | 48 | + .height($r('app.float.margin_48')) |
| 49 | .width('100%') | 49 | .width('100%') |
| 50 | //分割线 | 50 | //分割线 |
| 51 | Image($r('app.media.ic_news_detail_division')) | 51 | Image($r('app.media.ic_news_detail_division')) |
| 52 | .width('100%') | 52 | .width('100%') |
| 53 | - .height(7) | ||
| 54 | - .margin({left: 16, right: 16} ) | 53 | + .height($r('app.float.margin_7')) |
| 54 | + .margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) | ||
| 55 | //号主信息 | 55 | //号主信息 |
| 56 | Row() { | 56 | Row() { |
| 57 | //头像 | 57 | //头像 |
| 58 | Stack() { | 58 | Stack() { |
| 59 | Image(this.contentDetailData.rmhInfo?.rmhHeadUrl) | 59 | Image(this.contentDetailData.rmhInfo?.rmhHeadUrl) |
| 60 | .alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater')) | 60 | .alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater')) |
| 61 | - .width('32') | ||
| 62 | - .height('32') | 61 | + .width($r('app.float.margin_32')) |
| 62 | + .height($r('app.float.margin_32')) | ||
| 63 | .objectFit(ImageFit.Cover) | 63 | .objectFit(ImageFit.Cover) |
| 64 | - .borderRadius(16) | 64 | + .borderRadius($r('app.float.margin_16')) |
| 65 | Image($r('app.media.icon_border_test')) | 65 | Image($r('app.media.icon_border_test')) |
| 66 | - .width('48') | ||
| 67 | - .height('48') | 66 | + .width($r('app.float.margin_48')) |
| 67 | + .height($r('app.float.margin_48')) | ||
| 68 | .objectFit(ImageFit.Cover) | 68 | .objectFit(ImageFit.Cover) |
| 69 | - .borderRadius(24) | 69 | + .borderRadius($r('app.float.margin_24')) |
| 70 | } | 70 | } |
| 71 | - .width(48) | ||
| 72 | - .height(48) | 71 | + .width($r('app.float.margin_48')) |
| 72 | + .height($r('app.float.margin_48')) | ||
| 73 | .alignContent(Alignment.Center) | 73 | .alignContent(Alignment.Center) |
| 74 | Column(){ | 74 | Column(){ |
| 75 | //昵称 | 75 | //昵称 |
| 76 | Text("this.contentDetailData.rmhInfo?.rmhName") | 76 | Text("this.contentDetailData.rmhInfo?.rmhName") |
| 77 | - .fontSize(14) | 77 | + .fontSize($r('app.float.font_size_14')) |
| 78 | .fontColor($r('app.color.color_222222')) | 78 | .fontColor($r('app.color.color_222222')) |
| 79 | .fontWeight(FontWeight.Medium) | 79 | .fontWeight(FontWeight.Medium) |
| 80 | - .margin({ left: 5 }) | 80 | + .margin({ left: $r('app.float.margin_5') }) |
| 81 | //简介 | 81 | //简介 |
| 82 | Text("this.contentDetailData.rmhInfo?.rmhDesc") | 82 | Text("this.contentDetailData.rmhInfo?.rmhDesc") |
| 83 | - .fontSize(14) | 83 | + .fontSize($r('app.float.font_size_14')) |
| 84 | .fontColor($r('app.color.color_B0B0B0')) | 84 | .fontColor($r('app.color.color_B0B0B0')) |
| 85 | .fontWeight(FontWeight.Medium) | 85 | .fontWeight(FontWeight.Medium) |
| 86 | - .margin({ left: 5 }) | 86 | + .margin({ left: $r('app.float.margin_5') }) |
| 87 | } | 87 | } |
| 88 | if (!this.followStatus) { | 88 | if (!this.followStatus) { |
| 89 | Text('关注') | 89 | Text('关注') |
| 90 | .width(60) | 90 | .width(60) |
| 91 | - .height(24) | 91 | + .height($r('app.float.margin_48')) |
| 92 | .textAlign(TextAlign.Center) | 92 | .textAlign(TextAlign.Center) |
| 93 | .fontSize($r('app.float.font_size_12')) | 93 | .fontSize($r('app.float.font_size_12')) |
| 94 | - .borderRadius($r('app.float.button_border_radius')) | 94 | + .borderRadius($r('app.float.vp_3')) |
| 95 | .backgroundColor($r('app.color.color_ED2800')) | 95 | .backgroundColor($r('app.color.color_ED2800')) |
| 96 | .fontColor($r('app.color.color_fff')) | 96 | .fontColor($r('app.color.color_fff')) |
| 97 | .onClick(() => { | 97 | .onClick(() => { |
| @@ -99,12 +99,12 @@ export struct DynamicDetailComponent { | @@ -99,12 +99,12 @@ export struct DynamicDetailComponent { | ||
| 99 | }) | 99 | }) |
| 100 | } else { | 100 | } else { |
| 101 | Text('已关注') | 101 | Text('已关注') |
| 102 | - .width(60) | ||
| 103 | - .height(24) | 102 | + .width($r('app.float.margin_60')) |
| 103 | + .height($r('app.float.margin_48')) | ||
| 104 | .borderWidth(1) | 104 | .borderWidth(1) |
| 105 | .textAlign(TextAlign.Center) | 105 | .textAlign(TextAlign.Center) |
| 106 | .fontSize($r('app.float.font_size_12')) | 106 | .fontSize($r('app.float.font_size_12')) |
| 107 | - .borderRadius($r('app.float.button_border_radius')) | 107 | + .borderRadius($r('app.float.vp_3')) |
| 108 | .borderColor($r('app.color.color_CCCCCC')) | 108 | .borderColor($r('app.color.color_CCCCCC')) |
| 109 | .fontColor($r('app.color.color_CCCCCC')) | 109 | .fontColor($r('app.color.color_CCCCCC')) |
| 110 | .onClick(() => { | 110 | .onClick(() => { |
| @@ -113,6 +113,53 @@ export struct DynamicDetailComponent { | @@ -113,6 +113,53 @@ export struct DynamicDetailComponent { | ||
| 113 | } | 113 | } |
| 114 | } | 114 | } |
| 115 | .width('100%') | 115 | .width('100%') |
| 116 | + //内容 | ||
| 117 | + Text("这里展示标题这里展示标题这里展示标题这里这里展示标题这里展示标题这里展示标题这里这里展示标题这里展示标题这里展示标题这里") | ||
| 118 | + .fontColor($r('app.color.color_222222')) | ||
| 119 | + .fontSize($r('app.float.font_size_18')) | ||
| 120 | + .lineHeight($r('app.float.margin_25')) | ||
| 121 | + .margin({ top: $r('app.float.margin_6') | ||
| 122 | + ,left: $r('app.float.margin_16') | ||
| 123 | + ,right: $r('app.float.margin_16') }) | ||
| 124 | + //特别声明 | ||
| 125 | + Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。") | ||
| 126 | + .fontColor($r('app.color.color_CCCCCC')) | ||
| 127 | + .fontSize($r('app.float.font_size_12')) | ||
| 128 | + .lineHeight($r('app.float.margin_16')) | ||
| 129 | + .margin({ top: $r('app.float.margin_16') | ||
| 130 | + ,left: $r('app.float.margin_16') | ||
| 131 | + ,right: $r('app.float.margin_16') }) | ||
| 132 | + //微信/朋友圈/微博 | ||
| 133 | + Row(){ | ||
| 134 | + Image($r('app.media.xxhdpi_pic_wechat')) | ||
| 135 | + .width($r('app.float.margin_116')) | ||
| 136 | + .height($r('app.float.margin_36')) | ||
| 137 | + .objectFit(ImageFit.Cover) | ||
| 138 | + Image($r('app.media.xxhdpi_pic_pyq')) | ||
| 139 | + .width($r('app.float.margin_116')) | ||
| 140 | + .height($r('app.float.margin_36')) | ||
| 141 | + .margin({ left: $r('app.float.margin_4_negative')}) | ||
| 142 | + .objectFit(ImageFit.Cover) | ||
| 143 | + Image($r('app.media.xxhdpi_pic_wb')) | ||
| 144 | + .width($r('app.float.margin_116')) | ||
| 145 | + .height($r('app.float.margin_36')) | ||
| 146 | + .margin({ left: $r('app.float.margin_4_negative')}) | ||
| 147 | + .objectFit(ImageFit.Cover) | ||
| 148 | + } | ||
| 149 | + .margin({ top: $r('app.float.margin_24')}) | ||
| 150 | + //点赞 | ||
| 151 | + Row(){ | ||
| 152 | + Image($r('app.media.icon_like_selected_redheart')) | ||
| 153 | + .width($r('app.float.margin_24')) | ||
| 154 | + .height($r('app.float.margin_24')) | ||
| 155 | + .objectFit(ImageFit.Cover) | ||
| 156 | + Text("2.6万") | ||
| 157 | + .fontColor($r('app.color.color_999999')) | ||
| 158 | + .fontSize($r('app.float.font_size_16')) | ||
| 159 | + .lineHeight($r('app.float.margin_20')) | ||
| 160 | + .margin({ left: $r('app.float.margin_2')}) | ||
| 161 | + } | ||
| 162 | + //评论组件/底部组件 | ||
| 116 | } | 163 | } |
| 117 | } | 164 | } |
| 118 | .backgroundColor('#FFFFFFFF') | 165 | .backgroundColor('#FFFFFFFF') |
| @@ -2,6 +2,7 @@ import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from | @@ -2,6 +2,7 @@ import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from | ||
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | import { StringUtils } from 'wdKit'; | 3 | import { StringUtils } from 'wdKit'; |
| 4 | import { WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterRule } from 'wdRouter'; |
| 5 | +import { newsSkeleton } from './skeleton/newsSkeleton'; | ||
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | export struct ENewspaperItemComponent { | 8 | export struct ENewspaperItemComponent { |
| @@ -11,13 +12,20 @@ export struct ENewspaperItemComponent { | @@ -11,13 +12,20 @@ export struct ENewspaperItemComponent { | ||
| 11 | private startX: number = 0 | 12 | private startX: number = 0 |
| 12 | private startY: number = 0 | 13 | private startY: number = 0 |
| 13 | private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean | 14 | private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean |
| 15 | + @State isShowSkeleton: boolean = true | ||
| 14 | 16 | ||
| 15 | build() { | 17 | build() { |
| 16 | Stack() { | 18 | Stack() { |
| 19 | + newsSkeleton() | ||
| 20 | + .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) | ||
| 17 | Image(this.newspaperListItemBean.pagePic) | 21 | Image(this.newspaperListItemBean.pagePic) |
| 18 | .width('100%') | 22 | .width('100%') |
| 19 | .aspectRatio(378 / 566) | 23 | .aspectRatio(378 / 566) |
| 20 | .objectFit(ImageFit.Fill) | 24 | .objectFit(ImageFit.Fill) |
| 25 | + .onComplete(() => { | ||
| 26 | + this.isShowSkeleton = false | ||
| 27 | + }) | ||
| 28 | + .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) | ||
| 21 | 29 | ||
| 22 | Canvas(this.context) | 30 | Canvas(this.context) |
| 23 | .width('100%') | 31 | .width('100%') |
| @@ -62,7 +70,7 @@ export struct ENewspaperItemComponent { | @@ -62,7 +70,7 @@ export struct ENewspaperItemComponent { | ||
| 62 | pageID: 'IMAGE_TEXT_DETAIL', | 70 | pageID: 'IMAGE_TEXT_DETAIL', |
| 63 | extra: { | 71 | extra: { |
| 64 | relType: this.itemBeanClicked.relType ?? '', | 72 | relType: this.itemBeanClicked.relType ?? '', |
| 65 | - relId: ''+this.itemBeanClicked.relId, | 73 | + relId: '' + this.itemBeanClicked.relId, |
| 66 | sourcePage: '5' | 74 | sourcePage: '5' |
| 67 | } as ExtraDTO | 75 | } as ExtraDTO |
| 68 | } as Params, | 76 | } as Params, |
| @@ -110,11 +110,11 @@ export struct ENewspaperPageComponent { | @@ -110,11 +110,11 @@ export struct ENewspaperPageComponent { | ||
| 110 | }) | 110 | }) |
| 111 | 111 | ||
| 112 | Row() { | 112 | Row() { |
| 113 | - Text(this.calendarDate) | 113 | + Text(this.calendarDate?.replace('-', '.')?.replace('-', '.')) |
| 114 | .fontSize($r('app.float.font_size_20')) | 114 | .fontSize($r('app.float.font_size_20')) |
| 115 | .fontColor($r('app.color.white')) | 115 | .fontColor($r('app.color.white')) |
| 116 | .fontFamily('BebasNeue_Regular') | 116 | .fontFamily('BebasNeue_Regular') |
| 117 | - .fontWeight(FontWeight.Bold) | 117 | + .fontWeight(FontWeight.Regular) |
| 118 | 118 | ||
| 119 | Image($r('app.media.icon_triangle')) | 119 | Image($r('app.media.icon_triangle')) |
| 120 | .width($r('app.float.border_radius_6')) | 120 | .width($r('app.float.border_radius_6')) |
| @@ -167,6 +167,7 @@ export struct ENewspaperPageComponent { | @@ -167,6 +167,7 @@ export struct ENewspaperPageComponent { | ||
| 167 | .autoPlay(false) | 167 | .autoPlay(false) |
| 168 | .cachedCount(3) | 168 | .cachedCount(3) |
| 169 | .indicator(false) | 169 | .indicator(false) |
| 170 | + .loop(false) | ||
| 170 | .displayCount(1) | 171 | .displayCount(1) |
| 171 | .margin({ top: 35, left: 10, right: 10 }) | 172 | .margin({ top: 35, left: 10, right: 10 }) |
| 172 | .id('e_newspaper_content') | 173 | .id('e_newspaper_content') |
| @@ -191,12 +192,13 @@ export struct ENewspaperPageComponent { | @@ -191,12 +192,13 @@ export struct ENewspaperPageComponent { | ||
| 191 | .id('e_newspaper_shadow') | 192 | .id('e_newspaper_shadow') |
| 192 | 193 | ||
| 193 | Row() { | 194 | Row() { |
| 194 | - Text('滑动查看下一版') | 195 | + Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版') |
| 195 | .fontColor(Color.White) | 196 | .fontColor(Color.White) |
| 196 | .fontSize($r('app.float.font_size_14')) | 197 | .fontSize($r('app.float.font_size_14')) |
| 197 | Image($r('app.media.icon_next_page')) | 198 | Image($r('app.media.icon_next_page')) |
| 198 | .width($r('app.float.vp_16')) | 199 | .width($r('app.float.vp_16')) |
| 199 | .height($r('app.float.vp_16')) | 200 | .height($r('app.float.vp_16')) |
| 201 | + .visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible) | ||
| 200 | } | 202 | } |
| 201 | .justifyContent(FlexAlign.Center) | 203 | .justifyContent(FlexAlign.Center) |
| 202 | .margin({ top: $r('app.float.margin_16') }) | 204 | .margin({ top: $r('app.float.margin_16') }) |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | +import { CollectionUtils, DateTimeUtils, Logger, StringUtils, ToastUtils } from 'wdKit/Index'; | ||
| 4 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 3 | 5 | ||
| 4 | const TAG = 'Zh_Grid_Layout-02'; | 6 | const TAG = 'Zh_Grid_Layout-02'; |
| 5 | const FULL_PARENT: string = '100%'; | 7 | const FULL_PARENT: string = '100%'; |
| @@ -11,46 +13,76 @@ let listSize: number = 2; | @@ -11,46 +13,76 @@ let listSize: number = 2; | ||
| 11 | * Zh_Grid_Layout-02 | 13 | * Zh_Grid_Layout-02 |
| 12 | * | 14 | * |
| 13 | */ | 15 | */ |
| 14 | -@Preview | ||
| 15 | @Component | 16 | @Component |
| 16 | export struct ZhGridLayout02 { | 17 | export struct ZhGridLayout02 { |
| 17 | @State compDTO: CompDTO = {} as CompDTO | 18 | @State compDTO: CompDTO = {} as CompDTO |
| 19 | + @State operDataList: ContentDTO[] = [] | ||
| 20 | + currentPage = 1 | ||
| 21 | + pageSize = 12 | ||
| 18 | 22 | ||
| 19 | aboutToAppear() { | 23 | aboutToAppear() { |
| 20 | - if (this.compDTO.operDataList) { | ||
| 21 | - listSize = this.compDTO.operDataList.length > 5 ? 2 : this.compDTO.operDataList.length; | ||
| 22 | - } | 24 | + Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle) |
| 25 | + this.currentPage = 1 | ||
| 26 | + PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => { | ||
| 27 | + this.operDataList = [] | ||
| 28 | + this.operDataList.push(...liveReviewDTO.list) | ||
| 29 | + }) | ||
| 23 | } | 30 | } |
| 24 | 31 | ||
| 25 | build() { | 32 | build() { |
| 26 | Column() { | 33 | Column() { |
| 27 | - Row() { | ||
| 28 | - Image($r("app.media.redLine")) | ||
| 29 | - .width(3) | ||
| 30 | - .height(16) | ||
| 31 | - .margin({ right: 4 }) | ||
| 32 | - Text(this.compDTO.objectTitle) | ||
| 33 | - .fontSize($r("app.float.font_size_17")) | ||
| 34 | - .fontColor($r("app.color.color_222222")) | ||
| 35 | - .fontWeight(600) | ||
| 36 | - } | ||
| 37 | - .justifyContent(FlexAlign.Start) | ||
| 38 | - .margin({ top: 8, bottom: 8 }) | ||
| 39 | - .width(CommonConstants.FULL_WIDTH) | ||
| 40 | 34 | ||
| 41 | 35 | ||
| 42 | - GridRow({ | ||
| 43 | - columns: { sm: listSize, md: 2 }, | ||
| 44 | - breakpoints: { value: ['320vp', '520vp', '840vp'] } | ||
| 45 | - }) { | ||
| 46 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 47 | - GridCol() { | ||
| 48 | - this.buildItemCard(this.compDTO.operDataList[index]); | 36 | + Scroll() { |
| 37 | + Column() { | ||
| 38 | + Row() { | ||
| 39 | + Image($r("app.media.redLine")) | ||
| 40 | + .width(3) | ||
| 41 | + .height(16) | ||
| 42 | + .margin({ right: 4 }) | ||
| 43 | + Text(this.compDTO.objectTitle) | ||
| 44 | + .fontSize($r("app.float.font_size_17")) | ||
| 45 | + .fontColor($r("app.color.color_222222")) | ||
| 46 | + .fontWeight(600) | ||
| 47 | + } | ||
| 48 | + .justifyContent(FlexAlign.Start) | ||
| 49 | + .margin({ top: 8, bottom: 8 }) | ||
| 50 | + .width(CommonConstants.FULL_WIDTH) | ||
| 51 | + | ||
| 52 | + GridRow({ | ||
| 53 | + columns: { sm: listSize, md: 2 }, | ||
| 54 | + breakpoints: { value: ['320vp', '520vp', '840vp'] } | ||
| 55 | + }) { | ||
| 56 | + ForEach(this.operDataList, (item: ContentDTO, index: number) => { | ||
| 57 | + GridCol() { | ||
| 58 | + this.buildItemCard(item); | ||
| 59 | + } | ||
| 60 | + }) | ||
| 49 | } | 61 | } |
| 50 | - }) | 62 | + } |
| 63 | + | ||
| 51 | } | 64 | } |
| 65 | + .width("100%") | ||
| 66 | + .height("100%") | ||
| 67 | + // .layoutWeight(1) | ||
| 68 | + .edgeEffect(EdgeEffect.None) | ||
| 69 | + .scrollBar(BarState.Off) | ||
| 70 | + .onReachStart(() => { | ||
| 71 | + Logger.debug(TAG, 'onReachStart') | ||
| 72 | + }) | ||
| 73 | + .onReachEnd(() => { | ||
| 74 | + Logger.debug(TAG, 'onReachEnd') | ||
| 75 | + this.addItems() | ||
| 76 | + }) | ||
| 77 | + .nestedScroll({ | ||
| 78 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 79 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 80 | + }) | ||
| 52 | } | 81 | } |
| 53 | .width(CommonConstants.FULL_WIDTH) | 82 | .width(CommonConstants.FULL_WIDTH) |
| 83 | + // .width("100%") | ||
| 84 | + .height("100%") | ||
| 85 | + // .layoutWeight(1) | ||
| 54 | .padding({ | 86 | .padding({ |
| 55 | top: 14, | 87 | top: 14, |
| 56 | left: 16, | 88 | left: 16, |
| @@ -78,6 +110,15 @@ export struct ZhGridLayout02 { | @@ -78,6 +110,15 @@ export struct ZhGridLayout02 { | ||
| 78 | } | 110 | } |
| 79 | .width('100%') | 111 | .width('100%') |
| 80 | } | 112 | } |
| 113 | + | ||
| 114 | + addItems() { | ||
| 115 | + Logger.debug(TAG, 'addItems') | ||
| 116 | + this.currentPage++ | ||
| 117 | + PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => { | ||
| 118 | + this.operDataList.push(...liveReviewDTO.list) | ||
| 119 | + Logger.debug(TAG, 'addItems after: ' + this.operDataList.length) | ||
| 120 | + }) | ||
| 121 | + } | ||
| 81 | } | 122 | } |
| 82 | 123 | ||
| 83 | 124 |
| 1 | +import { CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | +import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | +import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | +import { PageRepository } from '../repository/PageRepository'; | ||
| 6 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 精选评论卡 | ||
| 10 | + * Zh_Single_Row-06 | ||
| 11 | + */ | ||
| 12 | +const TAG = 'Zh_Single_Row-06' | ||
| 13 | + | ||
| 14 | +@Entry | ||
| 15 | +@Component | ||
| 16 | +export struct ZhSingleRow06 { | ||
| 17 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 18 | + @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事'] | ||
| 19 | + @State activeIndexs: Array<number> = [] | ||
| 20 | + | ||
| 21 | + getItemWidth(index: number) { | ||
| 22 | + if (index % 4 === 0 || index % 4 === 3) { | ||
| 23 | + return 80 | ||
| 24 | + } else { | ||
| 25 | + return 96 | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + build() { | ||
| 30 | + Column() { | ||
| 31 | + //顶部 | ||
| 32 | + this.CompHeader(this.compDTO) | ||
| 33 | + Grid() { | ||
| 34 | + ForEach(this.list, (item: string, index: number) => { | ||
| 35 | + GridItem() { | ||
| 36 | + Text(item) | ||
| 37 | + .fontSize(14) | ||
| 38 | + .fontColor(this.activeIndexs.includes(index) ? 0x222222 : 0x666666) | ||
| 39 | + .fontWeight(this.activeIndexs.includes(index) ? 600 : 400) | ||
| 40 | + .textAlign(TextAlign.Center) | ||
| 41 | + } | ||
| 42 | + .onClick(() => { | ||
| 43 | + if (this.activeIndexs.includes(index)) { | ||
| 44 | + const ind = this.activeIndexs.indexOf(index); | ||
| 45 | + this.activeIndexs.splice(ind, 1) | ||
| 46 | + } else { | ||
| 47 | + this.activeIndexs.push(index) | ||
| 48 | + } | ||
| 49 | + }) | ||
| 50 | + }) | ||
| 51 | + } | ||
| 52 | + .height(70) | ||
| 53 | + .columnsTemplate('1fr 1fr 1fr 1fr') | ||
| 54 | + .rowsTemplate('1fr 1fr') | ||
| 55 | + .margin({bottom: 10}) | ||
| 56 | + | ||
| 57 | + | ||
| 58 | + Text('选中标签,为您推荐更多您感兴趣的内容') | ||
| 59 | + .fontSize(12) | ||
| 60 | + .fontColor(0xB0B0B0) | ||
| 61 | + .textAlign(TextAlign.Center) | ||
| 62 | + .margin({bottom: 10}) | ||
| 63 | + | ||
| 64 | + Row() { | ||
| 65 | + Text('选好了') | ||
| 66 | + .fontSize(14) | ||
| 67 | + .fontColor(0x000000) | ||
| 68 | + .width('100%') | ||
| 69 | + .textAlign(TextAlign.Center) | ||
| 70 | + } | ||
| 71 | + .height(40) | ||
| 72 | + .backgroundColor(0xf9f9f9) | ||
| 73 | + .width('100%') | ||
| 74 | + .borderRadius(3) | ||
| 75 | + } | ||
| 76 | + .padding({ | ||
| 77 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 78 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 79 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 80 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 81 | + }) | ||
| 82 | + .backgroundColor($r('app.color.white')) | ||
| 83 | + .margin({ bottom: 8 }) | ||
| 84 | + | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + @Builder | ||
| 88 | + CompHeader(item: CompDTO) { | ||
| 89 | + Row() { | ||
| 90 | + Row() { | ||
| 91 | + Image($r("app.media.icon_interest_ask")) | ||
| 92 | + .width(24) | ||
| 93 | + .height(24) | ||
| 94 | + .margin({ right: 4 }) | ||
| 95 | + Text('以下是否有您感兴趣?') | ||
| 96 | + .fontSize($r("app.float.font_size_17")) | ||
| 97 | + .fontColor(0x000000) | ||
| 98 | + .fontWeight(600) | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + Row() { | ||
| 102 | + Image($r("app.media.close_button")) | ||
| 103 | + .width(14) | ||
| 104 | + .height(14) | ||
| 105 | + .onClick(() => { | ||
| 106 | + }) | ||
| 107 | + } | ||
| 108 | + .padding({ | ||
| 109 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 110 | + }) | ||
| 111 | + } | ||
| 112 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 113 | + .margin({ top: 8, bottom: 8 }) | ||
| 114 | + .width('100%') | ||
| 115 | + } | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +@Extend(Text) | ||
| 119 | +function textOverflowStyle(maxLine: number) { | ||
| 120 | + .maxLines(maxLine) | ||
| 121 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +@Component | ||
| 125 | +struct CreatorItem { | ||
| 126 | + @Prop item: ContentDTO | ||
| 127 | + @State rmhIsAttention: number = 0 | ||
| 128 | + build() { | ||
| 129 | + ListItem() { | ||
| 130 | + Column() { | ||
| 131 | + Flex({direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween}) { | ||
| 132 | + Column() { | ||
| 133 | + Row() { | ||
| 134 | + Image('') | ||
| 135 | + .width(20) | ||
| 136 | + .height(20) | ||
| 137 | + .margin({right: 4}) | ||
| 138 | + .border({width: 1, color: 0xcccccc, radius: 10}) | ||
| 139 | + Text('立志之间') | ||
| 140 | + .fontColor(0x212228) | ||
| 141 | + .fontSize(12) | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + Column() { | ||
| 146 | + Row() { | ||
| 147 | + Image($r('app.media.icon_like_no')) | ||
| 148 | + .width(16) | ||
| 149 | + .height(16) | ||
| 150 | + .margin({right: 4}) | ||
| 151 | + Text('3835') | ||
| 152 | + .fontSize(14) | ||
| 153 | + .fontColor(0x999999) | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + .margin({top: 10, left: 10, right: 10, bottom: 8}) | ||
| 158 | + | ||
| 159 | + Text('就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,') | ||
| 160 | + .maxLines(2) | ||
| 161 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 162 | + .margin({left: 10, right: 10, bottom: 8}) | ||
| 163 | + .fontSize(17) | ||
| 164 | + .fontColor(0x212228) | ||
| 165 | + .lineHeight(25) | ||
| 166 | + | ||
| 167 | + Row() { | ||
| 168 | + Image('') | ||
| 169 | + .width(66) | ||
| 170 | + .height(44) | ||
| 171 | + .borderRadius({topLeft: 3, topRight: 0, bottomLeft: 3, bottomRight: 0}) | ||
| 172 | + Text('原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制') | ||
| 173 | + .margin({left: 8}) | ||
| 174 | + .width(172) | ||
| 175 | + .maxLines(2) | ||
| 176 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 177 | + } | ||
| 178 | + .linearGradient({ | ||
| 179 | + direction: GradientDirection.Right, | ||
| 180 | + colors: [[0xffffff, 0.0],[0xffffff, 0.8], [0xf9f9f9, 1.0]] | ||
| 181 | + }) | ||
| 182 | + } | ||
| 183 | + .width(276) | ||
| 184 | + .height(150) | ||
| 185 | + .margin({ right: 10 }) | ||
| 186 | + .borderWidth(1) | ||
| 187 | + .borderColor($r('app.color.color_EDEDED')) | ||
| 188 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 189 | + .backgroundColor(0xf9f9f9) | ||
| 190 | + } | ||
| 191 | + .onClick(() => { | ||
| 192 | + console.log('跳转到rmh'); | ||
| 193 | + }) | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + /** | ||
| 197 | + * 关注号主 TODO 这里后面需要抽离 | ||
| 198 | + */ | ||
| 199 | + handleAccention(item: ContentDTO, status: number) { | ||
| 200 | + this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 201 | + return | ||
| 202 | + // 未登录,跳转登录 | ||
| 203 | + if (!HttpUrlUtils.getUserId()) { | ||
| 204 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 205 | + return | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + const params: postInteractAccentionOperateParams = { | ||
| 209 | + attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 210 | + attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 211 | + attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 212 | + // userType: 1, | ||
| 213 | + // userId: '1', // TODO 用户id需要从本地获取 | ||
| 214 | + status: status, | ||
| 215 | + } | ||
| 216 | + PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 217 | + console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 218 | + if (status === 1) { | ||
| 219 | + this.rmhIsAttention = 0 | ||
| 220 | + } else { | ||
| 221 | + this.rmhIsAttention = 1 | ||
| 222 | + } | ||
| 223 | + }) | ||
| 224 | + } | ||
| 225 | +} |
| @@ -77,11 +77,13 @@ export struct PageComponent { | @@ -77,11 +77,13 @@ export struct PageComponent { | ||
| 77 | refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | 77 | refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, |
| 78 | this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | 78 | this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) |
| 79 | }) | 79 | }) |
| 80 | - } else { | 80 | + } else if (!this.pageModel.contentNeedScroll) { |
| 81 | NoMoreLayout() | 81 | NoMoreLayout() |
| 82 | } | 82 | } |
| 83 | } | 83 | } |
| 84 | } | 84 | } |
| 85 | + // comp自己处理分页,这里设置EdgeEffect.None | ||
| 86 | + .edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring) | ||
| 85 | .scrollBar(BarState.Off) | 87 | .scrollBar(BarState.Off) |
| 86 | .cachedCount(8) | 88 | .cachedCount(8) |
| 87 | .height(CommonConstants.FULL_PARENT) | 89 | .height(CommonConstants.FULL_PARENT) |
| 1 | +/** | ||
| 2 | + * 频道骨架屏 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +export struct channelSkeleton { | ||
| 8 | + @State quantity: Array<number> = [1, 2, 3,] | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Row() { | ||
| 12 | + Column() { | ||
| 13 | + | ||
| 14 | + ForEach(this.quantity, () => { | ||
| 15 | + Row() { | ||
| 16 | + Column() { | ||
| 17 | + textArea('60%', 12) | ||
| 18 | + textArea('60%', 12) | ||
| 19 | + textArea('40%', 12) | ||
| 20 | + } | ||
| 21 | + .RightStyle() | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + Column() { | ||
| 25 | + textArea('35%', 78) | ||
| 26 | + } | ||
| 27 | + .margin({ right: 0 }) | ||
| 28 | + } | ||
| 29 | + .height(100) | ||
| 30 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 31 | + .SkeletonStyle() | ||
| 32 | + }) | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + textArea('100%', 204) | ||
| 37 | + } | ||
| 38 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 39 | + .SkeletonStyle() | ||
| 40 | + | ||
| 41 | + ForEach([1, 2], () => { | ||
| 42 | + Row() { | ||
| 43 | + Column() { | ||
| 44 | + textArea('60%', 12) | ||
| 45 | + textArea('60%', 12) | ||
| 46 | + textArea('40%', 12) | ||
| 47 | + } | ||
| 48 | + .RightStyle() | ||
| 49 | + | ||
| 50 | + Column() { | ||
| 51 | + textArea('35%', 78) | ||
| 52 | + } | ||
| 53 | + .margin({ right: 0 }) | ||
| 54 | + } | ||
| 55 | + .height(100) | ||
| 56 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 57 | + .SkeletonStyle() | ||
| 58 | + }) | ||
| 59 | + } | ||
| 60 | + .width('100%') | ||
| 61 | + } | ||
| 62 | + .height('100%') | ||
| 63 | + } | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +@Builder | ||
| 67 | +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { | ||
| 68 | + Row() | ||
| 69 | + .width(width) | ||
| 70 | + .height(height) | ||
| 71 | + .backgroundColor('#FFF2F3F4') | ||
| 72 | + .margin({ top: 10 }) | ||
| 73 | + // .borderRadius(5) | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +// 全局公共样式 | ||
| 77 | +@Styles | ||
| 78 | +function SkeletonStyle() { | ||
| 79 | + .padding({ right: 18, left: 18 }) | ||
| 80 | + .width('100%') | ||
| 81 | + .margin({ top: 10 }) | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +@Extend(Column) | ||
| 85 | +function RightStyle() { | ||
| 86 | + .alignItems(HorizontalAlign.Start) | ||
| 87 | + .justifyContent(FlexAlign.SpaceAround) | ||
| 88 | + .height('100%') | ||
| 89 | +} | ||
| 90 | + |
| 1 | +/** | ||
| 2 | + * 详情骨架屏 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +export struct detailedSkeleton { | ||
| 8 | + @State quantity: Array<number> = [1, 2, 3, 4, 5, 6, 7] | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Row() { | ||
| 12 | + Column() { | ||
| 13 | + Column() { | ||
| 14 | + textArea('100%', 20) | ||
| 15 | + textArea('50%', 20) | ||
| 16 | + } | ||
| 17 | + .SkeletonStyle() | ||
| 18 | + .alignItems(HorizontalAlign.Start) | ||
| 19 | + | ||
| 20 | + Column() { | ||
| 21 | + textArea('40%', 12) | ||
| 22 | + textArea('40%', 12) | ||
| 23 | + } | ||
| 24 | + .SkeletonStyle() | ||
| 25 | + .alignItems(HorizontalAlign.Start) | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + Column() { | ||
| 29 | + textArea('100%', 12) | ||
| 30 | + textArea('100%', 12) | ||
| 31 | + textArea('90%', 12) | ||
| 32 | + } | ||
| 33 | + .SkeletonStyle() | ||
| 34 | + .alignItems(HorizontalAlign.Start) | ||
| 35 | + | ||
| 36 | + Column() { | ||
| 37 | + textArea('100%', 180) | ||
| 38 | + } | ||
| 39 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 40 | + .SkeletonStyle() | ||
| 41 | + | ||
| 42 | + ForEach(this.quantity, () => { | ||
| 43 | + Column() { | ||
| 44 | + textArea('100%', 12) | ||
| 45 | + textArea('90%', 12) | ||
| 46 | + } | ||
| 47 | + .SkeletonStyle() | ||
| 48 | + .alignItems(HorizontalAlign.Start) | ||
| 49 | + }) | ||
| 50 | + } | ||
| 51 | + .width('100%') | ||
| 52 | + } | ||
| 53 | + .height('100%') | ||
| 54 | + } | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +@Builder | ||
| 58 | +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { | ||
| 59 | + Row() | ||
| 60 | + .width(width) | ||
| 61 | + .height(height) | ||
| 62 | + .backgroundColor('#FFF2F3F4') | ||
| 63 | + .margin({ top: 10 }) | ||
| 64 | + // .borderRadius(5) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 全局公共样式 | ||
| 68 | +@Styles | ||
| 69 | +function SkeletonStyle() { | ||
| 70 | + .padding({ right: 18, left: 18 }) | ||
| 71 | + .width('100%') | ||
| 72 | + .margin({ top: 10 }) | ||
| 73 | +} |
| 1 | +/** | ||
| 2 | + * 电子报骨架屏 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +export struct newsSkeleton { | ||
| 8 | + @State quantity: Array<number> = [1, 2, 3,] | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Row() { | ||
| 12 | + Column() { | ||
| 13 | + Row() { | ||
| 14 | + Column() { | ||
| 15 | + Row() { | ||
| 16 | + Column() { | ||
| 17 | + Image($rawfile('apph5/image/peopleSeleton.svg')).width('100%').height(47)// 后缀名不能省略 | ||
| 18 | + .interpolation(ImageInterpolation.High) | ||
| 19 | + textArea('100%', 9) | ||
| 20 | + }.width('72.00%').alignItems(HorizontalAlign.Start).margin({ right: 5 }) | ||
| 21 | + | ||
| 22 | + Column() { | ||
| 23 | + textArea(27, 25) | ||
| 24 | + textArea(27, 4) | ||
| 25 | + textArea(27, 20) | ||
| 26 | + } | ||
| 27 | + .border({ width: 1 }) | ||
| 28 | + .borderColor('#FFF5F5F5') | ||
| 29 | + .padding({ right: 2, left: 2, top: 0, bottom: 2 }) | ||
| 30 | + .justifyContent(FlexAlign.SpaceEvenly) | ||
| 31 | + .alignItems(HorizontalAlign.Start) | ||
| 32 | + } | ||
| 33 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 34 | + .width('98%') | ||
| 35 | + | ||
| 36 | + // .height(64) | ||
| 37 | + | ||
| 38 | + BoxAndLine().width('100%') | ||
| 39 | + BoxAndBox({ firstBoxNumber: '65%', boxHeight: 100 }) | ||
| 40 | + Column() { | ||
| 41 | + textArea('100%', 79) | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + BoxAndBox({ firstBoxNumber: '30%', boxHeight: 51 }) | ||
| 45 | + | ||
| 46 | + }.width('45%') | ||
| 47 | + .opacity(1) | ||
| 48 | + .align(Alignment.Start) | ||
| 49 | + .alignItems(HorizontalAlign.Start) | ||
| 50 | + | ||
| 51 | + Column() { | ||
| 52 | + Column() { | ||
| 53 | + textArea('100%', 13) | ||
| 54 | + }.width('100%') | ||
| 55 | + | ||
| 56 | + BoxAndLine() | ||
| 57 | + | ||
| 58 | + Column() { | ||
| 59 | + textArea('95%', 126) | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + Column() { | ||
| 63 | + textArea('95%', 13) | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + Row() { | ||
| 67 | + Column() { | ||
| 68 | + textArea('100%', 30) | ||
| 69 | + }.width('50%').margin({ right: 5 }) | ||
| 70 | + | ||
| 71 | + Column() { | ||
| 72 | + textArea('100%', 30) | ||
| 73 | + }.layoutWeight(1) | ||
| 74 | + }.width('95%').justifyContent(FlexAlign.SpaceBetween) | ||
| 75 | + | ||
| 76 | + Column() { | ||
| 77 | + textArea('95%', 100) | ||
| 78 | + } | ||
| 79 | + }.width('45%') | ||
| 80 | + }.justifyContent(FlexAlign.SpaceBetween) | ||
| 81 | + } | ||
| 82 | + .width('100%') | ||
| 83 | + | ||
| 84 | + } | ||
| 85 | + .height('100%') | ||
| 86 | + } | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +@Component | ||
| 90 | +struct BoxAndLine { | ||
| 91 | + build() { | ||
| 92 | + Column() { | ||
| 93 | + textArea('100%', 130) | ||
| 94 | + textArea('100%', 13) | ||
| 95 | + textArea('80%', 13) | ||
| 96 | + }.width('98%').alignItems(HorizontalAlign.Start) | ||
| 97 | + } | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | + | ||
| 101 | +@Component | ||
| 102 | +struct BoxAndBox { | ||
| 103 | + @Prop firstBoxNumber: number | Resource | string | ||
| 104 | + @Prop boxHeight: number | Resource | string | ||
| 105 | + | ||
| 106 | + build() { | ||
| 107 | + Row() { | ||
| 108 | + Column() { | ||
| 109 | + textArea('100%', this.boxHeight) | ||
| 110 | + }.width(this.firstBoxNumber).margin({ right: 5 }) | ||
| 111 | + | ||
| 112 | + Column() { | ||
| 113 | + textArea('100%', this.boxHeight) | ||
| 114 | + }.layoutWeight(1) | ||
| 115 | + }.width('100%').justifyContent(FlexAlign.SpaceBetween) | ||
| 116 | + } | ||
| 117 | +} | ||
| 118 | + | ||
| 119 | +@Builder | ||
| 120 | +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { | ||
| 121 | + Row() | ||
| 122 | + .width(width) | ||
| 123 | + .height(height) | ||
| 124 | + .backgroundColor('#FFF5F5F5') | ||
| 125 | + .margin({ top: 5 }) | ||
| 126 | + // .borderRadius(5) | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +// 全局公共样式 | ||
| 130 | +@Styles | ||
| 131 | +function SkeletonStyle() { | ||
| 132 | + .padding({ right: 14, left: 14 }) | ||
| 133 | + .width('100%') | ||
| 134 | + .margin({ top: 5 }) | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +@Extend(Column) | ||
| 138 | +function RightStyle() { | ||
| 139 | + .alignItems(HorizontalAlign.Start) | ||
| 140 | + .justifyContent(FlexAlign.SpaceAround) | ||
| 141 | + .height('100%') | ||
| 142 | +} | ||
| 143 | + |
| 1 | -import { CommonConstants } from 'wdConstant' | ||
| 2 | -import { CompDTO } from 'wdBean' | 1 | +import { Action, CompDTO, ContentDTO, Params } from 'wdBean' |
| 2 | +import { WDRouterRule } from 'wdRouter/Index' | ||
| 3 | +import { Logger } from 'wdKit/Index' | ||
| 4 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 3 | 5 | ||
| 4 | @Component | 6 | @Component |
| 5 | export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | 7 | export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { |
| @@ -57,5 +59,23 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | @@ -57,5 +59,23 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | ||
| 57 | }) | 59 | }) |
| 58 | .backgroundColor($r("app.color.white")) | 60 | .backgroundColor($r("app.color.white")) |
| 59 | .margin({ bottom: 8 }) | 61 | .margin({ bottom: 8 }) |
| 62 | + .onClick(()=>{ | ||
| 63 | + this.gotoLive(this.compDTO?.operDataList[0]) | ||
| 64 | + }) | ||
| 65 | + } | ||
| 66 | + gotoLive(content: ContentDTO) { | ||
| 67 | + let taskAction: Action = { | ||
| 68 | + type: 'JUMP_DETAIL_PAGE', | ||
| 69 | + params: { | ||
| 70 | + detailPageType: 2, | ||
| 71 | + contentID: content?.objectId, | ||
| 72 | + extra: { | ||
| 73 | + relType: content?.relType, | ||
| 74 | + relId: content?.relId, | ||
| 75 | + } as ExtraDTO | ||
| 76 | + } as Params, | ||
| 77 | + }; | ||
| 78 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 79 | + Logger.debug(`gotoLive, ${content.objectId}`); | ||
| 60 | } | 80 | } |
| 61 | } | 81 | } |
| @@ -4,6 +4,9 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean' | @@ -4,6 +4,9 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean' | ||
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | import { WDRouterRule } from 'wdRouter/Index' | 5 | import { WDRouterRule } from 'wdRouter/Index' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 8 | +import { Logger } from 'wdKit/Index' | ||
| 9 | + | ||
| 7 | @Component | 10 | @Component |
| 8 | export struct LiveHorizontalCardComponent { | 11 | export struct LiveHorizontalCardComponent { |
| 9 | @State compDTO: CompDTO = {} as CompDTO | 12 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -79,6 +82,7 @@ export struct LiveHorizontalCardComponent { | @@ -79,6 +82,7 @@ export struct LiveHorizontalCardComponent { | ||
| 79 | .onClick(() => { | 82 | .onClick(() => { |
| 80 | if (item.objectType != '0') { | 83 | if (item.objectType != '0') { |
| 81 | console.log(item.objectId) | 84 | console.log(item.objectId) |
| 85 | + this.gotoLive(item) | ||
| 82 | } | 86 | } |
| 83 | }) | 87 | }) |
| 84 | }) | 88 | }) |
| @@ -96,4 +100,19 @@ export struct LiveHorizontalCardComponent { | @@ -96,4 +100,19 @@ export struct LiveHorizontalCardComponent { | ||
| 96 | }) | 100 | }) |
| 97 | .backgroundColor($r("app.color.white")) | 101 | .backgroundColor($r("app.color.white")) |
| 98 | } | 102 | } |
| 103 | + gotoLive(content: ContentDTO) { | ||
| 104 | + let taskAction: Action = { | ||
| 105 | + type: 'JUMP_DETAIL_PAGE', | ||
| 106 | + params: { | ||
| 107 | + detailPageType: 2, | ||
| 108 | + contentID: content?.objectId, | ||
| 109 | + extra: { | ||
| 110 | + relType: content?.relType, | ||
| 111 | + relId: content?.relId, | ||
| 112 | + } as ExtraDTO | ||
| 113 | + } as Params, | ||
| 114 | + }; | ||
| 115 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 116 | + Logger.debug(`gotoLive, ${content.objectId}`); | ||
| 117 | + } | ||
| 99 | } | 118 | } |
| 1 | // 视频直播直播预约 | 1 | // 视频直播直播预约 |
| 2 | import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' | 2 | import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' |
| 3 | -import { CompDTO, ContentDTO } from 'wdBean' | 3 | +import { Action, CompDTO, ContentDTO, Params } from 'wdBean' |
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | -import { StringUtils } from 'wdKit/Index' | 5 | +import { Logger, StringUtils } from 'wdKit/Index' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 8 | +import { WDRouterRule } from 'wdRouter/Index' | ||
| 9 | + | ||
| 7 | @Component | 10 | @Component |
| 8 | export struct LiveHorizontalReservationComponent { | 11 | export struct LiveHorizontalReservationComponent { |
| 9 | @State compDTO: CompDTO = {} as CompDTO | 12 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -70,6 +73,7 @@ export struct LiveHorizontalReservationComponent { | @@ -70,6 +73,7 @@ export struct LiveHorizontalReservationComponent { | ||
| 70 | .onClick(() => { | 73 | .onClick(() => { |
| 71 | if (item.objectType != '0') { | 74 | if (item.objectType != '0') { |
| 72 | console.log(item.objectId) | 75 | console.log(item.objectId) |
| 76 | + this.gotoLive(item) | ||
| 73 | } | 77 | } |
| 74 | }) | 78 | }) |
| 75 | }) | 79 | }) |
| @@ -87,4 +91,20 @@ export struct LiveHorizontalReservationComponent { | @@ -87,4 +91,20 @@ export struct LiveHorizontalReservationComponent { | ||
| 87 | }) | 91 | }) |
| 88 | .backgroundColor($r("app.color.white")) | 92 | .backgroundColor($r("app.color.white")) |
| 89 | } | 93 | } |
| 94 | + | ||
| 95 | + gotoLive(content: ContentDTO) { | ||
| 96 | + let taskAction: Action = { | ||
| 97 | + type: 'JUMP_DETAIL_PAGE', | ||
| 98 | + params: { | ||
| 99 | + detailPageType: 2, | ||
| 100 | + contentID: content?.objectId, | ||
| 101 | + extra: { | ||
| 102 | + relType: content?.relType, | ||
| 103 | + relId: content?.relId, | ||
| 104 | + } as ExtraDTO | ||
| 105 | + } as Params, | ||
| 106 | + }; | ||
| 107 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 108 | + Logger.debug(`gotoLive, ${content.objectId}`); | ||
| 109 | + } | ||
| 90 | } | 110 | } |
| 1 | import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean'; | 1 | import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean'; |
| 2 | -import { ViewType } from 'wdConstant/Index'; | ||
| 3 | -import { DateTimeUtils, Logger } from 'wdKit'; | 2 | +import { CompStyle, ViewType } from 'wdConstant/Index'; |
| 3 | +import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; | ||
| 4 | import { closeRefresh } from '../utils/PullDownRefresh'; | 4 | import { closeRefresh } from '../utils/PullDownRefresh'; |
| 5 | import PageModel from './PageModel'; | 5 | import PageModel from './PageModel'; |
| 6 | import PageViewModel from './PageViewModel'; | 6 | import PageViewModel from './PageViewModel'; |
| @@ -65,39 +65,33 @@ export class PageHelper { | @@ -65,39 +65,33 @@ export class PageHelper { | ||
| 65 | } else { | 65 | } else { |
| 66 | pageModel.hasMore = false; | 66 | pageModel.hasMore = false; |
| 67 | } | 67 | } |
| 68 | + | ||
| 69 | + // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) | ||
| 70 | + // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 | ||
| 68 | // 二次请求,批查互动数据 | 71 | // 二次请求,批查互动数据 |
| 69 | - PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { | ||
| 70 | - // 刷新,替换所有数据 | ||
| 71 | - // pageModel.compList.replaceAll(...data) | ||
| 72 | - pageModel.compList.updateItems(sizeBefore, data) | ||
| 73 | - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 74 | - }) | ||
| 75 | - // TODO 待优化,解决content级别的展现加载 | 72 | + // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { |
| 73 | + // // 刷新,替换所有数据 | ||
| 74 | + // // pageModel.compList.replaceAll(...data) | ||
| 75 | + // pageModel.compList.updateItems(sizeBefore, data) | ||
| 76 | + // pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 77 | + // }) | ||
| 78 | + // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll | ||
| 76 | if (isLastGroup) { | 79 | if (isLastGroup) { |
| 77 | closeRefresh(pageModel, true); | 80 | closeRefresh(pageModel, true); |
| 78 | - // // 最后一个楼层,特殊处理 | ||
| 79 | - // // 检测楼层最后一个组件业务数据是否需要通过访问接口获取 | ||
| 80 | - // let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1] | ||
| 81 | - // let compSize = CollectionUtils.getListSize(comp.operDataList) | ||
| 82 | - // // 直播回放,需要二次请求数据 | ||
| 83 | - // if (compSize <= 0 && comp.dataSourceType == 'LIVE_END') { | ||
| 84 | - // let liveReviewDTO = await PageViewModel.getLiveReviewUrl(pageModel.currentPage, pageModel.pageSize) | ||
| 85 | - // // content数据回来,塞给comp | ||
| 86 | - // comp.operDataList.push(...liveReviewDTO.list) | ||
| 87 | - // } | 81 | + // 最后一个楼层,特殊处理 |
| 82 | + // 检测楼层最后一个组件业务数据是否需要通过访问接口获取 | ||
| 83 | + let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1] | ||
| 84 | + let compSize = CollectionUtils.getListSize(comp.operDataList) | ||
| 85 | + // 直播回放,需要二次请求数据 | ||
| 86 | + if (compSize <= 0 && comp.compStyle == CompStyle.Zh_Grid_Layout_02) { | ||
| 87 | + // 这个comp,数据自己二次请求,自己分页处理,这里加flag,将page层滑动及loadmore ui去掉 | ||
| 88 | + pageModel.contentNeedScroll = true | ||
| 89 | + } | ||
| 88 | } | 90 | } |
| 89 | } | 91 | } |
| 90 | } | 92 | } |
| 91 | 93 | ||
| 92 | /** | 94 | /** |
| 93 | - * 获取直播回看数据 | ||
| 94 | - */ | ||
| 95 | - private async getLiveEnd(pageModel: PageModel) { | ||
| 96 | - let liveReviewDTO = await PageViewModel.getLiveReviewUrl(pageModel.currentPage, pageModel.pageSize) | ||
| 97 | - Logger.debug(TAG, 'aboutToAppear, getPreviewData ' + liveReviewDTO.hasNext); | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - /** | ||
| 101 | * comp加载更多,分页加载 | 95 | * comp加载更多,分页加载 |
| 102 | */ | 96 | */ |
| 103 | private compLoadMore(pageModel: PageModel) { | 97 | private compLoadMore(pageModel: PageModel) { |
| @@ -125,14 +119,6 @@ export class PageHelper { | @@ -125,14 +119,6 @@ export class PageHelper { | ||
| 125 | promptAction.showToast({ message: err }); | 119 | promptAction.showToast({ message: err }); |
| 126 | }) | 120 | }) |
| 127 | } | 121 | } |
| 128 | - | ||
| 129 | - /** | ||
| 130 | - * 节目数据分页加载 | ||
| 131 | - * TODO 待完善框架 | ||
| 132 | - */ | ||
| 133 | - private contentLoadMore() { | ||
| 134 | - | ||
| 135 | - } | ||
| 136 | } | 122 | } |
| 137 | 123 | ||
| 138 | 124 |
| @@ -20,6 +20,9 @@ export default class PageModel { | @@ -20,6 +20,9 @@ export default class PageModel { | ||
| 20 | // 当前请求数据的group | 20 | // 当前请求数据的group |
| 21 | groupData: GroupInfoDTO = {} as GroupInfoDTO; | 21 | groupData: GroupInfoDTO = {} as GroupInfoDTO; |
| 22 | compList: LazyDataSource<CompDTO> = new LazyDataSource(); | 22 | compList: LazyDataSource<CompDTO> = new LazyDataSource(); |
| 23 | + // 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载 | ||
| 24 | + // (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载) | ||
| 25 | + contentNeedScroll: boolean = false; | ||
| 23 | // 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉 | 26 | // 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉 |
| 24 | loadStrategy: number = 1; | 27 | loadStrategy: number = 1; |
| 25 | currentPage: number = 1; | 28 | currentPage: number = 1; |
| @@ -37,6 +37,10 @@ | @@ -37,6 +37,10 @@ | ||
| 37 | "value": "18fp" | 37 | "value": "18fp" |
| 38 | }, | 38 | }, |
| 39 | { | 39 | { |
| 40 | + "name": "font_size_18", | ||
| 41 | + "value": "18fp" | ||
| 42 | + }, | ||
| 43 | + { | ||
| 40 | "name": "font_size_24", | 44 | "name": "font_size_24", |
| 41 | "value": "24fp" | 45 | "value": "24fp" |
| 42 | }, | 46 | }, |
| @@ -49,6 +53,10 @@ | @@ -49,6 +53,10 @@ | ||
| 49 | "value": "36fp" | 53 | "value": "36fp" |
| 50 | }, | 54 | }, |
| 51 | { | 55 | { |
| 56 | + "name": "margin_4_negative", | ||
| 57 | + "value": "-4vp" | ||
| 58 | + }, | ||
| 59 | + { | ||
| 52 | "name": "main_margin", | 60 | "name": "main_margin", |
| 53 | "value": "14vp" | 61 | "value": "14vp" |
| 54 | }, | 62 | }, |
| @@ -77,6 +85,46 @@ | @@ -77,6 +85,46 @@ | ||
| 77 | "value": "160vp" | 85 | "value": "160vp" |
| 78 | }, | 86 | }, |
| 79 | { | 87 | { |
| 88 | + "name": "margin_80", | ||
| 89 | + "value": "80vp" | ||
| 90 | + }, | ||
| 91 | + { | ||
| 92 | + "name": "margin_2", | ||
| 93 | + "value": "2vp" | ||
| 94 | + }, | ||
| 95 | + { | ||
| 96 | + "name": "margin_5", | ||
| 97 | + "value": "5vp" | ||
| 98 | + }, | ||
| 99 | + { | ||
| 100 | + "name": "margin_7", | ||
| 101 | + "value": "7vp" | ||
| 102 | + }, | ||
| 103 | + { | ||
| 104 | + "name": "margin_20", | ||
| 105 | + "value": "20vp" | ||
| 106 | + }, | ||
| 107 | + { | ||
| 108 | + "name": "margin_24", | ||
| 109 | + "value": "24vp" | ||
| 110 | + }, | ||
| 111 | + { | ||
| 112 | + "name": "margin_25", | ||
| 113 | + "value": "25vp" | ||
| 114 | + }, | ||
| 115 | + { | ||
| 116 | + "name": "margin_28", | ||
| 117 | + "value": "28vp" | ||
| 118 | + }, | ||
| 119 | + { | ||
| 120 | + "name": "margin_48", | ||
| 121 | + "value": "48vp" | ||
| 122 | + }, | ||
| 123 | + { | ||
| 124 | + "name": "margin_60", | ||
| 125 | + "value": "60vp" | ||
| 126 | + }, | ||
| 127 | + { | ||
| 80 | "name": "single_row_03_img_height", | 128 | "name": "single_row_03_img_height", |
| 81 | "value": "88vp" | 129 | "value": "88vp" |
| 82 | }, | 130 | }, |
| @@ -133,6 +181,10 @@ | @@ -133,6 +181,10 @@ | ||
| 133 | "value": "24vp" | 181 | "value": "24vp" |
| 134 | }, | 182 | }, |
| 135 | { | 183 | { |
| 184 | + "name": "margin_6", | ||
| 185 | + "value": "6vp" | ||
| 186 | + }, | ||
| 187 | + { | ||
| 136 | "name": "margin_16", | 188 | "name": "margin_16", |
| 137 | "value": "16vp" | 189 | "value": "16vp" |
| 138 | }, | 190 | }, |
| @@ -141,6 +193,14 @@ | @@ -141,6 +193,14 @@ | ||
| 141 | "value": "20vp" | 193 | "value": "20vp" |
| 142 | }, | 194 | }, |
| 143 | { | 195 | { |
| 196 | + "name": "margin_32", | ||
| 197 | + "value": "32vp" | ||
| 198 | + }, | ||
| 199 | + { | ||
| 200 | + "name": "margin_36", | ||
| 201 | + "value": "36vp" | ||
| 202 | + }, | ||
| 203 | + { | ||
| 144 | "name": "vp_3", | 204 | "name": "vp_3", |
| 145 | "value": "3vp" | 205 | "value": "3vp" |
| 146 | }, | 206 | }, |
| @@ -167,6 +227,10 @@ | @@ -167,6 +227,10 @@ | ||
| 167 | { | 227 | { |
| 168 | "name": "card_comp_pagePadding_tb", | 228 | "name": "card_comp_pagePadding_tb", |
| 169 | "value": "14fp" | 229 | "value": "14fp" |
| 230 | + }, | ||
| 231 | + { | ||
| 232 | + "name": "margin_116", | ||
| 233 | + "value": "116vp" | ||
| 170 | } | 234 | } |
| 171 | ] | 235 | ] |
| 172 | } | 236 | } |
2.84 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_like_selected_redheart.png
0 → 100644
1.02 KB
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
10.1 KB
9.71 KB
8.55 KB
sight_harmony/features/wdComponent/src/main/resources/rawfile/apph5/image/peopleSeleton.svg
0 → 100644
| 1 | +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1713249268044" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2925" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M884.736 546.88c-1.792-5.12-7.04-9.728-12.8-7.232-3.2 1.344-10.496 12.544-11.072 9.6-2.752-14.08 16.704-18.048 19.52-25.344 3.008-8-4.224-11.52-10.24-13.888a47.232 47.232 0 0 1-16.192-11.072c-4.928-4.992-17.024-12.352-21.568-3.2-1.28 4.352-0.512 12.608-2.176 17.92-1.92 6.272-9.088 6.72-13.44 11.328-6.208 6.848 0.64 9.216 4.8 14.464 3.84 4.992 1.216 40.384-5.248 52.48-3.2 6.016-86.336 72.064-100.032 75.52-15.744 3.84-15.68 20.48-8.96 29.696 8.576 11.712 27.008 6.272 36.16-0.448 5.76-4.352 44.288-45.056 53.44-53.44 3.712-3.392 18.688-22.976 19.84-10.432a46.912 46.912 0 0 1-1.728 16.96c-1.856 5.888-5.568 14.848-5.12 21.248 0.768 10.24 19.2 24.32 28.8 20.096 6.208-2.816 6.72-12.096 6.08-18.816-0.576-7.04 0.768-49.024 2.24-62.72a46.08 46.08 0 0 1 5.952-20.8c5.248-8.768 36.928-27.072 31.744-41.92z m-226.88 26.624c-2.816 6.08-14.272-3.84-17.152-6.528-2.88-2.56-6.464-4.48-6.016-8.896 0.576-4.48 5.76-5.12 5.76-5.12 1.792-0.32 17.792-0.96 18.88 1.856a55.296 55.296 0 0 1-1.472 18.688z m14.72-97.28c-10.816-1.408-23.296 9.472-31.616 14.72-4.096 2.56-27.52 14.4-24 20.48 2.432 4.096 17.024 0.576 21.76-0.512 13.44-3.072 20.48-12.032 23.872-9.792 2.88 1.92 1.024 32.64-4.48 32.064-12.032-1.152-19.2-10.624-32.064-15.872-3.968-1.6-11.776-4.608-9.088 2.624 0.768 2.176 3.648 5.056 4.672 7.168 2.368 4.8 4.48 21.504 2.368 25.152-4.224 6.976-8.704-5.376-9.792-8.064-2.048-5.12-3.328-10.368-5.12-15.552-1.536-4.736-5.568-16.96-10.944-16.256-6.208 0.832-1.664 27.968-2.816 33.728-3.84 19.456-5.504 25.216-6.144 37.952-0.512 10.304 0 27.392 11.84 30.528 15.808 4.224 18.048-9.344 19.456-18.56 0.32-2.176 0.832-6.784 1.92-8.64 1.664-2.752 3.84-3.2 5.888-0.512 1.664 2.304 0.96 5.696 3.456 7.936 2.496 2.304 5.312 1.92 8.576 2.56 5.056 0.96 11.328-0.96 14.464 3.84 3.2 5.12 2.176 10.56 8.32 14.016 13.44 7.36 19.84-7.168 20.864-16.896 1.216-11.648 1.792-22.592 2.368-34.176 0.576-11.712 1.088-24.448 4.096-35.776a244.48 244.48 0 0 1 5.248-17.024 22.72 22.72 0 0 0 0.768-16.256c-3.776-9.728-19.648-18.368-23.936-18.88z m-165.312 2.304c4.48-4.16 12.032-9.664 10.88-16.32-4.352-25.92-44.672-8.384-59.968-0.768-22.208 11.136-11.52 5.824-50.432 24.96-5.888 2.816-3.2 7.04-2.304 9.6 3.2 9.216 17.664 13.632 23.808 9.728 5.12-3.264 54.08-37.76 56.704-34.112 4.032 5.504-20.8 24.512-32.32 29.056-5.12 2.048-13.184 9.408-14.784 15.04a12.992 12.992 0 0 0 0.192 8.96l-0.64-0.256c-1.856 0.64-6.848-0.192-8.512 0.96-1.536 1.024 1.728 20.928 8.128 33.28 2.304 4.352 4.288 8.32-1.088 11.008-6.208 3.072-17.088 15.68-4.928 16.832 2.624 0.256 5.44 0.384 7.68-0.896 1.728-1.024 4.992-2.944 7.488-2.24 2.56 0.768 4.736 8.32 6.4 10.944 5.312 8.064 24.576 43.328 33.728 45.632 8 2.048 21.312-1.152 24-9.984 1.408-4.416 2.56-36.864 2.496-41.664-0.064-4.288 0.256-9.856-0.896-13.76-1.088-3.648-3.84-9.152-8.448-7.872-4.928 1.28-5.184 8.832-6.016 12.8-1.024 4.8-2.24 26.304-7.232 26.368-3.52 0-20.16-26.624-22.016-30.336-1.92-3.776-3.52-7.36-0.96-11.008 4.48-6.464 19.2-14.976 11.264-23.68-6.272-6.784-20.48-4.992-22.592 3.584-0.64 2.56 0.896 12.608-4.416 8.96-3.072-2.112-8.704-17.088-6.656-19.2 0.832-0.832 4.224-1.472 7.296-1.792h3.2c10.88-0.96 26.496-6.72 29.952-15.296 1.152-2.88 2.56-6.592 0.064-8.576-1.984-1.664-2.624-1.92-3.2-4.16-0.64-2.688 19.52-21.504 24.128-25.792z m472.064 56.128c16.384-7.808 49.408-7.424 44.096-39.04-1.088-6.528-4.352-20.032-13.568-19.52-8 0.448-14.272 12.8-17.792 18.816-8.96 15.36-26.496 30.4-38.912 43.264-15.68 16.256-41.088 60.992-43.84 60.992-7.296-0.064 3.264-29.248 4.992-33.536 10.176-25.28 42.88-104.256 47.808-113.28 9.152-16.832 15.808-25.792 26.112-41.664 20.352-31.36-14.848-30.336-14.848-30.336-9.92 0.768-16.256 7.296-21.952 11.776-6.272 4.8-12.8 8.064-19.712 11.904-6.784 3.84-15.36 7.872-9.472 16.128 4.992 7.04 10.752 7.744 18.24 8.512a38.72 38.72 0 0 0 7.36 0.512c-1.216 7.232-25.28 50.112-30.848 66.752-11.392 34.24-20.224 98.368-36.8 128a29.888 29.888 0 0 0-3.392 23.68c2.112 6.912 14.272 11.52 21.952 5.376 6.144-4.864 6.976-29.312 28.48-67.072 6.016-10.496 9.6-6.144 14.592 3.584 4.544 8.768 8.512 31.104 14.592 39.296 19.52 26.176 41.408 18.688 44.352 9.472 4.48-13.632-3.84-23.872-9.792-29.824-16.896-16.704-59.712-28.992-49.152-48 7.872-14.08 28.544-21.504 37.504-25.792zM260.544 386.816c-0.576-9.856-6.912-17.472-16.064-22.72-4.288-2.496-19.52-9.664-23.04-6.144l1.472-0.32c-6.016 2.688-1.92 21.312-2.496 26.688-1.024 9.984-6.336 22.208-9.792 31.872-7.232 20.032-13.888 37.824-21.056 57.856a576.64 576.64 0 0 1-26.944 61.312c-9.984 19.84-19.712 40.256-29.888 59.84-5.76 11.2-11.84 22.272-19.2 32.32-6.848 9.152-14.464 20.352-22.784 28.416-6.848 6.592-15.872 12.8-24.512 16.064-10.496 4.032-20.032 4.864-30.72 6.912-4.928 0.896-26.24 2.304-31.04 4.096-13.696 4.992 7.872 11.648 13.952 11.584 21.76 0 44.992 1.536 64.64-5.568 18.944-6.912 35.84-21.12 47.936-36.736 13.44-17.344 37.632-61.76 46.976-81.216 11.52-23.808 58.24-112.64 62.912-125.312 6.08-16.64 20.544-41.408 19.648-59.008z m550.144 102.4a24.512 24.512 0 0 0 16.96-1.472 25.6 25.6 0 0 1 16.448-2.176c4.736 0.64 8.832 1.28 13.76 0.448 6.08-0.96 7.808-2.112 12.8-5.12 4.864-2.944 9.408-2.496 14.784-3.328a20.8 20.8 0 0 0 11.584-6.912c6.784-7.04 12.16-18.624 3.648-25.728-3.968-3.328-15.552-9.664-27.712-4.736a265.216 265.216 0 0 0-25.664 16.64c-9.728 6.912-21.568 9.472-31.488 15.36-3.84 2.24-9.152 5.248-11.648 8.96-3.264 4.672 1.92 6.784 6.528 8.064zM437.952 595.712c-11.008-4.672-14.912 2.624-21.632 6.464-3.264-5.12 0.128-12.416 0.96-17.856 0.96-6.4 6.72-38.4-17.92-51.008-1.984-1.024-5.568-1.472-5.568 1.408l-2.24 18.24c-5.632 43.2-9.728 53.76-10.112 60.864-0.256 6.848-0.704 16.576 3.712 21.952 3.648 4.288 9.472 7.488 15.488 5.824 5.76-1.472 24.128-17.472 29.056-22.208 5.056-4.8 19.008-19.2 8.256-23.68z m378.88-166.208c4.48 1.472 21.312 1.344 19.008 7.68-1.344 3.776-6.272 6.4-9.088 9.088-1.664 1.664-8.448 7.872-7.68 10.112 1.408 4.544 21.376-7.616 25.344-10.624 4.288-3.328 8.704-6.208 13.696-8.448 4.928-2.304 18.56-7.168 28.736-15.36 10.048-8.256 45.312-69.312 45.888-74.304 1.152-10.368-10.432-23.488-20.928-27.456-4.48-1.728-9.792 7.808-11.072 10.624-2.304 5.12-15.552 30.72-19.712 39.36a61.504 61.504 0 0 1-19.136 23.872c-8.96 6.08-18.56 8.896-28.8 11.904-5.248 1.6-26.688 6.656-28.8 9.792-2.88 4.224 8.192 12.352 12.544 13.76z m-489.088 219.136c-5.248 1.536-35.2 8.96-40.512 7.808-28.928-5.888-30.272-32.832-79.04-75.904-1.664-1.536-19.584-12.032-18.176-4.48 0 0 15.424 26.624 18.816 31.552 3.712 5.312 20.032 42.88 22.592 48.192 2.432 5.056 4.992 10.368 7.68 15.232 5.44 9.344 15.68 22.272 27.072 24.832 5.76 1.28 24.512-4.352 30.144-7.104 11.328-5.632 22.528-12.8 32.192-21.312 3.84-3.328 8.64-7.744 10.112-12.672 2.304-7.808-5.248-7.808-10.88-6.144z" p-id="2926" fill="#f6f6f6"></path></svg> |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | "wdKit": "file:../../commons/wdKit", | 13 | "wdKit": "file:../../commons/wdKit", |
| 14 | "wdBean": "file:../../features/wdBean", | 14 | "wdBean": "file:../../features/wdBean", |
| 15 | "wdConstant": "file:../../commons/wdConstant", | 15 | "wdConstant": "file:../../commons/wdConstant", |
| 16 | - "wdDetailPlayApi": "file:../../features/wdDetailPlayApi" | 16 | + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 17 | + "wdRouter": "file:../../commons/wdRouter" | ||
| 17 | } | 18 | } |
| 18 | } | 19 | } |
| 1 | +import { BottomComponent } from '../widgets/details/BottomComponent'; | ||
| 2 | +import { TabComponent } from '../widgets/details/TabComponent'; | ||
| 3 | +import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +@Component | ||
| 7 | +export struct DetailPlayHLivePage { | ||
| 8 | + aboutToAppear(): void { | ||
| 9 | + | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + build() { | ||
| 13 | + Column() { | ||
| 14 | + TopPlayComponent() | ||
| 15 | + TabComponent() | ||
| 16 | + BottomComponent() | ||
| 17 | + } | ||
| 18 | + .height('100%') | ||
| 19 | + .width('100%') | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + onPageShow(): void { | ||
| 23 | + | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + aboutToDisappear(): void { | ||
| 27 | + | ||
| 28 | + } | ||
| 29 | +} |
| @@ -10,11 +10,12 @@ import router from '@ohos.router'; | @@ -10,11 +10,12 @@ import router from '@ohos.router'; | ||
| 10 | export struct DetailPlayLivePage { | 10 | export struct DetailPlayLivePage { |
| 11 | TAG: string = 'DetailPlayLivePage'; | 11 | TAG: string = 'DetailPlayLivePage'; |
| 12 | liveViewModel: LiveViewModel = new LiveViewModel() | 12 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 13 | - @State relId: string = '500005302448' | ||
| 14 | - @State contentId: string = '20000016340' | ||
| 15 | - @State relType: string = '1' | 13 | + @State relId: string = '' |
| 14 | + @State contentId: string = '' | ||
| 15 | + @State relType: string = '' | ||
| 16 | @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | 16 | @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean |
| 17 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 17 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 18 | + @State tabs: string[] = ['直播间', '大家聊'] | ||
| 18 | 19 | ||
| 19 | aboutToAppear(): void { | 20 | aboutToAppear(): void { |
| 20 | //https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340 | 21 | //https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340 |
| @@ -30,7 +31,7 @@ export struct DetailPlayLivePage { | @@ -30,7 +31,7 @@ export struct DetailPlayLivePage { | ||
| 30 | build() { | 31 | build() { |
| 31 | Column() { | 32 | Column() { |
| 32 | TopPlayComponent() | 33 | TopPlayComponent() |
| 33 | - TabComponent() | 34 | + TabComponent({ tabs: this.tabs }) |
| 34 | BottomComponent() | 35 | BottomComponent() |
| 35 | } | 36 | } |
| 36 | .height('100%') | 37 | .height('100%') |
| @@ -46,6 +47,9 @@ export struct DetailPlayLivePage { | @@ -46,6 +47,9 @@ export struct DetailPlayLivePage { | ||
| 46 | .then( | 47 | .then( |
| 47 | (data) => { | 48 | (data) => { |
| 48 | if (data.length > 0) { | 49 | if (data.length > 0) { |
| 50 | + if (data[0].liveInfo?.liveState == 'wait') { | ||
| 51 | + this.tabs = ['简介', '直播间', '大家聊'] | ||
| 52 | + } | ||
| 49 | this.liveDetailsBean = data[0] | 53 | this.liveDetailsBean = data[0] |
| 50 | } | 54 | } |
| 51 | }, | 55 | }, |
| 1 | +import { BottomComponent } from '../widgets/details/BottomComponent'; | ||
| 2 | +import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | ||
| 3 | +import { TopPlayVComponent } from '../widgets/details/video/TopPlayVComponet'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +@Component | ||
| 7 | +export struct DetailPlayVLivePage { | ||
| 8 | + aboutToAppear(): void { | ||
| 9 | + | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + build() { | ||
| 13 | + Column() { | ||
| 14 | + TopPlayVComponent() | ||
| 15 | + // TabComponent() | ||
| 16 | + BottomComponent() | ||
| 17 | + } | ||
| 18 | + .height('100%') | ||
| 19 | + .width('100%') | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + onPageShow(): void { | ||
| 23 | + | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + aboutToDisappear(): void { | ||
| 27 | + | ||
| 28 | + } | ||
| 29 | +} |
| @@ -170,10 +170,10 @@ export class LiveModel { | @@ -170,10 +170,10 @@ export class LiveModel { | ||
| 170 | * @param isSubscribe | 170 | * @param isSubscribe |
| 171 | * @returns | 171 | * @returns |
| 172 | */ | 172 | */ |
| 173 | - liveAppointment(relationId: string, mLiveId: string, isSubscribe: boolean) { | 173 | + liveAppointment(relationId: string, liveId: string, isSubscribe: boolean) { |
| 174 | let params: Record<string, string> = {}; | 174 | let params: Record<string, string> = {}; |
| 175 | params['relationId'] = relationId | 175 | params['relationId'] = relationId |
| 176 | - params['liveId'] = mLiveId | 176 | + params['liveId'] = liveId |
| 177 | params['isSubscribe'] = `${isSubscribe}` | 177 | params['isSubscribe'] = `${isSubscribe}` |
| 178 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 178 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 179 | return new Promise<ResponseDTO<string>>((success, fail) => { | 179 | return new Promise<ResponseDTO<string>>((success, fail) => { |
| @@ -67,9 +67,9 @@ export class LiveViewModel { | @@ -67,9 +67,9 @@ export class LiveViewModel { | ||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | //直播预约/取消预约 | 69 | //直播预约/取消预约 |
| 70 | - liveAppointment(relationId: string, mLiveId: string, isSubscribe: boolean) { | 70 | + liveAppointment(relationId: string, liveId: string, isSubscribe: boolean) { |
| 71 | return new Promise<ResponseDTO<string>>((success, fail) => { | 71 | return new Promise<ResponseDTO<string>>((success, fail) => { |
| 72 | - this.liveModel.liveAppointment(relationId, mLiveId, isSubscribe).then((data) => { | 72 | + this.liveModel.liveAppointment(relationId, liveId, isSubscribe).then((data) => { |
| 73 | success(data) | 73 | success(data) |
| 74 | }).catch((message: string) => { | 74 | }).catch((message: string) => { |
| 75 | fail(message) | 75 | fail(message) |
| @@ -2,10 +2,12 @@ import font from '@ohos.font' | @@ -2,10 +2,12 @@ import font from '@ohos.font' | ||
| 2 | import { LiveDetailsBean } from 'wdBean/Index' | 2 | import { LiveDetailsBean } from 'wdBean/Index' |
| 3 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' | 3 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' |
| 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 5 | +import { HttpUrlUtils } from 'wdNetwork/Index' | ||
| 6 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 5 | 7 | ||
| 6 | @Component | 8 | @Component |
| 7 | export struct LiveCountdownComponent { | 9 | export struct LiveCountdownComponent { |
| 8 | - @Consume @Watch('calculateDataStatus') liveDetailsBean: LiveDetailsBean | 10 | + @State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean |
| 9 | textTimerController: TextTimerController = new TextTimerController() | 11 | textTimerController: TextTimerController = new TextTimerController() |
| 10 | @State format: string = 'HH:mm:ss' | 12 | @State format: string = 'HH:mm:ss' |
| 11 | @State month: string = '' | 13 | @State month: string = '' |
| @@ -26,7 +28,8 @@ export struct LiveCountdownComponent { | @@ -26,7 +28,8 @@ export struct LiveCountdownComponent { | ||
| 26 | }) | 28 | }) |
| 27 | setTimeout(() => { | 29 | setTimeout(() => { |
| 28 | this.textTimerController.start() | 30 | this.textTimerController.start() |
| 29 | - }, 2000) | 31 | + }, 0) |
| 32 | + this.updateData() | ||
| 30 | } | 33 | } |
| 31 | 34 | ||
| 32 | build() { | 35 | build() { |
| @@ -100,7 +103,7 @@ export struct LiveCountdownComponent { | @@ -100,7 +103,7 @@ export struct LiveCountdownComponent { | ||
| 100 | 103 | ||
| 101 | @Builder | 104 | @Builder |
| 102 | showAppointment() { | 105 | showAppointment() { |
| 103 | - Text('我要预约') | 106 | + Text(this.isAppointmentLive ? '取消预约' : '我要预约') |
| 104 | .width('100%') | 107 | .width('100%') |
| 105 | .height(42) | 108 | .height(42) |
| 106 | .textAlign(TextAlign.Center) | 109 | .textAlign(TextAlign.Center) |
| @@ -113,13 +116,17 @@ export struct LiveCountdownComponent { | @@ -113,13 +116,17 @@ export struct LiveCountdownComponent { | ||
| 113 | .border({ radius: 4 }) | 116 | .border({ radius: 4 }) |
| 114 | .backgroundColor(this.isAppointmentLive ? '#CCCCCC' : '#ED2800') | 117 | .backgroundColor(this.isAppointmentLive ? '#CCCCCC' : '#ED2800') |
| 115 | .onClick(() => { | 118 | .onClick(() => { |
| 119 | + if (!HttpUrlUtils.getUserId()) { | ||
| 120 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 121 | + return | ||
| 122 | + } | ||
| 116 | if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { | 123 | if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { |
| 117 | this.liveAppointment() | 124 | this.liveAppointment() |
| 118 | } | 125 | } |
| 119 | }) | 126 | }) |
| 120 | } | 127 | } |
| 121 | 128 | ||
| 122 | - calculateDataStatus() { | 129 | + updateData() { |
| 123 | if (!this.liveDetailsBean) { | 130 | if (!this.liveDetailsBean) { |
| 124 | return | 131 | return |
| 125 | } | 132 | } |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index' | ||
| 2 | import { TabChatComponent } from './TabChatComponent' | 1 | import { TabChatComponent } from './TabChatComponent' |
| 3 | import { TabInfoComponent } from './TabInfoComponent' | 2 | import { TabInfoComponent } from './TabInfoComponent' |
| 4 | import { TabLiveComponent } from './TabLiveComponent' | 3 | import { TabLiveComponent } from './TabLiveComponent' |
| @@ -9,7 +8,7 @@ export struct TabComponent { | @@ -9,7 +8,7 @@ export struct TabComponent { | ||
| 9 | @State selectedFontColor: string = '#222222' | 8 | @State selectedFontColor: string = '#222222' |
| 10 | @State currentIndex: number = 0 | 9 | @State currentIndex: number = 0 |
| 11 | private controller: TabsController = new TabsController() | 10 | private controller: TabsController = new TabsController() |
| 12 | - tabs: string[] = ['简介', '直播间', '大家聊'] | 11 | + @Prop tabs: string[] = [] |
| 13 | 12 | ||
| 14 | aboutToAppear(): void { | 13 | aboutToAppear(): void { |
| 15 | 14 | ||
| @@ -19,12 +18,21 @@ export struct TabComponent { | @@ -19,12 +18,21 @@ export struct TabComponent { | ||
| 19 | Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { | 18 | Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { |
| 20 | ForEach(this.tabs, (item: string, index: number) => { | 19 | ForEach(this.tabs, (item: string, index: number) => { |
| 21 | TabContent() { | 20 | TabContent() { |
| 22 | - if (0 == index) { | ||
| 23 | - TabInfoComponent() | ||
| 24 | - } else if (1 == index) { | ||
| 25 | - TabLiveComponent() | ||
| 26 | - } else { | ||
| 27 | - TabChatComponent() | 21 | + if (this.tabs.length == 3) { |
| 22 | + if (0 == index) { | ||
| 23 | + TabInfoComponent() | ||
| 24 | + } else if (1 == index) { | ||
| 25 | + TabLiveComponent() | ||
| 26 | + } else { | ||
| 27 | + TabChatComponent() | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + else { | ||
| 31 | + if (0 == index) { | ||
| 32 | + TabLiveComponent() | ||
| 33 | + } else { | ||
| 34 | + TabChatComponent() | ||
| 35 | + } | ||
| 28 | } | 36 | } |
| 29 | }.tabBar(this.tabBuilder(index, item)) | 37 | }.tabBar(this.tabBuilder(index, item)) |
| 30 | .backgroundColor('#F5F5F5') | 38 | .backgroundColor('#F5F5F5') |
| @@ -12,7 +12,7 @@ export struct TabInfoComponent { | @@ -12,7 +12,7 @@ export struct TabInfoComponent { | ||
| 12 | Column() { | 12 | Column() { |
| 13 | this.showLiveTitle() | 13 | this.showLiveTitle() |
| 14 | this.showLiveDetails() | 14 | this.showLiveDetails() |
| 15 | - LiveCountdownComponent() | 15 | + LiveCountdownComponent({liveDetailsBean:this.liveDetailsBean}) |
| 16 | }.margin({ | 16 | }.margin({ |
| 17 | top: 13, | 17 | top: 13, |
| 18 | left: 16, | 18 | left: 16, |
| @@ -8,12 +8,16 @@ import { TabLiveItemComponent } from './TabLiveItemComponent' | @@ -8,12 +8,16 @@ import { TabLiveItemComponent } from './TabLiveItemComponent' | ||
| 8 | export struct TabLiveComponent { | 8 | export struct TabLiveComponent { |
| 9 | liveViewModel: LiveViewModel = new LiveViewModel() | 9 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 10 | @State liveList: Array<LiveRoomItemBean> = [] | 10 | @State liveList: Array<LiveRoomItemBean> = [] |
| 11 | - @Consume liveDetailsBean: LiveDetailsBean | 11 | + @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean |
| 12 | 12 | ||
| 13 | - aboutToAppear(): void { | 13 | + updateDate() { |
| 14 | this.getLiveList() | 14 | this.getLiveList() |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | + aboutToAppear(): void { | ||
| 18 | + | ||
| 19 | + } | ||
| 20 | + | ||
| 17 | build() { | 21 | build() { |
| 18 | Stack() { | 22 | Stack() { |
| 19 | if (this.liveList.length == 0) { | 23 | if (this.liveList.length == 0) { |
| @@ -51,14 +51,18 @@ export struct PlayUIComponent { | @@ -51,14 +51,18 @@ export struct PlayUIComponent { | ||
| 51 | .margin({ | 51 | .margin({ |
| 52 | right: 10 | 52 | right: 10 |
| 53 | }) | 53 | }) |
| 54 | - Text(this.liveDetailsBean.newsTitle) | ||
| 55 | - .maxLines(1) | ||
| 56 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 57 | - .fontSize('16fp') | ||
| 58 | - .fontWeight(500) | ||
| 59 | - .fontColor(Color.White) | ||
| 60 | - .textAlign(TextAlign.Start) | ||
| 61 | - .layoutWeight(1) | 54 | + if (this.liveDetailsBean.liveInfo?.liveState != 'wait') { |
| 55 | + Text(this.liveDetailsBean.newsTitle) | ||
| 56 | + .maxLines(1) | ||
| 57 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 58 | + .fontSize('16fp') | ||
| 59 | + .fontWeight(500) | ||
| 60 | + .fontColor(Color.White) | ||
| 61 | + .textAlign(TextAlign.Start) | ||
| 62 | + .layoutWeight(1) | ||
| 63 | + } else { | ||
| 64 | + Blank() | ||
| 65 | + } | ||
| 62 | Image($r('app.media.icon_share')) | 66 | Image($r('app.media.icon_share')) |
| 63 | .width(24) | 67 | .width(24) |
| 64 | .aspectRatio(1) | 68 | .aspectRatio(1) |
| @@ -86,8 +90,25 @@ export struct PlayUIComponent { | @@ -86,8 +90,25 @@ export struct PlayUIComponent { | ||
| 86 | getLiveStatusView() { | 90 | getLiveStatusView() { |
| 87 | // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 91 | // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 88 | // 预约 | 92 | // 预约 |
| 93 | + if (this.liveDetailsBean.liveInfo?.liveState == 'wait') { | ||
| 94 | + Row() { | ||
| 95 | + Image($r('app.media.icon_live_status_wait')) | ||
| 96 | + .width(22) | ||
| 97 | + .height(18) | ||
| 98 | + Text('预约') | ||
| 99 | + .fontSize('11fp') | ||
| 100 | + .fontWeight(400) | ||
| 101 | + .fontColor(Color.White) | ||
| 102 | + } | ||
| 103 | + .backgroundColor('#4D000000') | ||
| 104 | + .padding({ | ||
| 105 | + top: 1, | ||
| 106 | + right: 4, | ||
| 107 | + bottom: 1 | ||
| 108 | + }) | ||
| 109 | + } | ||
| 89 | // 直播中 | 110 | // 直播中 |
| 90 | - if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | 111 | + else if (this.liveDetailsBean.liveInfo?.liveState == 'running') { |
| 91 | Row() { | 112 | Row() { |
| 92 | Image($r('app.media.icon_live_status_running')) | 113 | Image($r('app.media.icon_live_status_running')) |
| 93 | .width(22) | 114 | .width(22) |
| @@ -6,6 +6,8 @@ import { PlayUIComponent } from './PlayUIComponent'; | @@ -6,6 +6,8 @@ import { PlayUIComponent } from './PlayUIComponent'; | ||
| 6 | export struct TopPlayComponent { | 6 | export struct TopPlayComponent { |
| 7 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 7 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 8 | playerController: WDPlayerController = new WDPlayerController(); | 8 | playerController: WDPlayerController = new WDPlayerController(); |
| 9 | + @State imgUrl: string = '' | ||
| 10 | + @State isWait: boolean = false | ||
| 9 | 11 | ||
| 10 | aboutToAppear(): void { | 12 | aboutToAppear(): void { |
| 11 | this.playerController.onCanplay = () => { | 13 | this.playerController.onCanplay = () => { |
| @@ -15,6 +17,10 @@ export struct TopPlayComponent { | @@ -15,6 +17,10 @@ export struct TopPlayComponent { | ||
| 15 | 17 | ||
| 16 | updateData() { | 18 | updateData() { |
| 17 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 19 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 20 | + if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | ||
| 21 | + this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | ||
| 22 | + } | ||
| 23 | + this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' | ||
| 18 | if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | 24 | if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { |
| 19 | let playUrl = '' | 25 | let playUrl = '' |
| 20 | if (this.liveDetailsBean.liveInfo.liveState == 'running') { | 26 | if (this.liveDetailsBean.liveInfo.liveState == 'running') { |
| @@ -35,6 +41,10 @@ export struct TopPlayComponent { | @@ -35,6 +41,10 @@ export struct TopPlayComponent { | ||
| 35 | }) | 41 | }) |
| 36 | .height('100%') | 42 | .height('100%') |
| 37 | .width('100%') | 43 | .width('100%') |
| 44 | + .visibility(this.isWait ? Visibility.None : Visibility.Visible) | ||
| 45 | + Image(this.imgUrl) | ||
| 46 | + .objectFit(ImageFit.Contain) | ||
| 47 | + .visibility(this.isWait ? Visibility.Visible : Visibility.None) | ||
| 38 | PlayUIComponent({ playerController: this.playerController }) | 48 | PlayUIComponent({ playerController: this.playerController }) |
| 39 | } | 49 | } |
| 40 | .height(211) | 50 | .height(211) |
| @@ -43,5 +53,7 @@ export struct TopPlayComponent { | @@ -43,5 +53,7 @@ export struct TopPlayComponent { | ||
| 43 | 53 | ||
| 44 | aboutToDisappear(): void { | 54 | aboutToDisappear(): void { |
| 45 | this.playerController.pause() | 55 | this.playerController.pause() |
| 56 | + this.playerController.stop() | ||
| 57 | + this.playerController.release() | ||
| 46 | } | 58 | } |
| 47 | } | 59 | } |
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayVComponet.ets
0 → 100644
| 1 | +import { LiveDetailsBean } from 'wdBean/Index'; | ||
| 2 | +import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer/Index'; | ||
| 3 | +import { PlayUIComponent } from './PlayUIComponent'; | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export struct TopPlayVComponent { | ||
| 7 | + @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | ||
| 8 | + playerController: WDPlayerController = new WDPlayerController(); | ||
| 9 | + | ||
| 10 | + aboutToAppear(): void { | ||
| 11 | + this.playerController.onCanplay = () => { | ||
| 12 | + this.playerController.play() | ||
| 13 | + } | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + updateData() { | ||
| 17 | + //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | ||
| 18 | + if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | ||
| 19 | + let playUrl = '' | ||
| 20 | + if (this.liveDetailsBean.liveInfo.liveState == 'running') { | ||
| 21 | + playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl | ||
| 22 | + } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 23 | + playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | ||
| 24 | + } | ||
| 25 | + this.playerController.firstPlay(playUrl); | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + build() { | ||
| 30 | + Stack() { | ||
| 31 | + // https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-universal-attributes-image-effect-0000001862607345 | ||
| 32 | + Image(this.liveDetailsBean.fullColumnImgUrls[0].url) | ||
| 33 | + .height('100%') | ||
| 34 | + .width('100%') | ||
| 35 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 36 | + .blur(100) | ||
| 37 | + | ||
| 38 | + WDPlayerRenderView({ | ||
| 39 | + playerController: this.playerController, | ||
| 40 | + onLoad: async () => { | ||
| 41 | + } | ||
| 42 | + })// .height('100%') | ||
| 43 | + .width('100%')// 扩展至所有非安全区域 | ||
| 44 | + .onClick(() => { | ||
| 45 | + this.playerController.play() | ||
| 46 | + }) | ||
| 47 | + // PlayUIComponent({ playerController: this.playerController }) | ||
| 48 | + } | ||
| 49 | + // .height('100%') | ||
| 50 | + .width('100%') | ||
| 51 | + // 扩展至所有非安全区域 | ||
| 52 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + aboutToDisappear(): void { | ||
| 56 | + this.playerController.pause() | ||
| 57 | + } | ||
| 58 | +} |
sight_harmony/features/wdDetailPlayLive/src/main/resources/base/media/icon_live_status_wait.png
0 → 100644
1.83 KB
| 1 | import mediaquery from '@ohos.mediaquery'; | 1 | import mediaquery from '@ohos.mediaquery'; |
| 2 | import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; | 2 | import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; |
| 3 | -import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer'; | 3 | +import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer'; |
| 4 | import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi'; | 4 | import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi'; |
| 5 | import { PlayControlViewContainer } from '../view/PlayControlViewContainer'; | 5 | import { PlayControlViewContainer } from '../view/PlayControlViewContainer'; |
| 6 | import { PlayerDetailContainer } from '../view/PlayerDetailContainer'; | 6 | import { PlayerDetailContainer } from '../view/PlayerDetailContainer'; |
| @@ -32,6 +32,19 @@ export struct DetailPlayShortVideoPage { | @@ -32,6 +32,19 @@ export struct DetailPlayShortVideoPage { | ||
| 32 | @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2 | 32 | @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2 |
| 33 | @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 33 | @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 34 | @Provide followStatus: string = '0' // 关注状态 | 34 | @Provide followStatus: string = '0' // 关注状态 |
| 35 | + @Link @Watch('switchVideoStatusChange') switchVideoStatus: boolean | ||
| 36 | + | ||
| 37 | + switchVideoStatusChange() { | ||
| 38 | + if (this.switchVideoStatus) { | ||
| 39 | + if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_PAUSE) { | ||
| 40 | + this.playerController.play() | ||
| 41 | + } | ||
| 42 | + } else { | ||
| 43 | + if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_START) { | ||
| 44 | + this.playerController.pause() | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + } | ||
| 35 | 48 | ||
| 36 | currentIndexChange() { | 49 | currentIndexChange() { |
| 37 | if (this.currentIndex != this.index) { | 50 | if (this.currentIndex != this.index) { |
| @@ -166,6 +179,7 @@ export struct DetailPlayShortVideoPage { | @@ -166,6 +179,7 @@ export struct DetailPlayShortVideoPage { | ||
| 166 | }) | 179 | }) |
| 167 | .height('100%') | 180 | .height('100%') |
| 168 | .width('100%') | 181 | .width('100%') |
| 182 | + .margin({ top: this.contentDetailData?.videoInfo[0]?.videoLandScape === 1 ? 218 : 0 }) | ||
| 169 | .onClick(() => { | 183 | .onClick(() => { |
| 170 | console.error('WDPlayerRenderView=== onClick') | 184 | console.error('WDPlayerRenderView=== onClick') |
| 171 | this.playerController?.switchPlayOrPause(); | 185 | this.playerController?.switchPlayOrPause(); |
| @@ -24,6 +24,7 @@ export struct DetailVideoListPage { | @@ -24,6 +24,7 @@ export struct DetailVideoListPage { | ||
| 24 | @State currentIndex: number = 0 | 24 | @State currentIndex: number = 0 |
| 25 | @State interactDataList: InteractDataDTO[] = [] | 25 | @State interactDataList: InteractDataDTO[] = [] |
| 26 | @State isFullScreen: boolean = false | 26 | @State isFullScreen: boolean = false |
| 27 | + @State switchVideoStatus: boolean = false | ||
| 27 | 28 | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 29 | 30 | ||
| @@ -157,6 +158,7 @@ export struct DetailVideoListPage { | @@ -157,6 +158,7 @@ export struct DetailVideoListPage { | ||
| 157 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { | 158 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { |
| 158 | Column() { | 159 | Column() { |
| 159 | DetailPlayShortVideoPage({ | 160 | DetailPlayShortVideoPage({ |
| 161 | + switchVideoStatus: $switchVideoStatus, | ||
| 160 | contentDetailData: item, | 162 | contentDetailData: item, |
| 161 | currentIndex: this.currentIndex, | 163 | currentIndex: this.currentIndex, |
| 162 | index: index, | 164 | index: index, |
| @@ -34,14 +34,15 @@ export struct VideoChannelDetail { | @@ -34,14 +34,15 @@ export struct VideoChannelDetail { | ||
| 34 | private channelStrategy: string = '1' // 频道策略 1-推荐;2-时间线 | 34 | private channelStrategy: string = '1' // 频道策略 1-推荐;2-时间线 |
| 35 | // private topicId?: string = '' // 专题id | 35 | // private topicId?: string = '' // 专题id |
| 36 | // private recommend?: string = '' // 0.非推荐,1.推荐; | 36 | // private recommend?: string = '' // 0.非推荐,1.推荐; |
| 37 | - @State @Watch('navIndexChange') bottomNavIndex: number = 0 | ||
| 38 | - @State @Watch('navIndexChange') topNavIndex: number = 0 | 37 | + @Link @Watch('navIndexChange') bottomNavIndex: number |
| 38 | + @Link @Watch('navIndexChange') topNavIndex: number | ||
| 39 | private swiperController: SwiperController = new SwiperController() | 39 | private swiperController: SwiperController = new SwiperController() |
| 40 | @Provide showComment: boolean = false | 40 | @Provide showComment: boolean = false |
| 41 | @State data: ContentDetailDTO[] = [] | 41 | @State data: ContentDetailDTO[] = [] |
| 42 | @State currentIndex: number = 0 | 42 | @State currentIndex: number = 0 |
| 43 | @State interactDataList: InteractDataDTO[] = [] | 43 | @State interactDataList: InteractDataDTO[] = [] |
| 44 | @State totalCount: number = 0 | 44 | @State totalCount: number = 0 |
| 45 | + @State switchVideoStatus: boolean = false | ||
| 45 | 46 | ||
| 46 | /** | 47 | /** |
| 47 | * 监听视频频道激活或失活 | 48 | * 监听视频频道激活或失活 |
| @@ -49,30 +50,22 @@ export struct VideoChannelDetail { | @@ -49,30 +50,22 @@ export struct VideoChannelDetail { | ||
| 49 | navIndexChange() { | 50 | navIndexChange() { |
| 50 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { | 51 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { |
| 51 | // 如果视频在暂停则播放视频 | 52 | // 如果视频在暂停则播放视频 |
| 53 | + this.switchVideoStatus = true | ||
| 52 | } else { | 54 | } else { |
| 53 | // 如果视频在播放则暂停视频 | 55 | // 如果视频在播放则暂停视频 |
| 56 | + this.switchVideoStatus = false | ||
| 54 | } | 57 | } |
| 58 | + | ||
| 55 | } | 59 | } |
| 56 | 60 | ||
| 57 | async aboutToAppear(): Promise<void> { | 61 | async aboutToAppear(): Promise<void> { |
| 58 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 59 | - const windowClass: window.Window = windowStage.getMainWindowSync(); | ||
| 60 | - windowClass.setWindowSystemBarProperties({ | ||
| 61 | - statusBarContentColor: '#ffffff', | ||
| 62 | - }) | ||
| 63 | - console.error('aboutToAppear groupId', this.groupId) | ||
| 64 | - console.error('aboutToAppear pageId', this.pageId) | ||
| 65 | - console.error('aboutToAppear channelId', this.channelId) | 62 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 66 | // 根据视频频道传参查询视频楼层信息 | 63 | // 根据视频频道传参查询视频楼层信息 |
| 67 | this.getRecCompInfo() | 64 | this.getRecCompInfo() |
| 68 | } | 65 | } |
| 69 | 66 | ||
| 70 | aboutToDisappear(): void { | 67 | aboutToDisappear(): void { |
| 71 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 72 | - const windowClass: window.Window = windowStage.getMainWindowSync(); | ||
| 73 | - windowClass.setWindowSystemBarProperties({ | ||
| 74 | - statusBarContentColor: '#000000', | ||
| 75 | - }) | 68 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 76 | console.error('aboutToDisappear videoChanel') | 69 | console.error('aboutToDisappear videoChanel') |
| 77 | } | 70 | } |
| 78 | 71 | ||
| @@ -105,8 +98,7 @@ export struct VideoChannelDetail { | @@ -105,8 +98,7 @@ export struct VideoChannelDetail { | ||
| 105 | } | 98 | } |
| 106 | 99 | ||
| 107 | await ContentDetailRequest.getRecCompInfo(params).then(res => { | 100 | await ContentDetailRequest.getRecCompInfo(params).then(res => { |
| 108 | - console.log('根据视频频道传参查询视频楼层信息', res.data?.totalCount) | ||
| 109 | - console.log('根据视频频道传参查询视频楼层信息', JSON.stringify(res.data?.compList)) | 101 | + console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') |
| 110 | 102 | ||
| 111 | this.totalCount = res.data?.totalCount || 0 | 103 | this.totalCount = res.data?.totalCount || 0 |
| 112 | const list1: batchContentDetailParams = { | 104 | const list1: batchContentDetailParams = { |
| @@ -136,8 +128,6 @@ export struct VideoChannelDetail { | @@ -136,8 +128,6 @@ export struct VideoChannelDetail { | ||
| 136 | this.batchContentDetail(list1) | 128 | this.batchContentDetail(list1) |
| 137 | this.getContentInteract(list2) | 129 | this.getContentInteract(list2) |
| 138 | 130 | ||
| 139 | - }).catch((e: BusinessError) => { | ||
| 140 | - console.error('eeeeeeeeeeeeee', e) | ||
| 141 | }) | 131 | }) |
| 142 | } | 132 | } |
| 143 | 133 | ||
| @@ -147,7 +137,7 @@ export struct VideoChannelDetail { | @@ -147,7 +137,7 @@ export struct VideoChannelDetail { | ||
| 147 | async batchContentDetail(list: batchContentDetailParams) { | 137 | async batchContentDetail(list: batchContentDetailParams) { |
| 148 | if (list.contents.length > 0) { | 138 | if (list.contents.length > 0) { |
| 149 | await ContentDetailRequest.batchContentDetail(list).then(res => { | 139 | await ContentDetailRequest.batchContentDetail(list).then(res => { |
| 150 | - console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) | 140 | + console.log('根据视频楼层信息批量查询视频列表', res.data) |
| 151 | this.data = this.data.concat(res.data as []) | 141 | this.data = this.data.concat(res.data as []) |
| 152 | }) | 142 | }) |
| 153 | } | 143 | } |
| @@ -160,7 +150,7 @@ export struct VideoChannelDetail { | @@ -160,7 +150,7 @@ export struct VideoChannelDetail { | ||
| 160 | if (list.contentList.length > 0) { | 150 | if (list.contentList.length > 0) { |
| 161 | await ContentDetailRequest.getContentInteract(list).then(res => { | 151 | await ContentDetailRequest.getContentInteract(list).then(res => { |
| 162 | this.interactDataList = res.data || [] | 152 | this.interactDataList = res.data || [] |
| 163 | - console.log('根据视频信息批量查询点赞、收藏状态', JSON.stringify(res)) | 153 | + console.log('根据视频信息批量查询点赞、收藏状态', res.data) |
| 164 | }) | 154 | }) |
| 165 | } | 155 | } |
| 166 | } | 156 | } |
| @@ -171,6 +161,7 @@ export struct VideoChannelDetail { | @@ -171,6 +161,7 @@ export struct VideoChannelDetail { | ||
| 171 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { | 161 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { |
| 172 | Column() { | 162 | Column() { |
| 173 | DetailPlayShortVideoPage({ | 163 | DetailPlayShortVideoPage({ |
| 164 | + switchVideoStatus: $switchVideoStatus, | ||
| 174 | contentDetailData: item, | 165 | contentDetailData: item, |
| 175 | currentIndex: this.currentIndex, | 166 | currentIndex: this.currentIndex, |
| 176 | index: index, | 167 | index: index, |
| @@ -48,7 +48,9 @@ export struct PlayerTitleComment { | @@ -48,7 +48,9 @@ export struct PlayerTitleComment { | ||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | getName() { | 50 | getName() { |
| 51 | - return this.contentDetailData?.newsSourceName || this.contentDetailData?.editorName || '' | 51 | + // console.error(this.contentDetailData?.newsSourceName + '===========' + this.contentDetailData?.editorName) |
| 52 | + // this.contentDetailData?.newsSourceName || | ||
| 53 | + return this.contentDetailData?.editorName || '' | ||
| 52 | } | 54 | } |
| 53 | 55 | ||
| 54 | getTitle() { | 56 | getTitle() { |
| @@ -41,16 +41,15 @@ class MGPlayRenderViewIns { | @@ -41,16 +41,15 @@ class MGPlayRenderViewIns { | ||
| 41 | export struct WDPlayerRenderView { | 41 | export struct WDPlayerRenderView { |
| 42 | private playerController?: WDPlayerController; | 42 | private playerController?: WDPlayerController; |
| 43 | private xComponentController: XComponentController = new XComponentController(); | 43 | private xComponentController: XComponentController = new XComponentController(); |
| 44 | + private insId: string = "WDPlayRenderView" + insIndex; | ||
| 44 | onLoad?: ((event?: object) => void); | 45 | onLoad?: ((event?: object) => void); |
| 45 | - videoWidth: number = 0 | ||
| 46 | - videoHeight: number = 0 | 46 | + @State videoWidth: number = 0 |
| 47 | + @State videoHeight: number = 0 | ||
| 47 | @State selfSize: Size = new Size('100%', '100%'); | 48 | @State selfSize: Size = new Size('100%', '100%'); |
| 48 | - private insId: string = "WDPlayRenderView" + insIndex; | ||
| 49 | 49 | ||
| 50 | aboutToAppear() { | 50 | aboutToAppear() { |
| 51 | MGPlayRenderViewIns.add(); | 51 | MGPlayRenderViewIns.add(); |
| 52 | 52 | ||
| 53 | - console.log('playerController', this.playerController) | ||
| 54 | insIndex++; | 53 | insIndex++; |
| 55 | if (!this.playerController) { | 54 | if (!this.playerController) { |
| 56 | return | 55 | return |
| @@ -80,9 +79,7 @@ export struct WDPlayerRenderView { | @@ -80,9 +79,7 @@ export struct WDPlayerRenderView { | ||
| 80 | }) | 79 | }) |
| 81 | .onLoad(async (event) => { | 80 | .onLoad(async (event) => { |
| 82 | Logger.info(TAG, 'onLoad') | 81 | Logger.info(TAG, 'onLoad') |
| 83 | - let surfaceId = this.xComponentController.getXComponentSurfaceId() | ||
| 84 | - console.log('surfaceId===', surfaceId) | ||
| 85 | - console.log('insId===', this.insId) | 82 | + // const surfaceId = this.xComponentController.getXComponentSurfaceId() |
| 86 | this.xComponentController.setXComponentSurfaceSize({ | 83 | this.xComponentController.setXComponentSurfaceSize({ |
| 87 | surfaceWidth: 1920, | 84 | surfaceWidth: 1920, |
| 88 | surfaceHeight: 1080 | 85 | surfaceHeight: 1080 |
| @@ -94,27 +91,14 @@ export struct WDPlayerRenderView { | @@ -94,27 +91,14 @@ export struct WDPlayerRenderView { | ||
| 94 | }) | 91 | }) |
| 95 | .width(this.selfSize.width) | 92 | .width(this.selfSize.width) |
| 96 | .height(this.selfSize.height) | 93 | .height(this.selfSize.height) |
| 97 | - .margin({ top: this.getPlayerMarginTop() }) | ||
| 98 | } | 94 | } |
| 99 | .id(this.insId) | 95 | .id(this.insId) |
| 100 | .onAreaChange(() => { | 96 | .onAreaChange(() => { |
| 101 | // this.updateLayout() | 97 | // this.updateLayout() |
| 102 | }) | 98 | }) |
| 103 | .backgroundColor("#000000") | 99 | .backgroundColor("#000000") |
| 104 | - .alignItems(VerticalAlign.Center) | ||
| 105 | - .justifyContent(FlexAlign.Center) | ||
| 106 | - .alignItems(this.selfSize.width === '100%' ? VerticalAlign.Top : VerticalAlign.Center) | ||
| 107 | - .height('100%') | ||
| 108 | - .width('100%') | ||
| 109 | } | 100 | } |
| 110 | - | ||
| 111 | - /** | ||
| 112 | - * 横屏播放器非居中展示 | ||
| 113 | - */ | ||
| 114 | - getPlayerMarginTop() { | ||
| 115 | - return this.selfSize.width === '100%' && this.videoWidth > this.videoHeight ? 218 : 0 | ||
| 116 | - } | ||
| 117 | - | 101 | + |
| 118 | updateLayout() { | 102 | updateLayout() { |
| 119 | let info = componentUtils.getRectangleById(this.insId); | 103 | let info = componentUtils.getRectangleById(this.insId); |
| 120 | if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { | 104 | if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { |
-
Please register or login to post a comment