From 5ed5825655e8b20964d80d655fc6d802f6627236 Mon Sep 17 00:00:00 2001 From: "guangchao.xu" Date: Tue, 21 Jul 2020 18:15:56 +0800 Subject: [PATCH] =?utf8?q?=E6=B7=BB=E5=8A=A0webview=E5=88=86=E4=BA=AB?= =?utf8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- config.xml | 2 +- .../src/org/apache/cordova/CordovaBridge.java | 5 + .../apache/cordova/CordovaWebViewEngine.java | 3 + .../cordova/engine/SystemWebViewEngine.java | 5 + platforms/android/app/build.gradle | 2 +- .../app/src/main/assets/www/cordova.js | 11 + .../app/src/main/assets/www/js/main.js | 850 +++++++------- .../android/app/src/main/assets/www/main.html | 8 +- .../www/inappbrowser.js | 7 +- .../cordova/inappbrowser/InAppBrowser.java | 8 + platforms/android/platform_www/cordova.js | 11 + .../www/inappbrowser.js | 7 +- www/img/share.png | Bin 0 -> 956 bytes www/img/share1.png | Bin 0 -> 7444 bytes www/js/main.js | 850 +++++++------- www/js/mainmenu.js | 1012 +++++++++-------- www/share.html | 109 ++ 17 files changed, 1602 insertions(+), 1288 deletions(-) create mode 100644 www/img/share.png create mode 100644 www/img/share1.png create mode 100644 www/share.html diff --git a/config.xml b/config.xml index c774eec..409322b 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + dlapp A sample Apache Cordova application that responds to the deviceready event. diff --git a/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java b/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java index 28c407f..50511c5 100644 --- a/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java +++ b/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java @@ -116,6 +116,11 @@ public class CordovaBridge { //you're running Android 4.3 and below in 2017 @SuppressLint("TrulyRandom") int generateBridgeSecret() { + //新增 + //-----------start----------- + // if (expectedBridgeSecret >= 0) + // return expectedBridgeSecret; + //----------end----------- SecureRandom randGen = new SecureRandom(); expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE); return expectedBridgeSecret; diff --git a/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java b/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java index c8e5a55..8529fe1 100644 --- a/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java +++ b/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java @@ -22,6 +22,8 @@ import android.view.KeyEvent; import android.view.View; import android.webkit.ValueCallback; + + /** * Interface for all Cordova engines. * No methods will be added to this class (in order to be compatible with existing engines). @@ -34,6 +36,7 @@ public interface CordovaWebViewEngine { CordovaWebView getCordovaWebView(); ICordovaCookieManager getCookieManager(); + //CordovaBridge getCordovaBridge(); //新增 View getView(); void loadUrl(String url, boolean clearNavigationStack); diff --git a/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java b/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java index 1cbd7f8..1a22b12 100755 --- a/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java +++ b/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java @@ -125,6 +125,11 @@ public class SystemWebViewEngine implements CordovaWebViewEngine { bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue); exposeJsInterface(webView, bridge); } + // 新增 + //@Override + //public CordovaBridge getCordovaBridge(){ + // return bridge; + //} @Override public CordovaWebView getCordovaWebView() { diff --git a/platforms/android/app/build.gradle b/platforms/android/app/build.gradle index 6a72223..96829b6 100644 --- a/platforms/android/app/build.gradle +++ b/platforms/android/app/build.gradle @@ -176,7 +176,7 @@ android { abiFilters "armeabi" } versionCode 15 - versionName '1.4.2' + versionName '1.4.3' targetSdkVersion 28 } lintOptions { diff --git a/platforms/android/app/src/main/assets/www/cordova.js b/platforms/android/app/src/main/assets/www/cordova.js index 0f2d2e6..3ef0de9 100644 --- a/platforms/android/app/src/main/assets/www/cordova.js +++ b/platforms/android/app/src/main/assets/www/cordova.js @@ -301,6 +301,17 @@ var cordova = { delete cordova.callbacks[callbackId]; } } + //新增 + //-------------------start------------------ + else { + // __globalBrowser为表示当前界面开启了InAppBrowser + if(window.__globalBrowser) { + var message = 'cordova.callbackFromNative("'+callbackId+'",'+isSuccess+',' + status +',' +JSON.stringify(args) + ',' + keepCallback + ')'; + // 调用InAppBrowser插件里的js回传方法 + window.__globalBrowser.executeScript({code: message}); + } + } + //-------------------end------------------ } catch (err) { var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; console && console.log && console.log(msg); diff --git a/platforms/android/app/src/main/assets/www/js/main.js b/platforms/android/app/src/main/assets/www/js/main.js index f302033..f19972e 100644 --- a/platforms/android/app/src/main/assets/www/js/main.js +++ b/platforms/android/app/src/main/assets/www/js/main.js @@ -1,412 +1,460 @@ 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"); - // 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)) + }) + }, - 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"; + }) + }) + }); + $('#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); + }) + }) + $('#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.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); - 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"; - }) - }) - }); - $('#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); - }) - }) - $('#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.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) - 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(); + } else if (index == 2) { + $("#main1").hide(); + $("#main2").show(); + } + } + }, + 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(); - function changeTab(index) { - if (index == 1) { - $("#main1").show(); - $("#main2").hide(); - } else if (index == 2) { - $("#main1").hide(); - $("#main2").show(); - } - } - }, - 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({}); - }, - 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"; - } + 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" - }); - } + 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' + }, + // menu: { + // image: 'share.png', + // imagePressed: 'share.png', + // align: 'right', + // items: [{ + // event: 'shareQQ', + // label: '分享至QQ好友' + // }, + // { + // event: 'shareWX', + // label: '分享至微信好友' + // } + // ] + // }, + backButtonCanClose: true + }).addEventListener('closePressed', function(params) { + inAppBrowserRef.close(); + //window.location = "main.html" + }) + // .addEventListener('shareQQ', function(e) { + // // alert(1) + // var args = {}; + // args.client = QQSDK.ClientType.QQ; //QQSDK.ClientType.QQ,QQSDK.ClientType.TIM; + // args.scene = QQSDK.Scene.QQ; //QQSDK.Scene.QQZone,QQSDK.Scene.Favorite + // args.url = 'https://yy.dlsmk.cn/wisdompolice/app/getapplyqrcode?visitorid=' + vistorId; + // args.title = '大理APP'; + // args.description = '访客二维码'; + // // args.image = 'https://cordova.apache.org/static/img/cordova_bot.png'; + // QQSDK.shareNews(function() { + // alert('分享成功'); + // }, function(failReason) { + // alert(failReason); + // }, args); + // }).addEventListener('shareWX', function(e) { + // // alert(2) + // Wechat.share({ + // message: { + // title: "大理App分享", + // description: "访客二维码", + // thumb: "www/img/thumbnail.png", + // media: { + // type: Wechat.Type.WEBPAGE, + // webpageUrl: 'https://yy.dlsmk.cn/wisdompolice/app/getapplyqrcode?visitorid=' + vistorId + // } + // }, + // scene: Wechat.Scene.SESSION // share to Timeline + // }, function() { + // alert("分享成功"); + // }, function(reason) { + // alert("Failed: " + reason); + // }); + // }); +} diff --git a/platforms/android/app/src/main/assets/www/main.html b/platforms/android/app/src/main/assets/www/main.html index db80468..50ca9a5 100644 --- a/platforms/android/app/src/main/assets/www/main.html +++ b/platforms/android/app/src/main/assets/www/main.html @@ -149,7 +149,7 @@ -
    + @@ -200,7 +200,7 @@ - --> diff --git a/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js b/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js index a3021c2..885765e 100644 --- a/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js +++ b/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js @@ -111,7 +111,12 @@ cordova.define("cordova-plugin-inappbrowser.inappbrowser", function(require, exp strWindowFeatures = strWindowFeatures || ''; exec(cb, cb, 'InAppBrowser', 'open', [strUrl, strWindowName, strWindowFeatures]); - return iab; + //新增 + // 声明全局变量__globalBrowser,表示当前界面开启了InAppBrowser + //-----------------start-------------- + // window.__globalBrowser = iab; + //-----------------end-------------- + return iab; }; })(); diff --git a/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowser.java b/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowser.java index 9b3388c..55f2403 100644 --- a/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowser.java +++ b/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowser.java @@ -78,6 +78,8 @@ import java.util.StringTokenizer; @SuppressLint("SetJavaScriptEnabled") public class InAppBrowser extends CordovaPlugin { + //改造 + private static final String NATIVE_JS_PREFIX = "https://native-js/"; private static final String NULL = "null"; protected static final String LOG_TAG = "InAppBrowser"; @@ -1200,6 +1202,12 @@ public class InAppBrowser extends CordovaPlugin { } catch (JSONException ex) { LOG.d(LOG_TAG, "Should never happen"); } + //新增 + //-------------------------satrt------------------------------------ + // String jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document)"; + //在InAppBrowser WebView中注入一个对象(脚本或样式)。 + // injectDeferredObject(NATIVE_JS_PREFIX + "cordova.js", jsWrapper); + //---------------------------end--------------------------------- } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { diff --git a/platforms/android/platform_www/cordova.js b/platforms/android/platform_www/cordova.js index 0f2d2e6..3ef0de9 100644 --- a/platforms/android/platform_www/cordova.js +++ b/platforms/android/platform_www/cordova.js @@ -301,6 +301,17 @@ var cordova = { delete cordova.callbacks[callbackId]; } } + //新增 + //-------------------start------------------ + else { + // __globalBrowser为表示当前界面开启了InAppBrowser + if(window.__globalBrowser) { + var message = 'cordova.callbackFromNative("'+callbackId+'",'+isSuccess+',' + status +',' +JSON.stringify(args) + ',' + keepCallback + ')'; + // 调用InAppBrowser插件里的js回传方法 + window.__globalBrowser.executeScript({code: message}); + } + } + //-------------------end------------------ } catch (err) { var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; console && console.log && console.log(msg); diff --git a/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js b/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js index a3021c2..885765e 100644 --- a/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js +++ b/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js @@ -111,7 +111,12 @@ cordova.define("cordova-plugin-inappbrowser.inappbrowser", function(require, exp strWindowFeatures = strWindowFeatures || ''; exec(cb, cb, 'InAppBrowser', 'open', [strUrl, strWindowName, strWindowFeatures]); - return iab; + //新增 + // 声明全局变量__globalBrowser,表示当前界面开启了InAppBrowser + //-----------------start-------------- + // window.__globalBrowser = iab; + //-----------------end-------------- + return iab; }; })(); diff --git a/www/img/share.png b/www/img/share.png new file mode 100644 index 0000000000000000000000000000000000000000..6acb4561e218b3ed93194f6571e29a70f68eee41 GIT binary patch literal 956 zcmV;t14I0YP)+&5r-h1v}{{27q)4BKi?%wOJz4zMth{|UBI$#=b zF7Pk#Hn3LGt6iZ~GrsLtfJ=+dO~Bv4spa!p;08%M+A*sEu)Pp?4EPb4FX^=evV8{d zATS+RA?d2>0Bm0XyjdL2kkmZ)zOsE7@BwflFiXR< zE{>in!FzPK&Gs?C5t2UZ>WZN?U^{Iz0XPo$1=s>SE9nQ@F99=wZ6$D&Z%noa1GYow z$wNH;28;uu_Ysr##}v8zcsBssZvZoZpMaZz56hkNfK}yrDX?79t{TC2cR`^&O14c> za@U{F%L|B~fzu^zuMOb!2n2ACqzAg3x3v69NiWt0@H=oYaLKU6p{3=EBxR^nv0e?> z{v1eeN5P&M!oXcX*jXUy@hZ_9CA1wWy)iRgQVMavY=2p{n}K;h7BCG1$$#n~HZW3K zMcTxA8Msf5Hzr?KW&E&b`d-jX(xT%5XM2C(mZB9$mwVqAWz26=Q&Gt5h_UF( zcfbiibAO7YuW~pr3vBNP90eQ+`~~dj-((wbwli8YW&=Ey`^(FAG>}f)Hvx~vX8=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7++4htU*~6$WkLQ!LqYTzi6D6_sNK%*d%WT1YpLn%Osc9 z1{xxh4{!4X7W(l@A<{)hswOcx`xRRmobXau-a8W-J5%FJBNr-7si)hDlTY>EtIZTx&$m$cwZO%_!#X~OEIaZi!BTXNh5Ol3bmIWLX5w%rG# ztRx!C(r2=LKm_X%=y9IMtLNLO!q1UFmk_S zmecoU04n)$xV`lHrgn2Ry?F%$89=!~Q0f0>7Q@Mk8ho>wSA^xrVBw$K_xZPkA8RG8+Ls8^ z+PlwvpkNv&xDL!m{D#*J7~jh7S(qFzpA6hgvzw=E2fDHWu)@5S7)ATmQge0{owK$og?$G@$fYmYCxAT63xt z5OwGm12;{W&#nLZJ&^9#Wk3`dNUuJoj!qJA#vWoQ9m~2Q%TYMAskYqmGBOcXzjNRP od_CJkjyUe5sFN1L3r^{;Sh%UCpEneyPCEgNCRU?L&HnlS0kSj$lmGw# literal 0 HcmV?d00001 diff --git a/www/js/main.js b/www/js/main.js index f302033..f19972e 100644 --- a/www/js/main.js +++ b/www/js/main.js @@ -1,412 +1,460 @@ 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"); - // 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)) + }) + }, - 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"; + }) + }) + }); + $('#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); + }) + }) + $('#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.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); - 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"; - }) - }) - }); - $('#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); - }) - }) - $('#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.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) - 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(); + } else if (index == 2) { + $("#main1").hide(); + $("#main2").show(); + } + } + }, + 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(); - function changeTab(index) { - if (index == 1) { - $("#main1").show(); - $("#main2").hide(); - } else if (index == 2) { - $("#main1").hide(); - $("#main2").show(); - } - } - }, - 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({}); - }, - 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"; - } + 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" - }); - } + 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' + }, + // menu: { + // image: 'share.png', + // imagePressed: 'share.png', + // align: 'right', + // items: [{ + // event: 'shareQQ', + // label: '分享至QQ好友' + // }, + // { + // event: 'shareWX', + // label: '分享至微信好友' + // } + // ] + // }, + backButtonCanClose: true + }).addEventListener('closePressed', function(params) { + inAppBrowserRef.close(); + //window.location = "main.html" + }) + // .addEventListener('shareQQ', function(e) { + // // alert(1) + // var args = {}; + // args.client = QQSDK.ClientType.QQ; //QQSDK.ClientType.QQ,QQSDK.ClientType.TIM; + // args.scene = QQSDK.Scene.QQ; //QQSDK.Scene.QQZone,QQSDK.Scene.Favorite + // args.url = 'https://yy.dlsmk.cn/wisdompolice/app/getapplyqrcode?visitorid=' + vistorId; + // args.title = '大理APP'; + // args.description = '访客二维码'; + // // args.image = 'https://cordova.apache.org/static/img/cordova_bot.png'; + // QQSDK.shareNews(function() { + // alert('分享成功'); + // }, function(failReason) { + // alert(failReason); + // }, args); + // }).addEventListener('shareWX', function(e) { + // // alert(2) + // Wechat.share({ + // message: { + // title: "大理App分享", + // description: "访客二维码", + // thumb: "www/img/thumbnail.png", + // media: { + // type: Wechat.Type.WEBPAGE, + // webpageUrl: 'https://yy.dlsmk.cn/wisdompolice/app/getapplyqrcode?visitorid=' + vistorId + // } + // }, + // scene: Wechat.Scene.SESSION // share to Timeline + // }, function() { + // alert("分享成功"); + // }, function(reason) { + // alert("Failed: " + reason); + // }); + // }); +} diff --git a/www/js/mainmenu.js b/www/js/mainmenu.js index 2996fb1..6a8182a 100644 --- a/www/js/mainmenu.js +++ b/www/js/mainmenu.js @@ -1,492 +1,548 @@ 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,msgtype - var userid = window.localStorage.getItem("userid"); - var baseUrl = "https://yy.dlsmk.cn/wisdompolice/app" - console.log("openNotify:"+event); - if(device.platform == "Android") { - msgtype = event.extras.msgtype - if (msgtype ==="conference"){ - window.location= baseUrl + "/conference/signupconference?userId="+userid; - }else if(msgtype ==="atte1"){ - window.location= baseUrl + "/atte/reviewindex?custid="+userid; - }else if(msgtype ==="atte2"){ - window.location= baseUrl + "/atte/searchindex?custid="+userid; - }else if(msgtype ==="atte3"){ - window.location= baseUrl + "/atte/reviewClock?custid="+userid; - }else if(msgtype ==="atte4"){ - window.location= baseUrl + "/atte/clockhisindex?custid="+userid; - }else{ - refno = event.extras.refno + // 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, msgtype + var userid = window.localStorage.getItem("userid"); + var baseUrl = "https://yy.dlsmk.cn/wisdompolice/app" + console.log("openNotify:" + event); + if (device.platform == "Android") { + msgtype = event.extras.msgtype + // window.location = 'more.html' + if (msgtype === "conference") { + showRet(baseUrl + "/conference/signupconference?userId=" + userid); + } else if (msgtype === "atte1") { + showRet(baseUrl + "/atte/reviewindex?custid=" + userid); + } else if (msgtype === "atte2") { + showRet(baseUrl + "/atte/searchindex?custid=" + userid); + } else if (msgtype === "atte3") { + showRet(baseUrl + "/atte/reviewClock?custid=" + userid); + } else if (msgtype === "atte4") { + showRet(baseUrl + "/atte/clockhisindex?custid=" + userid); + } else { + refno = event.extras.refno + app.openBill(refno); + } + } else { + refno = event.refno + window.JPush.setApplicationIconBadgeNumber(0); app.openBill(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)) - }) - }, + //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"; - }) - }) - }); - var userid = window.localStorage.getItem("userid"); - $('#qrcodeBtn1').click(function() { - showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappvisitor?custid="+userid); - }); - - $('#qingjiaBtn').click(function() { - - //window.location = "https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid; - }); - $('#accessBtn').click(function() { - //window.location = "https://yy.dlsmk.cn/wisdompolice/app/doorappvisitor?custid="+userid; - }); - /*$('#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"; - }) - }) - }); + 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"; + }) + }) + }); + var userid = window.localStorage.getItem("userid"); + $('#qrcodeBtn1').click(function() { + showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappvisitor?custid=" + userid); + }); + + $('#qingjiaBtn').click(function() { + + //window.location = "https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid; + }); + $('#accessBtn').click(function() { + //window.location = "https://yy.dlsmk.cn/wisdompolice/app/doorappvisitor?custid="+userid; + }); + /*$('#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"; - //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); - }) - $('#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); + $("#doorBtn").click(function(){ + app.checkBefore(function() { + showRet(DOOR_URl); + }) + })*/ + $("#moreFuncBtn").click(function() { + window.location = "more.html"; + //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid); + }) + $('#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) - 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": 240, + "speed": 500, + "pageShow": true, + "autoPlay": 3000, + "pageStyle": 'dot', + "loop": true, + 'dotPosition': 'center', + currentPage: currentFun + }); - 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":240, - "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, - "type":"police", - "platform":device.platform - } - V1Bills(param, function(ok, ret) { - if (ok) { - if (ret.code == 200) { - console.log(ret) - //ret.version='1.3.9'; - //ret.versionmsg='新版本'; - //ret.versionurl='https://yy.dlsmk.cn/app/download/wisdompolice.apk'; - 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){ - $("#versioncheck").html('
    新版本'+ver); - 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=关闭'); - window.open(url,"_system",''); - } - }) - }else{ - $("#versioncheck").html('已是最新版'+version); - } - }); - }, - 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(); + function currentFun(index) { + //console.log(index) + } + }, + initData: function() { + this.loadBill() + }, + loadBill: function() { + //$("#loaddata").show() + //$("#nodata").hide(); + var param = { + "pageno": 1, + "type": "police", + "platform": device.platform + } + V1Bills(param, function(ok, ret) { + if (ok) { + if (ret.code == 200) { + console.log(ret) + //ret.version='1.3.9'; + //ret.versionmsg='新版本'; + //ret.versionurl='https://yy.dlsmk.cn/app/download/wisdompolice.apk'; + 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) { + $("#versioncheck").html( + '
    新版本' + ver); + 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=关闭'); + window.open(url, "_system", ''); + } + }) + } else { + $("#versioncheck").html('已是最新版' + version); + } + }); + }, + 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({}); + }, + 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 signed = window.localStorage.getItem("signed"); - if (isEmpty(signed) || signed != 'yes') { - window.location = 'bindcard.html' - }else{ - window.location = 'cardinfor.html' - } - }, - logout:function(){ - window.localStorage.removeItem("token"); - window.location = "login.html"; - }, - verisonCheck:function(){ - var param = { - "pageno": 1, - "type":"police", - "platform":device.platform - } - V1Bills(param, function(ok, ret) { - if (ok) { - if (ret.code == 200) { - console.log(ret) - //ret.version='1.3.9'; - //ret.versionmsg='新版本'; - //ret.versionurl='https://yy.dlsmk.cn/app/download/wisdompolice.apk'; - app.checkVersion(ret.version,ret.minversion,ret.versionmsg,ret.versionurl); - } else { - } - } else { - } - }) - } + 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 signed = window.localStorage.getItem("signed"); + if (isEmpty(signed) || signed != 'yes') { + window.location = 'bindcard.html' + } else { + window.location = 'cardinfor.html' + } + }, + logout: function() { + window.localStorage.removeItem("token"); + window.location = "login.html"; + }, + verisonCheck: function() { + var param = { + "pageno": 1, + "type": "police", + "platform": device.platform + } + V1Bills(param, function(ok, ret) { + if (ok) { + if (ret.code == 200) { + console.log(ret) + //ret.version='1.3.9'; + //ret.versionmsg='新版本'; + //ret.versionurl='https://yy.dlsmk.cn/app/download/wisdompolice.apk'; + app.checkVersion(ret.version, ret.minversion, ret.versionmsg, ret.versionurl); + } else {} + } else {} + }) + } }; 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" - }); - } + 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' + }, + menu: { + wwwImage: 'img/share.png', + wwwImagePressed: 'img/share.png', + align: 'right', + items: [{ + event: 'shareQQ', + label: '分享至QQ好友' + }, + { + event: 'shareWX', + label: '分享至微信好友' + } + ] + }, + backButtonCanClose: true + }).addEventListener('backPressed', function(e) { + // if (window.localStorage.getItem("share") === 1) { + // alert("share") + // inAppBrowserRef.close(); + // window.location = "share.html" + // } + }).addEventListener('closePressed', function(e) { + //alert('closePressed pressed'); + inAppBrowserRef.close(); + window.location = "main.html" + }) + .addEventListener('shareQQ', function(e) { + var visitorid = e.url.split("=")[1] + var path = 'https://yy.dlsmk.cn/wisdompolice/app/getapplyqrcode?visitorid=' + visitorid + var args = {}; + args.client = QQSDK.ClientType.QQ; //QQSDK.ClientType.QQ,QQSDK.ClientType.TIM; + args.scene = QQSDK.Scene.QQ; //QQSDK.Scene.QQZone,QQSDK.Scene.Favorite + args.title = '大理APP'; + args.description = '访客二维码'; + args.url = path; + // args.image = 'https://cordova.apache.org/static/img/cordova_bot.png'; + QQSDK.shareNews(function() { + alert('分享成功'); + }, function(failReason) { + alert(failReason); + }, args); + }) + .addEventListener('shareWX', function(e) { + var visitorid = e.url.split("=")[1] + var path = 'https://yy.dlsmk.cn/wisdompolice/app/getapplyqrcode?visitorid=' + visitorid + Wechat.share({ + message: { + title: "大理App分享", + description: "访客二维码", + thumb: "www/img/thumbnail.png", + media: { + type: Wechat.Type.WEBPAGE, + webpageUrl: path + } + }, + scene: Wechat.Scene.SESSION, // share to Timeline + }, function() { + alert("分享成功"); + }, function(reason) { + alert("Failed: " + reason); + }) + }); +} diff --git a/www/share.html b/www/share.html new file mode 100644 index 0000000..32a70c5 --- /dev/null +++ b/www/share.html @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + +
    + + 二维码分享 +
    +
      +
    • qq分享
    • +
    • 微信分享
    • +
    + + + + + + + + + + -- 2.17.1