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 |> 17397 【疑难】号主页-关注列表_我的,取消关注、后方数据上移动态效果与安卓不一致
  fix:  进入视频,点击评论,点击视频播放区域切换卡顿
  fix |> 采集数据稿件详情页,顶部左上角不应展示人民号logo
  fix |> 修复缺陷-20501 直播间,输入评论信息后关闭评论弹窗,未保存评论信息,再次弹出评论弹窗时,输入框为空
  fix:  断网,进入沉浸式播放鸿蒙默认缺省图背景颜色不正确
  fix: 18287 UI还原问题-【uat】视频详情页,点击评论,已点击点赞按钮样式和android不一致
  fix: 4G网络下,播放视频,流量费用提醒,鸿蒙版字体偏小,见截图
  ref |> 调整竖屏直播说两句高度
  fix: 20308 功能缺陷-直播预告列表,左边开播时间高度应与右侧预约按钮高度一致
  fix: 误提交
  fix: 19347 卡片来源显示规则-来源过长时,不符合省略优先级
  fix: 早晚报语音播放时,进入稿件详情,对稿件中的视频播放,语音没有暂停
  fix: 早晚报语音播放时,进入稿件详情,对稿件中的视频播放,语音没有暂停
  fix: 沉浸式播放时关闭网络,上滑视频,视频一直loading,恢复网络后,视频无法自动播放
