Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ws-webview

ws-webview api说明

Overview

只作用于文率科技内部webview的api说明,源码只作用于webview内部

Note

使用前最好先检测api对象是否存在

tyof(ws)!=undefined&& ...

ws

funcvaluetyperequired/optionalcomment
getUserInfoundefinedundefinedoptional返回用户信息,未登录return {}
showGoodsDetailidnumberrequired跳转到商品详情
showStoreDetailidnumberrequired跳转到商户详情
showCrowdfundDetailidnumberrequired跳转到众筹详情
photoGalleryimages,indexarray,numberrequired调起图片查看器 images:['url1','url1']
alerttitle,message,buttonsstring,string,arrayrequired,optional,optionalbuttons:[{text:string,onPress:func}]
loaddingaction,titlestring,stringrequired,optionalaction:PropTypes.oneOf(['show','hide']
pushLoginundefinedundefinedoptional跳转到登陆
pushWebViewurlstringrequired打开一个内部webview地址,url:demo/test1?id=1
popWebViewundefinedundefinedoptional关闭当前的webview导航
openWebViewurlstringrequired打开一个外部webview地址,完整的url
toasttextstringrequired注:使用子方法,不能直接使用 例: toast.show('');toast.info('');toast.warn('');toast.error('')
statusBarhidden/barStylebool/stringIosbarStyle:PropTypes.oneOf(['default', 'light-content'])
statusBarhidden/backgroundColor/translucentbool/string/boolAndroidbackgroundColor:color

addEventListener (data.action)

  • getUserInfo(Object) - Takes an object.
  • alert(Object) - alert array value.
setTimeout(function(){ws.addEventListener=function(e){switch(e.action){case'getUserInfo':
ws.alert(e.data)//UserInfobreak;case'alert':
ws.alert(e.data.value)//alert valuebreak;default:
}}},500)

About

ws-webview api说明

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors