wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  来源超过16个字符时隐藏时间和评论
  下划线
  手动暂停直播后,app进入后台后,在回到前台场景,不自动恢复播放,和 iOS 保持一致
... ... @@ -214,6 +214,8 @@ export struct CompParser {
} else {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
Divider().strokeWidth(1).color('#f5f5f5').width('103%').padding({ left: 16, right: 16 }).margin({left: -6})
} else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// 大专题
if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
... ... @@ -231,7 +233,7 @@ export struct CompParser {
) {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
} else {
Divider().strokeWidth(1).color('#f5f5f5').width('103%').padding({ left: 16, right: 16 }).margin({left: -6})
Divider().strokeWidth(1).color('#f5f5f5').width('103%').padding({ left: 16, right: 16 }).margin({left: -6,top:8})
}
} else {
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ...
import { CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { DateTimeUtils, Logger } from 'wdKit/Index';
import router from '@ohos.router'
@Reusable
... ... @@ -12,8 +12,24 @@ export struct CardSourceInfo {
isCompInnerSource: boolean = false
// 是否有展示的信息,如来源,标签、时间、评论
@State viewShowData: boolean = true
private maxLength: number = 16;
@State private isEllipsisActive: boolean = false;
@State private displayText: string = '';
aboutToAppear(): void {
this.processText();
}
processText() {
const sourceText = this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source;
if (sourceText.length > this.maxLength) {
this.displayText = sourceText.substring(0, this.maxLength) + '...';
this.isEllipsisActive = true;
} else {
this.displayText = sourceText;
this.isEllipsisActive = false;
}
//Logger.warn(`cj2024 sourceText displayText=${this.displayText} isEllipsisActive=${this.isEllipsisActive}`)
}
aboutToReuse(params: Record<string, object>): void {
... ... @@ -110,7 +126,7 @@ export struct CardSourceInfo {
// 来源信息
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
Text(this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source)
Text(this.displayText)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
... ... @@ -134,11 +150,12 @@ export struct CardSourceInfo {
Image($r("app.media.point"))
.width(11)
.height(11)
.visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden)
}
// 发布日期
if (this.showTime()) {
if (this.showTime() && !this.isEllipsisActive) {
Text(this.handleTimeStr())
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
... ... @@ -147,7 +164,7 @@ export struct CardSourceInfo {
}
// 评论数
if (!this.contentDTO.cornerMark && !this.contentDTO.corner) {
if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
... ...
... ... @@ -30,8 +30,9 @@ export struct PlayUIComponent {
// 当前播放资源的状态
@Consume playSourceState: number
manualClickPauseOrPlayBack?:(manualClickPauseOrPlay: boolean) => void
onChangeMenuVisible() {
this.isPlayStatus = !this.isPlayStatus
if (!this.contentDetailData || !this.contentDetailData.liveInfo ||
this.contentDetailData?.liveInfo?.liveState === 'wait') {
return
... ... @@ -398,12 +399,18 @@ export struct PlayUIComponent {
if (this.isPlayStatus) {
this.isPlayStatus = false
this.playerController?.pause()
if (this.manualClickPauseOrPlayBack) {
this.manualClickPauseOrPlayBack(true)
}
} else {
this.isPlayStatus = true
if (this.contentDetailData.liveInfo?.liveState == 'running') {
this.playerController?.firstPlay(this.liveUrl)
}
this.playerController?.play()
if (this.manualClickPauseOrPlayBack) {
this.manualClickPauseOrPlayBack(false)
}
}
})
}
... ...
... ... @@ -40,7 +40,13 @@ export struct TopPlayComponent {
@Consume @Watch('pageHideChange') pageHide: number
init: boolean = false
@Prop @Watch("liveIMControlMessageChange") lastLiveControl: LiveRoomItemBean = {} as LiveRoomItemBean // IM 控制消息
///是否是手动点击暂停,手动暂停的,页面重新出现时,不自动恢复播放
manualClickPauseOrPlay: boolean = false
pageShowChange() {
if (this.manualClickPauseOrPlay) {
return
}
this.playerController?.play()
}
... ... @@ -263,7 +269,9 @@ export struct TopPlayComponent {
PictureLoading().visibility(this.isHideLoading ? Visibility.None : Visibility.Visible)
// 视频播放器上的控制面板和信息
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl })
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl,manualClickPauseOrPlayBack:(manualClickPauseOrPlay: boolean) => {
this.manualClickPauseOrPlay = manualClickPauseOrPlay;
}})
// 直播结束
Text('直播已结束')
... ...