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

mta-wx

v1.5.0

Published

mta的小程序端的sdk

Downloads

27

Readme

mta的小程序端的sdk

引用方式

# 1.npm安装
npm install mta-wx
# 2.在微信开发者工具中的菜单栏:工具 --> 点击 构建npm
# 3.在微信开发者工具中的菜单栏:工具 --> 项目详情, 勾选“使用 npm 模块”选项

const mta = require('mta-wx')


###API通用必传参数:
>(1)wx : 小程序内的全局变量 wx  
(2)appId : 应用的appId 
(3)path :页面路径(不包含query参数)  
(5)ac :  埋点行为标识(详见:https://docs.qq.com/sheet/DZEtXVXFocW1wd3Rt?tab=BB08J2)

### 特殊可选参数: 
> (1) paramsType :(默认值为"0",即不对参数做任何处理),如果执行mta.register({paramsType:'1'}),那么会将参数中的content对象字段,转换成"a=1&b=2..."这种连接字符串的形式,作为args字段名扩展到原参数上,再上报。 

其他可选参数详见:https://docs.qq.com/sheet/DZHZsQlhCdEhLUHFk?tab=0zam46

### 全局注册固定参数(后续调API可以省略已注册的参数)
```js
//比如:
mta.register({appId:'XXXXXXXXX',wx:wx})
//或者多参数
mta.register({appId:'XXX',wx:wx,uid:'XXX',api:'/xx/xx/xxx})

去除全局注册固定参数

//比如:
mta.cutRegister('uid')
//或者多参数
mta.cutRegister('uid','uuid')

API - 进入和离开页面

#进入某个页面时
mta.enterPage({wx:wx,appId:'...',path:'...',其他可选参数...})

#离开某个页面时
mta.leavePage({wx:wx,appId:'...',path:'...',其他可选参数...})

API - 上报(传入已注册的全局参数以外的 所需上报的参数)

mta.up({...参数})

ac的取值详见:https://docs.qq.com/sheet/DZHZsQlhCdEhLUHFk?tab=BB08J2