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

m-weixin-utils

v1.0.28

Published

微信工具库

Downloads

10

Readme

m-weixin-utils

简洁,高效,实用的微信小程序方法封装 ** 反馈错误/缺漏 **

Installation

npm i m-weixin-utils

Exampleusage

import { Server , Upload , Utils } from 'm-weixin-utils';

Page({
  onLoad(){
    //发起get请求
    Server.get("https://www.npmjs.com/package/m-weixin-utils");
    //发起post请求
    Server.post("https://www.npmjs.com/package/m-weixin-utils");

    //从相册选择上传图片
    Upload.chooseImage(9).then(urls=>{
      //返回上传地址[]
      console.log(urls);
    })
  }
})

Api

Upload Class

uploadFile(tempFilePaths:any)

tempFilePaths:上传参数临时路径参数

chooseImage(number?:number)

number:选择图片后自动上传返回上传路径参数(上传数量)默认1

Server Class

get(url:any,options?={},header?={})

url:地址 options:请求参数 header:请求头

post(url:any,options?={},header?={})

url:地址 options:请求参数 header:请求头

Utils Class

formatTime(date:string)

date:2022-10-10 | 2022/10/10

gourl(path:string)

path:跳转路径 网址会自动跳转到/pages/webview/index?url=${encodeURIComponent(path)}

get_html(data:any)

data:html字符串自动适配微信小程序rich-text

tapinfo(e:any)

e返回点击的参数data-id

getRect(obj:string)

obj : class/ID获取元素信息DOM

checkFullSucreen()

获取小程序头部胶囊按钮与顶部的距离

alert(content:string)

content:弹窗提示

msg(content:string)

content:弹窗提示

confirm(msg:string,opction?:opctionType)

msg 提示 opction 可参考小程序官方文档

getsys(key:string)

获取本地存储

delsys(key:string)

删除本地存储

setsys(key:string)

设置本地存储

previewImage(current:string,urls:string[])

需要预览的图片

requestSubscribeMessage(tmplIds:string[])

tmplIds模板ID列表

openDocument(url:string)

url需要打开的文件地址

checkUpdateVersion()

检测当前的小程序 版本自动更新

urlEncode(data: object = {})

对象转URL

setClipboardData(data: string, title?: string)

data 复制内容 title 复制成功提示 默认 复制成功