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

hymd-store-jsapi

v1.12.7

Published

酷店掌移动端jsapi

Downloads

5

Readme

cool-sdk

使用

api接口的使用必须在页面中引入如下脚本:

npm install @cool/sdk --save

运行时环境

指令

接口api

接口api是对不同环境的接口的集合,统一使用native调用

通用api

通过api就是这个api在每个环境中都可以使用,区别于特定api,比如previewImage就是通用api,每个环境都有,createDing就是特定api,只有钉钉环境有

参考

注意

  1. 目前只能访问原生能力的方法,不能访问属性
  2. 每一个原生方法都需要有回调
  3. 返回值暂时不能支持promise
  4. 通用api,比如previewImage,需要在参数中添加isNative这个属性
    1. 通用接口重写一下(h5有得,原生也有的,原生重写下)
  5. 企业微信初始化配置暂时需要自己配置,未来会进行封装
  6. 调用企业微信相关api,此api必须得注册好
  7. 必须将router对象挂载在window中, window.router = router

todoList

  • 发布自动更新版本及生成版本记录
  • [x] 支持promise
  • [x] 原生路由和h5功能
  • 企业微信初始化封装
  • [x] 支持配置及并发上传图片, 配置上传地址等
  • api接口测试预览(使用代理嵌入到原生环境中)
  • [x] 调用传参和响应日志能力
  • 初始化自动加载jsbridge脚本功能
  • [x] 编辑图片功能
  • [x] ts类型文件
  • 全局变量冲突,比如window.dd.onMessage 与 window['getCommonData'], window.addEventListener("message")导致jsapi与项目的数据返回不正常

FQA

  1. 通信的全局变量冲突, 如何兼容, 暂时需要库里面的通信监听, 通过外部监听
    // 兼容app
     window['getCommonData'] = function(res) {
       cool.handleMessage?.(res)
       if (res.action === type) {
         // 安卓或ios结果与钉钉一致
         const result = paramsResultMapping(type, res)
         result.callbackId = callbackId
         successCbk(result);
       }
     };
    // 兼容dingding
    window.dd && (window.dd.onMessage = (data) => {
      // 
      cool.handleMessage?.(data)
    })
    // 兼容PC