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,恢复网络后,视频无法自动播放
Showing
16 changed files
with
292 additions
and
46 deletions
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | "wdJsBridge": "file:../wdJsBridge", | 12 | "wdJsBridge": "file:../wdJsBridge", |
| 13 | "wdBean": "file:../../features/wdBean", | 13 | "wdBean": "file:../../features/wdBean", |
| 14 | "wdRouter": "file:../wdRouter", | 14 | "wdRouter": "file:../wdRouter", |
| 15 | - "wdNetwork": "file:../wdNetwork" | 15 | + "wdNetwork": "file:../wdNetwork", |
| 16 | + "wdPlayer": "file:../../features/wdPlayer" | ||
| 16 | } | 17 | } |
| 17 | } | 18 | } |
| @@ -7,6 +7,8 @@ import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | @@ -7,6 +7,8 @@ import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | ||
| 7 | import { DateTimeUtils,EmitterUtils,EmitterEventId } from 'wdKit' | 7 | import { DateTimeUtils,EmitterUtils,EmitterEventId } from 'wdKit' |
| 8 | import { window } from '@kit.ArkUI'; | 8 | import { window } from '@kit.ArkUI'; |
| 9 | import { NativeCallH5Type,NativeCallH5Event,eventParams } from './NativeCallH5Type'; | 9 | import { NativeCallH5Type,NativeCallH5Event,eventParams } from './NativeCallH5Type'; |
| 10 | +import { AudioSuspensionModel } from '../viewmodel/AudioSuspensionModel' | ||
| 11 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 10 | 12 | ||
| 11 | const TAG = 'WdWebLocalComponent'; | 13 | const TAG = 'WdWebLocalComponent'; |
| 12 | 14 | ||
| @@ -44,6 +46,8 @@ export struct WdWebLocalComponent { | @@ -44,6 +46,8 @@ export struct WdWebLocalComponent { | ||
| 44 | @Consume @Watch('pageShowForUpdateData') pageShow :number | 46 | @Consume @Watch('pageShowForUpdateData') pageShow :number |
| 45 | @Consume @Watch('pageHideForUpdateData') pageHide :number | 47 | @Consume @Watch('pageHideForUpdateData') pageHide :number |
| 46 | 48 | ||
| 49 | + private AudioSuspension = new AudioSuspensionModel() | ||
| 50 | + | ||
| 47 | currentChanged(){ | 51 | currentChanged(){ |
| 48 | ///折叠屏转换 暂停播放器 | 52 | ///折叠屏转换 暂停播放器 |
| 49 | this.controller.pause() | 53 | this.controller.pause() |
| @@ -186,6 +190,19 @@ export struct WdWebLocalComponent { | @@ -186,6 +190,19 @@ export struct WdWebLocalComponent { | ||
| 186 | } | 190 | } |
| 187 | } | 191 | } |
| 188 | } | 192 | } |
| 193 | + // 暂停音频悬浮窗 | ||
| 194 | + pauseAudioCom() { | ||
| 195 | + // 判断当前窗口是否已显示,使用callback异步回调。 | ||
| 196 | + this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => { | ||
| 197 | + const errCode: number = err.code; | ||
| 198 | + if (errCode) { | ||
| 199 | + return; | ||
| 200 | + } | ||
| 201 | + if(data) { | ||
| 202 | + this.AudioSuspension.playerController.get()?.pause(); | ||
| 203 | + } | ||
| 204 | + }); | ||
| 205 | + } | ||
| 189 | //播放视频 | 206 | //播放视频 |
| 190 | private setCurrentPageOperate9: (data: Message) => void = (data) => { | 207 | private setCurrentPageOperate9: (data: Message) => void = (data) => { |
| 191 | if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate && data?.data?.operateType === '9') { | 208 | if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate && data?.data?.operateType === '9') { |
| @@ -235,6 +252,7 @@ export struct WdWebLocalComponent { | @@ -235,6 +252,7 @@ export struct WdWebLocalComponent { | ||
| 235 | this.cancelProgressTimer() | 252 | this.cancelProgressTimer() |
| 236 | this.controller.start() | 253 | this.controller.start() |
| 237 | this.startProgressTimer() | 254 | this.startProgressTimer() |
| 255 | + this.pauseAudioCom() | ||
| 238 | } | 256 | } |
| 239 | 257 | ||
| 240 | startProgressTimer() { | 258 | startProgressTimer() { |
| 1 | +import window from '@ohos.window'; | ||
| 2 | +import { Logger } from 'wdKit'; | ||
| 3 | +import { BackgroundAudioController, WDPlayerController } from 'wdPlayer'; | ||
| 4 | +import { BusinessError } from '@ohos.base'; | ||
| 5 | +import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | ||
| 6 | + | ||
| 7 | +const TAG = 'AudioSuspensionModel' | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 音频悬浮窗公共方法类 | ||
| 11 | + */ | ||
| 12 | +export class AudioSuspensionModel { | ||
| 13 | + public playerController: SubscribedAbstractProperty<WDPlayerController> = AppStorage.link<WDPlayerController>('playerController') | ||
| 14 | + public floatWindowClass: SubscribedAbstractProperty<window.Window> = AppStorage.link<window.Window>('floatWindowClass') | ||
| 15 | + public srcTitle: string = '' | ||
| 16 | + private url: string = '' | ||
| 17 | + // 窗口是否最小化 | ||
| 18 | + private isMinimize: SubscribedAbstractProperty<boolean> = AppStorage.link<boolean>('isMinimize') | ||
| 19 | + constructor() { | ||
| 20 | + this.initPlayerController() | ||
| 21 | + } | ||
| 22 | + /** | ||
| 23 | + * 判断音频实例是否已存在,不存在则创建 | ||
| 24 | + */ | ||
| 25 | + private initPlayerController() { | ||
| 26 | + if(this.playerController === undefined) { | ||
| 27 | + // Logger.info(TAG, 'playerController undefined') | ||
| 28 | + AppStorage.setOrCreate('playerController', new WDPlayerController({loop: false})); | ||
| 29 | + this.playerController = AppStorage.link<WDPlayerController>('playerController') | ||
| 30 | + // Logger.info(TAG, 'playerController create success') | ||
| 31 | + this.playerController.get().onStatusChange = (status: number) => { | ||
| 32 | + // console.info(TAG, 'this.currentStatus Model', status) | ||
| 33 | + EmitterUtils.sendEvent(EmitterEventId.AUDIO_CHANGE_STATUS, status) | ||
| 34 | + } | ||
| 35 | + } else { | ||
| 36 | + // Logger.info(TAG, 'playerController already exit') | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + /** | ||
| 40 | + * 配置音频地址 | ||
| 41 | + */ | ||
| 42 | + public async setPlayerUrl(url: string, srcTitle: string, srcContentId?: string, srcSource?: string) { | ||
| 43 | + /*console.log(TAG,'this.url', this.url) | ||
| 44 | + console.log(TAG,'url', url)*/ | ||
| 45 | + this.playerController.get().keepOnBackground = true | ||
| 46 | + BackgroundAudioController.sharedController().avplayerController = this.playerController.get() | ||
| 47 | + await BackgroundAudioController.sharedController().createSession() | ||
| 48 | + // BackgroundAudioController.sharedController().startContinuousTask() | ||
| 49 | + BackgroundAudioController.sharedController().listenPlayEvents() | ||
| 50 | + await BackgroundAudioController.sharedController().setSessionMetaData(srcContentId ?? "", srcTitle, $r("app.media.system_audio_icon_bk_center"), srcSource ?? "") | ||
| 51 | + BackgroundAudioController.sharedController().stopUseFeatures() | ||
| 52 | + | ||
| 53 | + if (this.url === url) { | ||
| 54 | + this.isMinimize = AppStorage.link<boolean>('isMinimize') | ||
| 55 | + // console.log(TAG, 'this.isMinimize', this.isMinimize?.get()) | ||
| 56 | + if (this.isMinimize?.get()) { | ||
| 57 | + EmitterUtils.sendEvent(EmitterEventId.AUDIO_WINDOW_EXPAND, 1) | ||
| 58 | + AppStorage.setOrCreate('isMinimize', false); | ||
| 59 | + this.playerController.get().resetPlay() | ||
| 60 | + } else { | ||
| 61 | + this.playerController.get().switchPlayOrPause() | ||
| 62 | + } | ||
| 63 | + } else { | ||
| 64 | + this.url = url | ||
| 65 | + this.playerController.get().firstPlay(url) | ||
| 66 | + this.playerController.get().onCanplay = () => { | ||
| 67 | + this.playerController.get().play() | ||
| 68 | + } | ||
| 69 | + this.srcTitle = srcTitle | ||
| 70 | + EmitterUtils.sendEvent(EmitterEventId.AUDIO_CHANGE_TITLe, this.srcTitle) | ||
| 71 | + EmitterUtils.sendEvent(EmitterEventId.AUDIO_WINDOW_EXPAND, 1) | ||
| 72 | + } | ||
| 73 | + this.showWindow() | ||
| 74 | + } | ||
| 75 | + // 显示悬浮窗。 | ||
| 76 | + public showWindow() { | ||
| 77 | + // 判断当前窗口是否已显示,使用callback异步回调。 | ||
| 78 | + this.floatWindowClass.get().isShowing((err: BusinessError, data) => { | ||
| 79 | + const errCode: number = err.code; | ||
| 80 | + if (errCode) { | ||
| 81 | + // console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err)); | ||
| 82 | + return; | ||
| 83 | + } | ||
| 84 | + // console.info(TAG, 'window is showing: ' + JSON.stringify(data)); | ||
| 85 | + if(data === false) { | ||
| 86 | + // 显示当前窗口,使用callback异步回调。 | ||
| 87 | + this.floatWindowClass.get().showWindow((err: BusinessError) => { | ||
| 88 | + let errCode: number = err.code; | ||
| 89 | + if (errCode) { | ||
| 90 | + // console.error(TAG, 'floatWindowClass Failed to show the window. Cause: ' + JSON.stringify(err)); | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + // console.info(TAG, 'floatWindowClass Succeeded in showing the window.'); | ||
| 94 | + }); | ||
| 95 | + } | ||
| 96 | + }); | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + // 设置悬浮窗尺寸 | ||
| 100 | + public resizeWindow(width: number, height: number) { | ||
| 101 | + this.floatWindowClass.get().resize(width, height, (err: BusinessError) => { | ||
| 102 | + let errCode: number = err.code; | ||
| 103 | + if (errCode) { | ||
| 104 | + // console.error(TAG, 'floatWindowClass Failed to change the window size. Cause:' + JSON.stringify(err)); | ||
| 105 | + return; | ||
| 106 | + } | ||
| 107 | + // console.info(TAG, 'floatWindowClass Succeeded in changing the window size.'); | ||
| 108 | + }); | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + // 隐藏悬浮窗 | ||
| 112 | + public minimize() { | ||
| 113 | + this.floatWindowClass.get().minimize((err: BusinessError) => { | ||
| 114 | + const errCode: number = err.code; | ||
| 115 | + if (errCode) { | ||
| 116 | + // console.error(TAG, 'Failed to minimize the window. Cause: ' + JSON.stringify(err)); | ||
| 117 | + return; | ||
| 118 | + } | ||
| 119 | + AppStorage.setOrCreate('isMinimize', true); | ||
| 120 | + // console.info(TAG, 'Succeeded in minimizing the window.'); | ||
| 121 | + }); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + | ||
| 125 | + | ||
| 126 | +} |
sight_harmony/commons/wdWebComponent/src/main/resources/base/media/system_audio_icon_bk_center.png
0 → 100644
117 KB
| @@ -139,29 +139,7 @@ export struct DynamicDetailComponent { | @@ -139,29 +139,7 @@ export struct DynamicDetailComponent { | ||
| 139 | 139 | ||
| 140 | build() { | 140 | build() { |
| 141 | Column() { | 141 | Column() { |
| 142 | - //logo、日期 | ||
| 143 | - Row() { | ||
| 144 | - Image($r('app.media.ic_article_rmh')) | ||
| 145 | - .width($r('app.float.margin_80')) | ||
| 146 | - .height($r('app.float.margin_28')) | ||
| 147 | - .margin({ left: $r('app.float.margin_16') }) | ||
| 148 | - Blank() | ||
| 149 | - Text(this.publishTime) | ||
| 150 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 151 | - .fontSize($r('app.float.font_size_12')) | ||
| 152 | - .lineHeight($r('app.float.margin_28')) | ||
| 153 | - .margin({ right: $r('app.float.margin_16') }) | ||
| 154 | - } | ||
| 155 | - .height($r('app.float.margin_48')) | ||
| 156 | - .width('100%') | ||
| 157 | - .alignItems(VerticalAlign.Bottom) | ||
| 158 | - .padding({ bottom: 5 }) | ||
| 159 | - .margin({top: `${this.topSafeHeight}px`}) | ||
| 160 | - //分割线 | ||
| 161 | - Image($r('app.media.ic_news_detail_division')) | ||
| 162 | - .width('100%') | ||
| 163 | - .height($r('app.float.margin_6')) | ||
| 164 | - .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 142 | + this.topNav() |
| 165 | Stack({ alignContent: Alignment.Bottom }) { | 143 | Stack({ alignContent: Alignment.Bottom }) { |
| 166 | if (!this.isNetConnected) { | 144 | if (!this.isNetConnected) { |
| 167 | EmptyComponent({ | 145 | EmptyComponent({ |
| @@ -704,6 +682,72 @@ export struct DynamicDetailComponent { | @@ -704,6 +682,72 @@ export struct DynamicDetailComponent { | ||
| 704 | .height('100%') | 682 | .height('100%') |
| 705 | } | 683 | } |
| 706 | 684 | ||
| 685 | + @Builder topNav() { | ||
| 686 | + //logo、日期 | ||
| 687 | + Row() { | ||
| 688 | + Image($r('app.media.ic_article_rmh')) | ||
| 689 | + .width($r('app.float.margin_80')) | ||
| 690 | + .height($r('app.float.margin_28')) | ||
| 691 | + .margin({ left: $r('app.float.margin_16') }) | ||
| 692 | + Blank() | ||
| 693 | + Text(this.publishTime) | ||
| 694 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 695 | + .fontSize($r('app.float.font_size_12')) | ||
| 696 | + .lineHeight($r('app.float.margin_28')) | ||
| 697 | + .margin({ right: $r('app.float.margin_16') }) | ||
| 698 | + } | ||
| 699 | + .height($r('app.float.margin_48')) | ||
| 700 | + .width('100%') | ||
| 701 | + .alignItems(VerticalAlign.Bottom) | ||
| 702 | + .padding({ bottom: 5 }) | ||
| 703 | + .margin({top: `${this.topSafeHeight}px`}) | ||
| 704 | + //分割线 | ||
| 705 | + Image($r('app.media.ic_news_detail_division')) | ||
| 706 | + .width('100%') | ||
| 707 | + .height($r('app.float.margin_6')) | ||
| 708 | + .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | ||
| 709 | + | ||
| 710 | + // 发布时间 ,TODO:需要参考文章详情 | ||
| 711 | + // Column() { | ||
| 712 | + // Row() { | ||
| 713 | + // if (this.isNetConnected && this.contentDetailData) { | ||
| 714 | + // if (this.contentDetailData.rmhPlatform == 1) { // 人民号 | ||
| 715 | + // if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号 | ||
| 716 | + // Blank().height(1) | ||
| 717 | + // } else { | ||
| 718 | + // Image($r('app.media.logo_rmh')).width(80) .height(28) | ||
| 719 | + // } | ||
| 720 | + // } else if (this.contentDetailData.rmhPlatform == 2) { // 普通用户 | ||
| 721 | + // Blank().height(1) | ||
| 722 | + // } else { | ||
| 723 | + // Image($r('app.media.logo_rmrb')).width(80) .height(28) | ||
| 724 | + // } | ||
| 725 | + // Text(this.publishTime) | ||
| 726 | + // .fontColor($r('app.color.color_B0B0B0')) | ||
| 727 | + // .fontSize(13) | ||
| 728 | + // .height(20) | ||
| 729 | + // } | ||
| 730 | + // } | ||
| 731 | + // .width(CommonConstants.FULL_WIDTH) | ||
| 732 | + // .height($r('app.float.margin_48')) | ||
| 733 | + // .padding({ left: 15, right: 15, }) | ||
| 734 | + // .justifyContent(FlexAlign.SpaceBetween) | ||
| 735 | + // .alignItems(VerticalAlign.Bottom) | ||
| 736 | + // | ||
| 737 | + // // if (this.isNetConnected && !this.detailContentEmpty) { | ||
| 738 | + // Row() { | ||
| 739 | + // Image($r('app.media.ic_news_detail_division')) | ||
| 740 | + // .width('100%') | ||
| 741 | + // .height(6) | ||
| 742 | + // .margin({ top: 10 }) | ||
| 743 | + // .objectFit(ImageFit.Fill) | ||
| 744 | + // } | ||
| 745 | + // .padding({ left: 15, right: 15 }) | ||
| 746 | + // .backgroundColor(Color.White) | ||
| 747 | + // // } | ||
| 748 | + // }.backgroundColor(Color.White) | ||
| 749 | + } | ||
| 750 | + | ||
| 707 | private titleText() { | 751 | private titleText() { |
| 708 | if(!StringUtils.isEmpty(this.contentDetailData.newsContent)){ | 752 | if(!StringUtils.isEmpty(this.contentDetailData.newsContent)){ |
| 709 | return this.contentDetailData.newsContent | 753 | return this.contentDetailData.newsContent |
| @@ -265,9 +265,17 @@ export struct ImageAndTextPageComponent { | @@ -265,9 +265,17 @@ export struct ImageAndTextPageComponent { | ||
| 265 | Column() { | 265 | Column() { |
| 266 | Row() { | 266 | Row() { |
| 267 | if (this.isNetConnected && !this.detailContentEmpty) { | 267 | if (this.isNetConnected && !this.detailContentEmpty) { |
| 268 | - Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) | ||
| 269 | - .width(80) | ||
| 270 | - .height(28) | 268 | + if (this.contentDetailData.rmhPlatform == 1) { // 人民号 |
| 269 | + if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号 | ||
| 270 | + Blank().height(1) | ||
| 271 | + } else { | ||
| 272 | + Image($r('app.media.logo_rmh')).width(80) .height(28) | ||
| 273 | + } | ||
| 274 | + } else if (this.contentDetailData.rmhPlatform == 2) { // 普通用户 | ||
| 275 | + Blank().height(1) | ||
| 276 | + } else { | ||
| 277 | + Image($r('app.media.logo_rmrb')).width(80) .height(28) | ||
| 278 | + } | ||
| 271 | Text(this.publishTime) | 279 | Text(this.publishTime) |
| 272 | .fontColor($r('app.color.color_B0B0B0')) | 280 | .fontColor($r('app.color.color_B0B0B0')) |
| 273 | .fontSize(13) | 281 | .fontSize(13) |
| @@ -189,21 +189,26 @@ export struct CardSourceInfo { | @@ -189,21 +189,26 @@ export struct CardSourceInfo { | ||
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | calcContentSpace() { | 191 | calcContentSpace() { |
| 192 | + | ||
| 193 | + console.log('display-text ,', this.displayText) | ||
| 192 | if (this.isLimited()) return; | 194 | if (this.isLimited()) return; |
| 193 | 195 | ||
| 194 | - const screenWidth = px2vp(display.getDefaultDisplaySync().width) | 196 | + const screenWidth = display.getDefaultDisplaySync().width |
| 195 | let leftSpace = screenWidth; | 197 | let leftSpace = screenWidth; |
| 198 | + console.log('display-leftSpace ', leftSpace) | ||
| 196 | const souceSize = this.getContentSize(this.displayText, 12); | 199 | const souceSize = this.getContentSize(this.displayText, 12); |
| 197 | const dotSize = 11; | 200 | const dotSize = 11; |
| 198 | 201 | ||
| 199 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { | 202 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { |
| 200 | const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12); | 203 | const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12); |
| 201 | leftSpace = leftSpace - cornerSize | 204 | leftSpace = leftSpace - cornerSize |
| 205 | + console.log('display-cornerMark ', cornerSize) | ||
| 202 | } | 206 | } |
| 203 | 207 | ||
| 204 | if (this.showTime()) { | 208 | if (this.showTime()) { |
| 205 | const timeSize = this.getContentSize(this.handleTimeStr(), 12); | 209 | const timeSize = this.getContentSize(this.handleTimeStr(), 12); |
| 206 | leftSpace = leftSpace - dotSize - timeSize | 210 | leftSpace = leftSpace - dotSize - timeSize |
| 211 | + console.log('display-showtime') | ||
| 207 | } | 212 | } |
| 208 | 213 | ||
| 209 | if (!this.isEllipsisActive) { | 214 | if (!this.isEllipsisActive) { |
| @@ -213,12 +218,14 @@ export struct CardSourceInfo { | @@ -213,12 +218,14 @@ export struct CardSourceInfo { | ||
| 213 | commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12); | 218 | commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12); |
| 214 | } | 219 | } |
| 215 | leftSpace = leftSpace - dotSize - commentSize | 220 | leftSpace = leftSpace - dotSize - commentSize |
| 221 | + console.log('display-commentSize ', commentSize) | ||
| 216 | } | 222 | } |
| 217 | 223 | ||
| 218 | if (leftSpace < souceSize) { | 224 | if (leftSpace < souceSize) { |
| 219 | this.onlyShowCornerAndSource = true; | 225 | this.onlyShowCornerAndSource = true; |
| 226 | + console.log('display-size 1') | ||
| 220 | } | 227 | } |
| 221 | - | 228 | + console.log('display-size 2,', leftSpace, souceSize, this.onlyShowCornerAndSource) |
| 222 | } | 229 | } |
| 223 | 230 | ||
| 224 | build() { | 231 | build() { |
| @@ -313,7 +320,6 @@ export struct CardSourceInfo { | @@ -313,7 +320,6 @@ export struct CardSourceInfo { | ||
| 313 | } | 320 | } |
| 314 | .width(CommonConstants.FULL_WIDTH) | 321 | .width(CommonConstants.FULL_WIDTH) |
| 315 | .margin({ top: this.viewShowData ? 8 : 0 }) | 322 | .margin({ top: this.viewShowData ? 8 : 0 }) |
| 316 | - .clip(true) | ||
| 317 | 323 | ||
| 318 | } | 324 | } |
| 319 | 325 |
| @@ -81,8 +81,9 @@ export struct LiveBigImage01Component { | @@ -81,8 +81,9 @@ export struct LiveBigImage01Component { | ||
| 81 | .fontFamily('PingFang SC-Medium') | 81 | .fontFamily('PingFang SC-Medium') |
| 82 | .maxLines(1) | 82 | .maxLines(1) |
| 83 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 83 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 84 | - .margin({ top: 8, bottom: 8 }) | ||
| 85 | .align(Alignment.Start) | 84 | .align(Alignment.Start) |
| 85 | + .height(24) | ||
| 86 | + .textAlign(TextAlign.Center) | ||
| 86 | 87 | ||
| 87 | Image($r('app.media.point_icon')) | 88 | Image($r('app.media.point_icon')) |
| 88 | .objectFit(ImageFit.Auto) | 89 | .objectFit(ImageFit.Auto) |
| @@ -100,9 +101,12 @@ export struct LiveBigImage01Component { | @@ -100,9 +101,12 @@ export struct LiveBigImage01Component { | ||
| 100 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 101 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 101 | .margin({ top: 8, bottom: 8, right: 10 }) | 102 | .margin({ top: 8, bottom: 8, right: 10 }) |
| 102 | .align(Alignment.Start) | 103 | .align(Alignment.Start) |
| 104 | + .height(24) | ||
| 105 | + .textAlign(TextAlign.Center) | ||
| 103 | } | 106 | } |
| 104 | .backgroundColor('#F5F5F5') | 107 | .backgroundColor('#F5F5F5') |
| 105 | .margin(12) | 108 | .margin(12) |
| 109 | + .height(24) | ||
| 106 | } | 110 | } |
| 107 | // 预约 | 111 | // 预约 |
| 108 | Row() { | 112 | Row() { |
| @@ -36,7 +36,7 @@ export struct CommentListDialogView { | @@ -36,7 +36,7 @@ export struct CommentListDialogView { | ||
| 36 | showClose: false, | 36 | showClose: false, |
| 37 | maskColor: "#50000000", | 37 | maskColor: "#50000000", |
| 38 | dragBar: false, | 38 | dragBar: false, |
| 39 | - onDisappear: () => { | 39 | + onWillDisappear: () => { |
| 40 | this.showCommentList = false | 40 | this.showCommentList = false |
| 41 | if (this.onClose) { this.onClose() } | 41 | if (this.onClose) { this.onClose() } |
| 42 | }, | 42 | }, |
| @@ -34,7 +34,9 @@ export struct FollowListDetailUI { | @@ -34,7 +34,9 @@ export struct FollowListDetailUI { | ||
| 34 | if (arr[1] == "0") { | 34 | if (arr[1] == "0") { |
| 35 | this.data.getDataArray().forEach((element, index) => { | 35 | this.data.getDataArray().forEach((element, index) => { |
| 36 | if (element.creatorId === arr[0]) { | 36 | if (element.creatorId === arr[0]) { |
| 37 | - this.data.deleteItem(index) | 37 | + animateTo({}, () => { |
| 38 | + this.data.deleteItem(index); | ||
| 39 | + }); | ||
| 38 | this.count = this.data.size() | 40 | this.count = this.data.size() |
| 39 | } | 41 | } |
| 40 | }); | 42 | }); |
| @@ -92,6 +94,7 @@ export struct FollowListDetailUI { | @@ -92,6 +94,7 @@ export struct FollowListDetailUI { | ||
| 92 | ListItem() { | 94 | ListItem() { |
| 93 | FollowChildComponent({ data: item, type: this.type }) | 95 | FollowChildComponent({ data: item, type: this.type }) |
| 94 | } | 96 | } |
| 97 | + .transition(TransitionEffect.OPACITY) | ||
| 95 | }, (item: FollowListDetailItem) => item.creatorId) | 98 | }, (item: FollowListDetailItem) => item.creatorId) |
| 96 | 99 | ||
| 97 | //没有更多数据 显示提示 | 100 | //没有更多数据 显示提示 |
| @@ -41,7 +41,7 @@ export struct PageComponent { | @@ -41,7 +41,7 @@ export struct PageComponent { | ||
| 41 | private pageTrackBean: PageTrackBean = new PageTrackBean() | 41 | private pageTrackBean: PageTrackBean = new PageTrackBean() |
| 42 | // 国殇灰度管理 | 42 | // 国殇灰度管理 |
| 43 | GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') | 43 | GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') |
| 44 | - @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | 44 | + @State netStatus: number | undefined = undefined // 存储网络状态 |
| 45 | 45 | ||
| 46 | build() { | 46 | build() { |
| 47 | Column() { | 47 | Column() { |
| @@ -251,7 +251,11 @@ export struct EmptyComponent { | @@ -251,7 +251,11 @@ export struct EmptyComponent { | ||
| 251 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) { | 251 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) { |
| 252 | imageString = $r('app.media.icon_no_result1') | 252 | imageString = $r('app.media.icon_no_result1') |
| 253 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | 253 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { |
| 254 | + if(this.isBlack) { | ||
| 255 | + imageString = $r('app.media.icon_no_net') | ||
| 256 | + } else { | ||
| 254 | imageString = $r('app.media.icon_no_net1') | 257 | imageString = $r('app.media.icon_no_net1') |
| 258 | + } | ||
| 255 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | 259 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { |
| 256 | imageString = $r('app.media.icon_no_content') | 260 | imageString = $r('app.media.icon_no_content') |
| 257 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { | 261 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { |
| @@ -361,7 +361,7 @@ export struct LikeComponent { | @@ -361,7 +361,7 @@ export struct LikeComponent { | ||
| 361 | .height(24) | 361 | .height(24) |
| 362 | if (this.likeCount > 0){ | 362 | if (this.likeCount > 0){ |
| 363 | RelativeContainer() { | 363 | RelativeContainer() { |
| 364 | - Image(this.likeStatus ? $r('app.media.ic_like_white_Select') : $r('app.media.ic_like_back')) | 364 | + Image($r('app.media.ic_like_white_Select')) |
| 365 | .objectFit(ImageFit.Fill) | 365 | .objectFit(ImageFit.Fill) |
| 366 | .resizable({ | 366 | .resizable({ |
| 367 | slice: { | 367 | slice: { |
| @@ -229,7 +229,7 @@ export struct LiveOperRowListView { | @@ -229,7 +229,7 @@ export struct LiveOperRowListView { | ||
| 229 | } | 229 | } |
| 230 | } | 230 | } |
| 231 | } | 231 | } |
| 232 | - .height(30) | 232 | + .height(this.isLlive ? 30:36) |
| 233 | .onClick(() => { | 233 | .onClick(() => { |
| 234 | if (this.onCommentInputFocus) { | 234 | if (this.onCommentInputFocus) { |
| 235 | this.onCommentInputFocus() | 235 | this.onCommentInputFocus() |
| @@ -382,7 +382,7 @@ export struct LiveOperRowListView { | @@ -382,7 +382,7 @@ export struct LiveOperRowListView { | ||
| 382 | this.publishCommentModel.rootCommentId = '-1'; | 382 | this.publishCommentModel.rootCommentId = '-1'; |
| 383 | this.publishCommentModel.parentId = '-1'; | 383 | this.publishCommentModel.parentId = '-1'; |
| 384 | this.publishCommentModel.placeHolderText = "说两句..." | 384 | this.publishCommentModel.placeHolderText = "说两句..." |
| 385 | - this.publishCommentModel.commentContent = "" | 385 | + // this.publishCommentModel.commentContent = "" |
| 386 | this.commentInputDialogController?.open(); | 386 | this.commentInputDialogController?.open(); |
| 387 | } | 387 | } |
| 388 | 388 |
| @@ -8,7 +8,7 @@ import { | @@ -8,7 +8,7 @@ import { | ||
| 8 | postInteractBrowsOperateParams | 8 | postInteractBrowsOperateParams |
| 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 10 | import { HttpUtils } from 'wdNetwork/Index'; | 10 | import { HttpUtils } from 'wdNetwork/Index'; |
| 11 | -import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit/Index'; | 11 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, NetworkType, WindowModel } from 'wdKit/Index'; |
| 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; | 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; |
| 13 | import { PlayerRightView } from '../view/PlayerRightView'; | 13 | import { PlayerRightView } from '../view/PlayerRightView'; |
| 14 | import { DisplayDirection } from 'wdConstant/Index'; | 14 | import { DisplayDirection } from 'wdConstant/Index'; |
| @@ -56,11 +56,12 @@ export struct DetailPlayShortVideoPage { | @@ -56,11 +56,12 @@ export struct DetailPlayShortVideoPage { | ||
| 56 | @State playerHeight: number | string = px2vp(this.windowHeight) | 56 | @State playerHeight: number | string = px2vp(this.windowHeight) |
| 57 | pageParam: ParamType = {} | 57 | pageParam: ParamType = {} |
| 58 | PageName: string = '' | 58 | PageName: string = '' |
| 59 | - @State toastText: ResourceStr = "正在使用非WI-FI网络,播放将产生流量费用" | 59 | + @State toastText: ResourceStr = "正在使用非Wi-Fi网络,播放将产生流量费用" |
| 60 | @Consume onlyWifiLoadVideo: boolean | 60 | @Consume onlyWifiLoadVideo: boolean |
| 61 | @Consume toastTextVisible: boolean | 61 | @Consume toastTextVisible: boolean |
| 62 | @StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm'; | 62 | @StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm'; |
| 63 | @State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false | 63 | @State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false |
| 64 | + @State timer: number = -1 | ||
| 64 | 65 | ||
| 65 | currentChanged() { | 66 | currentChanged() { |
| 66 | if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") { | 67 | if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") { |
| @@ -230,6 +231,24 @@ export struct DetailPlayShortVideoPage { | @@ -230,6 +231,24 @@ export struct DetailPlayShortVideoPage { | ||
| 230 | 231 | ||
| 231 | ///解决初始化竖屏视频时 this.ratio未更新导致显示错误 | 232 | ///解决初始化竖屏视频时 this.ratio未更新导致显示错误 |
| 232 | this.calculatePlayerRect() | 233 | this.calculatePlayerRect() |
| 234 | + | ||
| 235 | + // 注册监听网络连接 | ||
| 236 | + EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => { | ||
| 237 | + if (this.timer) { | ||
| 238 | + clearTimeout(this.timer) | ||
| 239 | + } | ||
| 240 | + this.timer = setTimeout(() => { | ||
| 241 | + let type: NetworkType | null = null | ||
| 242 | + if (str) { | ||
| 243 | + type = JSON.parse(str) as NetworkType | ||
| 244 | + } | ||
| 245 | + // 注册监听网络连接 | ||
| 246 | + if (this.currentIndex === this.index && type != NetworkType.TYPE_UNKNOWN) { | ||
| 247 | + console.log(TAG, '网络连接状态变化', type, 'this.currentIndex', this.currentIndex, 'this.index', this.index) | ||
| 248 | + this.currentIndexChange() | ||
| 249 | + } | ||
| 250 | + }, 1000) | ||
| 251 | + })) | ||
| 233 | } | 252 | } |
| 234 | 253 | ||
| 235 | contentTrackingDict() { | 254 | contentTrackingDict() { |
| @@ -285,7 +304,7 @@ export struct DetailPlayShortVideoPage { | @@ -285,7 +304,7 @@ export struct DetailPlayShortVideoPage { | ||
| 285 | } | 304 | } |
| 286 | 305 | ||
| 287 | showCommentListChanged() { | 306 | showCommentListChanged() { |
| 288 | - // console.log('DetailVideoListPage showCommentListChanged this.showCommentList', this.showCommentList) | 307 | + console.log('DetailVideoListPage showCommentListChanged this.showCommentList', this.showCommentList) |
| 289 | if (this.showCommentList) { | 308 | if (this.showCommentList) { |
| 290 | this.playerWidth = px2vp(this.windowWidth) | 309 | this.playerWidth = px2vp(this.windowWidth) |
| 291 | // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) | 310 | // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) |
| @@ -377,8 +396,8 @@ export struct DetailPlayShortVideoPage { | @@ -377,8 +396,8 @@ export struct DetailPlayShortVideoPage { | ||
| 377 | .fontFamily('PingFang SC-Regular') | 396 | .fontFamily('PingFang SC-Regular') |
| 378 | .fontWeight(FontWeight.Regular) | 397 | .fontWeight(FontWeight.Regular) |
| 379 | .fontColor('#FFFFFF') | 398 | .fontColor('#FFFFFF') |
| 380 | - .fontSize(14) | ||
| 381 | - .lineHeight(20) | 399 | + .fontSize(16) |
| 400 | + .lineHeight(24) | ||
| 382 | .textAlign(TextAlign.Center) | 401 | .textAlign(TextAlign.Center) |
| 383 | } | 402 | } |
| 384 | 403 | ||
| @@ -387,11 +406,18 @@ export struct DetailPlayShortVideoPage { | @@ -387,11 +406,18 @@ export struct DetailPlayShortVideoPage { | ||
| 387 | .fontFamily('PingFang SC-Regular') | 406 | .fontFamily('PingFang SC-Regular') |
| 388 | .fontWeight(FontWeight.Regular) | 407 | .fontWeight(FontWeight.Regular) |
| 389 | .fontColor(Color.White) | 408 | .fontColor(Color.White) |
| 390 | - .fontSize(12) | 409 | + .fontSize(14) |
| 410 | + .lineHeight(20) | ||
| 411 | + .textAlign(TextAlign.Center) | ||
| 412 | + .margin({ | ||
| 413 | + top: 5, | ||
| 414 | + bottom: 5, | ||
| 415 | + left: 8, | ||
| 416 | + right: 8 | ||
| 417 | + }) | ||
| 391 | } | 418 | } |
| 392 | .border({ width: 1, color: '#4DFFFFFF', radius: 4 }) | 419 | .border({ width: 1, color: '#4DFFFFFF', radius: 4 }) |
| 393 | - .height(28) | ||
| 394 | - .width(88) | 420 | + .height(30) |
| 395 | .alignItems(HorizontalAlign.Center) | 421 | .alignItems(HorizontalAlign.Center) |
| 396 | .justifyContent(FlexAlign.Center) | 422 | .justifyContent(FlexAlign.Center) |
| 397 | .margin({ | 423 | .margin({ |
| 1 | import { ContentDetailDTO } from 'wdBean/Index'; | 1 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 2 | -import { DateTimeUtils, ToastUtils } from 'wdKit/Index'; | 2 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'; |
| 3 | import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index'; | 3 | import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index'; |
| 4 | 4 | ||
| 5 | @Reusable | 5 | @Reusable |
| @@ -49,6 +49,12 @@ export struct PlayerProgressView { | @@ -49,6 +49,12 @@ export struct PlayerProgressView { | ||
| 49 | this.playerController?.play() | 49 | this.playerController?.play() |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | + // 注册监听网络连接 | ||
| 53 | + EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => { | ||
| 54 | + if (this.timer) { | ||
| 55 | + clearTimeout(this.timer) | ||
| 56 | + } | ||
| 57 | + })) | ||
| 52 | } | 58 | } |
| 53 | 59 | ||
| 54 | /** | 60 | /** |
-
Please register or login to post a comment