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

@foxit/pay-layer

v0.1.1

Published

``` npm i @foxit/pay-layer -S ```

Downloads

80

Readme

web端支付弹窗

install

npm i @foxit/pay-layer -S

use

// main.js

import payLayer from '@foxit/pay-layer'
import '@foxit/pay-layer/npm_pay_layer.css'
Vue.use(payLayer)

参数

参数

其中goodsDetails、tips和userData为必填, 其他参数为微信请求预支付后得到的参数。

示例

    <pay-layer
      v-if="showPay"
      @closePayLayer="showPay = false"
      @createPreVIPOrder="createPreVIPOrder"
      @checkWxPay="checkWxPay"
      @reChoosePayWay="reChoosePayWay"
      :goodsDetails="details"
      :tips="tips"
      :userData="userData"
      :orderNum="orderNum"
      :WXQRCode="WXQRCode"
      :payUnfinished="payUnfinished"
    />

参数的数据结构

tips: [
  {
    "title":"购买说明",
    "list":[
      "本内容为正版电子图书,虚拟物品付费之后概不接收任何退款。",
      "本内容只支持在线阅读,不支持下载。"
    ]
  }
]

userData: {
  "userId":900038694,
  "nickName":"cxx",
  "figure1":"http://thirdwx.qlogo.cn/mmopen/ajNicQQ/132","openIdType":"weixin",
  "tel":null,
  "email":null
}

goodsDetails: {
  "title":"我的中国故事:海外学者的中国缘",
}

WXQRCode:"http://foxit-common.s3.cn-north-1.amazonaws.com.cn/foxit-vip/qrCode/aee101c6f0e541eeb609e96021b466d3"

orderNum:"muban16363510937359000386945"

payUnfinished:false

回调函数

@closePayLayer  第一幕点击右上角关闭图标触发的回调。
@createPreVIPOrder="createPreVIPOrder"  第一幕点击立即支付触发的回调
@checkWxPay="checkWxPay" 第二幕点击付款完成触发的回调
@reChoosePayWay="reChoosePayWay"  第二幕点击重新选择支付方式
    reChoosePayWay() {
      this.WXQRCode = "";
      this.payUnfinished = false;
    },
    checkWxPay(e) {
      console.log(e);
      const params = {
        user_id: this.userId,
        product_id: this.id
      };
      isPay(params).then(res => {
        if (res.message == "已购买") {
          this.$router.go(0);
        }
        if (res.message == "未购买" && e == 1) {
          this.payUnfinished = true;
        }
      });
    },
    createPreVIPOrder(payway) {
      if (!this.userId) {
        localStorage.removeItem("userInfo");
        window.location.href = `https://muban.pdf365.cn/login_cb?cb=${encodeURIComponent(
          window.location.href
        )}`;
        return false;
      }
      if (payway === 0) {
        const params = {
          payType: payway === 0 ? 2 : 1,
          amount: 1,
          preId: this.preId,
          extra: this.extra || null,
          orderFrom: this.orderFrom,
          returnUrl: encodeURIComponent(window.location.href)
        };
        // 微信支付
        createPreVIPOrder(params).then(res => {
          console.log(res);
          if (res.ret === 0) {
            this.WXQRCode = res.data.img;
            this.orderNum = res.data.order_num;
            setInterval(this.checkWxPay, 3000);
          }
        });
      } else {
        window.location.href =
          "https://vip.foxitreader.cn/preOrder/createPreVIPOrder?payType=1&amount=1&preId=" +
          this.preId +
          "&extra=" +
          this.extra +
          "&orderFrom=" +
          this.orderFrom +
          "&returnUrl=" +
          encodeURIComponent(window.location.href);
      }
    },

示例图片 示例图片

tips