wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 调整竖屏直播结束页面已关注样式
  ref |> 横屏直播详情无回放时,不展示参与人数
  ref |> 优化竖屏直播结束页面布局
  ref |> 调整竖屏直播结束页面布局
  fix: 号主:甘肃发布,动态视频详情页点击视频,先闪一下获取内容失败,再继续播放视频
  fix |> 修复稿件详情页评论区域滚动到可视区域的问题
  fix |> 17456 无网络号主作品列表缺省图鸿蒙与安卓不一致
  fix: 19083 一多适配--折叠屏,金刚位应等分展示
  fix |> 消息偶现闪退,增加非空判断
  fix: 20451 金刚位-缺少下分割线
  ref |> 调整竖屏直播结束背景样式
  fix: 20455 大专题卡-引用稿件无评论评数,来源右侧多个
  fix |> 17457 无网络时进入协议节目鸿蒙与安卓显示不一致
  fix: 直播预约卡大图border
... ... @@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent {
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
@State executedStartTime: number = new Date().getTime()
private screenHeight: number = 0
... ... @@ -208,8 +207,9 @@ 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)
// console.log(TAG, ">>>>>当前页面滚动位置:", this.scroller.currentOffset().yOffset)
// console.log(TAG, ">>>>>当前评论区位置:", newValue.globalPosition.y as number)
// console.log(TAG, ">>>>>当前屏幕宽度和底部高度:", this.screenHeight,this.bottomHeight)
this.checkToScrollCommentArea()
})
// .onMeasureSize()
... ... @@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent {
* 查询点赞、收藏数量
*/
queryContentInteractCount() {
console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
// console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
const params: contentInteractParams = {
contentId: this.contentDetailData?.newsId + '',
... ... @@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent {
private pageScrollToCommonent() {
const info = componentUtils.getRectangleById('comment');
console.log(TAG, "点击滑动页面", JSON.stringify(info))
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentCommonentOffSetY-200
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
// 定位到评论区域
if (this.isScrollTop) {
if (!this.showMainText) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
... ... @@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent {
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
}
aboutToAppear() {
Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
// Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
this.screenHeight = DisplayUtils.getDeviceHeight()
this.initAnimationConfig();
... ... @@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent {
// 需要评论区位置,调用前 请确保它有值
return
}
let offSetY = this.info?.globalPosition.y as number -60
Logger.debug(TAG, "即将滚动至yOffset: " + offSetY)
let offSetY = this.info?.globalPosition.y as number -70
if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
this.showMainText = false
}else {
... ...
... ... @@ -139,6 +139,38 @@ export struct CardSourceInfo {
return parseInt(date) < twoDaysAgo.getTime()
}
showDot() {
// return (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)) != ''
// || (this.contentDTO.isSearch || this.contentDTO.isCollection ||
// !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
// (Number
// .parseFloat(this
// .contentDTO.publishTime))
// .indexOf
// ('-') === -1)
// )
let flag = false;
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
if (this.showTime() && !this.isEllipsisActive) {
flag = true
} else if (!this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
flag = true;
} else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
flag = true;
}
} else if (this.contentDTO?.author&&this.contentDTO?.author.length > 0) {
flag = true;
}
}
return flag;
}
build() {
Column(){
Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) {
... ... @@ -161,18 +193,7 @@ export struct CardSourceInfo {
}
// 点
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)) != ''
|| (this.contentDTO.isSearch || this.contentDTO.isCollection ||
!this.contentDTO.isSearch && DateTimeUtils.getCommentTime
(Number
.parseFloat(this
.contentDTO.publishTime))
.indexOf
('-') === -1)
)) {
if (this.showDot()) {
Image($r("app.media.point"))
.width(11)
... ...
... ... @@ -54,7 +54,7 @@ export struct behindDivider {
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
}
} else {
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
}
}
}
\ No newline at end of file
... ...
... ... @@ -23,9 +23,11 @@ export struct LiveBigImage01Component {
@State clicked: boolean = false;
index: number = 0
@State isLoadingAttention: boolean = false
@State curRouter: string = ''
async aboutToAppear() {
const curRouter = router.getState().name;
this.curRouter = curRouter;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -38,7 +40,7 @@ export struct LiveBigImage01Component {
.aspectRatio(16 / 9)
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : $r('app.color.color_33A3A3A3'))
.objectFit(ImageFit.Contain)
.borderWidth(0.5)
.borderWidth(this.curRouter !== 'ReserveMorePage' ? 0.5 : 0)
.borderColor($r('app.color.color_0D000000'))
.borderRadius({
topLeft: '4vp',
... ...
... ... @@ -30,8 +30,7 @@ export struct ZhGridLayout03 {
build() {
GridRow({
columns: { sm: listSize, md: 8 },
breakpoints: { value: ['320vp', '520vp', '840vp'] }
columns: listSize,
}) {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
GridCol() {
... ...
... ... @@ -103,7 +103,7 @@ struct InteractMessagePage {
Row(){
Text('共获')
.fontSize(18).height(40).align(Alignment.Bottom)
Text(this.likeNum.toString())
Text(this.likeNum?.toString())
.fontSize(40)
.fontColor(Color.Red)
.fontFamily('BebasNeue')
... ...
import { Logger} from 'wdKit'
import { Logger, ToastUtils} from 'wdKit'
import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
import {
ContentDTO,
... ... @@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent {
// LoadingComponent()
this.LoadingLayout()
} else if (this.viewType == 2) {
ErrorComponent()
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
}.width('100%')
.height('100%')
}else if(this.viewType == 4){
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
... ... @@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent {
this.isLoading = false
if (this.arr.length == 0) {
this.viewType = 2
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
... ...
... ... @@ -258,7 +258,7 @@ export struct PlayUIComponent {
.fontWeight(400)
.fontColor(Color.White)
if (this.liveRoomDataBean.pv > 0) {
if (this.liveRoomDataBean.pv > 0 && !StringUtils.isEmpty(this.liveUrl)) {
Image($r('app.media.icon_live_player_status_end'))
.width(12)
.height(12)
... ...
... ... @@ -82,6 +82,8 @@ export struct PlayerEndView {
}
build() {
Stack() {
Image(($r('app.media.live_detail_end_bg')))
Column() {
Text('直播已结束').fontWeight(500)
.fontSize(20)
... ... @@ -89,6 +91,19 @@ export struct PlayerEndView {
.padding({ bottom: 40, top: 120 })
Stack() {
if (this.contentDetailData.rmhInfo != null) {
Row() {
Image($r("app.media.live_end_BG_l"))
.width(307/2.0)
.height(254)
Image($r("app.media.live_end_BG_r"))
.width(307/2.0)
.height(254)
}
// .width(307)
// .height(254)
// .backgroundColor(Color.Red)
}
Column() {
if (this.contentDetailData.rmhInfo != null) {
Text(this.contentDetailData?.rmhInfo?.rmhName)
... ... @@ -102,22 +117,26 @@ export struct PlayerEndView {
.fontColor('#B2FFFFFF')
.padding({ top: 8 })
}
Stack() {
Row() {
Column() {
Text(this.duration).fontWeight(600).fontSize(24).fontColor(Color.White)
Text('直播时长').fontWeight(400).fontSize(13).fontColor(Color.White)
Text(this.duration).fontWeight(600).fontSize(20).fontColor(Color.White)
Text('直播时长').fontWeight(400).fontSize(12).fontColor(Color.White)
}
Text('').width(1).height(32).margin({ left: 36, right: 36 }).backgroundColor('#33FFFFFF')
Blank().width(1).height(32).margin({ left: 36, right: 36 })
Column() {
Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || ''))
.fontWeight(600)
.fontSize(24)
.fontSize(20)
.fontColor(Color.White)
Text('观看人数').fontWeight(400).fontSize(13).fontColor(Color.White)
Text('观看人数').fontWeight(400).fontSize(12).fontColor(Color.White)
}
}
.padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 })
Text('').width(1).height(32).margin({ left: 36, right: 36,top:this.contentDetailData.rmhInfo == null ? 26 : 16 }).backgroundColor('#33FFFFFF')
}
if (this.contentDetailData.rmhInfo != null) {
Row() {
Text(this.followStatus == '0' ? '关注' : '已关注')
... ... @@ -130,7 +149,7 @@ export struct PlayerEndView {
left: 122,
right: 122
})
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : '#CCCCCC')
.borderRadius(4)
.onClick(() => {
this.handleAccention()
... ... @@ -141,16 +160,16 @@ export struct PlayerEndView {
}
.width(307)
.height(this.contentDetailData.rmhInfo == null ? 100 : 254)
.backgroundColor('#999999')
.backgroundColor(this.contentDetailData.rmhInfo == null ? '#12ffffff' : '')
.borderRadius(4)
if (this.contentDetailData.rmhInfo != null) {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.width(80)
.height(80)
.borderRadius(40)
.borderWidth(1)
.borderColor(Color.White)
.borderStyle(BorderStyle.Solid)
// .borderWidth(1)
// .borderColor(Color.White)
// .borderStyle(BorderStyle.Solid)
.position({ x: '50%', y: 0 })
.markAnchor({ x: '50%', y: '50%' })
}
... ... @@ -181,6 +200,12 @@ export struct PlayerEndView {
}
.height('100%')
.width('100%')
// .align(Alignment.Center)
.justifyContent(FlexAlign.Center)
}
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -100,7 +100,7 @@ export struct DetailVideoListPage {
aboutToAppear() {
// 在视频详情页
this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
// console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
if (this.peopleShipHomeCreatorId) {
// 从人民号号主传过来的
this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
... ... @@ -112,6 +112,10 @@ export struct DetailVideoListPage {
}
async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) {
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen();
const action: Action = router.getParams() as Action;
if (action) {
... ... @@ -120,10 +124,14 @@ export struct DetailVideoListPage {
this.relId = action.params.extra.relId || '';
this.relType = action.params.extra.relType || '';
}
console.info(`cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
await this.getContentDetail(this.contentId, this.relId, this.relType)
// console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
}
} else {
// 无网络
this.netStatus = 1
}
}
aboutToDisappear(): void {
... ... @@ -249,8 +257,8 @@ export struct DetailVideoListPage {
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
this.isOffLine = resDTO.data == null ? true : false
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data) {
const params: contentListParams = {
contentList: [{
... ... @@ -288,7 +296,7 @@ export struct DetailVideoListPage {
pageSize: pageSize,
refreshTime: refreshTime
}).then(async (resDTO: ResponseDTO<PeopleShipNextListDTO>) => {
console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data))
// console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data))
this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data && resDTO.data.list && resDTO.data.list.length > 0) {
const params: contentListParams = {
... ... @@ -321,7 +329,7 @@ export struct DetailVideoListPage {
refreshCnt: 1
}).then(async res => {
if (res.data) {
console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data))
// console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data))
await this.getContentInteract(res.data)
this.data = this.data.concat(res.data)
// console.log('视频列表===', JSON.stringify(res.data))
... ...
import { CommonConstants } from 'wdConstant';
import { Logger } from 'wdKit';
import { router } from '@kit.ArkUI';
const TAG = 'EmptyComponent';
... ... @@ -19,11 +20,15 @@ export const enum WDViewDefaultType {
@Preview
@Component
export struct EmptyComponent {
// private emptySize: SizeOptions = {};
@State emptyWidth: string | number = CommonConstants.FULL_PARENT;
@State emptyHeight: string | number = CommonConstants.FULL_PARENT;
@State emptyType: number = WDViewDefaultType.WDViewDefaultType_NoNetwork; // 缺省图类型,传枚举
@State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举
@State emptyButton: boolean = false
@State isBlack: boolean = false // 背景是否为黑色 默认白色
@State timeNum: number = 10
///占位图上是否显示返回按钮
@State showBackButton: boolean = true
/**
* The empty image width percentage setting.
*/
... ... @@ -39,13 +44,27 @@ export struct EmptyComponent {
/**
* The empty data text opacity.
*/
readonly TEXT_OPACITY: number = 0.4;
private timer: number = -1
readonly TEXT_OPACITY: number = 1.0;
retry: () => void = () => {
}
build() {
Stack({alignContent:Alignment.Bottom}) {
this.noProgrammeData();
if (this.showBackButton) {
Image($r("app.media.icon_arrow_left_white"))
.width(24)
.height(24)
.onClick(() => {
router.back();
})
.position({
bottom: 15,
left: 16
})
}
}
}
/**
... ... @@ -64,17 +83,18 @@ export struct EmptyComponent {
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
.fontColor('#666666')
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
if (this.isShowButton()) {
if (this.emptyType !== 15) {
if (this.emptyType !== 15 && !this.isBlack) {
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor('#fffffff')
.backgroundColor(Color.White)
.fontColor('#FF666666')
.border({ width: 1 })
.borderColor('#FFEDEDED')
... ... @@ -106,7 +126,9 @@ export struct EmptyComponent {
}
.justifyContent(FlexAlign.Center)
.width(this.emptyWidth)
.layoutWeight(1)
.height(this.emptyHeight)
}
buildNoDataTip(): string {
... ... @@ -120,7 +142,7 @@ export struct EmptyComponent {
buildNoDataTipImage(): Resource | string {
Logger.info(TAG, "buildNoDataTip");
let imageString: Resource | string = ""
let imageString: Resource | string = $r('app.media.icon_no_net1')
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
imageString = $r('app.media.icon_no_net1')
}
... ... @@ -128,7 +150,7 @@ export struct EmptyComponent {
}
isShowButton() {
if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15 && this.emptyButton) {
return true
} else {
return false
... ...