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

nw-app-read

v2.9.11

Published

## 浏览器H5尝试打开云阅读APP

Downloads

218

Readme

nw-app-read

浏览器H5尝试打开云阅读APP

尝试唤起APP,如果未安装APP则跳转下载或wap页面

使用

直接引用

下载dist/openapp.js,通过script标签直接引入打包好的文件

<script src="./dist/openapp.js"></script>
<script type="text/javascript">
      NWAppRead.openAppRead({
          path: 'detail',
          query: {
              id: '1b7140a1bb4e4ec3bcbb08e5e0093cee_4' //阅读bookId
          },
          h5Fallback: true
      })

      //指定下载地址
      NWAppRead.openAppRead({
          path: 'detail',
          query: {
              id: '1b7140a1bb4e4ec3bcbb08e5e0093cee_4' //阅读bookId
          },
          downloadUrl: 'http://yuedu.163.com/goto?type=181129001'
      })
</script>

npm包引入

npm: 通过npm引入然后直接调用openAppRead()完成跳转

import {openAppRead} from 'nw-app-read'

参数为Object类型 如:

| 参数属性 | 类型 | 描述 | | --- | --- | --- | | path | String | h5跳转应用内页面 | | query | Object | h5跳转应用内页面参数 | | h5Fallback | Boolean | 非必须参数,为true时如果跳转不成功打开h5对应页面,而非跳下载(安卓系统和ios9以下的微信内,不跳微信提示页,直接跳h5页面),默认为false(打不开则跳下载) | | replace | Boolean | 是否使用location.replace去跳转页面,默认为false | | downloadUrl | String | 配置客户端下载地址,默认值为https://yuedu.163.com/download |

尝试APP打开发现页

      openAppRead({
          path: 'webview'
      })

尝试APP打开阅读详情页,打不开跳下载

    openAppRead({
            path: 'detail',//path='detail'表示使用APP打开详情页面
            query: {
                id: '1b7140a1bb4e4ec3bcbb08e5e0093cee_4'//阅读bookId
            }
        })

尝试APP打开资讯详情页,打不开跳下载

    openAppRead({
            path: 'news',
            query: {
                id: '0c74e2cb723d4a54a6953ab3317421bb_1', //资讯源id
                cid: 'cb3460f480f54daead3495a4354e147d_1' //资讯文章id
            }
        })

尝试APP打开书架

      openAppRead({
          path: 'shelf'
      })

尝试APP打开包月详情页,IOS客户端不支持shema跳包月详情页,故跳h5页面

      openAppRead({
            path: 'baoyue',
            query: {
                id: '60071003'//阅读bookId
            }
      })

尝试APP打开充值页

      openAppRead({
          path: 'recharge',
          query: {
              aid: '', //活动id,可选
              money: 2000,  //要充值的阅点数,可选
              url: 'https://m.yuedu.163.com/' //要打开的h5页面url,可选
          }
      })

尝试APP打开购买页

      openAppRead({
          path: 'trade',
          query: {
              id: '5ff9990cb61e418c82ea3d74f83137a8_4', //阅读bookId
              title: '碧台空歌', //书籍title
              full: 0, //0 按章购买 1 全本购买
              url: 'https://m.yuedu.163.com/' //要打开的h5页面url
          }
      })

尝试APP打开打包购

      openAppRead({
          path: 'packagebuy',
          query: {
              pid: '2260043022', //打包购pid
              url: 'https://m.yuedu.163.com/' //要打开的h5页面url
          }
      })

尝试APP打开h5页面,如活动页等

    openAppRead({
          path: 'activity',
          query: {
              url: location.href
          }
      })

尝试APP打开听书详情页

    openAppRead({
            path: 'audio',
            query: {
                id: 'audio_05f871a2e4f04293b9ac1abf95edb912_4' //阅读bookId
            }
        })

尝试APP打开书架页(V6.0版本)

    openAppRead({
            path: 'bookshelf'
        })

尝试APP打开手机号绑定页(V6.0版本)

    openAppRead({
            path: 'mobileBind'
        })

尝试APP打开排行页(V610版本)

    openAppRead({
          path: 'rank',
          query: {
              url: '/store/merged/rankNavi.json?uuid=b5648dd3c4f24d9796f590cd81ca076e&rankType=112',
              title: '排行榜'
          }
      })

尝试APP打开书城(V610版本)

    openAppRead({
        path: 'bookstore',
        query: {
            tab_index: 1
        }
    })

尝试APP打开分类(V610版本)

    openAppRead({
        path: 'category',
        query: {
            tab_index:  1,
            sub_tab_index: 2
        }
    })

尝试APP打开包月详情页面(V610版本)

    openAppRead({
        path: 'package',
        query: {
            baoyue_id: '60077001' //包月id
        }
    })

h5Fallback=true时尝试APP打开页面,打不开跳h5页面

    openAppRead({
            path: 'detail',
            query: {
                id: '1b7140a1bb4e4ec3bcbb08e5e0093cee_4'//阅读bookId
            },
            h5Fallback: true
        })