// ios桥 分类列表
function setupWebViewJavascriptBridge(callback) {
if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
window.WVJBCallbacks = [callback];
var WVJBIframe = document.createElement('iframe');
WVJBIframe.style.display = 'none';
WVJBIframe.src = 'https://__bridge_loaded__';
document.documentElement.appendChild(WVJBIframe);
setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
}
/*处理交互*/
setupWebViewJavascriptBridge(function(bridge) {
在这里做前端的点击事件传递参数,ios端同样需要接收参数,和注册。
$(document).on('click','.box-b-a',function(e){
var uid = $("#mide").val();
var id = $(".aads").val();
bridge.callHandler('storegogo', {'uid': uid,'id': id}, function(response){
})
})
})