Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yuzhilin
2024-04-23 11:25:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4006bb72891171e9c2081c7d2a6af145910957c7
4006bb72
1 parent
cfaad0bc
跳转
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
9 deletions
sight_harmony/commons/wdJsBridge/src/main/ets/bean/Message.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
sight_harmony/features/wdComponent/src/main/resources/rawfile/apph5/index.html
sight_harmony/commons/wdJsBridge/src/main/ets/bean/Message.ets
View file @
4006bb7
import { Action } from './Action';
interface dataObject {
// dataSource:
// 1、图文详情数据
// 2、英文端跳转推荐内容数据
// 3、显示图片预览
// 4、专题pageinfo数据
// 5、专题comp运营位点击跳转(传给App记录浏览历史)
// 6、图文详情引用内容跳转
// 7、专题分享海报图上的数据列表(H5可选第一页前5条运营位数据)
// 8、活动投稿 文章跳转
// 9、活动投稿 视频跳转
// 10、活动投稿 动态跳转
// 11、活动投稿 图集跳转
dataSource: number
operateType?: string
webViewHeight?: string
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
View file @
4006bb7
...
...
@@ -14,6 +14,7 @@ const TAG = 'JsBridgeBiz'
*/
export function performJSCallNative(data: Message, call: Callback) {
Logger.debug(TAG, 'performJSCallNative handlerName: ' + data.handlerName + ', data: ' + JSON.stringify(data.data))
switch (data.handlerName) {
case H5CallNativeType.jsCall_currentPageOperate:
break;
...
...
@@ -24,12 +25,13 @@ export function performJSCallNative(data: Message, call: Callback) {
case H5CallNativeType.jsCall_getArticleDetailBussinessData:
break;
case H5CallNativeType.jsCall_callAppService:
handleJsCallCallAppService(data)
break;
case H5CallNativeType.jsCall_receiveH5Data:
if(data?.data?.dataSource === 5){
handleH5Data(JSON.parse(data?.data?.dataJson || '{}'))
}
handleJsCallReceiveH5Data(data)
break;
case H5CallNativeType.jsCall_appInnerLinkMethod:
handleJsCallAppInnerLinkMethod(data)
break;
case 'changeNativeMessage':
call("this is change Web Message")
...
...
@@ -51,17 +53,35 @@ class AppInfo {
* 获取App公共信息
*/
function getAppPublicInfo(): string {
let info = new AppInfo()
info.plat = 'Phone'
// 直接用Android,后续适配再新增鸿蒙
info.system = 'Android'
info.networkStatus = 1
let result = JSON.stringify(info)
Logger.debug(TAG, 'getAppPublicInfo: ' + JSON.stringify(info))
return result;
}
function handleH5Data(content:ContentDTO) {
Logger.debug(TAG, 'handleH5Data' + ', content: ' + JSON.stringify(content))
ProcessUtils.processPage(content)
function handleJsCallReceiveH5Data(data: Message) {
switch (data?.data?.dataSource) {
case 5:
if (data?.data?.dataSource === 5) {
ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
}
break;
default:
break;
}
}
function handleJsCallCallAppService(data: Message) {
}
function handleJsCallAppInnerLinkMethod(data: Message) {
}
...
...
sight_harmony/features/wdComponent/src/main/resources/rawfile/apph5/index.html
View file @
4006bb7
...
...
@@ -14,9 +14,9 @@
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<!-- 设置苹果工具栏颜色 -->
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
/>
<script
src=
"./js/plugin/vconsole.min.js"
></script
>
<!-- <script src="./js/plugin/vconsole.min.js"></script>--
>
<script>
new
VConsole
()
//
new VConsole()
var
hasDetails
=
false
function
getTime
()
{
...
...
Please
register
or
login
to post a comment