wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  19184 UI还原问题-【uat】进入视频页,拖动进度条,显示进度时间颜色样式和ios 不一致
  ref |> 修改华为分享弹框上的默认App icon图
  ref |> 图文详情点击评论需要有正文和数字的切换功能开发
  fix |> 视频详情页输入框底部适配
  fix |> 修复直播频道中直播会看间偏大的问题
  fix |> 在直播预约详情页面点击直播预约后返回直播频道列表预约状态没有更新
  19996 卡片来源显示规则,评论数未展示
  19996 卡片来源显示规则,评论数未展示
  19989 视频详情页:文本框弹出样式,缺少发布时间。
  19988 视频详情页,标题和摘要折行不正确,全文按钮不应折到下一行,省略号和全文按钮颜色不正确。
  fix: uat>导航换肤,新闻频道列表页,卡片之间不应展示背景图
  fix: 设置仅wifi加载图片控制,4G网络下,奥运频道信息流页面未展示头图卡
  ref |> 竖屏直播时长不足一分钟,显示为0时1分
Showing 19 changed files with 172 additions and 92 deletions
@@ -504,10 +504,10 @@ export class DateTimeUtils { @@ -504,10 +504,10 @@ export class DateTimeUtils {
504 } 504 }
505 505
506 static liveDurationSecondToTime(seconds: number) { 506 static liveDurationSecondToTime(seconds: number) {
507 - let time = ''  
508 if (seconds < 60) { 507 if (seconds < 60) {
509 - return '0时0分' 508 + return '0时1分'
510 } 509 }
  510 + let time = ''
511 let days = Math.floor(seconds/this.SECONDS_IN_DAY) 511 let days = Math.floor(seconds/this.SECONDS_IN_DAY)
512 512
513 let hours = Math.floor(seconds%this.SECONDS_IN_DAY/this.SECONDS_IN_HOUR) 513 let hours = Math.floor(seconds%this.SECONDS_IN_DAY/this.SECONDS_IN_HOUR)
@@ -69,6 +69,7 @@ export struct ImageAndTextPageComponent { @@ -69,6 +69,7 @@ export struct ImageAndTextPageComponent {
69 private screenHeight: number = 0 69 private screenHeight: number = 0
70 private topHeight: number = 32 70 private topHeight: number = 32
71 private bottomHeight: number = 150 71 private bottomHeight: number = 150
  72 + @State showMainText: boolean = false
72 pageShowTime:number = 0; 73 pageShowTime:number = 0;
73 pageHideTime:number = 0; 74 pageHideTime:number = 0;
74 lastTimeoutId?: number 75 lastTimeoutId?: number
@@ -165,6 +166,7 @@ export struct ImageAndTextPageComponent { @@ -165,6 +166,7 @@ export struct ImageAndTextPageComponent {
165 .onAreaChange((oldValue: Area, newValue: Area) => { 166 .onAreaChange((oldValue: Area, newValue: Area) => {
166 this.info = newValue 167 this.info = newValue
167 console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset) 168 console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset)
  169 + console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number)
168 this.checkToScrollCommentArea() 170 this.checkToScrollCommentArea()
169 }) 171 })
170 // .onMeasureSize() 172 // .onMeasureSize()
@@ -207,25 +209,41 @@ export struct ImageAndTextPageComponent { @@ -207,25 +209,41 @@ export struct ImageAndTextPageComponent {
207 contentDetailData: this.contentDetailData, 209 contentDetailData: this.contentDetailData,
208 publishCommentModel: this.publishCommentModel, 210 publishCommentModel: this.publishCommentModel,
209 operationButtonList: this.operationButtonList, 211 operationButtonList: this.operationButtonList,
  212 + showMainText:this.showMainText,
210 styleType: 1, 213 styleType: 1,
211 onCommentIconClick: () => { 214 onCommentIconClick: () => {
212 const info = componentUtils.getRectangleById('comment'); 215 const info = componentUtils.getRectangleById('comment');
213 console.log(TAG, "点击滑动页面", JSON.stringify(info)) 216 console.log(TAG, "点击滑动页面", JSON.stringify(info))
214 217
215 - if (!this.offsetY) {  
216 - this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y  
217 - }  
218 - // 定位到评论区域  
219 - if (this.isScrollTop) {  
220 - this.scroller.scrollTo({  
221 - xOffset: 0,  
222 - yOffset: this.offsetY,  
223 - animation: true  
224 - })  
225 - } else {  
226 - this.scroller.scrollEdge(Edge.Top) 218 + //评论区当前位置
  219 + let currentCommonentOffSetY = this.info?.globalPosition.y as number
  220 + let offSetY = 0
  221 + if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
  222 + offSetY = currentCommonentOffSetY-200
  223 + this.showMainText = true
  224 + }else {
  225 + this.showMainText = false
227 } 226 }
228 - this.isScrollTop = !this.isScrollTop 227 + this.scroller.scrollTo({
  228 + yOffset: offSetY,
  229 + xOffset: 0,
  230 + animation: { duration: 1000, curve: Curve.Ease }
  231 + })
  232 +
  233 + // if (!this.offsetY) {
  234 + // this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
  235 + // }
  236 + // // 定位到评论区域
  237 + // if (this.isScrollTop) {
  238 + // this.scroller.scrollTo({
  239 + // xOffset: 0,
  240 + // yOffset: this.offsetY,
  241 + // animation: true
  242 + // })
  243 + // } else {
  244 + // this.scroller.scrollEdge(Edge.Top)
  245 + // }
  246 + // this.isScrollTop = !this.isScrollTop
229 } 247 }
230 }) 248 })
231 } 249 }
@@ -464,7 +482,7 @@ export struct ImageAndTextPageComponent { @@ -464,7 +482,7 @@ export struct ImageAndTextPageComponent {
464 return 482 return
465 } 483 }
466 let offSetY = currentScrollOffSetY 484 let offSetY = currentScrollOffSetY
467 - if (currentCommonentOffSetY > (this.screenHeight-this.bottomHeight) ) { 485 + if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
468 offSetY = currentCommonentOffSetY-200 486 offSetY = currentCommonentOffSetY-200
469 }else { 487 }else {
470 offSetY = currentScrollOffSetY + currentCommonentOffSetY-100 488 offSetY = currentScrollOffSetY + currentCommonentOffSetY-100
@@ -64,11 +64,13 @@ export struct CardSourceInfo { @@ -64,11 +64,13 @@ export struct CardSourceInfo {
64 } 64 }
65 65
66 handleTimeStr() { 66 handleTimeStr() {
67 - return DateTimeUtils.getCommentTime( 67 + let str = DateTimeUtils.getCommentTime(
68 this.contentDTO.publishTime.includes(' ') 68 this.contentDTO.publishTime.includes(' ')
69 ? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString()) 69 ? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())
70 : Number.parseFloat(this.contentDTO.publishTime) 70 : Number.parseFloat(this.contentDTO.publishTime)
71 ) 71 )
  72 + console.log('cj2024 str', str)
  73 + return str
72 } 74 }
73 75
74 showTime() { 76 showTime() {
@@ -80,6 +82,7 @@ export struct CardSourceInfo { @@ -80,6 +82,7 @@ export struct CardSourceInfo {
80 let flag: boolean = false; 82 let flag: boolean = false;
81 if (curRouter === 'MainPage') { 83 if (curRouter === 'MainPage') {
82 if (this.isTwoDaysAgo(publishTime)) { 84 if (this.isTwoDaysAgo(publishTime)) {
  85 + console.log('cj2024 isTwoDaysAgo', this.isTwoDaysAgo(publishTime))
83 flag = false 86 flag = false
84 } else { 87 } else {
85 flag = true; 88 flag = true;
@@ -87,6 +90,7 @@ export struct CardSourceInfo { @@ -87,6 +90,7 @@ export struct CardSourceInfo {
87 } else { 90 } else {
88 flag = true; 91 flag = true;
89 } 92 }
  93 + console.log('cj2024 flag', flag)
90 return flag; 94 return flag;
91 } 95 }
92 96
@@ -156,7 +160,7 @@ export struct CardSourceInfo { @@ -156,7 +160,7 @@ export struct CardSourceInfo {
156 } 160 }
157 161
158 // 点 162 // 点
159 - if ((this.showTime()&&(this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && 163 + if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
160 this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && 164 this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
161 (this.getContentDtoBean()?.interactData?.commentNum 165 (this.getContentDtoBean()?.interactData?.commentNum
162 // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' 166 // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
@@ -177,16 +181,18 @@ export struct CardSourceInfo { @@ -177,16 +181,18 @@ export struct CardSourceInfo {
177 } 181 }
178 182
179 // 发布日期 183 // 发布日期
180 - if (this.showTime() && !this.isEllipsisActive) { 184 + if (this.showTime()) {
181 Text(this.handleTimeStr()) 185 Text(this.handleTimeStr())
182 .fontSize($r("app.float.font_size_11")) 186 .fontSize($r("app.float.font_size_11"))
183 .fontColor($r("app.color.color_B0B0B0")) 187 .fontColor($r("app.color.color_B0B0B0"))
184 .flexShrink(0) 188 .flexShrink(0)
185 .margin({ right: 4 }) 189 .margin({ right: 4 })
  190 + .visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden)
186 } 191 }
187 192
188 // 评论数 193 // 评论数
189 - if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) { 194 + // if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
  195 + if (!this.isEllipsisActive) {
190 if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && 196 if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
191 this.showCommentNum()) { 197 this.showCommentNum()) {
192 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) 198 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
@@ -54,7 +54,7 @@ export struct Card5Component { @@ -54,7 +54,7 @@ export struct Card5Component {
54 bottomRight: $r('app.float.image_border_radius') 54 bottomRight: $r('app.float.image_border_radius')
55 } 55 }
56 ) 56 )
57 - // .aspectRatio(343 / 225) 57 + .height(this.loadImg ? '' : 114)
58 .autoResize(true) 58 .autoResize(true)
59 if (!!this.titleShowPolicy || this.titleShowPolicy === null ) { 59 if (!!this.titleShowPolicy || this.titleShowPolicy === null ) {
60 Row() 60 Row()
@@ -108,7 +108,7 @@ export struct CommentCustomDialog { @@ -108,7 +108,7 @@ export struct CommentCustomDialog {
108 } 108 }
109 .backgroundColor('#F9F9F9') 109 .backgroundColor('#F9F9F9')
110 // .width('100%') 110 // .width('100%')
111 - .margin({ top: 12, right: 12, left: 12, bottom: 10 }) 111 + .margin({ top: 12, right: 12, left: 12, bottom:10})
112 .height(80) 112 .height(80)
113 .borderRadius(4) 113 .borderRadius(4)
114 114
@@ -160,6 +160,7 @@ export struct CommentCustomDialog { @@ -160,6 +160,7 @@ export struct CommentCustomDialog {
160 }.justifyContent(FlexAlign.SpaceBetween) 160 }.justifyContent(FlexAlign.SpaceBetween)
161 .width('100%') 161 .width('100%')
162 .height(60) 162 .height(60)
  163 + .padding({bottom:20})
163 164
164 // .margin({ right: 12, left: 12 }) 165 // .margin({ right: 12, left: 12 })
165 // .backgroundColor(Color.Red) 166 // .backgroundColor(Color.Red)
@@ -161,6 +161,7 @@ export struct CommentIconComponent { @@ -161,6 +161,7 @@ export struct CommentIconComponent {
161 /*展示类型*/ 161 /*展示类型*/
162 @State type: number = 1 162 @State type: number = 1
163 @Prop contentDetail: ContentDetailDTO 163 @Prop contentDetail: ContentDetailDTO
  164 + @Prop showMainText: boolean = false // 是否显示正文样式
164 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 165 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
165 // aboutToAppear(): void { 166 // aboutToAppear(): void {
166 // setTimeout(() => { 167 // setTimeout(() => {
@@ -186,7 +187,7 @@ export struct CommentIconComponent { @@ -186,7 +187,7 @@ export struct CommentIconComponent {
186 // Stack({alignContent:Alignment.Start}) { 187 // Stack({alignContent:Alignment.Start}) {
187 if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { 188 if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
188 RelativeContainer() { 189 RelativeContainer() {
189 - Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) 190 + Image(this.styleType == 1 ? this.showMainText?$r('app.media.comment_icon_text_bg'):$r('app.media.comment_icon_number_bg') : this.showMainText?$r('app.media.comment_icon_text_block_bg'):$r('app.media.ic_like_back_Select'))
190 .objectFit(ImageFit.Fill) 191 .objectFit(ImageFit.Fill)
191 .resizable({ 192 .resizable({
192 slice: { 193 slice: {
@@ -205,10 +206,9 @@ export struct CommentIconComponent { @@ -205,10 +206,9 @@ export struct CommentIconComponent {
205 // x:-6 206 // x:-6
206 // }) 207 // })
207 .id("Image") 208 .id("Image")
208 -  
209 - Text(this.publishCommentModel.totalCommentNumer)// Text("44444444") 209 + Text(this.showMainText?'正文':this.publishCommentModel.totalCommentNumer)// Text("44444444")
210 .fontSize(8) 210 .fontSize(8)
211 - .fontColor('#ffffff')// .backgroundColor('#ED2800') 211 + .fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800')
212 .height(12) 212 .height(12)
213 .textAlign(TextAlign.Center) 213 .textAlign(TextAlign.Center)
214 .alignRules({ 214 .alignRules({
@@ -36,8 +36,8 @@ export struct CompNormalTitle { @@ -36,8 +36,8 @@ export struct CompNormalTitle {
36 .padding({ 36 .padding({
37 left: 10, 37 left: 10,
38 right: 10, 38 right: 10,
39 - top: $r('app.float.card_comp_pagePadding_tb'),  
40 - bottom: $r('app.float.card_comp_pagePadding_tb') 39 + // top: $r('app.float.card_comp_pagePadding_tb'),
  40 + // bottom: $r('app.float.card_comp_pagePadding_tb')
41 }) 41 })
42 .backgroundColor(0xffffff) 42 .backgroundColor(0xffffff)
43 .width(CommonConstants.FULL_WIDTH) 43 .width(CommonConstants.FULL_WIDTH)
@@ -41,8 +41,8 @@ export struct ZhGridLayout02NewsContent { @@ -41,8 +41,8 @@ export struct ZhGridLayout02NewsContent {
41 .padding({ 41 .padding({
42 left: 10, 42 left: 10,
43 right: 10, 43 right: 10,
44 - top: $r('app.float.card_comp_pagePadding_tb'),  
45 - bottom: $r('app.float.card_comp_pagePadding_tb') 44 + // top: $r('app.float.card_comp_pagePadding_tb'),
  45 + // bottom: $r('app.float.card_comp_pagePadding_tb')
46 }) 46 })
47 .backgroundColor(0xffffff) 47 .backgroundColor(0xffffff)
48 .width(CommonConstants.FULL_WIDTH) 48 .width(CommonConstants.FULL_WIDTH)
@@ -4,9 +4,8 @@ import { postInteractAccentionOperateParams } from 'wdBean'; @@ -4,9 +4,8 @@ import { postInteractAccentionOperateParams } from 'wdBean';
4 import { PageRepository } from '../../repository/PageRepository'; 4 import { PageRepository } from '../../repository/PageRepository';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { HttpUtils } from 'wdNetwork/Index'; 6 import { HttpUtils } from 'wdNetwork/Index';
7 -import { DateTimeUtils, SPHelper } from 'wdKit'; 7 +import { DateTimeUtils, SPHelper,Logger, ToastUtils,EmitterUtils,EmitterEventId } from 'wdKit';
8 import { LiveModel } from '../../viewmodel/LiveModel' 8 import { LiveModel } from '../../viewmodel/LiveModel'
9 -import { Logger, ToastUtils } from 'wdKit';  
10 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 9 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
11 import { SpConstants } from 'wdConstant/Index' 10 import { SpConstants } from 'wdConstant/Index'
12 import { InfomationCardClick } from '../../utils/infomationCardClick'; 11 import { InfomationCardClick } from '../../utils/infomationCardClick';
@@ -94,6 +93,31 @@ export struct ZhSingleRow03 { @@ -94,6 +93,31 @@ export struct ZhSingleRow03 {
94 this.getReserveState(); 93 this.getReserveState();
95 } 94 }
96 this.loadImg = await onlyWifiLoadImg(); 95 this.loadImg = await onlyWifiLoadImg();
  96 +
  97 + // 获取预约
  98 + EmitterUtils.receiveEvent(EmitterEventId.LIVE_ROOM_SUBSCRIBE, (str?: string) => {
  99 + Logger.debug(TAG, 'receiveEvent LIVE_ROOM_SUBSCRIBE: ' + str)
  100 + if (str) {
  101 + // 跳转指定频道场景,传参底导id、频道id
  102 + const model: ReserveItemBean = JSON.parse(str)
  103 + for (let contentItem of this.compDTO.operDataList) {
  104 + let liveStr = new String(model.liveId)
  105 + if (contentItem.objectId == liveStr) {
  106 + if (model.subscribe){
  107 + this.reservedIds.push(contentItem.objectId.toString())
  108 + }else {
  109 + let index = this.reservedIds.findIndex(item => item == contentItem.objectId);
  110 + if (index > -1) {
  111 + this.reservedIds.splice(index, 1);
  112 + }
  113 + }
  114 + let time = DateTimeUtils.getTimeStamp().toString()
  115 + this.compDTO.timestamp = time
  116 + return
  117 + }
  118 + }
  119 + }
  120 + })
97 } 121 }
98 122
99 123
@@ -174,7 +174,15 @@ export struct TopNavigationComponentNew { @@ -174,7 +174,15 @@ export struct TopNavigationComponentNew {
174 autoRefresh: this.autoRefresh2Page, 174 autoRefresh: this.autoRefresh2Page,
175 isMourning: mourningCheckFn(`${navItem.channelId}`), 175 isMourning: mourningCheckFn(`${navItem.channelId}`),
176 }) 176 })
177 - .backgroundColor(CompUtils.isRMH(this.navItem)?Color.White:Color.Transparent) 177 + .margin({
  178 + left: 6,
  179 + right: 6
  180 + })
  181 + .borderRadius({
  182 + topLeft: 6,
  183 + topRight: 6
  184 + })
  185 + .backgroundColor(CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem) ? Color.White : Color.Transparent)
178 } 186 }
179 187
180 /** 188 /**
@@ -79,6 +79,7 @@ export struct OperRowListView { @@ -79,6 +79,7 @@ export struct OperRowListView {
79 @ObjectLink publishCommentModel: publishCommentModel 79 @ObjectLink publishCommentModel: publishCommentModel
80 @State styleType: number = -1 80 @State styleType: number = -1
81 @State showCommentIcon: boolean = true // 评论图标 81 @State showCommentIcon: boolean = true // 评论图标
  82 + @Prop showMainText: boolean = false // 是否显示正文样式
82 @State bgColor: ResourceColor = Color.White 83 @State bgColor: ResourceColor = Color.White
83 @State interactData: InteractDataDTO = {} as InteractDataDTO 84 @State interactData: InteractDataDTO = {} as InteractDataDTO
84 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 85 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@@ -299,7 +300,8 @@ export struct OperRowListView { @@ -299,7 +300,8 @@ export struct OperRowListView {
299 CommentIconComponent({ 300 CommentIconComponent({
300 publishCommentModel: this.publishCommentModel, 301 publishCommentModel: this.publishCommentModel,
301 styleType: this.styleType, 302 styleType: this.styleType,
302 - contentDetail: this.contentDetailData 303 + contentDetail: this.contentDetailData,
  304 + showMainText: this.showMainText
303 }) 305 })
304 .onClick(() => { 306 .onClick(() => {
305 console.log('akdbakdbakdbaksjd') 307 console.log('akdbakdbakdbaksjd')
  1 +import { DateTimeUtils } from 'wdKit'
  2 +
1 @Preview 3 @Preview
2 @CustomDialog 4 @CustomDialog
3 export struct DetailDialog { 5 export struct DetailDialog {
@@ -5,6 +7,7 @@ export struct DetailDialog { @@ -5,6 +7,7 @@ export struct DetailDialog {
5 @Prop name: string 7 @Prop name: string
6 @Prop title: string 8 @Prop title: string
7 @Prop summary: string 9 @Prop summary: string
  10 + @Prop publishTime: string
8 @Link isOpenDetail: boolean 11 @Link isOpenDetail: boolean
9 12
10 build() { 13 build() {
@@ -36,6 +39,16 @@ export struct DetailDialog { @@ -36,6 +39,16 @@ export struct DetailDialog {
36 .fontWeight(400) 39 .fontWeight(400)
37 .margin({ top: 8 }) 40 .margin({ top: 8 })
38 .lineHeight(21) 41 .lineHeight(21)
  42 +
  43 + Text(DateTimeUtils.formatDate(new Date(this.publishTime).getTime(),
  44 + DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
  45 + .fontSize(12)
  46 + .fontColor(Color.White)
  47 + .opacity(0.7)
  48 + .lineHeight(16)
  49 + .fontWeight(400)
  50 + .fontFamily('PingFang SC-Regular')
  51 + .margin({ top: 8, bottom: 8 })
39 } 52 }
40 .alignItems(HorizontalAlign.Start) 53 .alignItems(HorizontalAlign.Start)
41 54
@@ -130,11 +130,15 @@ export struct PlayerFullScreenView { @@ -130,11 +130,15 @@ export struct PlayerFullScreenView {
130 Column() { 130 Column() {
131 Text() { 131 Text() {
132 Span(this.upProVal) 132 Span(this.upProVal)
  133 + .fontColor(Color.White)
133 Span(' / ') 134 Span(' / ')
  135 + .fontColor(Color.White)
134 Span(this.duration) 136 Span(this.duration)
  137 + .fontColor('#888888')
  138 +
135 } 139 }
136 .fontSize(24) 140 .fontSize(24)
137 - .fontColor(Color.White) 141 +
138 .fontWeight(600) 142 .fontWeight(600)
139 .margin({ bottom: 30 }) 143 .margin({ bottom: 30 })
140 .visibility(this.isDragging ? Visibility.Visible : Visibility.None) 144 .visibility(this.isDragging ? Visibility.Visible : Visibility.None)
@@ -77,11 +77,14 @@ export struct PlayerProgressView { @@ -77,11 +77,14 @@ export struct PlayerProgressView {
77 Column() { 77 Column() {
78 Text() { 78 Text() {
79 Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration))) 79 Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
  80 + .fontColor(Color.White)
80 Span(' / ') 81 Span(' / ')
  82 + .fontColor(Color.White)
81 Span(DateTimeUtils.secondToTime(this.videoDuration)) 83 Span(DateTimeUtils.secondToTime(this.videoDuration))
  84 + .fontColor('#888888')
82 } 85 }
83 .fontSize(24) 86 .fontSize(24)
84 - .fontColor(Color.White) 87 +
85 .fontWeight(600) 88 .fontWeight(600)
86 .margin({ bottom: 30 }) 89 .margin({ bottom: 30 })
87 .visibility(this.isDragging ? Visibility.Visible : Visibility.None) 90 .visibility(this.isDragging ? Visibility.Visible : Visibility.None)
1 import measure from '@ohos.measure' 1 import measure from '@ohos.measure'
2 import { ContentDetailDTO } from 'wdBean/Index' 2 import { ContentDetailDTO } from 'wdBean/Index'
3 import { DetailDialog } from './DetailDialog' 3 import { DetailDialog } from './DetailDialog'
4 -import { componentUtils } from '@kit.ArkUI'  
5 import { DateTimeUtils } from 'wdKit' 4 import { DateTimeUtils } from 'wdKit'
6 5
7 const TAG = 'PlayerTitleView'; 6 const TAG = 'PlayerTitleView';
  7 +
8 @Preview 8 @Preview
9 @Component 9 @Component
10 export struct PlayerTitleView { 10 export struct PlayerTitleView {
@@ -17,20 +17,18 @@ export struct PlayerTitleView { @@ -17,20 +17,18 @@ export struct PlayerTitleView {
17 @State isOverLines: boolean = false 17 @State isOverLines: boolean = false
18 @State isTitleOverLines: boolean = false 18 @State isTitleOverLines: boolean = false
19 @State summary: string = '' 19 @State summary: string = ''
20 -  
21 @State private titleLines: number = 0 20 @State private titleLines: number = 0
22 @State private summaryLines: number = 0 21 @State private summaryLines: number = 0
23 -  
24 -  
25 dialogController: CustomDialogController = new CustomDialogController({ 22 dialogController: CustomDialogController = new CustomDialogController({
26 builder: DetailDialog({ 23 builder: DetailDialog({
27 name: this.getName(), 24 name: this.getName(),
28 title: this.getTitle(), 25 title: this.getTitle(),
29 summary: this.getSummary(), 26 summary: this.getSummary(),
  27 + publishTime: this.getPublishTime(),
30 isOpenDetail: this.isOpenDetail 28 isOpenDetail: this.isOpenDetail
31 29
32 }), 30 }),
33 - cancel:()=>{ 31 + cancel: () => {
34 this.isOpenDetail = !this.isOpenDetail 32 this.isOpenDetail = !this.isOpenDetail
35 }, 33 },
36 customStyle: true, 34 customStyle: true,
@@ -58,6 +56,10 @@ export struct PlayerTitleView { @@ -58,6 +56,10 @@ export struct PlayerTitleView {
58 return this.contentDetailData?.newIntroduction || '' 56 return this.contentDetailData?.newIntroduction || ''
59 } 57 }
60 58
  59 + getPublishTime(): string {
  60 + return this.contentDetailData?.publishTime || ''
  61 + }
  62 +
61 /** 63 /**
62 * 截断文本 64 * 截断文本
63 * @param {string} str 要截断的文本 '啊啊啊啊啊' 65 * @param {string} str 要截断的文本 '啊啊啊啊啊'
@@ -74,7 +76,7 @@ export struct PlayerTitleView { @@ -74,7 +76,7 @@ export struct PlayerTitleView {
74 fontSize: fontSize, 76 fontSize: fontSize,
75 fontWeight: 400, 77 fontWeight: 400,
76 lineHeight: 20, 78 lineHeight: 20,
77 - wordBreak:WordBreak.BREAK_ALL 79 + wordBreak: WordBreak.BREAK_ALL
78 }) 80 })
79 let clipStr: string = '' 81 let clipStr: string = ''
80 for (let i = 0; i < strArr.length; i++) { 82 for (let i = 0; i < strArr.length; i++) {
@@ -83,7 +85,7 @@ export struct PlayerTitleView { @@ -83,7 +85,7 @@ export struct PlayerTitleView {
83 fontSize: fontSize, 85 fontSize: fontSize,
84 fontWeight: 400, 86 fontWeight: 400,
85 lineHeight: 20, 87 lineHeight: 20,
86 - wordBreak:WordBreak.BREAK_ALL 88 + wordBreak: WordBreak.BREAK_ALL
87 }) >= textWidth * maxLines - measureTruncateWidth) { 89 }) >= textWidth * maxLines - measureTruncateWidth) {
88 this.isOverLines = true 90 this.isOverLines = true
89 break; 91 break;
@@ -93,6 +95,7 @@ export struct PlayerTitleView { @@ -93,6 +95,7 @@ export struct PlayerTitleView {
93 console.log(TAG, 'clipStr:', clipStr) 95 console.log(TAG, 'clipStr:', clipStr)
94 return clipStr 96 return clipStr
95 } 97 }
  98 +
96 /** 99 /**
97 * 截断文本 100 * 截断文本
98 * @param {string} str 要截断的文本 '啊啊啊啊啊' 101 * @param {string} str 要截断的文本 '啊啊啊啊啊'
@@ -109,7 +112,7 @@ export struct PlayerTitleView { @@ -109,7 +112,7 @@ export struct PlayerTitleView {
109 fontSize: fontSize, 112 fontSize: fontSize,
110 fontWeight: 600, 113 fontWeight: 600,
111 lineHeight: 20, 114 lineHeight: 20,
112 - wordBreak:WordBreak.BREAK_ALL 115 + wordBreak: WordBreak.BREAK_ALL
113 }) 116 })
114 let clipStr: string = '' 117 let clipStr: string = ''
115 for (let i = 0; i < strArr.length; i++) { 118 for (let i = 0; i < strArr.length; i++) {
@@ -118,7 +121,7 @@ export struct PlayerTitleView { @@ -118,7 +121,7 @@ export struct PlayerTitleView {
118 fontSize: fontSize, 121 fontSize: fontSize,
119 fontWeight: 600, 122 fontWeight: 600,
120 lineHeight: 20, 123 lineHeight: 20,
121 - wordBreak:WordBreak.BREAK_ALL 124 + wordBreak: WordBreak.BREAK_ALL
122 }) >= textWidth * maxLines - measureTruncateWidth) { 125 }) >= textWidth * maxLines - measureTruncateWidth) {
123 this.isTitleOverLines = true 126 this.isTitleOverLines = true
124 break; 127 break;
@@ -145,14 +148,13 @@ export struct PlayerTitleView { @@ -145,14 +148,13 @@ export struct PlayerTitleView {
145 this.summary = this.getSummary() 148 this.summary = this.getSummary()
146 } 149 }
147 150
148 -  
149 private updateSummaryLines() { 151 private updateSummaryLines() {
150 this.summaryLines = Math.max(1, 4 - this.titleLines) 152 this.summaryLines = Math.max(1, 4 - this.titleLines)
151 // console.info(`cj2024 titleLines = ${this.titleLines}`) 153 // console.info(`cj2024 titleLines = ${this.titleLines}`)
152 - this.isOverLines = this.summary.length > this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)).length 154 + this.isOverLines = this.summary.length >
  155 + this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)).length
153 } 156 }
154 157
155 -  
156 build() { 158 build() {
157 Column() { 159 Column() {
158 if (this.getName()) { 160 if (this.getName()) {
@@ -212,50 +214,50 @@ export struct PlayerTitleView { @@ -212,50 +214,50 @@ export struct PlayerTitleView {
212 // }) 214 // })
213 // } 215 // }
214 // } else { 216 // } else {
215 - if(this.summary && this.titleLines < 4) {  
216 - Text() {  
217 - Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))  
218 - .fontSize(14)  
219 - .fontColor(Color.White)  
220 - .lineHeight(21) 217 + if (this.summary && this.titleLines < 4) {
  218 + Text() {
  219 + Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))
  220 + .fontSize(14)
  221 + .fontColor(Color.White)
  222 + .lineHeight(21)
  223 + .fontWeight(400)
  224 + .fontFamily('PingFang SC-Regular')
  225 + if (this.isOverLines) {
  226 + Span('... 全文')
  227 + .fontColor('#888888')
221 .fontWeight(400) 228 .fontWeight(400)
222 .fontFamily('PingFang SC-Regular') 229 .fontFamily('PingFang SC-Regular')
223 - if (this.isOverLines) {  
224 - Span('... 全文')  
225 - .fontColor('#888888')  
226 - .fontWeight(400)  
227 - .fontFamily('PingFang SC-Regular')  
228 - .fontSize(12)  
229 - .onClick(() => {  
230 - this.isOpenDetail = true  
231 - this.dialogController?.open()  
232 - })  
233 - ImageSpan($r('app.media.comment_unfold_svg'))  
234 - .width(14)  
235 - .height(14)  
236 - .objectFit(ImageFit.Fill)  
237 - .verticalAlign(ImageSpanAlignment.BOTTOM)  
238 - .margin({bottom:1})  
239 - // .padding({ 230 + .fontSize(12)
  231 + .onClick(() => {
  232 + this.isOpenDetail = true
  233 + this.dialogController?.open()
  234 + })
  235 + ImageSpan($r('app.media.comment_unfold_svg'))
  236 + .width(14)
  237 + .height(14)
  238 + .objectFit(ImageFit.Fill)
  239 + .verticalAlign(ImageSpanAlignment.BOTTOM)
  240 + .margin({ bottom: 1 })// .padding({
240 // bottom: 4 241 // bottom: 4
241 // }) 242 // })
242 - .onClick(() => {  
243 - this.isOpenDetail = true  
244 - this.dialogController?.open()  
245 - }) 243 + .onClick(() => {
  244 + this.isOpenDetail = true
  245 + this.dialogController?.open()
  246 + })
246 247
247 - }  
248 } 248 }
249 - .padding({  
250 - left: 0,//6  
251 - right: 6,  
252 - top: 0,//4  
253 - bottom: 4  
254 - })  
255 -  
256 } 249 }
  250 + .padding({
  251 + left: 0, //6
  252 + right: 6,
  253 + top: 0, //4
  254 + bottom: 4
  255 + })
  256 +
  257 + }
257 // } 258 // }
258 - Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(), DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM)) 259 + Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
  260 + DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
259 .fontSize(12) 261 .fontSize(12)
260 .fontColor(Color.White) 262 .fontColor(Color.White)
261 .opacity(0.7) 263 .opacity(0.7)
@@ -274,7 +276,7 @@ export struct PlayerTitleView { @@ -274,7 +276,7 @@ export struct PlayerTitleView {
274 @Builder 276 @Builder
275 titleBuilder() { 277 titleBuilder() {
276 Text() { 278 Text() {
277 - Span(this.clipTitleText(this.getTitle(), 14, 4, this.windowWidth - 230 - vp2px(50))) 279 + Span(this.clipTitleText(this.getTitle(), 14, 4, this.windowWidth - 234 - vp2px(50)))
278 .fontSize(15) 280 .fontSize(15)
279 .fontColor(Color.White) 281 .fontColor(Color.White)
280 .lineHeight(20) 282 .lineHeight(20)
@@ -282,7 +284,7 @@ export struct PlayerTitleView { @@ -282,7 +284,7 @@ export struct PlayerTitleView {
282 .fontFamily('PingFang SC-Regular') 284 .fontFamily('PingFang SC-Regular')
283 if (this.isTitleOverLines) { 285 if (this.isTitleOverLines) {
284 Span('... 全文') 286 Span('... 全文')
285 - .fontColor('#888888') 287 + .fontColor(Color.White)
286 .fontWeight(600) 288 .fontWeight(600)
287 .fontFamily('PingFang SC-Regular') 289 .fontFamily('PingFang SC-Regular')
288 .fontSize(12) 290 .fontSize(12)
@@ -295,8 +297,7 @@ export struct PlayerTitleView { @@ -295,8 +297,7 @@ export struct PlayerTitleView {
295 .height(14) 297 .height(14)
296 .objectFit(ImageFit.Fill) 298 .objectFit(ImageFit.Fill)
297 .verticalAlign(ImageSpanAlignment.BOTTOM) 299 .verticalAlign(ImageSpanAlignment.BOTTOM)
298 - .margin({bottom:1})  
299 - // .padding({ 300 + .margin({ bottom: 1 })// .padding({
300 // bottom: 4 301 // bottom: 4
301 // }) 302 // })
302 .onClick(() => { 303 .onClick(() => {
@@ -308,14 +309,14 @@ export struct PlayerTitleView { @@ -308,14 +309,14 @@ export struct PlayerTitleView {
308 } 309 }
309 .onAreaChange((oldArea: Area, newArea: Area) => { 310 .onAreaChange((oldArea: Area, newArea: Area) => {
310 //console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`) 311 //console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
311 - this.titleLines = Math.floor((newArea.height as number) / 20)// 20是行高 312 + this.titleLines = Math.floor((newArea.height as number) / 20) // 20是行高
312 //console.info(`cj2024 titleLines = ${this.titleLines}`) 313 //console.info(`cj2024 titleLines = ${this.titleLines}`)
313 this.updateSummaryLines() 314 this.updateSummaryLines()
314 }) 315 })
315 .padding({ 316 .padding({
316 - left: 0,//6 317 + left: 0, //6
317 right: 6, 318 right: 6,
318 - top: 0,//4 319 + top: 0, //4
319 bottom: 4 320 bottom: 4
320 }) 321 })
321 } 322 }
@@ -22,7 +22,7 @@ export class WDShare { @@ -22,7 +22,7 @@ export class WDShare {
22 desc: content.shareInfo.shareSummary, 22 desc: content.shareInfo.shareSummary,
23 link: content.shareInfo.shareUrl, 23 link: content.shareInfo.shareUrl,
24 deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content), 24 deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content),
25 - // posterImg:$r("app.media.test_share_poster"), 25 + posterImg:$r("app.media.test_share_poster"),
26 } 26 }
27 }) 27 })
28 } 28 }