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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@byhealth/native-jssdk

v0.0.12

Published

汤臣倍健营养家 APP JSSDK

Downloads

31

Readme

Native App JSSDK

汤臣倍健营养家 APP JSSDK

安装

推荐使用yarn安装:yarn add @byhealth/native-jssdk

或使用NPM安装:npm install @byhealth/native-jssdk

使用

import { scanQrCode, closeWindow } from '@byhealth/native-jssdk';

scanQrCode()
  .then(result => {
    // result 是识别后的结果
  });

closeWindow(); // 关闭当前WebView

API

打开摄像头,扫描识别条形码 scanBarCode(): Promise<string>

返回结果:

识别的文本

打开摄像头,扫描识别二维码 scanQrCode(): Promise<string>

返回结果:

识别的文本

发送短信到手机号 sendSMS(mobile: string, message: string): Promise<void>

参数列表:

mobile: 手机号码

message: 默认发送消息

返回结果:

批量发送短信到手机号列表 batchSendSMS(mobiles: Array<string>, message: string): Promise<void>

参数列表:

mobiles: 手机号码数组

message: 默认发送消息

返回结果:

关闭WebView窗口 closeWindow(): Promise<void>

返回结果:

返回页面 goBack(): Promise<void>

当前页面有上一级页面时,调用会返回上一页面; 如果页面没有上一级页面,则关闭当前页面(Android不关闭)。

返回结果:

跳转到指定页面 goToPage(type: any): Promise<void>

参数列表:

type: 目前只识别参数值“1”,跳转到“中奖明细”页面

返回结果:

监听返回按钮事件 listenBack(cb: Function): Promise<void>

参数列表:

cb: 点击返回按钮时候的回调

返回结果:

取消监听返回按钮事件 unlistenBack(): Promise<void>

返回结果:

设置WebView的标题 setTitle(title: string): Promise<void>

参数列表:

title: 要设置的标题

返回结果:

弹出提示消息 alert(message: string): Promise<void>

参数列表:

message: 要弹出的消息

返回结果:

无 (无阻塞)

获取用户信息 userInfo(): Promise<Object>

返回结果:

当前登录用户信息

调用手机振动 mobileVibrate(): Promise<void>

返回结果:

调用系统分享功能 share(info: Object): Promise<void>

参数列表:

info.title: 分享标题

info.content: 分享内容

info.image: 分享图片

info.url: 分享链接

返回结果:

显示右上角导航按钮 showNavRightButton(text: string, onClick: function): Promise<void>

返回结果:

隐藏已显示的右上角导航按钮 hiddenNavRightButton(): Promise<void>

返回结果:

开始播放音乐 playMusic(url: string): Promise<void>

返回结果:

pauseMusic pauseMusic(): Promise<void>

返回结果:

恢复播放音乐 resumeMusic(): Promise<void>

返回结果: