
var jetourApp = androidJs;
var appType = "Android";


function initApp(type){
	appType = type;
}

//iOS初始化代码
function setupWebViewJavascriptBridge(callback) {
    if (window.WKWebViewJavascriptBridge) { return callback(WKWebViewJavascriptBridge); }
    if (window.WKWVJBCallbacks) { return window.WKWVJBCallbacks.push(callback); }
    window.WKWVJBCallbacks = [callback];
    window.webkit.messageHandlers.iOS_Native_InjectJavascript.postMessage(null)
}

function isAndroid(){
	if(appType == "Android"){
		return true;
	}
	return false;
}


function jetour_isLogin(){
	var str = "";
	if(isAndroid()){
		str = androidJs.jetour_isLogin();
	}else{
		bridge.callHandler('jetour_isLogin', null, function (responseData) {
                str = responseData.toString();
        });
	}
	return str;
}

function jetour_jumpToCustomView(type){
	var str = "";
	var JsonObj =  "{'type': "+type+",'value':'1'}";
	if(isAndroid()){
		str = androidJs.jetour_jumpToCustomView(JsonObj);
	}else{
		bridge.callHandler('jetour_jumpToCustomView', JsonObj, function (responseData) {
                str = responseData.toString();
        });
	}
	return str;
}