vue调微信支付

我这个是后台会返给我微信支付的配置信息
vue调微信支付_第1张图片

    gosuccessful() {
      this.$post("", {
        token: localStorage.getItem("token"),
        user_name: this.user_name,
        phone: this.phone,
        id: this.info.id
      }).then(res => {
        console.log(res);
        if (res.code == 200) {
          this.weixininfo = res.data; //拿到配置信息
          WeixinJSBridge.invoke(
            "getBrandWCPayRequest",
            this.weixininfo,
            res => {
              if (res.err_msg == "get_brand_wcpay_request:ok") {
                Toast("支付成功");
              } else {
                Toast("支付失败");
              }
            }
          );
        }
      });
    },

你可能感兴趣的:(支付)