app修改
diff --git a/www/js/index.js b/www/js/index.js
index 5f48d1e..82aa5bb 100644
--- a/www/js/index.js
+++ b/www/js/index.js
@@ -25,16 +25,15 @@
},
onDeviceReady: function() {
- debugger;
var firstload = window.localStorage.getItem("firstload");
- if(isEmpty(firstload)||firstload!='yes'){
+ /*if(isEmpty(firstload)||firstload!='yes'){
app.toPage("startload.html")
return;
- }
+ }*/
var uid = window.localStorage.getItem("token");
if (isEmpty(uid)) {
//window.location = "login.html";
- toPage("login.html")
+ this.toPage("login.html")
} else {
//尝试登陆
V1Infor(function(ok, ret) {
@@ -69,7 +68,7 @@
setTimeout(function() {
//window.location=page;
window.location=page;
- },2000)
+ },1000)
}
};
app.initialize();
\ No newline at end of file
diff --git a/www/js/lib/aui-slide.js b/www/js/lib/aui-slide.js
index 2f44157..f2b79b3 100644
--- a/www/js/lib/aui-slide.js
+++ b/www/js/lib/aui-slide.js
@@ -8,7 +8,7 @@
*/
(function(window) {
"use strict";
-
+ var autoInderval;
var translateVal,
firstTouchX,
firstTouchY,
@@ -87,7 +87,7 @@
this.createPagination(0);
this.setPageDotPosition();
}
- if(this.options.autoPlay > 500 && this.loop){
+ if(this.options.autoPlay > 500){
this.autoPlay(0);
}
this.slideWrap.addEventListener('touchstart', this.touchStart.bind(this), false);
@@ -104,13 +104,18 @@
// 自动播放
auiSlide.prototype.autoPlay = function (index) {
var self = this;
- setInterval(function(){
+ autoInderval = setInterval(function(){
self.slideTo(self.getCircle(self.index-1), -self.slideWrapWidth, 0);
self.slideTo(self.getCircle(self.index+2), self.slideWrapWidth, 0);
self.slideTo(self.index, -self.slideWrapWidth, self.options.speed);
self.slideTo(self.getCircle(self.index+1), 0, self.options.speed);
self.index = self.getCircle(self.index+1);
self.setPaginationActive(self.index);
+ if((self.index+1)==self.pageCount()){
+ if(!self.options.loop){
+ clearInterval(autoInderval);
+ }
+ }
}, self.options.autoPlay)
};
// 设置当前分页
diff --git a/www/js/mainmenu.js b/www/js/mainmenu.js
index a0e4fca..eacec44 100644
--- a/www/js/mainmenu.js
+++ b/www/js/mainmenu.js
@@ -74,12 +74,17 @@
})
})
});
+ var userid = window.localStorage.getItem("userid");
$('#qrcodeBtn1').click(function() {
- app.checkBefore(function() {
- app.checkOther(function() {
- window.location = "qrcode.html";
- })
- })
+ 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() {
@@ -114,6 +119,7 @@
})*/
$("#moreFuncBtn").click(function(){
window.location = "more.html";
+ //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
})
$('#usersec').click(function() {
app.checkBefore(function() {
@@ -191,7 +197,7 @@
"pageShow":true,
"autoPlay":3000,
"pageStyle":'dot',
- "loop":false,
+ "loop":true,
'dotPosition':'center',
currentPage:currentFun
});
@@ -207,12 +213,16 @@
//$("#nodata").hide();
var param = {
"pageno": 1,
+ "type":"police",
"platform":device.platform
}
V1Bills(param, function(ok, ret) {
if (ok) {
- console.log(ret)
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 + "!")
@@ -256,6 +266,7 @@
//alert(version);
//alert(version);
if(ver>version){
+ $("#versioncheck").html('<div class="aui-dot" style="position:relative;top:0; right:0;display:inline-block;"></div>新版本'+ver);
var cum = new auiDialog({});
var confirm = cum.alert({
title: "有新的版本",
@@ -263,9 +274,12 @@
buttons: ['取消', '去更新']
}, function(ret) {
if (ret.buttonIndex == 2) {
- cordova.InAppBrowser.open(url, '_system', 'location=no,toolbar=yes,toolbarposition=top,closebuttoncaption=关闭');
+ //cordova.InAppBrowser.open(url, '_system', 'location=no,toolbar=yes,toolbarposition=top,closebuttoncaption=关闭');
+ window.open(url,"_system",'');
}
})
+ }else{
+ $("#versioncheck").html('已是最新版'+version);
}
});
},
@@ -396,6 +410,26 @@
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();
@@ -426,20 +460,17 @@
showPageTitle: true
},
backButton: {
- image: 'back.png',
- imagePressed: 'back.png',
+ wwwImage: 'img/back.png',
+ wwwImagePressed: 'img/back.png',
align: 'left',
event: 'backPressed'
},
- closeButton: {
- image: 'close.png',
- imagePressed: 'close.png',
- align: 'left',
- event: 'closePressed'
- },
backButtonCanClose: true
- }).addEventListener('closePressed', function(params){
+ }).addEventListener('backPressed', function(e) {
+ //alert('back pressed');
+ }).addEventListener('closePressed', function(e) {
+ //alert('closePressed pressed');
inAppBrowserRef.close();
- //window.location = "main.html"
- });
+ window.location = "main.html"
+ });
}
diff --git a/www/js/more.js b/www/js/more.js
new file mode 100644
index 0000000..26b18f2
--- /dev/null
+++ b/www/js/more.js
@@ -0,0 +1,66 @@
+var app = {
+
+ // Application Constructor
+ initialize: function() {
+ document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
+ },
+
+ onDeviceReady: function() {
+ var userid = window.localStorage.getItem("userid");
+ $('#moreBtn3').click(function() {
+ window.location = "bill.html";
+ });
+ $("#moreBtn1").click(function(){
+ //window.location = "more.html";
+ showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
+ })
+ $("#moreBtn2").click(function(){
+ //window.location = "more.html";
+ //showRet("https://yy.dlsmk.cn/wisdompolice/app/doorappindex?custid="+userid);
+ alert("暂未开通");
+ })
+ },
+
+};
+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"
+ });
+ }
diff --git a/www/js/server.js b/www/js/server.js
index 5854db6..c3dc21c 100644
--- a/www/js/server.js
+++ b/www/js/server.js
@@ -2,10 +2,11 @@
var SERVER = "https://yy.dlsmk.cn/payapi/mobileapi";
var DOOR_URl = "https://yy.dlsmk.cn/door/app/appMintUIindex";//门禁服务地址
var GLOBAL_TODAY="";
+var BASE_URL="https://yy.dlsmk.cn";
var GLOBAL_YESTERDAY="";
var CURRENT_INDEX=1;
if (dev) {
- SERVER = "http://yy.dlsmk.cn:8080/payapi/mobileapi";
+ SERVER = "http://172.28.43.7:8099/payapi/mobileapi";
}
function V1Bindcardcode(param,callback) {
ajaxPost("/v1/bindcardcode", param, callback)