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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hly-app-bridge

v1.2.19

Published

H5通过WebView容器与Native交互

Downloads

73

Readme

hly-app-bridge

H5通过WebView容器与Native交互

采用ES6标准打包的js库

install

npm官网安装源

npm install hly-app-bridge --save

公司npm私服安装源

npm install hly-app-bridge -registry=http://192.168.20.217:8081/repository/npm-bendi/

JS 前端调用

导入头文件

import HLYAppBridge from 'hly-app-bridge';

应用

  • 重新登录
HLYAppBridge.relogin();
  • 首页Pop
HLYAppBridge.h5MainPagePop();
  • PDF浏览页
HLYAppBridge.pdfView('XX说明书','http://local.zorrosoft.com/Files/PluginOK.pdf');
  • 银联支付插件
HLYAppBridge.unionPay(tnNo, (payRet) => {
  console.log('支付结果:' + payRet);
});
  • 司机贷插件
HLYAppBridge.driverLoan(userName, mobile, usrcertno);
  • 人脸识别SDK
HLYAppBridge.faceVerify(
  userName,
  certNo,
  orderNo,
  openApiNonce,
  openApiUserId,
  openApiSign,
  (verifyRet) => {
    console.log('认证结果:' + verifyRet);
});
  • OBU设置
HLYAppBridge.obuSetting(cardId);
  • OBU检测
HLYAppBridge.obuCheck();
  • APP本地数据保存
HLYAppBridge.storageSave(strKey, strVal);
  • APP本地数据删除
HLYAppBridge.storageRemove(strKey);
  • APP本地数据查询
HLYAppBridge.storageGet(key, (val) => {
  console.log('取值结果:' + val);
});
  • 拉起微信小程序
const miniProgramId = 'gh_4738dcf93a6d';                      // 慧联运支付测试用小程序,原始ID
const path = 'pages/index/index?unionMiniPayOrder=xxxxxxx';   // 小程序页面路径 + '?key=val'
const type = 0;                                               // 0 -- 正式版  1 -- 开发版  2 -- 体验版
HLYAppBridge.launchWxMiniProgram(miniProgramId, path, type,(extMsg) => {
  console.log('小程序主动返回APP的参数:' + extMsg);            //对应小程序组件 <button open-type="launchApp"> 中的 app-parameter 属性值
})
  • 微信分享
HLYAppBridge.wxShare('分享标题', '分享描述', 'http://wwww.baidu.com',"https://tse2-mm.cn.bing.net/th/id/OIP.S0BT3MfRDw7v8Ia0DYLTIgHaF0?pid=ImgDet&rs=1");
  • 权限请求
HLYAppBridge.requestPermissions([HLYAppBridge.CameraPermission,HLYAppBridge.LocationPermission],(grant) => {
  console.log('是否授权' + grant);       
})
  • 上传通信录及通话记录
HLYAppBridge.uploadContactsAndCallLog()
  • 打开通讯录,选择联系人及上传操作
  • contacts:string {name : "", phone: ""}
  • type:string
  • 0:开通讯录并返回选择的联系人
  • 1:打开通讯录返回联系人并上传通讯录及通话记录
  • 2:请求权限后上传通讯录及通话记录
