From: qiaowei Date: Tue, 14 Apr 2020 05:08:35 +0000 (+0800) Subject: 公安app修改 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=9579db49ed24da51339056c0fd3c58fceed959a7;p=dali_platform%2Fmobile.git 公安app修改 --- diff --git a/config.xml b/config.xml index 6283731..0c356ca 100644 --- a/config.xml +++ b/config.xml @@ -1,6 +1,6 @@ - - dlapp + + dlapp A sample Apache Cordova application that responds to the deviceready event. diff --git a/platforms/android/app/build.gradle b/platforms/android/app/build.gradle index b59ebb2..9a325ca 100644 --- a/platforms/android/app/build.gradle +++ b/platforms/android/app/build.gradle @@ -166,7 +166,7 @@ task cdvPrintProps { android { defaultConfig { - applicationId 'com.dalicitycard.app' + applicationId 'com.dalipolice.app' if (cdvMinSdkVersion != null) { minSdkVersion cdvMinSdkVersion } diff --git a/platforms/android/app/src/main/AndroidManifest.xml b/platforms/android/app/src/main/AndroidManifest.xml index 3238e12..4eb48c9 100644 --- a/platforms/android/app/src/main/AndroidManifest.xml +++ b/platforms/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/platforms/android/app/src/main/assets/www/css/index.css b/platforms/android/app/src/main/assets/www/css/index.css index b23e33c..fb20796 100644 --- a/platforms/android/app/src/main/assets/www/css/index.css +++ b/platforms/android/app/src/main/assets/www/css/index.css @@ -38,6 +38,12 @@ body { position: absolute; animation: myfirst 2s linear infinite alternate; } +.mainmeun-div{ + height: 100%; + flex-direction: row;justify-content: center; + align-items: center;display: flex!important; + font-size: 20px; +} @keyframes myfirst { 0% { diff --git a/platforms/android/app/src/main/assets/www/index.html b/platforms/android/app/src/main/assets/www/index.html index 576b5e9..005362a 100644 --- a/platforms/android/app/src/main/assets/www/index.html +++ b/platforms/android/app/src/main/assets/www/index.html @@ -1,6 +1,5 @@ - @@ -9,15 +8,10 @@ - 大理市民卡 + 大理公安在线 - + diff --git a/platforms/android/app/src/main/assets/www/js/index.js b/platforms/android/app/src/main/assets/www/js/index.js index db3d7ce..9e660c1 100644 --- a/platforms/android/app/src/main/assets/www/js/index.js +++ b/platforms/android/app/src/main/assets/www/js/index.js @@ -25,9 +25,16 @@ var app = { }, onDeviceReady: function() { + debugger; + var firstload = window.localStorage.getItem("firstload"); + if(isEmpty(firstload)){ + app.toPage("startload.html") + return; + } var uid = window.localStorage.getItem("token"); if (isEmpty(uid)) { - window.location = "login.html"; + //window.location = "login.html"; + toPage("login.html") } else { //尝试登陆 V1Infor(function(ok, ret) { @@ -37,23 +44,32 @@ var app = { if(!isEmpty(ret.token)){ window.localStorage.setItem("token",ret.token); } - window.location = "main.html"; + //window.location = "main.html"; + app.toPage("main.html") }else{ - window.location = "login.html"; + //window.location = "login.html"; + app.toPage("login.html") } } else { //alert('无法请求到服务器,请检查网络并稍后再试'); if (ret.status == 401) { //need login - window.location = "login.html"; + //window.location = "login.html"; + app.toPage("login.html") } else { //TODO ,没有网络 - - window.location = "main.html"; + app.toPage("main.html") + //window.location = "main.html"; } } }) } + }, + toPage:function(page){ + setTimeout(function() { + //window.location=page; + window.location=page; + },2000) } }; app.initialize(); \ No newline at end of file diff --git a/platforms/android/app/src/main/assets/www/login.html b/platforms/android/app/src/main/assets/www/login.html index 60827f3..bce7fd5 100644 --- a/platforms/android/app/src/main/assets/www/login.html +++ b/platforms/android/app/src/main/assets/www/login.html @@ -12,7 +12,7 @@
    diff --git a/platforms/android/app/src/main/assets/www/main.html b/platforms/android/app/src/main/assets/www/main.html index c8bb590..0d18b69 100644 --- a/platforms/android/app/src/main/assets/www/main.html +++ b/platforms/android/app/src/main/assets/www/main.html @@ -9,171 +9,73 @@ +
    -
    -

    您好!

    -
    -
    -
    -
    -
    扫一扫
    -
    -
    -
    -
    我的码
    -
    +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    市民卡挂失
    -
    -
    -
    -
    账单查询
    -
    -
    -
    -
    账户安全
    -
    -
    -
    -
    远程开门
    -
    +
    + +
    +
    +
    -
    -
    -
    -
    近期交易
    -
    更多>
    -
    +
    -
    -
    -
    - - 正在加载 -
    - -
      @@ -253,6 +139,10 @@
      首页
    + +
    消息
    +
    +
    我的
    @@ -262,8 +152,9 @@ + - + diff --git a/platforms/android/app/src/main/java/com/dalicitycard/app/MainActivity.java b/platforms/android/app/src/main/java/com/dalipolice/app/MainActivity.java similarity index 97% rename from platforms/android/app/src/main/java/com/dalicitycard/app/MainActivity.java rename to platforms/android/app/src/main/java/com/dalipolice/app/MainActivity.java index 7b7fe6b..9682df9 100644 --- a/platforms/android/app/src/main/java/com/dalicitycard/app/MainActivity.java +++ b/platforms/android/app/src/main/java/com/dalipolice/app/MainActivity.java @@ -17,7 +17,7 @@ under the License. */ -package com.dalicitycard.app; +package com.dalipolice.app; import android.os.Bundle; import org.apache.cordova.*; diff --git a/platforms/android/app/src/main/res/drawable-hdpi/icon.png b/platforms/android/app/src/main/res/drawable-hdpi/icon.png index a79c7cf..cf210c5 100644 Binary files a/platforms/android/app/src/main/res/drawable-hdpi/icon.png and b/platforms/android/app/src/main/res/drawable-hdpi/icon.png differ diff --git a/platforms/android/app/src/main/res/drawable-ldpi/icon.png b/platforms/android/app/src/main/res/drawable-ldpi/icon.png index 24166c6..7cfa69b 100644 Binary files a/platforms/android/app/src/main/res/drawable-ldpi/icon.png and b/platforms/android/app/src/main/res/drawable-ldpi/icon.png differ diff --git a/platforms/android/app/src/main/res/drawable-mdpi/icon.png b/platforms/android/app/src/main/res/drawable-mdpi/icon.png index 613d8e7..74e4190 100644 Binary files a/platforms/android/app/src/main/res/drawable-mdpi/icon.png and b/platforms/android/app/src/main/res/drawable-mdpi/icon.png differ diff --git a/platforms/android/app/src/main/res/drawable-xhdpi/icon.png b/platforms/android/app/src/main/res/drawable-xhdpi/icon.png index 1737ab8..96b824e 100644 Binary files a/platforms/android/app/src/main/res/drawable-xhdpi/icon.png and b/platforms/android/app/src/main/res/drawable-xhdpi/icon.png differ diff --git a/platforms/android/app/src/main/res/drawable-xxhdpi/icon.png b/platforms/android/app/src/main/res/drawable-xxhdpi/icon.png index a8c7b45..8dea17d 100644 Binary files a/platforms/android/app/src/main/res/drawable-xxhdpi/icon.png and b/platforms/android/app/src/main/res/drawable-xxhdpi/icon.png differ diff --git a/platforms/android/app/src/main/res/drawable-xxxhdpi/icon.png b/platforms/android/app/src/main/res/drawable-xxxhdpi/icon.png index 5b33488..d5a2e54 100644 Binary files a/platforms/android/app/src/main/res/drawable-xxxhdpi/icon.png and b/platforms/android/app/src/main/res/drawable-xxxhdpi/icon.png differ diff --git a/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png b/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png index a79c7cf..cf210c5 100644 Binary files a/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png and b/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png differ diff --git a/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index a79c7cf..cf210c5 100644 Binary files a/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png b/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png index 24166c6..7cfa69b 100644 Binary files a/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png and b/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png differ diff --git a/platforms/android/app/src/main/res/mipmap-ldpi/ic_launcher.png b/platforms/android/app/src/main/res/mipmap-ldpi/ic_launcher.png index 24166c6..7cfa69b 100644 Binary files a/platforms/android/app/src/main/res/mipmap-ldpi/ic_launcher.png and b/platforms/android/app/src/main/res/mipmap-ldpi/ic_launcher.png differ diff --git a/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png b/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png index 613d8e7..74e4190 100644 Binary files a/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png and b/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png differ diff --git a/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 613d8e7..74e4190 100644 Binary files a/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png b/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png index 1737ab8..96b824e 100644 Binary files a/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png and b/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png differ diff --git a/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 1737ab8..96b824e 100644 Binary files a/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png b/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png index a8c7b45..8dea17d 100644 Binary files a/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png and b/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png differ diff --git a/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index a8c7b45..8dea17d 100644 Binary files a/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png b/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png index 5b33488..d5a2e54 100644 Binary files a/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png and b/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png differ diff --git a/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 5b33488..d5a2e54 100644 Binary files a/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/platforms/android/app/src/main/res/values/strings.xml b/platforms/android/app/src/main/res/values/strings.xml index 04fccc7..c6e1b7a 100644 --- a/platforms/android/app/src/main/res/values/strings.xml +++ b/platforms/android/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@ dlapp - 大理市民卡 + 大理公安在线 @string/launcher_name diff --git a/platforms/android/app/src/main/res/xml/config.xml b/platforms/android/app/src/main/res/xml/config.xml index 648e931..a983c3b 100644 --- a/platforms/android/app/src/main/res/xml/config.xml +++ b/platforms/android/app/src/main/res/xml/config.xml @@ -1,5 +1,5 @@ - + @@ -43,7 +43,7 @@ - dlapp + dlapp A sample Apache Cordova application that responds to the deviceready event. diff --git a/platforms/browser/config.xml b/platforms/browser/config.xml index c6f9fad..ca652aa 100644 --- a/platforms/browser/config.xml +++ b/platforms/browser/config.xml @@ -1,6 +1,6 @@ - - dlapp + + dlapp A sample Apache Cordova application that responds to the deviceready event. diff --git a/www/css/aui-slide.css b/www/css/aui-slide.css new file mode 100644 index 0000000..7c1170e --- /dev/null +++ b/www/css/aui-slide.css @@ -0,0 +1,113 @@ +/** + * aui-slide.css 轮播样式 + * verson 0.0.2 + * @author 流浪男 + * http://www.auicss.com + * @todo more things to abstract, e.g. Loading css etc. + * Licensed under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + */ +.aui-slide-wrap { + display: block; + position: relative; + list-style: none; + margin: 0; + padding: 0; + height: 100%; + width: 100%; + overflow: hidden; +} +.aui-slide-wrap .aui-slide-node { + position: absolute; + top: 0; + left: 0; + margin: 0; + padding: 0; + width: 100%; + height: 100%; + list-style: none; + overflow: hidden; + background: #ffffff; +} +.aui-slide-node-center { + display: -moz-box; + display: -webkit-box; + display: box; + -moz-box-pack: center; + -webkit-box-pack: center; + box-pack: center; +} +.aui-slide-node-middle { + display: -moz-box; + display: -webkit-box; + display: box; + -moz-box-align: center; + -webkit-box-align: center; + box-align: center; +} +.aui-slide-node img { + width: 100%; + height: 100%; +} +.aui-slide-page-wrap { + width: 100%; + height: 30px; + line-height: 30px; + position: absolute; + padding: 0; + left: 0; + right: 0; + bottom: 5px; + z-index: 9999; + text-align: center; +} +.aui-slide-page-dot { + position: relative; + display: inline-block; + width: 6px; + height: 6px; + border-radius: 50%; + list-style: none; + margin: 5px 3px 0 3px; + background: #c7c7c7; + -webkit-transition: all 0.5s; + transition: all 0.5s; +} +.aui-slide-page-line { + position: absolute; + bottom: -14px; + height: 1px !important; + position: relative; + display: inline-block; + background: #eeeeee; + -webkit-transition: all 0.5s; + transition: all 0.5s; +} +.aui-slide-page-active { + background: #1abc9c; + from { opacity: 0.3; } + to { opacity: 1 } +} +.aui-slide-prev-btn, +.aui-slide-next-btn { + display: inline-block; + width: 50px; + height: 30px; + line-height: 30px; + font-size: 1.2em; + color: #1abc9c; + background: rgba(249,249,249,0.6); + position: relative; +} +.aui-slide-prev-btn { + border-top-left-radius: 15px; + border-bottom-left-radius: 15px; +} +.aui-slide-next-btn { + border-top-right-radius: 15px; + border-bottom-right-radius: 15px; +} +.aui-slide-prev-btn:active, +.aui-slide-next-btn:active { + color: #f1c40f; +} \ No newline at end of file diff --git a/www/css/index.css b/www/css/index.css index b23e33c..fb20796 100644 --- a/www/css/index.css +++ b/www/css/index.css @@ -38,6 +38,12 @@ body { position: absolute; animation: myfirst 2s linear infinite alternate; } +.mainmeun-div{ + height: 100%; + flex-direction: row;justify-content: center; + align-items: center;display: flex!important; + font-size: 20px; +} @keyframes myfirst { 0% { diff --git a/www/img/s1.jpg b/www/img/s1.jpg new file mode 100644 index 0000000..d664916 Binary files /dev/null and b/www/img/s1.jpg differ diff --git a/www/img/s2.jpg b/www/img/s2.jpg new file mode 100644 index 0000000..6f8e3d3 Binary files /dev/null and b/www/img/s2.jpg differ diff --git a/www/img/s3.jpg b/www/img/s3.jpg new file mode 100644 index 0000000..4fd46a4 Binary files /dev/null and b/www/img/s3.jpg differ diff --git a/www/img/splashscreen.png b/www/img/splashscreen.png new file mode 100644 index 0000000..a93b845 Binary files /dev/null and b/www/img/splashscreen.png differ diff --git a/www/index.html b/www/index.html index 576b5e9..005362a 100644 --- a/www/index.html +++ b/www/index.html @@ -1,6 +1,5 @@ - @@ -9,15 +8,10 @@ - 大理市民卡 + 大理公安在线 - + diff --git a/www/js/index.js b/www/js/index.js index db3d7ce..9e660c1 100644 --- a/www/js/index.js +++ b/www/js/index.js @@ -25,9 +25,16 @@ var app = { }, onDeviceReady: function() { + debugger; + var firstload = window.localStorage.getItem("firstload"); + if(isEmpty(firstload)){ + app.toPage("startload.html") + return; + } var uid = window.localStorage.getItem("token"); if (isEmpty(uid)) { - window.location = "login.html"; + //window.location = "login.html"; + toPage("login.html") } else { //尝试登陆 V1Infor(function(ok, ret) { @@ -37,23 +44,32 @@ var app = { if(!isEmpty(ret.token)){ window.localStorage.setItem("token",ret.token); } - window.location = "main.html"; + //window.location = "main.html"; + app.toPage("main.html") }else{ - window.location = "login.html"; + //window.location = "login.html"; + app.toPage("login.html") } } else { //alert('无法请求到服务器,请检查网络并稍后再试'); if (ret.status == 401) { //need login - window.location = "login.html"; + //window.location = "login.html"; + app.toPage("login.html") } else { //TODO ,没有网络 - - window.location = "main.html"; + app.toPage("main.html") + //window.location = "main.html"; } } }) } + }, + toPage:function(page){ + setTimeout(function() { + //window.location=page; + window.location=page; + },2000) } }; app.initialize(); \ No newline at end of file diff --git a/www/js/mainmenu.js b/www/js/mainmenu.js new file mode 100644 index 0000000..226091a --- /dev/null +++ b/www/js/mainmenu.js @@ -0,0 +1,445 @@ +var app = { + + // Application Constructor + initialize: function() { + this.initTab(); + document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); + document.addEventListener('jpush.receiveRegistrationId', function(event) { + console.log(event.registrationId) + }, false) + document.addEventListener("jpush.openNotification", function (event) { + var refno + console.log("openNotify:"+event); + if(device.platform == "Android") { + refno = event.extras.refno + } else { + refno = event.refno + window.JPush.setApplicationIconBadgeNumber(0); + } + app.openBill(refno); + console.log("openNotify:"+refno); + }, false) + }, + openBill:function(billno){ + window.localStorage.setItem("currentrefno",billno); + window.location='billdetail.html'; + }, + initJpush: function() { + if(device.platform == "Android") { + } else { + window.JPush.setApplicationIconBadgeNumber(0); + } + window.JPush.init(); + window.JPush.setDebugMode(true); + window.JPush.isPushStopped(function(result) { + if (result == 0) { + //window.JPush.resumePush(); + } else { + window.JPush.resumePush(); + } + }); + window.JPush.getUserNotificationSettings(function(result) { + if(result == 0) { + } else if(result > 0) { + } + }); + var uid = window.localStorage.getItem("uid"); + window.JPush.setAlias({ sequence: 1, alias: uid }, + (result) => { + var sequence = result.sequence + var alias = result.alias + //alert(JSON.stringify(result)) + }, (error) => { + var sequence = error.sequence + var errorCode = error.code + //alert(JSON.stringify(error)) + }) + }, + + onDeviceReady: function() { + var uid = window.localStorage.getItem("token"); + this.initJpush(); + $('#scanBtn').click(function() { + //window.location = "scan.html"; + app.checkBefore(function() { + app.checkOther(function() { + window.location = "scan.html"; + }) + }) + }); + $('#qrcodeBtn').click(function() { + app.checkBefore(function() { + app.checkOther(function() { + window.location = "qrcode.html"; + }) + }) + }); + $('#qrcodeBtn1').click(function() { + app.checkBefore(function() { + app.checkOther(function() { + window.location = "qrcode.html"; + }) + }) + }); + /*$('#cardBtn').click(function() { + app.checkBefore(function() { + app.checkOther(function() { + window.location = "card.html"; + }) + }) + }); + $('#billBtn').click(function() { + app.checkBefore(function() { + window.location = "bill.html"; + }) + }); + $('#moreBtn').click(function() { + app.checkBefore(function() { + window.location = "bill.html"; + }) + }); + $('#secBtn').click(function() { + //window.location = "security.html"; + app.checkBefore(function() { + app.checkOther(function() { + window.location = "security.html"; + }) + }) + }); + + $("#doorBtn").click(function(){ + app.checkBefore(function() { + showRet(DOOR_URl); + }) + })*/ + $("#moreFuncBtn").click(function(){ + window.location = "more.html"; + }) + $('#usersec').click(function() { + app.checkBefore(function() { + app.checkOther(function() { + window.location = "security.html"; + }) + }) + }); + $('#accsignbtn').click(function() { + app.checkBefore(function() { + var signed = window.localStorage.getItem("signed"); + var cum = new auiDialog({}); + if (isEmpty(signed) || signed != 'yes') { + var confirm = cum.alert({ + title: "提示", + msg: '您尚未签约市民卡免密代扣签约协议,无法使用该功能', + buttons: ['取消', '去签约'] + }, function(ret) { + if (ret.buttonIndex == 2) { + app.toSignCode(); + } + }) + }else{ + window.location = 'signxycheck.html' + } + }) + }); + this.initSlider(); + this.initData(); + this.backBtn(); + }, + backBtn: function(){ + document.addEventListener("backbutton", function(e){ + e.preventDefault(); + navigator.app.exitApp(); + }, false); + }, + initTab: function() { + //$("#maincontent").css("top", $("#maintop").height()) + var tab = new auiTab({ + element: document.getElementById("footer"), + }, function(ret) { + window.localStorage.setItem("tabindex", ret.index); + + changeTab(ret.index); + }); + var tabindex = window.localStorage.getItem("tabindex"); + if (!tabindex || tabindex == 0) { + tabindex = 1 + } + changeTab(tabindex); + tab.setActive(tabindex) + + function changeTab(index) { + if (index == 1) { + $("#main1").show(); + $("#main2").hide(); + $("#main3").hide(); + } else if (index == 2) { + $("#main1").hide(); + $("#main2").show(); + $("#main3").hide(); + } else if (index == 3) { + $("#main1").hide(); + $("#main2").hide(); + $("#main3").show(); + } + } + }, + initSlider:function(){ + var slide = new auiSlide({ + container:document.getElementById("startslider"), + "height":260, + "speed":500, + "pageShow":true, + "autoPlay":3000, + "pageStyle":'dot', + "loop":true, + 'dotPosition':'center', + currentPage:currentFun + }); + function currentFun(index){ + //console.log(index) + } + }, + initData: function() { + this.loadBill() + }, + loadBill: function() { + //$("#loaddata").show() + //$("#nodata").hide(); + var param = { + "pageno": 1, + "platform":device.platform + } + V1Bills(param, function(ok, ret) { + if (ok) { + console.log(ret) + if (ret.code == 200) { + app.checkVersion(ret.version,ret.minversion,ret.versionmsg,ret.versionurl); + //app.checkVersion("1.3.9","1","new func","https://shouji.baidu.com/software/26706357.html"); + //$("#maingt").text(ret.t + "!") + $("#user-amount").text(ret.amount) + $("#user-point").text(ret.point) + if (ret.needrebind) { + window.localStorage.removeItem("userid"); + } else { + window.localStorage.setItem("userid", ret.userid); + } + window.localStorage.setItem("signed", ret.signed); + window.localStorage.setItem("paypwdset", ret.paypwdset); + window.localStorage.setItem("name", ret.name); + if (ret.page && ret.page.count > 0) { + GLOBAL_TODAY = ret.today; + GLOBAL_YESTERDAY = ret.yesterday; + //app.initBillView(ret.page) + app.initView(); + } else { + //$("#loaddata").hide() + //$("#nodatahint").text("暂无数据") + //$("#nodata").show(); + app.initView(); + } + } else { + //$("#loaddata").hide() + //$("#nodatahint").text("数据加载异常") + //$("#nodata").show(); + app.initView(); + } + } else { + //$("#loaddata").hide() + //$("#nodatahint").text("请求数据失败") + //$("#nodata").show(); + app.initView(); + } + }) + }, + checkVersion:function(ver,minver,m,url){ + cordova.getAppVersion.getVersionNumber(function (version) { + //alert(version); + //alert(version); + if(ver>version){ + var cum = new auiDialog({}); + var confirm = cum.alert({ + title: "有新的版本", + msg: m, + buttons: ['取消', '去更新'] + }, function(ret) { + if (ret.buttonIndex == 2) { + cordova.InAppBrowser.open(url, '_system', 'location=no,toolbar=yes,toolbarposition=top,closebuttoncaption=关闭'); + } + }) + } + }); + }, + initBillView: function(page) { + var html = ''; + for (var i = 0; i < page.data.length; i++) { + var bean = page.data[i] + html += '
    '; + html += '
    '; + html += '
    '; + html += '
    ' + bean.transdesc + '
    '; + if (bean.tradeflag == 'in') { + html += '
    +' + bean.amount + '
    '; + } else { + html += '
    ' + bean.amount + '
    '; + } + html += '
    '; + } + $("#billcontent").html(html); + $("#loaddata").hide() + $("#nodata").hide(); + $("#billcontent").show(); + + }, + initView: function() { + var userid = window.localStorage.getItem("userid"); + var signed = window.localStorage.getItem("signed"); + if (isEmpty(userid)) { + $("#userbank").text("未绑定"); + $("#userbank").css("color", "red") + } else { + $("#userbank").text("已绑定"); + $("userbank").css("color", "#757575"); + } + if (isEmpty(signed) || signed != 'yes') { + $("#usersign").text("未签约"); + $("#usersign").css("color", "red") + } else { + $("#usersign").text("已签约"); + $("usersign").css("color", "#757575"); + } + var phone = window.localStorage.getItem("phoneX"); + if (!isEmpty(phone)) { + $("#userphone").text(phone) + } + var name = window.localStorage.getItem("name"); + if (isEmpty(name)) { + $("#username").text("匿名") + } else { + $("#username").text(name) + $("#homename").text(name) + } + }, + checkBefore: function(callback) { + var uid = window.localStorage.getItem("token"); + if (isEmpty(uid)) { + window.location = "login.html"; + } else { + var userid = window.localStorage.getItem("userid"); + if (isEmpty(userid)) { + var cum = new auiDialog({}); + var confirm = cum.alert({ + title: "提示", + msg: '为了不影响您正常使用相关功能,请先绑定银行卡', + buttons: ['取消', '去绑卡'] + }, function(ret) { + if (ret.buttonIndex == 2) { + window.location = 'bindcard.html' + } + }) + } else { + if (callback) { + callback() + } + } + } + }, + checkOther: function(callback) { + var signed = window.localStorage.getItem("signed"); + var cum = new auiDialog({}); + + if (isEmpty(signed) || signed != 'yes') { + var confirm = cum.alert({ + title: "提示", + msg: '您尚未签约市民卡免密代扣签约协议,无法使用该功能', + buttons: ['取消', '去签约'] + }, function(ret) { + if (ret.buttonIndex == 2) { + app.toSignCode(); + } + }) + } else { + if (callback) { + callback() + } + } + }, + toSignCode: function(){ + var param = { + } + V1Bindcardcode(param, function(ok, ret) { + if (ok) { + if (ret.code == 200) { + window.location = 'bindcheck.html' + } else { + $.alert(ret.msg, "错误"); + } + } else { + $.alert("请求失败了 " + ret.status + ",请稍后再试", "错误"); + } + }) + }, + toSign: function() { + window.location = 'signxycheck.html' + }, + toBillDetail: function(refno) { + window.localStorage.setItem("currentrefno", refno); + window.location = 'billdetail.html'; + }, + toCard: function() { + var userid = window.localStorage.getItem("userid"); + if (isEmpty(userid)) { + window.location = 'bindcard.html' + } else { + window.location = 'cardinfor.html' + } + }, + logout:function(){ + window.localStorage.removeItem("token"); + window.location = "login.html"; + } +}; +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: { + image: 'back.png', + imagePressed: 'back.png', + align: 'left', + event: 'backPressed' + }, + closeButton: { + image: 'close.png', + imagePressed: 'close.png', + align: 'left', + event: 'closePressed' + }, + backButtonCanClose: true + }).addEventListener('closePressed', function(params){ + inAppBrowserRef.close(); + //window.location = "main.html" + }); + } diff --git a/www/js/startload.js b/www/js/startload.js new file mode 100644 index 0000000..2ac0b7d --- /dev/null +++ b/www/js/startload.js @@ -0,0 +1,20 @@ +var app = { + initialize: function() { + document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); + }, + + onDeviceReady: function() { + + }, + toMain:function(){ + window.localStorage.setItem("firstload",'no'); + var uid = window.localStorage.getItem("token"); + if (isEmpty(uid)) { + window.location = "login.html"; + //toPage("login.html") + } else { + window.location = "main.html"; + } + } +}; +app.initialize(); \ No newline at end of file diff --git a/www/login.html b/www/login.html index 60827f3..bce7fd5 100644 --- a/www/login.html +++ b/www/login.html @@ -12,7 +12,7 @@
      diff --git a/www/main.html b/www/main.html index c8bb590..0d18b69 100644 --- a/www/main.html +++ b/www/main.html @@ -9,171 +9,73 @@ +
      -
      -

      您好!

      -
      -
      -
      -
      -
      扫一扫
      -
      -
      -
      -
      我的码
      -
      +
      +
      +
      +
      -
      -
      -
      -
      -
      -
      -
      -
      市民卡挂失
      -
      -
      -
      -
      账单查询
      -
      -
      -
      -
      账户安全
      -
      -
      -
      -
      远程开门
      -
      +
      + +
      +
      +
      -
      -
      -
      -
      近期交易
      -
      更多>
      -
      +
      -
      -
      -
      - - 正在加载 -
      - -
        @@ -253,6 +139,10 @@
        首页
      + +
      消息
      +
      +
      我的
      @@ -262,8 +152,9 @@ + - + diff --git a/www/main2.html b/www/main2.html new file mode 100644 index 0000000..c8bb590 --- /dev/null +++ b/www/main2.html @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + +
      +
      +
      +

      您好!

      +
      +
      +
      +
      +
      扫一扫
      +
      +
      +
      +
      我的码
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      市民卡挂失
      +
      +
      +
      +
      账单查询
      +
      +
      +
      +
      账户安全
      +
      +
      +
      +
      远程开门
      +
      +
      +
      +
      +
      +
      +
      近期交易
      +
      更多>
      +
      +
      +
      +
      +
      +
      + + 正在加载 +
      + + +
      +
      +
      + +
      +
      + +
      首页
      +
      +
      + +
      我的
      +
      +
      + + + + + + + + + \ No newline at end of file diff --git a/www/more.html b/www/more.html new file mode 100644 index 0000000..f9aef06 --- /dev/null +++ b/www/more.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + 更多功能 + + +
      + + + +
      更多功能
      +
      +
      +
      + 敬请期待 +
      +
      + + + + + + + diff --git a/www/startload.html b/www/startload.html new file mode 100644 index 0000000..93c1cc1 --- /dev/null +++ b/www/startload.html @@ -0,0 +1,65 @@ + + + + + + + + + + + 大理公安在线 + + + +
      +
      +
      + +
      +
      + +
      +
      + +
      开始使用
      +
      +
      +
      +
      + + + + + + + + + \ No newline at end of file