blob: 7c6e8f81972827fd15bfead914c899976b436dfd [file] [log] [blame]
var app = {
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
onDeviceReady: function() {
var userid = window.localStorage.getItem("userid");
$('#moreBtn3').click(function() {
window.location = "bill.html";
});
$("#moreBtn1").click(function(){
//window.location = "more.html";
showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/addindex?custid="+userid);
})
$("#moreBtn4").click(function(){
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/clockindex?custid="+userid);
})
$("#moreBtn5").click(function(){
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/reviewindex?custid="+userid);
})
$("#moreBtn6").click(function(){
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/reviewClock?custid="+userid);
})
$("#moreBtn7").click(function(){
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/doordtl?custid="+userid);
})
$("#moreBtn8").click(function(){ //考勤记录
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/attedtl?custid="+userid);
})
$("#moreBtn9").click(function(){ //会议记录
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/conference/conferencedtl?userId="+userid);
})
$("#moreBtn2").click(function(){ //会议
//window.location = "more.html";
//showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
showRet("https://yy.dlsmk.cn/wisdompolice/app/conference/signupconference?userId="+userid);
})
},
};
app.initialize();
function showRet(url) {
if(isEmpty(url)){
return;
}
var userid = window.localStorage.getItem("userid");
//if (url.indexOf("yy.dlsmk.cn")>=0) {
if(url.indexOf("?")>0){
url=url+'&userid='+userid;
}else{
url=url+'?userid='+userid;
}
//}
console.log(url)
var inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', {
statusbar: {
color: '#03a9f4ff'
},
toolbar: {
height: 44,
color: '#03a9f4ff'
},
title: {
color: '#ffffffff',
showPageTitle: true
},
backButton: {
wwwImage: 'img/back.png',
wwwImagePressed: 'img/back.png',
align: 'left',
event: 'backPressed'
},
backButtonCanClose: true
}).addEventListener('backPressed', function(e) {
//alert('back pressed');
}).addEventListener('closePressed', function(e) {
//alert('closePressed pressed');
inAppBrowserRef.close();
window.location = "main.html"
});
}