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 |> 修复竖屏直播结束页展示,和安卓不一致问题
  fix: 【生产】搜索页面,点击热门搜索词后,搜索结果页,缺少评论和点赞按钮。
... ... @@ -503,6 +503,31 @@ export class DateTimeUtils {
}
}
static liveDurationSecondToTime(seconds: number) {
let time = ''
if (seconds < 60) {
return '0时0分'
}
let days = Math.floor(seconds/this.SECONDS_IN_DAY)
let hours = Math.floor(seconds%this.SECONDS_IN_DAY/this.SECONDS_IN_HOUR)
let minutes = Math.floor(seconds%this.SECONDS_IN_DAY%this.SECONDS_IN_HOUR/this.SECONDS_IN_MINUTE)
if (days > 0) {
time = time + days.toString()+"天"
}
if (hours > 0 || minutes > 0) {
time = time + hours.toString() + "时"
}
if (minutes > 0 || (days == 0 && hours > 0)) {
time = time + minutes.toString() + "分"
}
return time
}
static padding(num: string) {
let length = 2;
for (let len = (num.toString()).length; len < length; len = num.length) {
... ...
... ... @@ -54,7 +54,11 @@ export struct CardParser {
}
build() {
this.contentBuilder(this.contentDTO);
Column() {
// Text('CardParser')
// Text(JSON.stringify(this.contentDTO.appStyle))
this.contentBuilder(this.contentDTO);
}
}
@Builder
... ...
... ... @@ -23,6 +23,8 @@ export struct CarderInteraction {
@State likeBean: Record<string, string> = {}
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@State isShowComment: boolean = false // 是否显示评论
@State isShowLike: boolean = false // 是否显示点赞
@Provide pageName: string = TrackConstants.PageName.DynamicDetail
@Provide pageId: string = TrackConstants.PageName.DynamicDetail
... ... @@ -35,13 +37,19 @@ export struct CarderInteraction {
this.likeBean['title'] = this.contentDetailData.newsTitle + ''
this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
this.contentDTO.shareFlag = this.contentDTO.shareFlag?this.contentDTO.shareFlag:'1'
this.contentDTO.shareFlag = this.contentDTO.shareFlag ? this.contentDTO.shareFlag : '1'
console.log('是否显示分享',this.contentDTO.shareFlag)
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
this.isShowComment = this.buildDisplayComment()
this.isShowLike = this.buildDisplayLike()
// console.log(TAG, 'this.isShowComment', this.isShowComment)
// console.log(TAG, 'this.isShowLike', this.isShowLike)
// console.log(TAG, 'router.getState().name', router.getState().name)
}
build() {
Row() {
if(this.contentDetailData?.shareInfo?.shareOpen === 1){
... ... @@ -61,10 +69,14 @@ export struct CarderInteraction {
}
if(this.contentDetailData?.openComment == 1 || router.getState().name === 'PeopleShipHomePage'){
if (this.buildDisplayComment()) this.commentLayout()
if (this.isShowComment) {
this.commentLayout()
}
}
if(this.buildDisplayLike()) this.builderLike()
if(this.isShowLike) {
this.builderLike()
}
}
.width('100%')
.margin({ top: 11 })
... ... @@ -99,12 +111,10 @@ export struct CarderInteraction {
@Builder
builderLike() {
Row() {
if (this.likeBean?.contentId) {
LikeComponent({
data: this.likeBean,
componentType: 3
})
}
LikeComponent({
data: this.likeBean,
componentType: 3
})
}
.visibility(this.likesStyle == 4 || !this.openLikes ? Visibility.None : Visibility.Visible)
}
... ... @@ -117,7 +127,8 @@ export struct CarderInteraction {
let data = await MultiPictureDetailViewModel.getDetailData(this.contentDTO.relId, this.contentDTO.objectId,
this.contentDTO.relType)
this.contentDetailData = data[0];
console.log('动态详情', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'this.contentDetailData.rmhInfo', JSON.stringify(this.contentDetailData.rmhInfo))
} catch (exception) {
console.log('请求失败', JSON.stringify(exception))
}
... ... @@ -125,32 +136,27 @@ export struct CarderInteraction {
///是否展示评论
buildDisplayComment(): boolean {
let isDisplay = false
if (this.contentDTO.rmhInfo) {
if (this.contentDTO.rmhInfo.cnIsComment === 1 && this.contentDTO.openComment === 1) {
isDisplay = true
}
}else {
if (this.contentDTO.openComment === 1) {
isDisplay = true
}
// console.log(TAG, 'buildDisplayComment this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'buildDisplayComment this.contentDetailData.rmhInfo', JSON.stringify(this.contentDetailData.rmhInfo))
const hasRmhInfo = this.contentDetailData && this.contentDetailData.rmhInfo;
if (hasRmhInfo) {
return this.contentDetailData?.rmhInfo!.cnlsComment === 1 && this.contentDetailData.openComment === 1;
}
return isDisplay
return this.contentDetailData?.openComment === 1;
}
///是否展示点赞
buildDisplayLike(): boolean {
let isDisplay = false
if (this.contentDTO.rmhInfo) {
if (this.contentDTO.rmhInfo.cnIsLike === 1 && this.contentDTO.openLikes === 1) {
isDisplay = true
}
}else {
if (this.contentDTO.openLikes === 1) {
isDisplay = true
}
// console.log(TAG, 'buildDisplayLike this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'buildDisplayLike this.contentDetailData.rmhInfo', JSON.stringify(this.contentDetailData.rmhInfo))
const hasRmhInfo = this.contentDetailData && this.contentDetailData.rmhInfo;
if (hasRmhInfo) {
return this.contentDetailData?.rmhInfo!.cnlsLike === 1 && this.contentDetailData.openLikes === 1;
}
return isDisplay
return this.contentDetailData?.openLikes === 1;
}
}
... ...
... ... @@ -72,6 +72,7 @@ export struct CompParser {
build() {
Column() {
// Text('CompParser')
// Text(JSON.stringify(this.compDTO.compStyle))
this.componentBuilder();
}
... ...
... ... @@ -20,12 +20,18 @@ export struct PlayerEndView {
}
aboutToAppear(): void {
this.calculateLiveDuration()
this.getBatchAttentionStatus()
}
calculateLiveDuration() {
const sn =
DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
let en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
if (this.contentDetailData.liveInfo?.endTime == null) {
en = DateTimeUtils.getTimeStamp()
}
const sd = DateTimeUtils.getDuration(sn, en)
this.duration = DateTimeUtils.secondToTime(sd / 1000)
this.getBatchAttentionStatus()
this.duration = DateTimeUtils.liveDurationSecondToTime(sd / 1000)
}
/**
... ... @@ -84,21 +90,22 @@ export struct PlayerEndView {
Stack() {
Column() {
Text(this.contentDetailData?.rmhInfo?.rmhName)
.fontWeight(400)
.fontSize(18)
.fontColor(Color.White)
.padding({ top: 52 })
Text(this.contentDetailData?.rmhInfo?.rmhDesc || '')
.fontWeight(400)
.fontSize(13)
.fontColor('#B2FFFFFF')
.padding({ top: 8 })
if (this.contentDetailData.rmhInfo != null) {
Text(this.contentDetailData?.rmhInfo?.rmhName)
.fontWeight(400)
.fontSize(18)
.fontColor(Color.White)
.padding({ top: 52 })
Text(this.contentDetailData?.rmhInfo?.rmhDesc || '')
.fontWeight(400)
.fontSize(13)
.fontColor('#B2FFFFFF')
.padding({ top: 8 })
}
Row() {
Column() {
Text(this.duration).fontWeight(600).fontSize(24).fontColor(Color.White)
Text('时长').fontWeight(400).fontSize(13).fontColor(Color.White)
Text('直播时长').fontWeight(400).fontSize(13).fontColor(Color.White)
}
Text('').width(1).height(32).margin({ left: 36, right: 36 }).backgroundColor('#33FFFFFF')
... ... @@ -110,30 +117,30 @@ export struct PlayerEndView {
Text('观看人数').fontWeight(400).fontSize(13).fontColor(Color.White)
}
}
.padding({ top: 16 })
Row() {
Text(this.followStatus == '0' ? '关注' : '已关注')
.fontWeight(400)
.fontSize(16)
.fontColor(Color.White)
.padding({
top: 8,
bottom: 8,
left: 122,
right: 122
})
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
.borderRadius(4)
.onClick(() => {
this.handleAccention()
})
.padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 })
if (this.contentDetailData.rmhInfo != null) {
Row() {
Text(this.followStatus == '0' ? '关注' : '已关注')
.fontWeight(400)
.fontSize(16)
.fontColor(Color.White)
.padding({
top: 8,
bottom: 8,
left: 122,
right: 122
})
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
.borderRadius(4)
.onClick(() => {
this.handleAccention()
})
}
.padding({ top: 24 })
}
.padding({ top: 24 })
}
.width(307)
.height(254)
.height(this.contentDetailData.rmhInfo == null ? 100 : 254)
.backgroundColor('#999999')
.borderRadius(4)
if (this.contentDetailData.rmhInfo != null) {
... ...