在苹果Safari浏览器是无法通过iframe来唤起微信或支付宝APP支付的
但可以通过以下方法来完美解决iframe打开APP支付
1. 在iframe中的页面中JS代码:
window.top.postMessage({ success: true, pay_url: pay_url }, "*");
2. 在父页面监听消息
window.addEventListener('message', function(event) {
var result = event.data;
if (result.success){
console.log('最顶消息');
window.top.location.href = result.pay_url;
}
});