npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

xy-app-bridge

v1.6.3

Published

``` 和 webview交互 调用 app 方法 @param {String} name @param {String | Object} data ```

Readme

callhandler

和 webview交互
调用 app 方法
    @param {String} name
    @param {String | Object} data
  • getToken:获取用户 token

  • callCameraOrPhoto:调用原生相机与相册(原生弹窗)上传图片(原 getImage)

参数:
相册图片最大选择张数(String) 如:“1”、“3”
返回结果:
图片的base64
  • previewImageView:图片预览(原 showImage)
参数:
String index;  图片的角标。一上来显示 第几张图片
List<String> images;  图片集合
String desc;  文本内容
  • goBack:线上三门峡返回功能
  • closeWeb:关闭 webView,回到首页
  • jumpTargetPage:跳转原生页面
 0:首页
 1:帖子评论回复详情页
 2:评论回复详情页
 6:跳转到我的-点赞/关注列表页面
 11:便民
 13:圈子内容页14:便游
 16:跳转到系统消息
 18:便企
 19:我的
  • topViewStatus:隐藏显示导航条(原 controlTopView)
接收参数 type show显示/hide隐藏
  • pushMapApp:调取原生地图来导航
参数:
String longitude;  经度
String latitude;  纬度
String addressname;  地址名称
  • handlePayment:发起支付(直接调起微信 SDK)
 参数:
 微信支付需要参数:
 String payType;  支付类型 “wxPay”
 String appId; 微信支付AppID
 String nonceStr; 随机字符串,不长于32位。推荐随机数生成算法
 String packageValue; 扩展字段,暂填写固定值Sign=WXPay
 String partnerId; 微信支付商户号
 String prepayId; 预支付码,微信返回的支付交易会话ID
 String sign;  签名
 String timestamp; 时间戳
 返回结果:
 微信支付吊起是否成功回调(非支付结果)
 int code;  吊起支付SDK结果 200:成功  500:失败
 String msg; 成功/失败的信息
  • openShare:分享功能
 * String shareType  //分享类型 “shareUrl”-链接“sharePicture”-图片“shareVideo”-视频“shareMusic”-音频 “shareText”-文字
  * String title; // 分享标题
  * String desc; // 分享描述
  * String image; // 分享图片
  * String url; // 分享链接
  * String video; // 分享视频地址
  * String music; // 分享音频地址
  * List<String> shareList; //分享支持的渠道  "wxFriend":微信好友   "wxCircle":朋友圈   "QQ"    "weibo":微博
  * List<String> functionList; //分享支持的附加功能 copyUrl(复制链接) printscreen(截图)  webPrintscreen(Web长截图)
  * boolean showScreenLight; //控制分享页面是否显示 屏幕亮度,true/false
  * boolean showFontSize; //控制分享页面是否显示 字体大小, true/false

默认值  {
            shareType: "shareUrl",
            shareList: ["wxFriend", "wxCircle"],
            showScreenLight: false,
            showFontSize: false
        };
  • handleCustomerService:拉起原生的客服聊天窗口(原 goCuService)
  • topViewButtonShowWithStatus:顶部状态栏右侧三个点/相机
 * 顶部状态栏右侧三个点/相机
 * String btnType;	类型:camera(相机) 需要传btnList数组,类型为:setting(三个点),需要传share对象
 * btnList:Array,类型为camera时候所需要的数据
 *    [
 *       {
 *          String title;   提交页面导航栏显示的名称
 *          String btnTitle; 按钮的名称
 *          String textViewDefaultText;  input框的文字显示
 *          String submitImageURL;  上传图片地址
 *          String submitDataURL;  提交的接口
 *          int submitType;  需要上传文字和图片  0 是图片文字都不为空 1文字不为空 2 图片不为空
        }
        ...
      ]
 *  share:Object,类型为setting的时候所需要的数据
 *    {
 *      String title;  分享的标题
 *      String content;  分享的内容
 *      String image;  分享的缩略图
 *      String url;  分享的页面URL
 *    }
  • openCameraOrPhoto:直接吊起相机或者相册(没有弹窗)
参数:
String type;  "camera":相机	“photo”:相册
String maxNumber;  相册选择照片时的最大张数
返回结果:
图片的base64
  • pushUploadImageView:调用图文提交页面
参数:
String title;  提交页面导航栏显示的名称
String textViewDefaultText;默认文案
String submitImageURL;  上传图片的地址
String submitDataURL;  提交图文的接口地址
SubmitDicBean submitDic;
int submitType;  需要上传文字和图片  0 是图片文字都不为空 1文字不为空 2 图片不为空
  • pushLogin:未登录状态跳转登录页面
参数:
登录完成后是否要跳转到首页(String) “backHome”:跳转到首页
默认:backHome
  • handleScan:扫一扫(新)(支持跳 H5、原生页面)
  • handleScanSafe:扫一扫(新)(支持跳 H5、原生页面)(类似 handleScan,为不影响原有调用重新封装,新增方法添加安全域名)
参数:
String openType;  “native”:(扩展字段,暂未开放)原生页面 “web”:h5页面
webParameters{  openType为web时传递
	List safeDNSList;   安全域名集合
	String safeContentRegExp ;   正则表达式(与safeDNSList取一)
	String parameters;  扫描结果拼接的参数
}
nativeParameters{  openType为native时传递
	String targetPager;  原生目标页面
}
  • getIDcard:吊起实名认证页面
  • getLocation:获取定位坐标
返回结果:
String latitude;维度
String longtitude 经度
  • hiddenRightBtn:隐藏页面右上角三个点
  • showNetErrorView:显示错误页面
  • saveImageWithURL:保存 h5 图片到本地
参数:
要保存图片的URl(String)
  • byCollectState:H5 通知原生便游收藏成功/取消收藏
参数:
int id;   便游ID
int state;   便游状态ID 0:未收藏 1:已收藏
  • getAliPayAuth:支付宝授权
  • getUserInfo:获取用户信息(手机号、姓名、身份证号)
返回结果:
String realName;  用户姓名
String phone  用户手机号
String realID  用户身份证号
  • voicePlay:语音播报
参数:
语音播报的地址(String)
  • closeButtonStatus:控制顶部状态栏关闭按钮的显示
接收参数 type show显示/hide隐藏
  • invokeFaceDetection:吊起活体检测
返回结果:
String faceUrl;  人脸识别base64结果
String deviceId;  设备ID
  • directShare:分享 (支持链接、图片、视频、音频、文字)直接分享到平台
参数:
String sharePlatform; 分享到的平台 "wxFriend":微信好友   "wxCircle":朋友圈   "QQ":qq    "weibo":微博
String shareType;  分享类型 “shareUrl”-链接“sharePicture”-图片“shareVideo”-视频“shareMusic”-音频 “shareText”-文字
String title;  分享标题
String desc; 分享描述
String image;  分享图片
String url;  分享链接
String video;  分享视频地址
String music;  分享音频地址
  • copyContentToClipboard:复制内容到剪切板
接收 输入内容
  • userTokenExpired:h5 页面通知移动端 token 过期

  • callPhone:拨打电话

  • cleanHistoryPager:请示历史浏览记录

参数:
需要拨打的电话(String)