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

qiao-weixinx

v3.2.0

Published

tools for weixin mini program

Downloads

33

Readme

qiao-weixinx

use

  1. 微信开发者工具——项目设置——调试基础库——>=2.2.1 版本&勾选【使用 npm 模块】
  2. npm i qiao-weixinx 后微信开发者工具——工具——npm 构建
  3. var q = require('qiao-weixinx');

api

ajax

var q = require('qiao-weixinx');

// ajax with url
// default data {}
// default method post
q.ajax(
  {
    url: url,
  },
  function (data) {
    // success
  },
  function (data) {
    // fail
  },
);

// ajax with url, data, method, headers
q.ajax(
  {
    url: url,
    data: {
      // data
    },
    method: 'POST',
    headers: {
      // headers
    },
  },
  function (data) {
    // success
  },
  function (data) {
    // fail
  },
);

alert

var q = require('qiao-weixinx');

// alert, without callback
q.alert('alert');

// alert, with callback
q.alert('alert', function () {
  // callback for click ok
});

// custom alert, without callback
q.alert({
  title: 'alert',
  content: 'alert',
  confirmText: 'ok',
  confirmColor: '#3CC51F',
});

// custom alert, with callback
q.alert(
  {
    title: 'alert',
    content: 'alert',
    confirmText: 'ok',
    confirmColor: '#3CC51F',
  },
  function () {
    // callback for click ok
  },
);

confirm

var q = require('qiao-weixinx');

// confirm, without callback
q.confirm('confirm');

// confirm, with callback
q.confirm(
  'confirm',
  function () {
    // callback for click ok
  },
  function () {
    // callback for click cancel
  },
);

// custom confirm, without callback
q.confirm({
  title: 'confirm',
  content: 'confirm',
  showCancel: true,
  cancelText: 'cancel',
  cancelColor: '#000000',
  confirmText: 'ok',
  confirmColor: '#3CC51F',
});

// custom confirm, with callback
q.confirm(
  {
    title: 'confirm',
    content: 'confirm',
    showCancel: true,
    cancelText: 'cancel',
    cancelColor: '#000000',
    confirmText: 'ok',
    confirmColor: '#3CC51F',
  },
  function () {
    // callback for click ok
  },
  function () {
    // callback for click cancel
  },
);

suc

var q = require('qiao-weixinx');

// tip for success
q.suc('success message');

// custom tip for success
q.suc({
  title: 'success message',
  duration: 3000,
  mask: true,
});

tip

var q = require('qiao-weixinx');

// tip
q.tip('tips');

// custom tip
q.tip({
  title: 'custom tip',
  duration: 3000,
  mask: true,
});

loading

var q = require('qiao-weixinx');

// default loading
q.loading();

// custom loading
q.loading('custom loading');

hideLoading

var q = require('qiao-weixinx');

// hide loading
q.hideLoading();

sheet

var q = require('qiao-weixinx');

// sheet
q.sheet(['1', '2'], function (index) {
  // index : 0,1
});

title

var q = require('qiao-weixinx');

// set navigation bar title
q.title(
  title,
  function () {
    // success
  },
  function () {
    // fail
  },
);

to

var q = require('qiao-weixinx');

// navigate to
q.to(
  url,
  function () {
    // success
  },
  function () {
    // fail
  },
);

rto

var q = require('qiao-weixinx');

// redirect to
q.rto(
  url,
  function () {
    // success
  },
  function () {
    // fail
  },
);

tab

var q = require('qiao-weixinx');

// switch tab
q.tab(
  url,
  function () {
    // success
  },
  function () {
    // fail
  },
);

back

var q = require('qiao-weixinx');

// navigate back
q.back(page);

set

var q = require('qiao-weixinx');

// set data to localstorage
q.set(key, value);

get

var q = require('qiao-weixinx');

// get data from localstorage
q.get(key);

del

var q = require('qiao-weixinx');

// del data from localstorage
q.del(key);

clear

var q = require('qiao-weixinx');

// clear data from localstorage
q.clear();

isAndroid

var q = require('qiao-weixinx');

// is android
var isAndroid = q.isAndroid();
console.log(isAndroid);

isIos

var q = require('qiao-weixinx');

// is ios
var isIos = q.isIos();
console.log(isIos);

net

var q = require('qiao-weixinx');

// net
q.net(function (type) {
  // type : wifi/2g/3g/4g/unknown/none
});

screen

var q = require('qiao-weixinx');

// get screen
q.screen(
  null,
  function (v) {
    // success
  },
  function () {
    // fail
  },
);

// set screen keep on
q.screen(
  'on',
  function () {
    // success
  },
  function () {
    // fail
  },
);

// set screen 0-1
q.screen(
  0,
  function () {
    // success
  },
  function () {
    // fail
  },
);

showImg

var q = require('qiao-weixinx');

// show img with url
q.showImg(url);

// show img with urls
q.showImg(url, urls);

checkAuth

var q = require('qiao-weixinx');

// check auth
q.checkAuth('scope.camera', 'need camera auth', function () {
  // success
});

version

var q = require('qiao-weixinx');

// get weixin version
var weixinVersion = q.version();
console.log(weixinVersion);

sversion

var q = require('qiao-weixinx');

// get weixin sdk version
var weixinSDKVersion = q.sversion();
console.log(weixinSDKVersion);

higherThan

var q = require('qiao-weixinx');

// compare weixin sdk version higher than
var flag = q.higherThan('0.9.90');
console.log(flag);