wangliang_wd

feat:优化横屏直播,直播状态切换提示

@@ -38,6 +38,16 @@ export class WDRouterRule { @@ -38,6 +38,16 @@ export class WDRouterRule {
38 } 38 }
39 } 39 }
40 40
  41 +
  42 + static jumpWithReplaceAction(action?: Action) {
  43 + if (!action || !action.type) {
  44 + ToastUtils.showToast("跳转参数异常", 1000);
  45 + return
  46 + }
  47 + let page = Action2Page.get(action);
  48 + WDRouterRule.jumpWithReplacePage(page, action)
  49 + }
  50 +
41 static jumpWithReplacePage(page?: WDRouterPage, params?: object) { 51 static jumpWithReplacePage(page?: WDRouterPage, params?: object) {
42 if (page) { 52 if (page) {
43 let action = RouterJumpInterceptor.getInterceptorAction(page) 53 let action = RouterJumpInterceptor.getInterceptorAction(page)
@@ -113,4 +113,5 @@ export { VoiceInputView } from './src/main/ets/components/comment/view/VoiceInpu @@ -113,4 +113,5 @@ export { VoiceInputView } from './src/main/ets/components/comment/view/VoiceInpu
113 113
114 export { ComponentModule } from './src/main/ets/ComponentModule' 114 export { ComponentModule } from './src/main/ets/ComponentModule'
115 115
  116 +export { MyCustomDialog } from './src/main/ets/components/reusable/MyCustomDialog'
116 // export {voicese} 117 // export {voicese}
1 -import { ContentDetailDTO, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index'; 1 +import { Action,ContentDetailDTO, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index';
2 import { LiveViewModel } from '../viewModel/LiveViewModel'; 2 import { LiveViewModel } from '../viewModel/LiveViewModel';
3 import { TabComponent } from '../widgets/details/TabComponent'; 3 import { TabComponent } from '../widgets/details/TabComponent';
4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; 4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
@@ -7,13 +7,14 @@ import mediaquery from '@ohos.mediaquery'; @@ -7,13 +7,14 @@ import mediaquery from '@ohos.mediaquery';
7 import { CustomToast, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit/Index'; 7 import { CustomToast, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit/Index';
8 import { display, router, window } from '@kit.ArkUI'; 8 import { display, router, window } from '@kit.ArkUI';
9 import { WDAliPlayerController } from 'wdPlayer/Index'; 9 import { WDAliPlayerController } from 'wdPlayer/Index';
10 -import { LiveOperRowListView } from 'wdComponent'; 10 +import { LiveOperRowListView,MyCustomDialog } from 'wdComponent';
11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; 11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
12 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; 12 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
13 import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg'; 13 import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg';
14 import { LiveDetailChatRoomController } from '../im/LiveDetailChatRoomController'; 14 import { LiveDetailChatRoomController } from '../im/LiveDetailChatRoomController';
15 import { LiveMessageOptType, LiveMessageRoomType } from 'wdBean/src/main/ets/bean/live/LiveRoomBean'; 15 import { LiveMessageOptType, LiveMessageRoomType } from 'wdBean/src/main/ets/bean/live/LiveRoomBean';
16 import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; 16 import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
  17 +import { ProcessUtils, WDRouterRule } from 'wdRouter';
17 18
18 let TAG: string = 'DetailPlayLivePage'; 19 let TAG: string = 'DetailPlayLivePage';
19 20
@@ -54,6 +55,20 @@ export struct DetailPlayLivePage { @@ -54,6 +55,20 @@ export struct DetailPlayLivePage {
54 @State isPORTRAIT: boolean = true 55 @State isPORTRAIT: boolean = true
55 @State half_SCREEN: boolean = true 56 @State half_SCREEN: boolean = true
56 57
  58 + dialogController: CustomDialogController = new CustomDialogController({
  59 + builder: MyCustomDialog({
  60 + confirm: () => {
  61 + WDRouterRule.jumpWithReplaceAction(router.getParams() as Action)
  62 + },
  63 + title:'该直播已开始!请前往围观吧',
  64 + tipShow: false,
  65 + rightText: '去看直播' ,
  66 + }),
  67 + autoCancel: true,
  68 + alignment: DialogAlignment.Center,
  69 + customStyle: true,
  70 + })
  71 +
57 async aboutToAppear(): Promise<void> { 72 async aboutToAppear(): Promise<void> {
58 Logger.info(TAG, `wyj-aboutToAppear`) 73 Logger.info(TAG, `wyj-aboutToAppear`)
59 74
@@ -120,8 +135,11 @@ export struct DetailPlayLivePage { @@ -120,8 +135,11 @@ export struct DetailPlayLivePage {
120 const banComment = liveRoomItemBean.data == "1" 135 const banComment = liveRoomItemBean.data == "1"
121 this.banComment = banComment 136 this.banComment = banComment
122 } break 137 } break
  138 + case LiveMessageOptType.ZH_START_LIVE:{
  139 + this.dialogController.open()
  140 + // this.lastLiveControl = liveRoomItemBean
  141 + } break
123 case LiveMessageOptType.ZH_STOP_LIVE: 142 case LiveMessageOptType.ZH_STOP_LIVE:
124 - case LiveMessageOptType.ZH_START_LIVE:  
125 case LiveMessageOptType.ZH_CHANGE_PAD: { // 直播垫片控制 143 case LiveMessageOptType.ZH_CHANGE_PAD: { // 直播垫片控制
126 this.lastLiveControl = liveRoomItemBean 144 this.lastLiveControl = liveRoomItemBean
127 } break 145 } break