基础版本
diff --git a/www/js/server.js b/www/js/server.js
new file mode 100644
index 0000000..3194de9
--- /dev/null
+++ b/www/js/server.js
@@ -0,0 +1,298 @@
+var dev = true;
+var SERVER = "";
+var GLOBAL_TODAY="";
+var GLOBAL_YESTERDAY="";
+var CURRENT_INDEX=1;
+if (dev) {
+ SERVER = "http://172.28.43.3:8099/payapi/mobileapi";
+}
+function V1Cardinfor(callback) {
+ ajaxPost("/v1/cardinfor", {}, callback)
+}
+
+function V1Pwdset(param,callback) {
+ ajaxPost("/v1/pwdset", param, callback)
+}
+
+function V1Billdetail(param,callback) {
+ ajaxPost("/v1/billdetail", param, callback)
+}
+
+function V1Bills(param,callback) {
+ ajaxPost("/v1/bills", param, callback)
+}
+
+function V1CardLost(param,callback) {
+ ajaxPost("/v1/cardlost", param, callback)
+}
+
+function V1Signbxy(param,callback) {
+ ajaxPost("/v1/signbxy", param, callback)
+}
+
+function V1Bxy(callback) {
+ ajaxPost("/v1/bxy", {}, callback)
+}
+
+function V1Paypwd(param,callback) {
+ ajaxPost("/v1/paypwd", param, callback)
+}
+function V1Code(callback) {
+ ajaxPost("/v1/code", {}, callback)
+}
+function V1Checkcode(param,callback) {
+ ajaxPost("/v1/checkcode", param, callback)
+}
+
+function V1Bindcard(param,callback) {
+ ajaxPost("/v1/bindcard", param, callback)
+}
+
+function V1Infor(callback) {
+ ajaxPost("/v1/infor", {}, callback)
+}
+
+function IRegister(param,callback) {
+ ajaxPost("/i/register", param, callback)
+}
+
+function ICheckCode(param,callback) {
+ ajaxPost("/i/checkcode", param, callback)
+}
+
+function IGetPage(callback) {
+ ajaxPost("/i/uxy", {}, callback)
+}
+
+function IGetCode(param,callback) {
+ ajaxPost("/i/code", param, callback)
+}
+
+
+function IServeTime(callback) {
+ ajaxPost("/i/time", {}, callback)
+}
+
+function Login(param, callback) {
+ ajaxPost("/login", param, callback)
+}
+
+function ajaxGet(url, callback) {
+ var token = window.localStorage.getItem("token");
+ var tenantid = window.localStorage.getItem("tenantid");
+ $.ajax({
+ url: SERVER + url,
+ type: "GET",
+ dataType: "json",
+ headers: hd,
+ crossDomain: true,
+ success: function(result) {
+ if (callback) {
+ callback(true, result)
+ }
+ },
+ error: function(status, err) {
+ if (callback) {
+ callback(false, status)
+ }
+ }
+ });
+}
+
+function ajaxPost(url, param, callback) {
+ var token = window.localStorage.getItem("token");
+ var tenantid = window.localStorage.getItem("tenantid");
+ var hd = {};
+ hd["Authorization"] = "Bearer " + token;
+ hd["X-TENANT-ID"] = tenantid;
+ console.log(param)
+ $.ajax({
+ url: SERVER + url,
+ type: "POST",
+ contentType: "application/x-www-form-urlencoded",
+ dataType: "json",
+ data: param,
+ crossDomain: true,
+ timeout: 10000,
+ headers: hd,
+ success: function(result) {
+ if (callback) {
+ callback(true, result)
+ }
+ },
+ error: function(status, err) {
+ console.log(status,err)
+ if (status && status.status == 401) {
+ window.location = "login.html";
+ } else {
+ if (callback) {
+ callback(false, status, err)
+ }
+ }
+ }
+ });
+}
+
+
+function formatDateShort(date) {
+ if (!date || date.length == 0) {
+ return date;
+ }
+ if (date.length < 6) {
+ return date;
+ }
+ if (date.length < 8) {
+ return date.substring(0, 4) + "-" + date.substring(4, 6);
+ }
+ return date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8);
+}
+
+function formatDate(date, flag) {
+ if (!date || date.length == 0) {
+ return date;
+ }
+ if (date.length < 6) {
+ return date;
+ }
+ if (date.length < 8) {
+ return date.substring(0, 4) + "-" + date.substring(4, 6);
+ }
+ if (date.length < 12) {
+ return date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8);
+ }
+ if (flag || date.length < 14) {
+ return date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8) + " " + date.substring(8, 10) + ":" + date.substring(10, 12);
+ }
+ return date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8) + " " + date.substring(8, 10) + ":" + date.substring(10, 12) + ":" + date.substring(12, 14);
+}
+function formatDateNoYear(date,time) {
+ if (isEmpty(date)) {
+ return date;
+ }
+ if(isEmpty(time)){
+ return date;
+ }
+ if (date.length < 8||time.length<4) {
+ return date;
+ }
+ if(!isEmpty(GLOBAL_TODAY)){
+ if(date==GLOBAL_TODAY){
+ return "今天 "+time.substring(0,2)+":"+time.substring(2,4)
+ }
+ }else if(!isEmpty(GLOBAL_YESTERDAY)){
+ if(date==GLOBAL_YESTERDAY){
+ return "昨天 "+time.substring(0,2)+":"+time.substring(2,4)
+ }
+ }
+ return date.substring(4, 6) + "-" + date.substring(6, 8) + " " +time.substring(0,2)+":"+time.substring(2,4)
+}
+
+function formateDateZH(date) {
+ if (!date || date.length == 0) {
+ return date;
+ }
+ if (date.length < 6) {
+ return date;
+ }
+ if (date.length < 8) {
+ return date.substring(0, 4) + "年" + date.substring(4, 6) + "月";
+ }
+ if (date.length < 12) {
+ return date.substring(0, 4) + "年" + date.substring(4, 6) + "月" + date.substring(6, 8) + "日";
+ }
+ if (date.length < 14) {
+ return date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8) + " " + date.substring(8, 10) + ":" + date.substring(10, 12);
+ }
+ return date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8) + " " + date.substring(8, 10) + ":" + date.substring(10, 12) + ":" + date.substring(12, 14);
+}
+
+function isNull(data) {
+ return (data == "" || data == undefined || data == null) ? true : false;
+}
+
+function checkMobile(sMobile) {
+ if (!(/^1[3|4|5|7|8|9][0-9]{9}$/.test(sMobile))) {
+ return false;
+ }
+ return true;
+}
+
+function isEmpty(str) {
+ if (!str || str == 'undefined' || str == null || str == '') {
+ return true;
+ }
+ return false;
+}
+
+function timeText(stime, t) {
+ var temp = parseInt((stime - t) / 1000);
+ if (temp <= 30) {
+ return '刚刚';
+ }
+ if (temp < 60) {
+ return temp + '秒钟前';
+ }
+ temp = parseInt(temp / 60);
+ if (temp < 60) {
+ return temp + '分钟前';
+ }
+ temp = parseInt(temp / 60);
+ if (temp < 24) {
+ return temp + '小时前';
+ }
+ temp = parseInt(temp / 24);
+ if (temp < 30) {
+ return temp + '天前';
+ }
+ temp = parseInt(temp / 30);
+ if (temp < 12) {
+ return temp + '个月前';
+ }
+ temp = parseInt(temp / 12);
+ return temp + '年前';
+}
+
+function trimTxt(str) {
+ if (isEmpty(str)) {
+ return '';
+ }
+ return str;
+}
+var wait=60;
+function btnTime(id) {
+ if (wait == 0) {
+ $("#"+id).removeAttr("disabled");
+ $("#"+id).removeClass("vcodedisabled")
+ $("#"+id).text("获取验证码");
+ wait = 60;
+ } else {
+ $("#"+id).attr("disabled", "disabled");
+ $("#"+id).text(wait + "s");
+ wait--;
+ setTimeout(function() {
+ btnTime(id)
+ },
+ 1000)
+ }
+}
+var dialog;
+function showOk(m,callback){
+ if(!dialog||dialog==null){
+ dialog = new auiDialog({});
+ }
+ dialog.alert({
+ title:"提示",
+ msg:m,
+ buttons:['确定']
+ },function(ret){
+ if(callback){
+ callback(ret)
+ }
+ })
+}
+function alertError(msg){
+ $.alert(msg, "错误");
+}
+function alertOk(msg){
+ $.alert(msg, "提示");
+}