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

@byhealth/points

v4.0.51

Published

查看文档 [document](http://wx-test.by-health.com/web/points2020/#/)

Downloads

133

Readme

查看文档 document


new Points({
    // Object 初始化参数
    data: {
        phone,
        antiFakeCode
    },

    // Object 自定义HTHLelement Id 与字段(表单/事件)的映射关系
    elementNodeMappingField,

    // Boolean 是否验证手机号码 默认否
    verifyPhone,

    // Boolean 是否绑定手机号码 默认否
    bindPhone,

    // Boolean 是否禁用手机号码 默认否
    disabledPhone,

    // Boolean 是否隐藏手机号码 默认否
    hidePhone,

    // Object 错误码与错误信息映射关系
    errorCodeMap,

    // object {antifakecode, bindPhone, sendValidateCode, checkValidateCode, checkRiskPointsLimitStatus } 定义防伪积分,绑定手机,获取验证码等 api接口 默认使用中台生产API
    API,

    // String 挂载Dom 使用默认模版时,默认模版挂载的目标HTHLelement Id 
    targetId,

    // String 模板id 使用默认模版时,创建的子节点Id
    templateId,

    // Boolean 自动挂载 实例化Points时是否自动完成HTHLelement元素的挂载以及事件的处理,默认true;false时需要通过Points.mount方法手动挂载
    autoMount,

    // Function 扫码回调
    onScan,
    
    // Function 处理积分异常 Promise
    handleError,
    
    // Function 追加验证处理 Promise
    handleValidate,

    // Function 初始化回调
    onInit,

    // Function 积分回调
    onSubmit,

    // Function 处理弹窗数据
    onCloseMessage,
    
    // Object 验证手机倒计时设置 {interval: 倒计时, buttonText: 按钮文字, countdownText: 接受一个方法复写倒计时文字 count => `${count}秒后重试`}
    verifyPhoneCountdown
})

Options

Points.setData

Function 设置当前参数

Points.mount

Function 挂载Points,重置数据代理与监听

Points.unmount

Function 挂载Points,卸载Points

Points.$data

Object 获取当前参数

Points.prevData

Object 获取历史请求数据与响应数据 {request, response}

static

Points.PointsError

Class PointsError 用于创建Points内部能处理的异常, throw new PointsError(message, code) message错误信息 code错误码。

Points.tools

其他工具集

{
    Modal, // Class 信息弹窗
    Loading, // Class 加载 Loading
    validate, // Object 表单验证工具
    nativeAppJssdk, // 营养管家AppJssdk
    // 整合微信与营养管家App的条形码与二维码扫码方法
    scan:{
        qrCode,
        barCode
    }
}

✋500:其他异常错误 -防伪积分操作异常,异常信息【异常信息文案内容】
✋20000, "防伪码输入有误,请重新输入16位防伪码"
✋20001, "您查询的是{brand}正品,请扫描或输入产品瓶身条形码完善信息"
🎈20002, "您查询的是{brand}正品,此防伪码已在{jfTime}首次查询并积分"
🎈20003, "您查询的是{brand}正品,此产品已被兑换暂不积分,如有疑问请致电{telephone}"
🎈20004, "您查询的是{brand}正品,本品暂不积分,如有疑问请致电{telephone}"
🎈20005, 首次查询:您查询的是{brand}正品,本品不单独销售暂不积分,如有疑问请致电{telephone}
🎈20005, 非首次查询:您查询的是{brand}正品,本品不单独销售暂不积分,此防伪码已在${firstVerifyTime}首次查询 🎈20006, "对不起,内部员工与经销连锁店员不能积分,如有疑问请致电%s"
🎈20007, "对不起,该账户%s不能积分,如有疑问请致电%s"
✋20008, "您已触发积分预警,暂时无法积分,请按照短信指引上传相关资料进行审核。"
🎈20009, "您查询的是{brand}正品,产品已过保质期不参与积分,如有疑问请致电{telephone}"
✋20010, "您购买的产品防伪码信息不完整,如有疑问请拨打产品包装上的营养咨询热线"
🎈20011, "本品为正品(电商渠道),如需积分请前往电商渠道"
🎈20012, "本品为正品(电商渠道),如需积分请前往电商渠道"
🎈20013, "您查询的是{brand}正品,本品暂不积分,套装礼盒积分请扫描外包装防伪码"