本人解决办法:
直接在success里面添加延迟,就可以了
function sendAjax(result){
$.ajax({
url: contextPath+"/cloudticketExchange/checkQRcode.action?cloudticketExchange.ext2="+result,
method: "post",
async: false,
success:function(data){
alert(data.result1);
}
});
}
wx.ready(function () {
// 9.1.2 扫描二维码并返回结果
document.querySelector('#scanQRCode1').onclick = function () {
wx.scanQRCode({
needResult: 1,
desc: 'scanQRCode desc',
success: function (res) {
//在这里加入延迟即可
setTimeout(function(){sendAjax(res.resultStr);},1000);
}
});
};
});