HLYAppBridge.openContacts(type ,(contacts) =>{
})
  • 关闭H5并调整到指定路径
  • url:string(H5地址或具体Rn页面路由类似 OBU检测:HLY://Home/ElectronicTagModifySelect)
HLYAppBridge.h5MainPopToDestination(url)
  • H5跳转App地图
  • {"mapName": "http://maps.apple.com/", "url": ""}
HLYAppBridge.h5ToAppMap(data: object)
  • H5运单签收
HLYAppBridge.h5WaybillSign(data: object)
  • H5货运司机完善回调
HLYAppBridge.h5PerfectDriverInformation(data: object)
  • 接单协议签署完成回调
  • @param {string} waybillId 运单id
  • @param {string} carId 车辆id
HLYAppBridge.agreementSignComplete(waybillId: string, carId: string)
  • OBU设置 西藏卡 发行激活
  • @param {string} cardId 卡记录id
  • @param {string} vehiclePlate 车牌号
  • @param {string} vehiclePlateColor 车牌颜色编码
  • @param {string} orderId 订单号
HLYAppBridge.obuXzCardSetting(cardId: string,vehiclePlate: string,vehiclePlateColor: string,orderId: string)
  • 微信/QQ分享 带生成海报
  • @param {string} shareTitle 分享标题
  • @param {string} shareContent 分享内容
  • @param {string} shareUrl 分享链接
  • @param {string} thumImage 分享图片
  • @param {object} other 生成海报参数
  • @param {function} callback 生成海报调用回调 参数string 需要JSON转化
HLYAppBridge.wxAndQqShare(shareTitle, shareContent, shareUrl, thumImage, other, (data) => {
  console.log('生成海报参数:' + data);
})
  • 图片保存到相册 base64 数据 URI
  • @param {string} picUri base64 数据 URi
HLYAppBridge.hlySaveToCameraRoll(picUri);
  • 清空数据并退出app
HLYAppBridge.clearExitApp();
  • H5单独调用拍照功能
  • @param {function} callback 获取拍摄的照片base64
HLYAppBridge.takeCamera((data) => {
  console.log('生成海报参数:' + data);
})
  • 微信图片分享
  • @param {string} channel 分享渠道 1 微信好友 2 朋友圈
  • @param {string} title 分享标题
  • @param {string} description 分享内容描述
  • @param {string} thumImage 分享图片 小图 缩略图
  • @param {string} imageUrl 分享图片 大图
  • @param {object} other 其他参数
  • @param {function} callback 微信图片分享调用回调
HLYAppBridge.wechatShareImage(channel,title,description,thumImage,imageUrl, other, (data) => {
  console.log('微信图片分享调用回调:' + data);
})
  • H5单独调用相册功能
  • @param {string} {"data":"","fileName":""} 获取拍摄的照片base64
HLYAppBridge.launchImageLibrary((data) => {
  console.log('单独调用相册功能:' + data);
})

更新说明

v1.2.18(2024/07/16)

  1. H5单独调用相册功能;

v1.2.17(2024/02/18)

  1. 修改跳转地图和浏览器桥接;

v1.2.15(2023/12/27)

  1. 微信图片分享;

v1.2.13(2022/11/24)

  1. H5单独调用拍照功能;

v1.2.12(2022/11/15)

  1. 清空数据并退出app;

v1.2.11(2022/02/23)

  1. 图片保存到相册 base64 数据 URI;

v1.2.10(2022/02/16)

  1. 微信/QQ分享 带生成海报;

v1.2.9(2021/12/29)

  1. 新增西藏卡发行激活设置回调通知;

v1.2.8(2021/12/18)

  1. 新增接单协议签署完成回调;

v1.2.7(2021/12/10)

  1. 新增H5运单司机资料完善成功回调 默认参数{};

v1.2.6(2021/12/10)

  1. 新增H5运单签收方法;

v1.2.4(2021/10/25)

  1. 新增h5ToAppMap方法;

v1.2.3(2021/9/26)

  1. 新增h5MainPopToDestination方法;

v1.2.2(2021/7/06)

  1. openContacts方法扩展;

v1.2.1(2021/6/15)

  1. 微信分享新增缩略图;

v1.2.0(2021/6/2)

  1. 新增OBU检测;

v1.1.9(2021/5/18)

  1. 打开通讯录优化;

v1.1.8(2021/5/17)

  1. 新增打开通讯录;

v1.1.7(2021/5/12)

  1. 新增上传通信录及通话记录;

v1.1.6(2021/5/11)

  1. 权限类型定义;

v1.1.5(2021/5/11)

  1. 新增动态权限请求;

v1.1.4(2021/4/21)

  1. 拉起微信小程序支持开发版、发布版或体验版可配;
  2. 增加微信分享功能

v1.1.3(2021/4/21)

  1. 拉起微信小程序后主动返回APP时增加参数回调;

v1.1.2(2021/2/22)

  1. 修复README文档:增加“公司npm私服安装源”命令;

v1.1.1(2021/2/19)

  1. 修复README文档格式;
  2. 由UMD兼容标准改为ES6标准打包js库;

v1.1.0(2021/2/19)

  1. 更改为TS版本,加入TS类型描述文件便于编辑器智能提示;

v1.0.3(2021/2/6)

  1. 增加README说明文档;

v1.0.2(2021/2/6)

  1. 修复在React-Native-WebView容器中,页面mouted生命周期里无法与容器通讯交互的问题;

v1.0.1(2021/2/4)

  1. 兼容对原生WebView容器的通讯交互方式;

v1.0.0(2021/2/3)

  1. 提供H5与React-Native-WebView容器之间的通讯交互方法;