rbk
v0.0.28
Published
rbk jsbrage
Downloads
16
Readme
rubik-ui JSBridge VUE版本
安装
cnpm i --save rbk
使用
import { xxx } from 'rbk';
export default {
...
mounted(){
rbk.ready(()=>{
xxx()
})
},
methods:{
somefunction(){
xxx()
}
}
}
说明:在
mounted
(或者其他更早的生命周期)内必须在rbk.ready()
方法内调用,在methods
字段下可以任意调用。
下面是客户端组件列表
|prop|effect|parameter|other|
|:-|:-|:-|:-|
|login
|登录
|callBack
||
|loading
|等待框显示
|||
|loadDismiss
|等待框消失
|||
|alertDialog
|alert弹框
|config
:{title
,content
,button
}/callBack
|config
可以是字符串
或json对象
;callBack
即点击确认时的回调|
|confirmDialog
|confirm
|config
:{title
,content
,left_button
,right_button
}/callBack
:{callBack
,callBackLeft
,callBackRight
}|config
可以是字符串
或json对象
;callBack
可以传1~3
个方法|
|codeScanning
|扫码
|callBack
|返回参数:{"R":200,"code":"231322312332"}|
|accessCamera
|拍照
|callBack
|返回参数:{"R":200,"imageUrl":""}|
|accessGallery
|相册
|callBack
|返回参数:{"R":200,"imageUrl":""}|
|dateSelector
|日期选择器
|callBack
/date
|返回参数:{"R":200,"date":"2015-07-19"}|
|timeSelector
|时间选择器
|callBack
/time
|返回参数:{"R":200,"time":"12:40"}|
|goBack
|返回上一页
|||
|goHome
|返回首页
|||
|closeWebView
|关闭WebView
|||
|getClientType
|返回用户ClientType
|callBack
|返回参数:{"R":200,"client-type":""}|
|getUserOpenID
|返回用户OpenID
|callBack
|返回参数:{"R":200,"user_openid":""}|
|titleBar
|配置titlebar
|params
|文档: https://www.kancloud.cn/yaming/center/263802 |
|WXPay
|微信支付
|obj
|文档:https://www.kancloud.cn/yaming/center/268739 {"R":200,"code":"0"}/{"R":200,"code":"-1"}/{"R":200,"code":"-2"}|
|aliPay
|支付宝支付
|obj
|文档同上|