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 139 additions and 59 deletions
... ... @@ -504,10 +504,10 @@ export class DateTimeUtils {
}
static liveDurationSecondToTime(seconds: number) {
let time = ''
if (seconds < 60) {
return '0时0分'
return '0时1分'
}
let time = ''
let days = Math.floor(seconds/this.SECONDS_IN_DAY)
let hours = Math.floor(seconds%this.SECONDS_IN_DAY/this.SECONDS_IN_HOUR)
... ...
... ... @@ -69,6 +69,7 @@ export struct ImageAndTextPageComponent {
private screenHeight: number = 0
private topHeight: number = 32
private bottomHeight: number = 150
@State showMainText: boolean = false
pageShowTime:number = 0;
pageHideTime:number = 0;
lastTimeoutId?: number
... ... @@ -165,6 +166,7 @@ export struct ImageAndTextPageComponent {
.onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset)
console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number)
this.checkToScrollCommentArea()
})
// .onMeasureSize()
... ... @@ -207,25 +209,41 @@ export struct ImageAndTextPageComponent {
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
showMainText:this.showMainText,
styleType: 1,
onCommentIconClick: () => {
const info = componentUtils.getRectangleById('comment');
console.log(TAG, "点击滑动页面", JSON.stringify(info))
if (!this.offsetY) {
this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentCommonentOffSetY-200
this.showMainText = true
}else {
this.showMainText = false
}
// 定位到评论区域
if (this.isScrollTop) {
this.scroller.scrollTo({
yOffset: offSetY,
xOffset: 0,
yOffset: this.offsetY,
animation: true
animation: { duration: 1000, curve: Curve.Ease }
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
// if (!this.offsetY) {
// this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
// }
// // 定位到评论区域
// if (this.isScrollTop) {
// this.scroller.scrollTo({
// xOffset: 0,
// yOffset: this.offsetY,
// animation: true
// })
// } else {
// this.scroller.scrollEdge(Edge.Top)
// }
// this.isScrollTop = !this.isScrollTop
}
})
}
... ... @@ -464,7 +482,7 @@ export struct ImageAndTextPageComponent {
return
}
let offSetY = currentScrollOffSetY
if (currentCommonentOffSetY > (this.screenHeight-this.bottomHeight) ) {
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentCommonentOffSetY-200
}else {
offSetY = currentScrollOffSetY + currentCommonentOffSetY-100
... ...
... ... @@ -64,11 +64,13 @@ export struct CardSourceInfo {
}
handleTimeStr() {
return DateTimeUtils.getCommentTime(
let str = DateTimeUtils.getCommentTime(
this.contentDTO.publishTime.includes(' ')
? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())
: Number.parseFloat(this.contentDTO.publishTime)
)
console.log('cj2024 str', str)
return str
}
showTime() {
... ... @@ -80,6 +82,7 @@ export struct CardSourceInfo {
let flag: boolean = false;
if (curRouter === 'MainPage') {
if (this.isTwoDaysAgo(publishTime)) {
console.log('cj2024 isTwoDaysAgo', this.isTwoDaysAgo(publishTime))
flag = false
} else {
flag = true;
... ... @@ -87,6 +90,7 @@ export struct CardSourceInfo {
} else {
flag = true;
}
console.log('cj2024 flag', flag)
return flag;
}
... ... @@ -156,7 +160,7 @@ export struct CardSourceInfo {
}
// 点
if ((this.showTime()&&(this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
(this.getContentDtoBean()?.interactData?.commentNum
// || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
... ... @@ -177,16 +181,18 @@ export struct CardSourceInfo {
}
// 发布日期
if (this.showTime() && !this.isEllipsisActive) {
if (this.showTime()) {
Text(this.handleTimeStr())
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.margin({ right: 4 })
.visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden)
}
// 评论数
if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
// if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
if (!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())}评`)
... ...
... ... @@ -54,7 +54,7 @@ export struct Card5Component {
bottomRight: $r('app.float.image_border_radius')
}
)
// .aspectRatio(343 / 225)
.height(this.loadImg ? '' : 114)
.autoResize(true)
if (!!this.titleShowPolicy || this.titleShowPolicy === null ) {
Row()
... ...
... ... @@ -108,7 +108,7 @@ export struct CommentCustomDialog {
}
.backgroundColor('#F9F9F9')
// .width('100%')
.margin({ top: 12, right: 12, left: 12, bottom: 10 })
.margin({ top: 12, right: 12, left: 12, bottom:10})
.height(80)
.borderRadius(4)
... ... @@ -160,6 +160,7 @@ export struct CommentCustomDialog {
}.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
.height(60)
.padding({bottom:20})
// .margin({ right: 12, left: 12 })
// .backgroundColor(Color.Red)
... ...
... ... @@ -161,6 +161,7 @@ export struct CommentIconComponent {
/*展示类型*/
@State type: number = 1
@Prop contentDetail: ContentDetailDTO
@Prop showMainText: boolean = false // 是否显示正文样式
styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
// aboutToAppear(): void {
// setTimeout(() => {
... ... @@ -186,7 +187,7 @@ export struct CommentIconComponent {
// Stack({alignContent:Alignment.Start}) {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
RelativeContainer() {
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
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'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
... ... @@ -205,10 +206,9 @@ export struct CommentIconComponent {
// x:-6
// })
.id("Image")
Text(this.publishCommentModel.totalCommentNumer)// Text("44444444")
Text(this.showMainText?'正文':this.publishCommentModel.totalCommentNumer)// Text("44444444")
.fontSize(8)
.fontColor('#ffffff')// .backgroundColor('#ED2800')
.fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800')
.height(12)
.textAlign(TextAlign.Center)
.alignRules({
... ...
... ... @@ -36,8 +36,8 @@ export struct CompNormalTitle {
.padding({
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
// top: $r('app.float.card_comp_pagePadding_tb'),
// bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
... ...
... ... @@ -41,8 +41,8 @@ export struct ZhGridLayout02NewsContent {
.padding({
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
// top: $r('app.float.card_comp_pagePadding_tb'),
// bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
... ...
... ... @@ -4,9 +4,8 @@ import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { ProcessUtils } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, SPHelper } from 'wdKit';
import { DateTimeUtils, SPHelper,Logger, ToastUtils,EmitterUtils,EmitterEventId } from 'wdKit';
import { LiveModel } from '../../viewmodel/LiveModel'
import { Logger, ToastUtils } from 'wdKit';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { SpConstants } from 'wdConstant/Index'
import { InfomationCardClick } from '../../utils/infomationCardClick';
... ... @@ -94,6 +93,31 @@ export struct ZhSingleRow03 {
this.getReserveState();
}
this.loadImg = await onlyWifiLoadImg();
// 获取预约
EmitterUtils.receiveEvent(EmitterEventId.LIVE_ROOM_SUBSCRIBE, (str?: string) => {
Logger.debug(TAG, 'receiveEvent LIVE_ROOM_SUBSCRIBE: ' + str)
if (str) {
// 跳转指定频道场景,传参底导id、频道id
const model: ReserveItemBean = JSON.parse(str)
for (let contentItem of this.compDTO.operDataList) {
let liveStr = new String(model.liveId)
if (contentItem.objectId == liveStr) {
if (model.subscribe){
this.reservedIds.push(contentItem.objectId.toString())
}else {
let index = this.reservedIds.findIndex(item => item == contentItem.objectId);
if (index > -1) {
this.reservedIds.splice(index, 1);
}
}
let time = DateTimeUtils.getTimeStamp().toString()
this.compDTO.timestamp = time
return
}
}
}
})
}
... ...
... ... @@ -174,7 +174,15 @@ export struct TopNavigationComponentNew {
autoRefresh: this.autoRefresh2Page,
isMourning: mourningCheckFn(`${navItem.channelId}`),
})
.backgroundColor(CompUtils.isRMH(this.navItem)?Color.White:Color.Transparent)
.margin({
left: 6,
right: 6
})
.borderRadius({
topLeft: 6,
topRight: 6
})
.backgroundColor(CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem) ? Color.White : Color.Transparent)
}
/**
... ...
... ... @@ -79,6 +79,7 @@ export struct OperRowListView {
@ObjectLink publishCommentModel: publishCommentModel
@State styleType: number = -1
@State showCommentIcon: boolean = true // 评论图标
@Prop showMainText: boolean = false // 是否显示正文样式
@State bgColor: ResourceColor = Color.White
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
... ... @@ -299,7 +300,8 @@ export struct OperRowListView {
CommentIconComponent({
publishCommentModel: this.publishCommentModel,
styleType: this.styleType,
contentDetail: this.contentDetailData
contentDetail: this.contentDetailData,
showMainText: this.showMainText
})
.onClick(() => {
console.log('akdbakdbakdbaksjd')
... ...
import { DateTimeUtils } from 'wdKit'
@Preview
@CustomDialog
export struct DetailDialog {
... ... @@ -5,6 +7,7 @@ export struct DetailDialog {
@Prop name: string
@Prop title: string
@Prop summary: string
@Prop publishTime: string
@Link isOpenDetail: boolean
build() {
... ... @@ -36,6 +39,16 @@ export struct DetailDialog {
.fontWeight(400)
.margin({ top: 8 })
.lineHeight(21)
Text(DateTimeUtils.formatDate(new Date(this.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.alignItems(HorizontalAlign.Start)
... ...
... ... @@ -130,11 +130,15 @@ export struct PlayerFullScreenView {
Column() {
Text() {
Span(this.upProVal)
.fontColor(Color.White)
Span(' / ')
.fontColor(Color.White)
Span(this.duration)
.fontColor('#888888')
}
.fontSize(24)
.fontColor(Color.White)
.fontWeight(600)
.margin({ bottom: 30 })
.visibility(this.isDragging ? Visibility.Visible : Visibility.None)
... ...
... ... @@ -77,11 +77,14 @@ export struct PlayerProgressView {
Column() {
Text() {
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
.fontColor(Color.White)
Span(' / ')
.fontColor(Color.White)
Span(DateTimeUtils.secondToTime(this.videoDuration))
.fontColor('#888888')
}
.fontSize(24)
.fontColor(Color.White)
.fontWeight(600)
.margin({ bottom: 30 })
.visibility(this.isDragging ? Visibility.Visible : Visibility.None)
... ...
import measure from '@ohos.measure'
import { ContentDetailDTO } from 'wdBean/Index'
import { DetailDialog } from './DetailDialog'
import { componentUtils } from '@kit.ArkUI'
import { DateTimeUtils } from 'wdKit'
const TAG = 'PlayerTitleView';
@Preview
@Component
export struct PlayerTitleView {
... ... @@ -17,20 +17,18 @@ export struct PlayerTitleView {
@State isOverLines: boolean = false
@State isTitleOverLines: boolean = false
@State summary: string = ''
@State private titleLines: number = 0
@State private summaryLines: number = 0
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
name: this.getName(),
title: this.getTitle(),
summary: this.getSummary(),
publishTime: this.getPublishTime(),
isOpenDetail: this.isOpenDetail
}),
cancel:()=>{
cancel: () => {
this.isOpenDetail = !this.isOpenDetail
},
customStyle: true,
... ... @@ -58,6 +56,10 @@ export struct PlayerTitleView {
return this.contentDetailData?.newIntroduction || ''
}
getPublishTime(): string {
return this.contentDetailData?.publishTime || ''
}
/**
* 截断文本
* @param {string} str 要截断的文本 '啊啊啊啊啊'
... ... @@ -74,7 +76,7 @@ export struct PlayerTitleView {
fontSize: fontSize,
fontWeight: 400,
lineHeight: 20,
wordBreak:WordBreak.BREAK_ALL
wordBreak: WordBreak.BREAK_ALL
})
let clipStr: string = ''
for (let i = 0; i < strArr.length; i++) {
... ... @@ -83,7 +85,7 @@ export struct PlayerTitleView {
fontSize: fontSize,
fontWeight: 400,
lineHeight: 20,
wordBreak:WordBreak.BREAK_ALL
wordBreak: WordBreak.BREAK_ALL
}) >= textWidth * maxLines - measureTruncateWidth) {
this.isOverLines = true
break;
... ... @@ -93,6 +95,7 @@ export struct PlayerTitleView {
console.log(TAG, 'clipStr:', clipStr)
return clipStr
}
/**
* 截断文本
* @param {string} str 要截断的文本 '啊啊啊啊啊'
... ... @@ -109,7 +112,7 @@ export struct PlayerTitleView {
fontSize: fontSize,
fontWeight: 600,
lineHeight: 20,
wordBreak:WordBreak.BREAK_ALL
wordBreak: WordBreak.BREAK_ALL
})
let clipStr: string = ''
for (let i = 0; i < strArr.length; i++) {
... ... @@ -118,7 +121,7 @@ export struct PlayerTitleView {
fontSize: fontSize,
fontWeight: 600,
lineHeight: 20,
wordBreak:WordBreak.BREAK_ALL
wordBreak: WordBreak.BREAK_ALL
}) >= textWidth * maxLines - measureTruncateWidth) {
this.isTitleOverLines = true
break;
... ... @@ -145,14 +148,13 @@ export struct PlayerTitleView {
this.summary = this.getSummary()
}
private updateSummaryLines() {
this.summaryLines = Math.max(1, 4 - this.titleLines)
// console.info(`cj2024 titleLines = ${this.titleLines}`)
this.isOverLines = this.summary.length > this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)).length
this.isOverLines = this.summary.length >
this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)).length
}
build() {
Column() {
if (this.getName()) {
... ... @@ -212,7 +214,7 @@ export struct PlayerTitleView {
// })
// }
// } else {
if(this.summary && this.titleLines < 4) {
if (this.summary && this.titleLines < 4) {
Text() {
Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))
.fontSize(14)
... ... @@ -235,8 +237,7 @@ export struct PlayerTitleView {
.height(14)
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.BOTTOM)
.margin({bottom:1})
// .padding({
.margin({ bottom: 1 })// .padding({
// bottom: 4
// })
.onClick(() => {
... ... @@ -247,15 +248,16 @@ export struct PlayerTitleView {
}
}
.padding({
left: 0,//6
left: 0, //6
right: 6,
top: 0,//4
top: 0, //4
bottom: 4
})
}
// }
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(), DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
... ... @@ -274,7 +276,7 @@ export struct PlayerTitleView {
@Builder
titleBuilder() {
Text() {
Span(this.clipTitleText(this.getTitle(), 14, 4, this.windowWidth - 230 - vp2px(50)))
Span(this.clipTitleText(this.getTitle(), 14, 4, this.windowWidth - 234 - vp2px(50)))
.fontSize(15)
.fontColor(Color.White)
.lineHeight(20)
... ... @@ -282,7 +284,7 @@ export struct PlayerTitleView {
.fontFamily('PingFang SC-Regular')
if (this.isTitleOverLines) {
Span('... 全文')
.fontColor('#888888')
.fontColor(Color.White)
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
.fontSize(12)
... ... @@ -295,8 +297,7 @@ export struct PlayerTitleView {
.height(14)
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.BOTTOM)
.margin({bottom:1})
// .padding({
.margin({ bottom: 1 })// .padding({
// bottom: 4
// })
.onClick(() => {
... ... @@ -308,14 +309,14 @@ export struct PlayerTitleView {
}
.onAreaChange((oldArea: Area, newArea: Area) => {
//console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
this.titleLines = Math.floor((newArea.height as number) / 20)// 20是行高
this.titleLines = Math.floor((newArea.height as number) / 20) // 20是行高
//console.info(`cj2024 titleLines = ${this.titleLines}`)
this.updateSummaryLines()
})
.padding({
left: 0,//6
left: 0, //6
right: 6,
top: 0,//4
top: 0, //4
bottom: 4
})
}
... ...
... ... @@ -22,7 +22,7 @@ export class WDShare {
desc: content.shareInfo.shareSummary,
link: content.shareInfo.shareUrl,
deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content),
// posterImg:$r("app.media.test_share_poster"),
posterImg:$r("app.media.test_share_poster"),
}
})
}
... ...