Showing
2 changed files
with
54 additions
and
4 deletions
| @@ -24,8 +24,8 @@ interface dataObject { | @@ -24,8 +24,8 @@ interface dataObject { | ||
| 24 | // 9、活动投稿 视频跳转 | 24 | // 9、活动投稿 视频跳转 |
| 25 | // 10、活动投稿 动态跳转 | 25 | // 10、活动投稿 动态跳转 |
| 26 | // 11、活动投稿 图集跳转 | 26 | // 11、活动投稿 图集跳转 |
| 27 | - dataSource: WDH5WebDataSource | ||
| 28 | - operateType?: string | 27 | + dataSource?: WDH5WebDataSource |
| 28 | + operateType?: WDH5WebPageOperationType | ||
| 29 | webViewHeight?: string | 29 | webViewHeight?: string |
| 30 | dataJson?: string | 30 | dataJson?: string |
| 31 | appInnerLink?: string | 31 | appInnerLink?: string |
| @@ -39,6 +39,7 @@ interface dataObject { | @@ -39,6 +39,7 @@ interface dataObject { | ||
| 39 | positionTop?: string | 39 | positionTop?: string |
| 40 | videoLandscape?: string | 40 | videoLandscape?: string |
| 41 | imgListData?: string | 41 | imgListData?: string |
| 42 | + statusBarMode?: string | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | /** | 45 | /** |
| @@ -85,4 +86,41 @@ export enum WDH5WebDataSource { | @@ -85,4 +86,41 @@ export enum WDH5WebDataSource { | ||
| 85 | WDH5WebDataSourcePartinActivityPublishVideo = 9, | 86 | WDH5WebDataSourcePartinActivityPublishVideo = 9, |
| 86 | WDH5WebDataSourcePartinActivityPublishDynamic = 10, | 87 | WDH5WebDataSourcePartinActivityPublishDynamic = 10, |
| 87 | WDH5WebDataSourcePartinActivityPublishPicture = 11, | 88 | WDH5WebDataSourcePartinActivityPublishPicture = 11, |
| 88 | -} | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +export enum WDH5WebPageOperationType { | ||
| 92 | + WDH5WebPageOperationTypeClose = '1', | ||
| 93 | + WDH5WebPageOperationTypeReload = '2', | ||
| 94 | + WDH5WebPageOperationTypeGoBack = '3', | ||
| 95 | + WDH5WebPageOperationTypePlayerVideoFor4G = '4', | ||
| 96 | + WDH5WebPageOperationTypeEmailSubscribeHasClosed = '5', | ||
| 97 | + WDH5WebPageOperationTypeHeightUpdate = '8', | ||
| 98 | + WDH5WebPageOperationTypeVideoPlay = '9', // 让App开始播放视频 | ||
| 99 | + WDH5WebPageOperationTypeAudioPlayed = '10', // H5开始播放音频 (做互斥用) | ||
| 100 | + WDH5WebPageOperationTypeCloseAppNavigationBar = '12', | ||
| 101 | + WDH5WebPageOperationTypeOpenAppNavigationBar = '13', | ||
| 102 | + WDH5WebPageOperationTypeCloseBottomBar = '14', | ||
| 103 | + WDH5WebPageOperationTypeOpenBottomBar = '15', | ||
| 104 | + WDH5WebPageOperationTypeShowNavigationShareButton = '16', | ||
| 105 | + WDH5WebPageOperationTypeHiddenNavigationShareButton = '17', | ||
| 106 | + WDH5WebPageOperationTypeSetTitle = '18', | ||
| 107 | + WDH5WebPageOperationTypeSetStatusBar = '19', | ||
| 108 | + WDH5WebPageOperationTypeBottomBarMaskViewShow = '20', | ||
| 109 | + WDH5WebPageOperationTypeBottomBarMaskViewHidden = '21', | ||
| 110 | + WDH5WebPageOperationTypeRetry = '22', | ||
| 111 | + WDH5WebPageOperationTypeCreatorFollowStatusChanged = '24', | ||
| 112 | + | ||
| 113 | + WDH5WebPageOperationTypeStartPopupAlert = '32', //(原生代码确保Webview底部到底) | ||
| 114 | + WDH5WebPageOperationTypeEndPopupAlert = '33', | ||
| 115 | + | ||
| 116 | + WDH5WebPageOperationTypeSkipHomePage = '40', | ||
| 117 | + WDH5WebPageOperationTypeSkipScoreCenterSign = '41', | ||
| 118 | + WDH5WebPageOperationTypeSkipFeedbackPage = '42', | ||
| 119 | + WDH5WebPageOperationTypeSkipFollowListPage = '43', | ||
| 120 | + | ||
| 121 | + WDH5WebPageOperationTypeShowLoading = '47', | ||
| 122 | + WDH5WebPageOperationTypeHiddenLoading = '48', | ||
| 123 | + | ||
| 124 | + WDH5WebPageOperationTypeVideoRectChange = '49', // 修改App视频尺寸 (暂未使用) | ||
| 125 | + | ||
| 126 | +}; |
| @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil'; | @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil'; | ||
| 5 | import { Action } from 'wdBean'; | 5 | import { Action } from 'wdBean'; |
| 6 | import { performJSCallNative } from './JsBridgeBiz'; | 6 | import { performJSCallNative } from './JsBridgeBiz'; |
| 7 | import { H5CallNativeType } from './H5CallNativeType'; | 7 | import { H5CallNativeType } from './H5CallNativeType'; |
| 8 | -import { Message,WDH5WebDataSource } from 'wdJsBridge/src/main/ets/bean/Message'; | 8 | +import { Message,WDH5WebDataSource,WDH5WebPageOperationType } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 9 | import { JSON } from '@kit.ArkTS'; | 9 | import { JSON } from '@kit.ArkTS'; |
| 10 | +import { WindowModel } from 'wdKit'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'WdWebComponent'; | 12 | const TAG = 'WdWebComponent'; |
| 12 | 13 | ||
| @@ -84,7 +85,18 @@ export struct WdWebComponent { | @@ -84,7 +85,18 @@ export struct WdWebComponent { | ||
| 84 | } | 85 | } |
| 85 | } | 86 | } |
| 86 | 87 | ||
| 88 | + if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) { | ||
| 89 | + this.jsCall_currentPageOperate(data) | ||
| 90 | + return | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + private jsCall_currentPageOperate(data: Message) { | ||
| 95 | + if (data.data?.operateType == WDH5WebPageOperationType.WDH5WebPageOperationTypeSetStatusBar) { | ||
| 96 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: data.data?.statusBarMode =='2'?'#ffffff':'#000000'}) | ||
| 97 | + } | ||
| 87 | } | 98 | } |
| 99 | + | ||
| 88 | onPageBegin: (url?: string) => void = () => { | 100 | onPageBegin: (url?: string) => void = () => { |
| 89 | Logger.debug(TAG, 'onPageBegin'); | 101 | Logger.debug(TAG, 'onPageBegin'); |
| 90 | this.registerHandlers(); | 102 | this.registerHandlers(); |
-
Please register or login to post a comment