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:功能缺陷-【uat】进入视频直播-肌少症--小心跌倒,点击评论按钮,进入全部评论,底部点赞图标显示和android不一致,看图
  fix:人民日报早晚报内容后无法点赞-偶现
  fix:点赞样式设置-祈福或默哀,未登录用户详情页点赞后,触发登录,登录成功后,点击点赞按钮无响应
  fix:【缺省图】视频稿件进入详情后,没有获取到播放数据时,没有展示缺省图
  fix |> 修复搜索模块人民号名称显示<em>标签
... ... @@ -6,6 +6,7 @@ import { HttpUrlUtils, WDHttp } from '../../../../Index';
import { RefreshTokenRes } from '../bean/RefreshTokenRes';
import { ResposeError } from '../bean/ResposeError';
import { HttpUtils } from '../utils/HttpUtils';
// import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
const TAG: string = 'HttpBizUtil'
... ...
... ... @@ -155,11 +155,12 @@ export class ProcessUtils {
return;
}
// 网络出小差了,请检查网络后重试
let netStatus = NetworkUtil.isNetConnected()
if(!netStatus){
ToastUtils.shortToast('网络出小差了,请检查网络后重试')
return
}
// let netStatus = NetworkUtil.isNetConnected()
// if(!netStatus){
// ToastUtils.shortToast('网络出小差了,请检查网络后重试')
// return
// }
let type = content.objectType;
if (typeof type == "number") {
... ...
... ... @@ -48,6 +48,7 @@ export struct ImageAndTextPageComponent {
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State recommendList: ContentDTO[] = []
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State getNewsStatusOfUser: boolean = false // 接口获取点赞、收藏状态,为true时获取失败
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State isPageEnd: boolean = false
@State publishTime: string = ''
... ... @@ -73,6 +74,10 @@ export struct ImageAndTextPageComponent {
pageShowForUpdateData() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
// 未登录查不到稿件收藏状态,导致newsStatusOfUser为undefined,影响后续点赞效果
if(this.getNewsStatusOfUser) {
this.getInteractDataStatus()
}
}
//内容浏览Tracking
... ... @@ -291,7 +296,7 @@ export struct ImageAndTextPageComponent {
if (this.detailContentEmpty) {
this.emptyType = 18
}
console.log(TAG, JSON.stringify(detailBeans))
console.log(TAG, "dl", JSON.stringify(detailBeans))
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
let dateTime =
... ... @@ -302,6 +307,7 @@ export struct ImageAndTextPageComponent {
this.getRecommend()
}
if (this.contentDetailData?.openLikes === 1) {
console.log(TAG, '点赞this.getInteractDataStatus()')
this.getInteractDataStatus()
this.queryContentInteractCount()
}
... ... @@ -364,13 +370,15 @@ export struct ImageAndTextPageComponent {
}
]
}
console.error(TAG, JSON.stringify(this.contentDetailData))
// console.log(TAG,'contentDetailData', JSON.stringify(params.contentList))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
console.error(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
console.log(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
this.getNewsStatusOfUser = false // 获取成功
this.newsStatusOfUser = data[0];
Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
// console.log(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
} catch (exception) {
console.error(TAG, JSON.stringify(exception))
this.getNewsStatusOfUser = true // 获取失败
console.error(TAG,'exception', JSON.stringify(exception))
}
}
... ... @@ -391,13 +399,22 @@ export struct ImageAndTextPageComponent {
}
console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
PageRepository.postExecuteLike(params).then(res => {
console.log(TAG, '点赞、res', JSON.stringify(res))
console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
// console.log(TAG, '点赞、res', JSON.stringify(res))
console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
this.queryContentInteractCount()
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
} else {
this.likeNum = Number(this.likeNum) - 1
}
console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
} else {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
})
... ... @@ -415,7 +432,7 @@ export struct ImageAndTextPageComponent {
}]
}
PageRepository.getContentInteract(params).then(res => {
console.error(TAG, 'res', JSON.stringify(res))
console.error(TAG, 'queryContentInteractCount', JSON.stringify(res))
if (res.data) {
this.interactData = res.data[0]
this.likeNum = Number(res.data[0]?.likeNum) || 0
... ...
... ... @@ -5,6 +5,15 @@ import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
@Component
export struct SearchCreatorComponent{
@ObjectLink item: SearchRmhDescription
userName: string = ''
aboutToAppear(): void {
const userNetName: string = this.item.creatorName;
this.userName = userNetName;
if (userNetName.includes('<em>') && userNetName.includes('</em>')) {
this.userName = userNetName.replaceAll('<em>','').replaceAll('</em>','');
}
}
build() {
Column(){
... ... @@ -26,7 +35,7 @@ export struct SearchCreatorComponent{
.height('92lpx')
.margin({bottom:'15lpx'})
Text(this.item.creatorName)
Text(this.userName)
.fontSize('25lpx')
.fontWeight('400lpx')
.lineHeight('35lpx')
... ...
... ... @@ -58,6 +58,7 @@ export struct LikeComponent {
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
}
console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
console.log(TAG, 'this.componentType', this.componentType)
console.log(TAG, 'this.likesStyle', this.likesStyle)
console.log(TAG, 'this.openLikes', this.openLikes)
this.onDataUpdated()
... ... @@ -93,7 +94,7 @@ export struct LikeComponent {
//卡片底部互动样式
this.likeCompStyle3()
} else if (this.componentType == 4) {
// 直播,点赞按钮底测有灰色圆角背景+右上点赞数量
// 使用包括频道视频底部点赞
this.likeCompStyle4()
} else if (this.componentType == 5) {
// 图集点赞,展示标识
... ... @@ -286,38 +287,57 @@ export struct LikeComponent {
@Builder
likeCompStyle4() {
Stack({ alignContent: Alignment.Bottom }) {
Column() {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.transLikeStyle().url)
.width(24)
.height(24)
.onClick(() => {
this.clickButtonEvent()
})
}
.justifyContent(FlexAlign.Center)
.width(36)
.height(36)
.borderRadius(18)
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
Row() {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))
if (this.likeCount != 0) {
RelativeContainer() {
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
top: 1,
left: 20,
right: 1,
bottom: 1
}
})
.alignRules({
top: { anchor: "Text", align: VerticalAlign.Top },
left: { anchor: "Text", align: HorizontalAlign.Start },
right: { anchor: "Text", align: HorizontalAlign.End },
bottom: { anchor: "Text", align: VerticalAlign.Bottom },
})
.id("Image")
Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444")
.fontSize(8)
.fontColor(Color.White)
.padding({ left: 8, right: 2 })
}
.height(12)
.alignItems(VerticalAlign.Center)
.position({ x: '100%', y: 10 })
.markAnchor({ x: '100%' })
.backgroundImage($r('app.media.ic_like_back'))
.backgroundImageSize({height: 13})
.textAlign(TextAlign.Center)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
/*动态计算文字宽度*/
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +
12)
8)
.padding({left:2})
.id("Text")
.visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
}
.width(36)
.height(42)
.offset({
x: 12
})
}
}
.width(24)
.height(24)
.onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
}
... ...
import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, SPHelper, StringUtils } from 'wdKit';
import {
... ... @@ -322,7 +322,7 @@ export class PageRepository {
*/
static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
return WDHttp.post(url, params)
return HttpBizUtil.post(url, params)
}
/**
... ... @@ -332,7 +332,7 @@ export class PageRepository {
*/
static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getExecuteCollcetUrl()
return WDHttp.post(url, params)
return HttpBizUtil.post(url, params)
}
/**
... ... @@ -364,7 +364,7 @@ export class PageRepository {
*/
private static postInteractAccentionOperateInfo(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
return WDHttp.post(url, params)
return HttpBizUtil.post(url, params)
}
/**
... ...
... ... @@ -228,18 +228,7 @@ export struct DetailVideoListPage {
}
build() {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
} else if (this.isOffLine) {
if (this.netStatus !== undefined || this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
... ...