... ... @@ -12,6 +12,7 @@
"wdJsBridge": "file:../wdJsBridge",
"wdBean": "file:../../features/wdBean",
"wdRouter": "file:../wdRouter",
"wdNetwork": "file:../wdNetwork"
"wdNetwork": "file:../wdNetwork",
"wdPlayer": "file:../../features/wdPlayer"
}
}
... ...
... ... @@ -7,6 +7,8 @@ import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
import { DateTimeUtils,EmitterUtils,EmitterEventId } from 'wdKit'
import { window } from '@kit.ArkUI';
import { NativeCallH5Type,NativeCallH5Event,eventParams } from './NativeCallH5Type';
import { AudioSuspensionModel } from '../viewmodel/AudioSuspensionModel'
import { BusinessError } from '@kit.BasicServicesKit';
const TAG = 'WdWebLocalComponent';
... ... @@ -44,6 +46,8 @@ export struct WdWebLocalComponent {
@Consume @Watch('pageShowForUpdateData') pageShow :number
@Consume @Watch('pageHideForUpdateData') pageHide :number
private AudioSuspension = new AudioSuspensionModel()
currentChanged(){
///折叠屏转换 暂停播放器
this.controller.pause()
... ... @@ -186,6 +190,19 @@ export struct WdWebLocalComponent {
}
}
}
// 暂停音频悬浮窗
pauseAudioCom() {
// 判断当前窗口是否已显示,使用callback异步回调。
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
return;
}
if(data) {
this.AudioSuspension.playerController.get()?.pause();
}
});
}
//播放视频
private setCurrentPageOperate9: (data: Message) => void = (data) => {
if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate && data?.data?.operateType === '9') {
... ... @@ -235,6 +252,7 @@ export struct WdWebLocalComponent {
this.cancelProgressTimer()
this.controller.start()
this.startProgressTimer()
this.pauseAudioCom()
}
startProgressTimer() {
... ...
import window from '@ohos.window';
import { Logger } from 'wdKit';
import { BackgroundAudioController, WDPlayerController } from 'wdPlayer';
import { BusinessError } from '@ohos.base';
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
const TAG = 'AudioSuspensionModel'
/**
* 音频悬浮窗公共方法类
*/
export class AudioSuspensionModel {
public playerController: SubscribedAbstractProperty<WDPlayerController> = AppStorage.link<WDPlayerController>('playerController')
public floatWindowClass: SubscribedAbstractProperty<window.Window> = AppStorage.link<window.Window>('floatWindowClass')
public srcTitle: string = ''
private url: string = ''
// 窗口是否最小化
private isMinimize: SubscribedAbstractProperty<boolean> = AppStorage.link<boolean>('isMinimize')
constructor() {
this.initPlayerController()
}
/**
* 判断音频实例是否已存在,不存在则创建
*/
private initPlayerController() {
if(this.playerController === undefined) {
// Logger.info(TAG, 'playerController undefined')
AppStorage.setOrCreate('playerController', new WDPlayerController({loop: false}));
this.playerController = AppStorage.link<WDPlayerController>('playerController')
// Logger.info(TAG, 'playerController create success')
this.playerController.get().onStatusChange = (status: number) => {
// console.info(TAG, 'this.currentStatus Model', status)
EmitterUtils.sendEvent(EmitterEventId.AUDIO_CHANGE_STATUS, status)
}
} else {
// Logger.info(TAG, 'playerController already exit')
}
}
/**
* 配置音频地址
*/
public async setPlayerUrl(url: string, srcTitle: string, srcContentId?: string, srcSource?: string) {
/*console.log(TAG,'this.url', this.url)
console.log(TAG,'url', url)*/
this.playerController.get().keepOnBackground = true
BackgroundAudioController.sharedController().avplayerController = this.playerController.get()
await BackgroundAudioController.sharedController().createSession()
// BackgroundAudioController.sharedController().startContinuousTask()
BackgroundAudioController.sharedController().listenPlayEvents()
await BackgroundAudioController.sharedController().setSessionMetaData(srcContentId ?? "", srcTitle, $r("app.media.system_audio_icon_bk_center"), srcSource ?? "")
BackgroundAudioController.sharedController().stopUseFeatures()
if (this.url === url) {
this.isMinimize = AppStorage.link<boolean>('isMinimize')
// console.log(TAG, 'this.isMinimize', this.isMinimize?.get())
if (this.isMinimize?.get()) {
EmitterUtils.sendEvent(EmitterEventId.AUDIO_WINDOW_EXPAND, 1)
AppStorage.setOrCreate('isMinimize', false);
this.playerController.get().resetPlay()
} else {
this.playerController.get().switchPlayOrPause()
}
} else {
this.url = url
this.playerController.get().firstPlay(url)
this.playerController.get().onCanplay = () => {
this.playerController.get().play()
}
this.srcTitle = srcTitle
EmitterUtils.sendEvent(EmitterEventId.AUDIO_CHANGE_TITLe, this.srcTitle)
EmitterUtils.sendEvent(EmitterEventId.AUDIO_WINDOW_EXPAND, 1)
}
this.showWindow()
}
// 显示悬浮窗。
public showWindow() {
// 判断当前窗口是否已显示,使用callback异步回调。
this.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
if(data === false) {
// 显示当前窗口,使用callback异步回调。
this.floatWindowClass.get().showWindow((err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'floatWindowClass Failed to show the window. Cause: ' + JSON.stringify(err));
return;
}
// console.info(TAG, 'floatWindowClass Succeeded in showing the window.');
});
}
});
}
// 设置悬浮窗尺寸
public resizeWindow(width: number, height: number) {
this.floatWindowClass.get().resize(width, height, (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'floatWindowClass Failed to change the window size. Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'floatWindowClass Succeeded in changing the window size.');
});
}
// 隐藏悬浮窗
public minimize() {
this.floatWindowClass.get().minimize((err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed to minimize the window. Cause: ' + JSON.stringify(err));
return;
}
AppStorage.setOrCreate('isMinimize', true);
// console.info(TAG, 'Succeeded in minimizing the window.');
});
}
}
\ No newline at end of file
... ...
... ... @@ -139,29 +139,7 @@ export struct DynamicDetailComponent {
build() {
Column() {
//logo、日期
Row() {
Image($r('app.media.ic_article_rmh'))
.width($r('app.float.margin_80'))
.height($r('app.float.margin_28'))
.margin({ left: $r('app.float.margin_16') })
Blank()
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_28'))
.margin({ right: $r('app.float.margin_16') })
}
.height($r('app.float.margin_48'))
.width('100%')
.alignItems(VerticalAlign.Bottom)
.padding({ bottom: 5 })
.margin({top: `${this.topSafeHeight}px`})
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_6'))
.padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
this.topNav()
Stack({ alignContent: Alignment.Bottom }) {
if (!this.isNetConnected) {
EmptyComponent({
... ... @@ -704,6 +682,72 @@ export struct DynamicDetailComponent {
.height('100%')
}
@Builder topNav() {
//logo、日期
Row() {
Image($r('app.media.ic_article_rmh'))
.width($r('app.float.margin_80'))
.height($r('app.float.margin_28'))
.margin({ left: $r('app.float.margin_16') })
Blank()
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_28'))
.margin({ right: $r('app.float.margin_16') })
}
.height($r('app.float.margin_48'))
.width('100%')
.alignItems(VerticalAlign.Bottom)
.padding({ bottom: 5 })
.margin({top: `${this.topSafeHeight}px`})
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_6'))
.padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
// 发布时间 ,TODO:需要参考文章详情
// Column() {
// Row() {
// if (this.isNetConnected && this.contentDetailData) {
// if (this.contentDetailData.rmhPlatform == 1) { // 人民号
// if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号
// Blank().height(1)
// } else {
// Image($r('app.media.logo_rmh')).width(80) .height(28)
// }
// } else if (this.contentDetailData.rmhPlatform == 2) { // 普通用户
// Blank().height(1)
// } else {
// Image($r('app.media.logo_rmrb')).width(80) .height(28)
// }
// Text(this.publishTime)
// .fontColor($r('app.color.color_B0B0B0'))
// .fontSize(13)
// .height(20)
// }
// }
// .width(CommonConstants.FULL_WIDTH)
// .height($r('app.float.margin_48'))
// .padding({ left: 15, right: 15, })
// .justifyContent(FlexAlign.SpaceBetween)
// .alignItems(VerticalAlign.Bottom)
//
// // if (this.isNetConnected && !this.detailContentEmpty) {
// Row() {
// Image($r('app.media.ic_news_detail_division'))
// .width('100%')
// .height(6)
// .margin({ top: 10 })
// .objectFit(ImageFit.Fill)
// }
// .padding({ left: 15, right: 15 })
// .backgroundColor(Color.White)
// // }
// }.backgroundColor(Color.White)
}
private titleText() {
if(!StringUtils.isEmpty(this.contentDetailData.newsContent)){
return this.contentDetailData.newsContent
... ...
... ... @@ -265,9 +265,17 @@ export struct ImageAndTextPageComponent {
Column() {
Row() {
if (this.isNetConnected && !this.detailContentEmpty) {
Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
.width(80)
.height(28)
if (this.contentDetailData.rmhPlatform == 1) { // 人民号
if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号
Blank().height(1)
} else {
Image($r('app.media.logo_rmh')).width(80) .height(28)
}
} else if (this.contentDetailData.rmhPlatform == 2) { // 普通用户
Blank().height(1)
} else {
Image($r('app.media.logo_rmrb')).width(80) .height(28)
}
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(13)
... ...
... ... @@ -189,21 +189,26 @@ export struct CardSourceInfo {
}
calcContentSpace() {
console.log('display-text ,', this.displayText)
if (this.isLimited()) return;
const screenWidth = px2vp(display.getDefaultDisplaySync().width)
const screenWidth = display.getDefaultDisplaySync().width
let leftSpace = screenWidth;
console.log('display-leftSpace ', leftSpace)
const souceSize = this.getContentSize(this.displayText, 12);
const dotSize = 11;
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12);
leftSpace = leftSpace - cornerSize
console.log('display-cornerMark ', cornerSize)
}
if (this.showTime()) {
const timeSize = this.getContentSize(this.handleTimeStr(), 12);
leftSpace = leftSpace - dotSize - timeSize
console.log('display-showtime')
}
if (!this.isEllipsisActive) {
... ... @@ -213,12 +218,14 @@ export struct CardSourceInfo {
commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12);
}
leftSpace = leftSpace - dotSize - commentSize
console.log('display-commentSize ', commentSize)
}
if (leftSpace < souceSize) {
this.onlyShowCornerAndSource = true;
console.log('display-size 1')
}
console.log('display-size 2,', leftSpace, souceSize, this.onlyShowCornerAndSource)
}
build() {
... ... @@ -313,7 +320,6 @@ export struct CardSourceInfo {
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: this.viewShowData ? 8 : 0 })
.clip(true)
}
... ...
... ... @@ -81,8 +81,9 @@ export struct LiveBigImage01Component {
.fontFamily('PingFang SC-Medium')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ top: 8, bottom: 8 })
.align(Alignment.Start)
.height(24)
.textAlign(TextAlign.Center)
Image($r('app.media.point_icon'))
.objectFit(ImageFit.Auto)
... ... @@ -100,9 +101,12 @@ export struct LiveBigImage01Component {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ top: 8, bottom: 8, right: 10 })
.align(Alignment.Start)
.height(24)
.textAlign(TextAlign.Center)
}
.backgroundColor('#F5F5F5')
.margin(12)
.height(24)
}
// 预约
Row() {
... ...
... ... @@ -36,7 +36,7 @@ export struct CommentListDialogView {
showClose: false,
maskColor: "#50000000",
dragBar: false,
onDisappear: () => {
onWillDisappear: () => {
this.showCommentList = false
if (this.onClose) { this.onClose() }
},
... ...
... ... @@ -34,7 +34,9 @@ export struct FollowListDetailUI {
if (arr[1] == "0") {
this.data.getDataArray().forEach((element, index) => {
if (element.creatorId === arr[0]) {
this.data.deleteItem(index)
animateTo({}, () => {
this.data.deleteItem(index);
});
this.count = this.data.size()
}
});
... ... @@ -92,6 +94,7 @@ export struct FollowListDetailUI {
ListItem() {
FollowChildComponent({ data: item, type: this.type })
}
.transition(TransitionEffect.OPACITY)
}, (item: FollowListDetailItem) => item.creatorId)
//没有更多数据 显示提示
... ...
... ... @@ -41,7 +41,7 @@ export struct PageComponent {
private pageTrackBean: PageTrackBean = new PageTrackBean()
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State netStatus: number | undefined = undefined // 存储网络状态
build() {
Column() {
... ...
... ... @@ -251,7 +251,11 @@ export struct EmptyComponent {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
imageString = $r('app.media.icon_no_result1')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
if(this.isBlack) {
imageString = $r('app.media.icon_no_net')
} else {
imageString = $r('app.media.icon_no_net1')
}
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
imageString = $r('app.media.icon_no_content')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
... ...
... ... @@ -361,7 +361,7 @@ export struct LikeComponent {
.height(24)
if (this.likeCount > 0){
RelativeContainer() {
Image(this.likeStatus ? $r('app.media.ic_like_white_Select') : $r('app.media.ic_like_back'))
Image($r('app.media.ic_like_white_Select'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
... ...
... ... @@ -229,7 +229,7 @@ export struct LiveOperRowListView {
}
}
}
.height(30)
.height(this.isLlive ? 30:36)
.onClick(() => {
if (this.onCommentInputFocus) {
this.onCommentInputFocus()
... ... @@ -382,7 +382,7 @@ export struct LiveOperRowListView {
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
this.publishCommentModel.placeHolderText = "说两句..."
this.publishCommentModel.commentContent = ""
// this.publishCommentModel.commentContent = ""
this.commentInputDialogController?.open();
}
... ...
... ... @@ -8,7 +8,7 @@ import {
postInteractBrowsOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, NetworkType, WindowModel } from 'wdKit/Index';
import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { DisplayDirection } from 'wdConstant/Index';
... ... @@ -56,11 +56,12 @@ export struct DetailPlayShortVideoPage {
@State playerHeight: number | string = px2vp(this.windowHeight)
pageParam: ParamType = {}
PageName: string = ''
@State toastText: ResourceStr = "正在使用非WI-FI网络,播放将产生流量费用"
@State toastText: ResourceStr = "正在使用非Wi-Fi网络,播放将产生流量费用"
@Consume onlyWifiLoadVideo: boolean
@Consume toastTextVisible: boolean
@StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm';
@State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false
@State timer: number = -1
currentChanged() {
if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") {
... ... @@ -230,6 +231,24 @@ export struct DetailPlayShortVideoPage {
///解决初始化竖屏视频时 this.ratio未更新导致显示错误
this.calculatePlayerRect()
// 注册监听网络连接
EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => {
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
let type: NetworkType | null = null
if (str) {
type = JSON.parse(str) as NetworkType
}
// 注册监听网络连接
if (this.currentIndex === this.index && type != NetworkType.TYPE_UNKNOWN) {
console.log(TAG, '网络连接状态变化', type, 'this.currentIndex', this.currentIndex, 'this.index', this.index)
this.currentIndexChange()
}
}, 1000)
}))
}
contentTrackingDict() {
... ... @@ -285,7 +304,7 @@ export struct DetailPlayShortVideoPage {
}
showCommentListChanged() {
// console.log('DetailVideoListPage showCommentListChanged this.showCommentList', this.showCommentList)
console.log('DetailVideoListPage showCommentListChanged this.showCommentList', this.showCommentList)
if (this.showCommentList) {
this.playerWidth = px2vp(this.windowWidth)
// this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
... ... @@ -377,8 +396,8 @@ export struct DetailPlayShortVideoPage {
.fontFamily('PingFang SC-Regular')
.fontWeight(FontWeight.Regular)
.fontColor('#FFFFFF')
.fontSize(14)
.lineHeight(20)
.fontSize(16)
.lineHeight(24)
.textAlign(TextAlign.Center)
}
... ... @@ -387,11 +406,18 @@ export struct DetailPlayShortVideoPage {
.fontFamily('PingFang SC-Regular')
.fontWeight(FontWeight.Regular)
.fontColor(Color.White)
.fontSize(12)
.fontSize(14)
.lineHeight(20)
.textAlign(TextAlign.Center)
.margin({
top: 5,
bottom: 5,
left: 8,
right: 8
})
}
.border({ width: 1, color: '#4DFFFFFF', radius: 4 })
.height(28)
.width(88)
.height(30)
.alignItems(HorizontalAlign.Center)
.justifyContent(FlexAlign.Center)
.margin({
... ...
import { ContentDetailDTO } from 'wdBean/Index';
import { DateTimeUtils, ToastUtils } from 'wdKit/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index';
import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index';
@Reusable
... ... @@ -49,6 +49,12 @@ export struct PlayerProgressView {
this.playerController?.play()
}
}
// 注册监听网络连接
EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => {
if (this.timer) {
clearTimeout(this.timer)
}
}))
}
/**
... ...