修改绑定功能
diff --git a/www/js/main.js b/www/js/main.js
index 87d6f53..3b01a2a 100644
--- a/www/js/main.js
+++ b/www/js/main.js
@@ -2,6 +2,7 @@
// Application Constructor
initialize: function() {
+ this.initTab();
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
@@ -42,19 +43,47 @@
});
$('#secBtn').click(function() {
app.checkBefore(function() {
- window.location = "security.html";
+ app.checkOther(function() {
+ window.location = "security.html";
+ })
})
});
$('#usersec').click(function() {
app.checkBefore(function() {
- window.location = "security.html";
+ app.checkOther(function() {
+ window.location = "security.html";
+ })
})
});
this.initData();
},
+ 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();
+ } else if (index == 2) {
+ $("#main1").hide();
+ $("#main2").show();
+ }
+ }
+ },
initData: function() {
this.loadBill()
-
},
loadBill: function() {
$("#loaddata").show()
@@ -122,7 +151,7 @@
$("#loaddata").hide()
$("#nodata").hide();
$("#billcontent").show();
-
+
},
initView: function() {
var userid = window.localStorage.getItem("userid");
@@ -210,18 +239,18 @@
}
}
},
- toSign:function(){
+ toSign: function() {
window.location = 'signxycheck.html'
},
toBillDetail: function(refno) {
window.localStorage.setItem("currentrefno", refno);
window.location = 'billdetail.html';
},
- toCard:function(){
+ toCard: function() {
var userid = window.localStorage.getItem("userid");
if (isEmpty(userid)) {
window.location = 'bindcard.html'
- }else{
+ } else {
window.location = 'cardinfor.html'
}
}