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

wxgo-coupon

v1.0.6

Published

发券组件。使用前需申请微信发券插件使用权限。

Downloads

17

Readme

wxgo-coupon

发券组件。使用前需申请微信发券插件使用权限。

使用前准备

一. 申请发券插件使用权限

  1. 小程序账号登录微信公众平台
  2. 设置 —> 第三方服务 —> 添加插件 进入添加插件操作页面
  3. 搜索插件名 微信支付券商户平台抽奖模块 并添加, 提交审核待通过
二. 在小程序app.json 文件中加入配置
// app.json
{
  "plugins": {
    "sendCoupon": {
      "version": "1.1.5",
      "provider": "wxf3f436ba9bd4be7b"
    }
  }
}
三. 添加合法域名
  1. 小程序账号登录微信公众平台
  2. 开发 —> 开发管理 —> 开发设置 —> 服务器域名
  3. downloadFile合法域名 中增加如下配置
https://wxgo.cdn.adwke.com
  1. 在request合法域名中增加
https://wxgo.adwke.com/

使用方法

一. npm安装
npm install wxgo-coupon
二. 构建
  1. 在根目录新建wxcomponents文件夹
  2. 打开node_modules/wxgo-coupon文件,copy目录中整个src文件到wxcomponents目录下,按需重命名使用
  3. 目录结构
┌─wxcomponents              微信小程序自定义组件存放目录
│   └──wxgo-coupon      微信小程序自定义组件
│        ├─index.js
│        ├─index.wxml
│        ├─index.json
│        └─index.wxss
├─pages
├─main.js
├─App.vue
├─manifest.json
└─pages.json
  1. 小程序开发者工具 -> 详情(工具右上角) -> 本地设置 -> 使用npm模块
  2. 小程序开发者工具 -> 工具 -> 构建 npm
  3. 构建成功后小程序代码包中将产出 "miniprogram_npm" 文件夹
三. 使用
  1. 新建页面
  2. 页面的json文件中做如下配置
//pages.json
{
  "pages": [
    {
      "path": "wxgo-coupon/wxgo-coupon,
      "style": {
          "usingComponents": {
              "wxgo-coupon": "/wxcomponents/wxgo-coupon/index"
          }
      }
    }
  ]
}
  1. 在页面中引入该组件(页面中不能有其他元素,只能有该组件),并配置分享
<template>
  <wxgo-coupon 
    sercet="sercet" 
    openid="openid" 
    serverUrl="serverUrl"
    extendParam="extendParam"
  >
  </wxgo-coupon>
</template>

<script>
  export default {
    onShareAppMessage(res) {
      title:'你的好友@你,发现这里有好多隐藏的微信支付商家代金券~',
      path:'当前页面所在路径'
    }
  }
</script>
  • 小程序原生
  1. 新建页面pages
  2. 页面的json文件中做如下配置
// index.json
{
    "usingComponents": {
        "wxgo-coupon": "wxgo-coupon"
    },
    "navigationStyle": "custom",
    "navigationBarBackgroundColor": "#25AB52",
    "navigationBarTextStyle": "white",
    "disableScroll":true
}
  1. 在页面wxml文件中引使用该组件(页面中不能有其他元素,只能有该组件)
// index.wxml
<wxgo-coupon
     sercet="sercet" 
    openid="openid" 
    serverUrl="serverUrl"
    extendParam="extendParam"
>
</wxgo-coupon>
  1. 在页面js文件中配置分享参数
// index.js
onShareAppMessage(){
  return {
    title:'你的好友@你,发现这里有好多隐藏的微信支付商家代金券~',
    path:'当前新建得pages路径'
  }
}
四、参数说明

| 变量 | 类型 | 必填? | 说明 | | - | - | - | - | | sercet| String | 是 | 联系运营获取 | | openid | String | 是 | 用户openid | | serverUrl | String | 是 | 取值:https://wxgo.adwke.com/ |