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

pf-xiaochengxu-pvuv

v1.0.8

Published

小程序埋点代码

Downloads

7

Readme

说明

小程序专用埋点功能

安装

npm i pf-xiaochengxu-pvuv
or
yarn add pf-xiaochengxu-pvuv

使用

// main.js
// 1.0.1 版本以上写法
import { pvuv } from 'pf-xiaochengxu-pvuv'
// 1.0.1 版本以下写法
import pvuv from 'pf-xiaochengxu-pvuv'

const pvuv = new pvuv({
	mapKey: '******', // 地图key
	systemId: '***', // 系统 id, 不同的项目有不同的 id
	url: '***'
})
uni.pvuv = pvuv;

// manifest.json
"mp-weixin" : {
    // ......
    "permission" : {
        "scope.userLocation": {
            "desc": "你的位置信息将用于小程序位置接口的效果展示"
        }
    }
}

API

初始化参数

| 参数名 | 说明 | 类型 | 值 | 是否必填 | | ----- | ----- | ----- | ----- | ----- | | mapKey | 高德地图key,如果不填则不进行地图信息获取 | string | *** | false | | systemId | 系统ID | string | '' | true | | url | 埋点请求地址 | string | *** | true |

方法

埋点方法 pvuv.sendLogMonitor_pvuv(pointId, userId, otherParams)

|参数名|说明|类型|默认值|是否必填| |-----|-----|-----|-----| ----- | | pointId | 埋点id | string | - | true | | userId | 用户id | string | - | false | | otherParams | 其他供埋点分析的参数 | Object | - | false |

设置系统id pvuv.setSystemId(value)

|参数名|说明|类型|默认值|是否必填| |-----|-----|-----|-----| ----- | | value | 值 | string | - | true |

注意

需要将以下地址添加到小程序的白名单中

  • https:*** 埋点接口
  • https://restapi.amap.com 高德地图接口

npm 发布

  • 提交代码(无需push到github仓库)
  • npm run build (打包)
  • npm version patch (自动升级 package.json 中的 version,如果手动改后,则不需要执行这个命令)
  • npm publish (发布)

发布注意

  • 需要在命令行工具中登录 npm , 执行 npm login
  • 登录 npm 不能使用淘宝代理,需要执行 npm config set registry https://registry.npmjs.org/ 将代理设置为 npmjs