Authored by 毕凯

Merge branch 'hotfix/wechat' into 'release/5.7.1'

微信支付问题



See merge request !618
... ... @@ -146,19 +146,13 @@ if ($aliPayEL && $aliPayEL.length > 0 && $aliPayEL.data('href')) {
});
}
// 微信支付
function callpay(orderCode) {
/**
* 获取微信支付数据
* @param {*} orderCode
*/
function getWechatPayData(orderCode) {
let jsApiParameters;
$loadingToast.removeClass('hide');
if (typeof WeixinJSBridge === 'undefined') {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
} else {
$.ajax({
type: 'GET',
url: '/cart/index/new/pay',
... ... @@ -182,6 +176,26 @@ function callpay(orderCode) {
$loadingToast.addClass('hide');
}
});
}
// 微信支付
function callpay(orderCode) {
$loadingToast.removeClass('hide');
if (typeof WeixinJSBridge === 'undefined') {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', function() {
getWechatPayData(orderCode);
}, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', function() {
getWechatPayData(orderCode);
});
document.attachEvent('onWeixinJSBridgeReady', function() {
getWechatPayData(orderCode);
});
}
} else {
getWechatPayData(orderCode);
}
}
... ...