vue.js 微信支付前端代码分享

实例如下所示:

{ //1:支付类型,可不填 this.message = rt.t WeixinjsBridge.invoke( 'getBrandWCPayRequest',{ 'appId': this.message.appId,'timeStamp': this.message.timeStamp,'nonceStr': this.message.nonceStr,'package': this.message.package,'signType': this.message.signType,'paySign': this.message.paySign },function (res) { console.log(res) if (res.err_msg === 'get_brand_wcpay_request:ok') { Toast('微信支付成功') this.$router.push('/mineOrder') } else if (res.err_msg === 'get_brand_wcpay_request:cancel') { Toast('用户取消支付') // window.location.href = 'gift_failview.do?out_Trade_no=' + this.orderId } else if (res.err_msg === 'get_brand_wcpay_request:fail') { Toast('网络异常,请重试') } } ) }) },callpay: function () { if (typeof WeixinjsBridge === 'undefined') { if (document.addEventListener) { document.addEventListener('WeixinjsBridgeReady',this.onBridgeReady(),false) } else if (document.attachEvent) { document.attachEvent('WeixinjsBridgeReady',this.onBridgeReady()) document.attachEvent('onWeixinjsBridgeReady',this.onBridgeReady()) } } else { this.onBridgeReady() } }

以上这篇vue.js 微信支付前端代码分享就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。

相关文章

可以通过min-width属性来设置el-table-column的最小宽度。以...
yarn dev,当文件变动后,会自动重启。 yanr start不会自动重...
ref 用于创建一个对值的响应式引用。这个值可以是原始值(如...
通过修改 getWK005 函数来实现这一点。这里的 query 参数就是...
<el-form-item label="入库类型" ...
API 变动 样式类名变化: 一些组件的样式类名有所变动,可能需...