xugenyuan

fix |> (文章配置使用外链),详情页顶部缺少标题;互动区不应显示语音播报按钮

http://192.168.1.3:8080/zentao/bug-view-20517.html

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -42,7 +42,7 @@ export struct H5NewsWebPageComponent {
action: Action = {} as Action
@State webUrl: string = '';
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State recommendList: ContentDTO[] = []
// @State recommendList: ContentDTO[] = []
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State isPageEnd: boolean = false
... ... @@ -58,7 +58,7 @@ export struct H5NewsWebPageComponent {
@State showCommentList: boolean = false
@State index: number = 0
@State currentIndex: number = 0
private navTitle = '人民日报';
@State navTitle: string = ""
build() {
Stack({ alignContent: Alignment.Top }){
... ... @@ -137,13 +137,14 @@ export struct H5NewsWebPageComponent {
console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0]))
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
this.navTitle = this.contentDetailData.newsTitle
let dateTime =
DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
// let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
// this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
if (this.contentDetailData?.recommendShow === 1) {
this.getRecommend()
}
// if (this.contentDetailData?.recommendShow === 1) {
// this.getRecommend()
// }
if (this.contentDetailData?.openLikes === 1) {
console.log(TAG, '点赞this.getInteractDataStatus()')
this.getInteractDataStatus()
... ... @@ -167,10 +168,10 @@ export struct H5NewsWebPageComponent {
if (this.contentDetailData.openLikes === 1) {
this.operationButtonList.push('like')
}
if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length &&
this.contentDetailData?.audioList[0].audioUrl) {
this.operationButtonList.push('listen')
}
// if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length &&
// this.contentDetailData?.audioList[0].audioUrl) {
// this.operationButtonList.push('listen')
// }
this.operationButtonList.push('collect')
if (this.contentDetailData.shareInfo?.shareOpen === 1) {
this.operationButtonList.push('share')
... ... @@ -179,23 +180,23 @@ export struct H5NewsWebPageComponent {
}
}
private async getRecommend() {
let params: postRecommendListParams = {
imei: HttpUtils.getImei(),
userId: HttpUtils.getUserId(),
contentId: String(this.contentDetailData?.newsId),
recType: 1,
contentType: this.contentDetailData?.newsType,
relId: this.contentDetailData?.reLInfo?.relId,
// channelId: String(this.contentDetailData?.reLInfo?.channelId)
}
let recommendList = await DetailViewModel.postRecommendList(params)
if (recommendList.length > 0) {
//推荐列表过滤音频和活动入口
this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13');
}
}
// private async getRecommend() {
// let params: postRecommendListParams = {
// imei: HttpUtils.getImei(),
// userId: HttpUtils.getUserId(),
// contentId: String(this.contentDetailData?.newsId),
// recType: 1,
// contentType: this.contentDetailData?.newsType,
// relId: this.contentDetailData?.reLInfo?.relId,
// // channelId: String(this.contentDetailData?.reLInfo?.channelId)
// }
// let recommendList = await DetailViewModel.postRecommendList(params)
// if (recommendList.length > 0) {
// //推荐列表过滤音频和活动入口
// this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13');
// }
//
// }
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
... ...
... ... @@ -3,7 +3,7 @@ import router from '@ohos.router'
@Component
export struct CustomTitleUI {
imgBack:boolean = true
titleName:ResourceStr = "默认标题"
@Prop titleName: ResourceStr = ""
@Prop percent:number = 1
isShowBottomLine:boolean = false
... ...