qiaowei | bd656ad | 2020-06-11 15:12:03 +0800 | [diff] [blame] | 1 | var app = { |
| 2 | |
| 3 | // Application Constructor |
| 4 | initialize: function() { |
| 5 | document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); |
| 6 | }, |
| 7 | |
| 8 | onDeviceReady: function() { |
| 9 | var userid = window.localStorage.getItem("userid"); |
| 10 | $('#moreBtn3').click(function() { |
| 11 | window.location = "bill.html"; |
| 12 | }); |
| 13 | $("#moreBtn1").click(function(){ |
| 14 | //window.location = "more.html"; |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 15 | showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/addindex?custid="+userid); |
qiaowei | bd656ad | 2020-06-11 15:12:03 +0800 | [diff] [blame] | 16 | }) |
qiaowei | 0d9c0cd | 2020-06-24 16:27:18 +0800 | [diff] [blame] | 17 | $("#moreBtn4").click(function(){ |
| 18 | //window.location = "more.html"; |
| 19 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 20 | showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/clockindex?custid="+userid); |
qiaowei | 0d9c0cd | 2020-06-24 16:27:18 +0800 | [diff] [blame] | 21 | }) |
| 22 | $("#moreBtn5").click(function(){ |
| 23 | //window.location = "more.html"; |
| 24 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 25 | showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/reviewindex?custid="+userid); |
qiaowei | 0d9c0cd | 2020-06-24 16:27:18 +0800 | [diff] [blame] | 26 | }) |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 27 | $("#moreBtn6").click(function(){ |
| 28 | //window.location = "more.html"; |
| 29 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
| 30 | showRet("https://yy.dlsmk.cn/wisdompolice/app/atte/reviewClock?custid="+userid); |
| 31 | }) |
| 32 | $("#moreBtn7").click(function(){ |
| 33 | //window.location = "more.html"; |
| 34 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
| 35 | showRet("https://yy.dlsmk.cn/wisdompolice/app/doordtl?custid="+userid); |
| 36 | }) |
guangchao.xu | 5f13fea | 2020-07-16 10:35:20 +0800 | [diff] [blame] | 37 | $("#moreBtn8").click(function(){ //考勤记录 |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 38 | //window.location = "more.html"; |
| 39 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
guangchao.xu | 5f13fea | 2020-07-16 10:35:20 +0800 | [diff] [blame] | 40 | showRet("https://yy.dlsmk.cn/wisdompolice/app/attedtl?custid="+userid); |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 41 | }) |
guangchao.xu | 5f13fea | 2020-07-16 10:35:20 +0800 | [diff] [blame] | 42 | $("#moreBtn9").click(function(){ //会议记录 |
| 43 | //window.location = "more.html"; |
| 44 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
guangchao.xu | b11a35b | 2020-07-17 16:56:37 +0800 | [diff] [blame^] | 45 | showRet("https://yy.dlsmk.cn/wisdompolice/app/conference/conferencedtl?userId="+userid); |
guangchao.xu | 5f13fea | 2020-07-16 10:35:20 +0800 | [diff] [blame] | 46 | }) |
guangchao.xu | b11a35b | 2020-07-17 16:56:37 +0800 | [diff] [blame^] | 47 | $("#moreBtn2").click(function(){ //会议 |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 48 | //window.location = "more.html"; |
| 49 | //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); |
guangchao.xu | b11a35b | 2020-07-17 16:56:37 +0800 | [diff] [blame^] | 50 | showRet("https://yy.dlsmk.cn/wisdompolice/app/conference/signupconference?userId="+userid); |
qiaowei | 98635db | 2020-06-28 17:41:21 +0800 | [diff] [blame] | 51 | }) |
| 52 | |
qiaowei | bd656ad | 2020-06-11 15:12:03 +0800 | [diff] [blame] | 53 | }, |
| 54 | |
| 55 | }; |
| 56 | app.initialize(); |
| 57 | |
| 58 | function showRet(url) { |
| 59 | if(isEmpty(url)){ |
| 60 | return; |
| 61 | } |
| 62 | var userid = window.localStorage.getItem("userid"); |
| 63 | //if (url.indexOf("yy.dlsmk.cn")>=0) { |
| 64 | if(url.indexOf("?")>0){ |
| 65 | url=url+'&userid='+userid; |
| 66 | }else{ |
| 67 | url=url+'?userid='+userid; |
| 68 | } |
| 69 | //} |
| 70 | console.log(url) |
| 71 | var inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', { |
| 72 | statusbar: { |
| 73 | color: '#03a9f4ff' |
| 74 | }, |
| 75 | toolbar: { |
| 76 | height: 44, |
| 77 | color: '#03a9f4ff' |
| 78 | }, |
| 79 | title: { |
| 80 | color: '#ffffffff', |
| 81 | showPageTitle: true |
| 82 | }, |
| 83 | backButton: { |
| 84 | wwwImage: 'img/back.png', |
| 85 | wwwImagePressed: 'img/back.png', |
| 86 | align: 'left', |
| 87 | event: 'backPressed' |
| 88 | }, |
| 89 | backButtonCanClose: true |
| 90 | }).addEventListener('backPressed', function(e) { |
| 91 | //alert('back pressed'); |
| 92 | }).addEventListener('closePressed', function(e) { |
| 93 | //alert('closePressed pressed'); |
| 94 | inAppBrowserRef.close(); |
| 95 | window.location = "main.html" |
| 96 | }); |
| 97 | } |