天天看点

Vue 微信扫码支付

wechatPay(jsonStr) {

console.log(‘微信支付jsonStr’, jsonStr);

try {

const json = JSON.parse(jsonStr);

console.log(‘json’, json);

if (typeof WeixinJSBridge !== ‘undefined’) {

WeixinJSBridge.invoke(‘getBrandWCPayRequest’, json, res => {

if (res.err_msg === ‘get_brand_wcpay_request:ok’) {

this.KaTeX parse error: Expected 'EOF', got '}' at position 25: …'支付成功!'); }̲ }); } e…fn.toast(‘请使用微信支付’);

}

} catch (e) {

this.$fn.toast(‘服务器繁忙,请稍后再试’);

}

}

继续阅读