修改触发模式

master
yixian 6 years ago
parent 723f211a9c
commit 7f730dfe75

@ -19,9 +19,19 @@ $(document).ready(function () {
var dataCache = {paying: false}; var dataCache = {paying: false};
$('#key_P').bind('touchstart', startPay); $('#key_P').bind('touchstart', startPay);
if (window.paydata) { if (window.paydata) {
wx.ready(function () { var paymentInvoker = function() {
invokePay(window.paydata); invokePay(window.paydata);
}) };
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', paymentInvoker, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', paymentInvoker);
document.attachEvent('onWeixinJSBridgeReady', paymentInvoker);
}
}else{
paymentInvoker();
}
} }
function startPay() { function startPay() {

Loading…
Cancel
Save