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

@bbtfe/downloadbar

v0.0.2

Published

通用下载组件.

Downloads

5

Readme

DownloadBar通用下载条组件

分享页的通用下载条, 一般显示在顶部或底部

引用方式

npm引用

npm i @bbtfe/downloadbar
import DownloadBar from '@bbtfe/downloadbar';

script引用

支持HTTPS和HTTP,建议在通常页面中使用下面去掉协议头的形式引用即可。

<script src="//static02.babytreeimg.com/img/bca/downloadBar/0.0.2/dist.min.js"></script>

开发说明

  • 拉取源码到本地,源码目录:bbt-fe-comp/downloadBar
  • npm i
  • npm run build
  • bbt-common-asset项目下对应的SDK目录(bbt-common-asset/static/downloadBar)新建版本号文件夹
  • 将dist下文件拷至 新版本号 目录里
  • 以gittool方法提交代码, 编译后的代码bbt-common-asset,源码bbt-fe-comp, 都需要提交
  • 项目中引入验证下

API

1. 显示下载条

DownloadBar.show([object Object]);

DownloadBar.show方法的各参数的默认值为:

const options = {
    title: '宝宝树孕育',
    desc: '孕育养娃神器',
    btnText: '立即下载',
    logo: '//pic01.babytreeimg.com/img/wp/ic/lg_pregnancy_big_2020.png',
    showClose: true,
    dpParams: {
          autoDp: false,
          schemeUrl: 'bbtrp://com.babytree.pregnancy/home/homepage',
          download: {
               android: 'http://r.babytree.com/8iSVC2b',
               ios: 'http://r.babytree.com/8iSVC2b',
          },
          coverImage: {
               canClose: true,
               ios: '//static02.babytreeimg.com/img/preg-fe/caneat/common/ios-cover.png',
               android: '//static02.babytreeimg.com/img/preg-fe/caneat/common/android-cover.png',
          },
          yybUrl: 'http://a.app.qq.com/o/simple.jsp?pkgname=com.babytree.apps.pregnancy&ckey=CK1351100144579',
    },
    dpSDKV: '1.2.0',
    trackSDKV: '0.2.3',
    mode: 'default',
    position: 'top',
    onClose: () => {},
    onClick: () => {},
    closeAnimate: false, 
}

DownloadBar.show方法各参数含义:

a. onClick: 下载按钮的点击事件回调 b. onClose: 点击关闭bar的事件回调 c. title: 要显示的title,默认为:'宝宝树', d. desc: 要显示的描述,默认为:'孕育养娃神器', e. btnText: 下载按钮的文案,默认为:'立即下载', f. logo: 要显示的logo,默认为:'//pic01.babytreeimg.com/img/wp/ic/lg_pregnancy_big_2020.png', g. showClose: 是否可以关闭bar,默认为:true, h. dpSDKV: deeplink sdk的版本号, 默认为: '1.1.7', i. trackSDKV: tracking埋点sdk的版本号,默认为: '0.2.1', j. mode: bar的固定方式,默认为:'default',可以设置为‘fixed’ k. position: bar显示位置,默认为‘top’显示在顶部,可以设置为‘bottom’,要mode设置为fixed才会生效 l. dpParams: dp时所需要的一些参数,object

 1.schemeUrl: 需要dp起来的app的路由,默认: 'bbtrp://com.babytree.pregnancy/home/homepage',
 2.download:ios和android下载的链接,默认:
 3.coverImage:在ios和安卓中弹出的遮罩和是否可以关掉该遮罩,
 4.yybUrl:应用宝下载链接, 默认为:'http://a.app.qq.com/o/simple.jsp?pkgname=com.babytree.apps.pregnancy&ckey=CK1351100144579',

2. 隐藏下载条

DownloadBar.hide();

3. 注意点

a. 已经做了在孕育app中不显示下载bar b. 如果页面中没有引入deeplink,tracking和w2a的相关js的话,会自动引入 c. 下载bar的固定方式有两种: ‘default’和‘fixed’