Authored by 郭成尧

wechat-pay-error

... ... @@ -146,19 +146,9 @@ if ($aliPayEL && $aliPayEL.length > 0 && $aliPayEL.data('href')) {
});
}
// 微信支付
function callpay(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 +172,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);
}
}
... ...