Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
AppJSBridge
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
5
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李犇
9 years ago
Commit
af92776309b60a64f72cd1eeaa5e797bcbd303e7
1 parent
52352553
提交header定义文档初稿
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
39 deletions
HeaderType.md
HeaderType.md
View file @
af92776
#
YHJSBridg
e
#
HeaderTyp
e
==================
YHJSBridge用于实现JavaScript与原生Objective-c之间的方法调用
## JS调用OC
### 调用方法
```
js
var
params
=
{
"action"
:
"action"
,
"arguments"
:{...}
};
<!--
触发机能
-->
yohoInterface
.
triggerEvent
(
onSuccess
,
onFail
,
params
);
```
*
yohoInterface
全局js对象,用于调用native代码,是所有与native通信的载体。
*
triggerEvent
通过此方法,发起native通信请求。所有的native通信都由此方法
*
onSuccess
调用native代码成功后的回调方法
*
onFail
调用native代码失败后的回调方法
*
params
具体行为所需参数
### params参数详解
*
action :行为参数,代表此次调用的行为。例如
`go.login`
表示跳转至登陆页面
*
arguments:参数列表,用于传递参数
action|arguments|描述
---|---|---
go.tab|{"index":tab_index}|跳转至指定index的tab(从0开始)
go.login|{""}|跳转至登陆页面
go.shopingCart|{""}|跳转至购物车页面
go.address|{"uid":"9876096"}|跳转至地址管理页面
go.imageBrowser|{"images":
[
imgUrl1,imgUrl2...
]
}|跳转至图片浏览页面
go.newPage|{"url":""}|跳转至新页面(页面内容为html)
go.pay|{"order":"098768"}|跳转至支付页面
定义原生应用提供给H5调用的页面头部类型
\ No newline at end of file
...
...
Please
register
or
login
to post a comment