wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 20476 图文详情页,视频播放完成后的重播按钮,不应半透明
  fix: 19347 卡片来源显示规则-来源过长时,不符合省略优先级
  fix |> 19826 搜索结果,点击内容,提示内容不存在,页面会闪黑边,见比对视频
  ref |> 直播详情直播间和大家聊,以及竖屏直播结束页面头像添加占位图
  Revert "ref |> 横屏直播详情无回放时,不展示参与人数"
  fix |> 稿件详情页-GIF动图评论不展示
  ref |> 热门评论最后一条与分割线间距过小,见截图
  fix |> 20506 人民号频道,切换推荐和关注tab,选中tab标题不应上抬。
... ... @@ -315,8 +315,7 @@ export struct WdWebLocalComponent {
Text('重播').fontColor(Color.White).fontSize(14)
}
.backgroundColor(Color.Black)
.opacity(0.5)
.backgroundColor("#80000000")
.justifyContent(FlexAlign.Center)
.width(this.positionWidth)
.height(this.positionHeight)
... ...
... ... @@ -3,6 +3,8 @@ import { CommonConstants, CompStyle } from 'wdConstant/Index';
import { DateTimeUtils, Logger } from 'wdKit/Index';
import router from '@ohos.router'
import { SearchShowRed, textItem, titleInitRes } from '../../utils/searchShowRed';
import measure from '@ohos.measure'
import display from '@ohos.display';
@Reusable
@Component
... ... @@ -20,10 +22,13 @@ export struct CardSourceInfo {
@State authorMarked: boolean = false;
@State authorArr: textItem[] = []
@State onlyShowCornerAndSource: boolean = false;
aboutToAppear(): void {
this.processText();
this.titleInit();
this.calcContentSpace();
}
titleInit() {
... ... @@ -171,6 +176,48 @@ export struct CardSourceInfo {
return flag;
}
getContentSize(textContent: string, fontSize: number ) {
return px2vp(Number(measure.measureTextSize({
textContent,
fontSize
}).width))
}
calcContentSpace() {
if (this.isLimited()) return;
const screenWidth = px2vp(display.getDefaultDisplaySync().width)
let leftSpace = screenWidth;
const souceSize = this.getContentSize(this.displayText, 12);
const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12);
const dotSize = 11;
const timeSize = this.getContentSize(this.handleTimeStr(), 12);
const commentNum = this.getContentDtoBean()?.interactData?.commentNum
let commentSize = 0;
if (commentNum) {
commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12);
}
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
leftSpace = leftSpace - cornerSize
}
if (this.showTime()) {
leftSpace = leftSpace - dotSize - timeSize
}
if (!this.isEllipsisActive) {
leftSpace = leftSpace - dotSize - commentSize
}
if (leftSpace < souceSize) {
this.onlyShowCornerAndSource = true;
}
}
build() {
Column(){
Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) {
... ... @@ -192,6 +239,7 @@ export struct CardSourceInfo {
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
if (!this.onlyShowCornerAndSource) {
// 点
if (this.showDot()) {
... ... @@ -232,6 +280,8 @@ export struct CardSourceInfo {
}
}
}
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -260,6 +310,7 @@ export struct CardSourceInfo {
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: this.viewShowData ? 8 : 0 })
.clip(true)
}
... ... @@ -268,13 +319,17 @@ export struct CardSourceInfo {
* @returns
*/
private getContentDtoBean(): ContentDTO {
let content = new ContentDTO
if (this.compDTO == undefined) {
return this.contentDTO
content = this.contentDTO
}
if (this.compDTO.operDataList.length == 0) {
return this.contentDTO
content = this.contentDTO
}
if (!content) {
content = this.compDTO.operDataList[0]
}
return this.compDTO.operDataList[0]
return content;
}
/**
... ...
... ... @@ -11,6 +11,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
import { ToastUtils } from 'wdKit';
import MinePageDatasModel from '../../model/MinePageDatasModel';
const TAG: string = 'Card2Component'
/**
... ... @@ -140,7 +142,22 @@ export struct Card2Component {
this.clicked = true;
}
persistentStorage(this.contentDTO.objectId);
this.jumpDetail()
})
}
/**
* 是否需要判断某种类型才需要判断内容是否存在的场景,目前测试没发现问题
*/
jumpDetail(){
MinePageDatasModel.getAssertDetailData(this.contentDTO.relId,this.contentDTO.objectId,this.contentDTO.relType).then((value) => {
if(value == "1"){
ProcessUtils.processPage(this.contentDTO)
}else{
ToastUtils.shortToast("内容不存在")
}
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
})
}
}
... ...
... ... @@ -131,6 +131,7 @@ export struct CommentComponent {
Column() {
if (showGapLine) {
Blank().height(12)
Divider().strokeWidth(6).color('#f5f5f5')
}
... ... @@ -493,7 +494,11 @@ struct ChildCommentItem {
.onClick(() => {
this.replyComment()
})
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 95})
}
commentFooterView({
item: this.item,
... ... @@ -712,6 +717,12 @@ struct commentHeaderView {
this.replyComment()
})
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 60})
}
commentFooterView({
item: this.item,
dialogController: this.dialogController,
... ...
... ... @@ -260,7 +260,7 @@ export struct TopNavigationComponentNew {
buildTabBarItems(mourningCheckFn: (channelId: string) => boolean) {
ForEach(this.topNavList, (navItem: TopNavDTO, index: number) => {
ListItem() {
this.tabBarBuilder(navItem, index)
this.tabBarBuilder(navItem, index,true)
}
.grayscale(mourningCheckFn(`${navItem.channelId}`) ? 1 : 0)
});
... ... @@ -374,7 +374,7 @@ export struct TopNavigationComponentNew {
* @param index
*/
@Builder
tabBarBuilder(item: TopNavDTO, index: number) {
tabBarBuilder(item: TopNavDTO, index: number,isRmh:boolean = false) {
Column() {
if (item.iconUrl && item.iconCUrl) {
... ... @@ -398,11 +398,17 @@ export struct TopNavigationComponentNew {
})
.maxLines(this.MAX_LINE)
.id(index.toString())
if(isRmh){
Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
.visibility(this.currentTopNavSelectedIndex === index?Visibility.Visible:Visibility.Hidden)
}else{
if (this.currentTopNavSelectedIndex === index) {
Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
}
}
}
... ...
... ... @@ -18,8 +18,8 @@ export struct TabChatItemComponent {
build() {
Row() {
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') :
this.item.senderUserAvatarUrl)
Image(this.item.senderUserAvatarUrl)
.alt($r('app.media.default_head'))
.borderRadius(90)
.width(24)
.height(24)
... ...
... ... @@ -16,7 +16,8 @@ export struct TabLiveItemComponent {
build() {
Column() {
Row() {
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl)
Image(this.item.senderUserAvatarUrl)
.alt($r('app.media.default_head'))
.borderRadius(90)
.width(24)
.height(24)
... ...
... ... @@ -258,7 +258,7 @@ export struct PlayUIComponent {
.fontWeight(400)
.fontColor(Color.White)
if (this.liveRoomDataBean.pv > 0 && !StringUtils.isEmpty(this.liveUrl)) {
if (this.liveRoomDataBean.pv > 0) {
Image($r('app.media.icon_live_player_status_end'))
.width(12)
.height(12)
... ...
... ... @@ -164,6 +164,7 @@ export struct PlayerEndView {
.borderRadius(4)
if (this.contentDetailData.rmhInfo != null) {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.alt($r('app.media.default_head'))
.width(80)
.height(80)
.borderRadius(40)
... ...