实例如下所示:

公司主营业务:成都网站制作、做网站、外贸营销网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联推出涪陵免费做网站回馈大家。
onBridgeReady: function () {
const openId = localStorage.getItem('openId')
payService.payment(this.$route.params.orderId, 1, openId).then(rt => { //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 微信支付前端代码分享就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持创新互联。