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-comic

v2.2.3

Published

尝试唤起网易漫画APP,唤起不成功跳下载,或者使用浏览器直接打开

Downloads

8

Readme

插件用于cms或外包活动尝试打开网易漫画APP场景

(1)尝试唤起APP,如果未安装APP则跳转下载页场景

(2)尝试唤起APP,如果未安装APP则h5打开对应页面场景

使用

直接引用:下载/dist/bundle.js到工程中即可调用NWAppComic.openAppComic()方法完成跳转

<script src="dist/bundle.js"></script>

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

import {openAppComic} from 'nw-app-comic'

参数为Object类型,参数同jsbridge pageRedirect跳转类型参数(更多跳转类型请查看蜗牛读书jsbridge wiki) 如:

| 参数属性 | 类型 | 描述 | | --- | --- | --- | | path | String | h5跳转应用内页面 | | query | Object | h5跳转应用内页面参数 | | h5Fallback | Boolean | 非必须参数,如果跳转不成功是否使用h5打开对应页面,而非跳下载,默认为false(打不开则跳下载) | | replace | Boolean | 是否使用location.replace代理location.href进行跳转,默认为false | | onOpenFailed | Function | 如传此参数会尝试打开APP,如果打不开则调用回调,在微信中会提示使用浏览器打开 | 注:如需加mid 在query对象中添加mid属性 如:

      NWAppComic.openAppComic({
          path: 'webview',//表示用APP内嵌打开
          query: {
              url: location.href,//打开的链接地址
              title: '网易漫画',
              auth: false,
              mid:"xxx"
          }
      })

尝试APP内嵌打开内嵌页,打不开跳下载

      NWAppComic.openAppComic({
          path: 'webview',//表示用APP内嵌打开
          query: {
              url: location.href,//打开的链接地址
              title: '网易漫画',
              auth: false
          }
      })

尝试APP内嵌打开内嵌页,失败则直接浏览器打开

      NWAppComic.openAppComic({
          path: 'webview',//表示用APP内嵌打开
          query: {
              url: location.href,//打开的链接地址
              title: '网易漫画',
              auth: false
          },
          h5Fallback: true
      })

尝试APP内嵌打开内嵌页,失败则调用回调

 var doWebView3 = function () {
      NWAppComic.openAppComic({
        path: 'webview',//表示用APP内嵌打开
        query: {
          url: location.href,//打开的链接地址
          title: '网易漫画',
          auth: false
        },
        onOpenFailed: function () {
          alert('这是打不开app的回调')
        }
      })
    }

尝试APP打开漫画详情页,打不开跳下载

    NWAppComic.openAppComic({
            path: 'detail',//path='detail'表示使用APP打开漫画详情页面
            query: {
                id: '4508538831870127506'//漫画bookId
            }
        })

尝试APP打开漫画详情页,失败使用h5打开详情页

 NWAppComic.openAppComic({
            path: 'detail',//path='detail'表示使用APP打开漫画详情页面
            query: {
                id: '4508538831870127506'//漫画bookId
            },
            h5Fallback: true
        })

APP打开话题页

        NWAppComic.openAppComic({
            path: 'topic',
            query: {
                id: '3042276'//话题id
            }
        });

APP打开阅读器

     NWAppComic.openAppComic({
            path: 'reader',
            query: {
                id: '4508538831870127506',//bookid
                sectionId: '5085798221480150048'//sectionId
            }
        });