大理需求:绑定银行卡时银行卡号和身份证号去空格,60s之后重复发,注意:安卓版本使用的是platforms/android目录下代码,不能覆盖,里面做了特殊代码修改
diff --git a/www/bindcheck.html b/www/bindcheck.html
index 51e13e9..9e2560a 100644
--- a/www/bindcheck.html
+++ b/www/bindcheck.html
@@ -30,6 +30,9 @@
<div class="weui-cell__bd">
<input class="weui-input" type="tel" id="code" style="font-size: 14px;" placeholder="请输入验证码" maxlength="6">
</div>
+ <div class="weui-cell__ft">
+ <button class="weui-vcode-btn" onclick="app.getCode()" id="codebtn" style="width: 100px;height: 1rem;font-size: 14px;">获取验证码</button>
+ </div>
</div>
</div>
<section class="aui-content-padded" style="margin-top: 30px;">
diff --git a/www/img/icon_door.png b/www/img/icon_door.png
new file mode 100644
index 0000000..b539064
--- /dev/null
+++ b/www/img/icon_door.png
Binary files differ
diff --git a/www/js/bindcard.js b/www/js/bindcard.js
index e9cb86c..f7e91a2 100644
--- a/www/js/bindcard.js
+++ b/www/js/bindcard.js
@@ -21,15 +21,19 @@
let vals = Object.values(dict);
console.log(keys, vals)
var items=[];
+ var selectItem=items[0];
for(var key of keys){
var bean = {
"title":dict[key],
"value":key
}
+ if(key == 'idcard'){
+ selectItem=bean;
+ }
items.push(bean)
}
- $("#idtype").val(items[0].title)
- $("#idtype").attr("data-values",items[0].value)
+ $("#idtype").val(selectItem.title)
+ $("#idtype").attr("data-values",selectItem.value)
$("#idtype").select({
title: "请选择证件类型",
items: items
@@ -55,11 +59,10 @@
$.alert("请选择证件类型", "错误");
return;
}
- /*var agree = $("input[type=checkbox]:checked").val();
- if(isEmpty(agree)){
- $.alert("请同意用户协议与隐私条款", "提示");
- return;
- }*/
+ cardnum = cardnum.trim();
+ name = name.trim();
+ idno = idno.trim();
+
$.showLoading("正在处理");
var param = {
"cardno": cardnum,
@@ -72,8 +75,11 @@
$.hideLoading();
console.log(ret)
if (ret.code == 200) {
- window.localStorage.setItem("phoneX",ret.phonex);
window.localStorage.setItem("name", name);
+ window.localStorage.setItem("cardno", cardnum);
+ window.localStorage.setItem("idtype", idtype);
+ window.localStorage.setItem("idno", idno);
+ window.localStorage.setItem("phoneX",ret.phonex);
window.localStorage.setItem("personid", ret.personid);
window.localStorage.setItem("signed", ret.signed);
window.localStorage.setItem("paypwdset", ret.paypwdset);
diff --git a/www/js/bindcheck.js b/www/js/bindcheck.js
index a4214fc..32dba4c 100644
--- a/www/js/bindcheck.js
+++ b/www/js/bindcheck.js
@@ -13,6 +13,44 @@
phone = window.localStorage.getItem("phone");
$("#phone").text(phone)
}
+ $("#codebtn").attr("disabled","disabled")
+ $("#codebtn").addClass("vcodedisabled")
+ btnTime('codebtn');
+ },
+ getCode: function() {
+ var name = window.localStorage.getItem("name");
+ var cardno = window.localStorage.getItem("cardno");
+ var idtype = window.localStorage.getItem("idtype");
+ var idno = window.localStorage.getItem("idno");
+
+ $.showLoading("正在请求");
+ var param = {
+ "cardno": cardno,
+ "idtype": idtype,
+ "name": name,
+ "idno": idno
+ }
+ V1Bindcard(param, function(ok, ret) {
+ if (ok) {
+ $.hideLoading();
+ if (ret.code == 200) {
+ $("#codebtn").attr("disabled","disabled")
+ $("#codebtn").addClass("vcodedisabled")
+ btnTime('codebtn');
+ } else {
+ if (ret.code == -1) {
+ $.alert(ret.msg, "提示", function() {
+ window.location = "main.html"
+ });
+ } else {
+ $.alert(ret.msg, "错误");
+ }
+ }
+ } else {
+ $.hideLoading();
+ $.alert("请求失败了 " + ret.status + ",请稍后再试", "错误");
+ }
+ })
},
doNext: function() {
var code = $("#code").val();
diff --git a/www/js/main.js b/www/js/main.js
index 90977da..4d55357 100644
--- a/www/js/main.js
+++ b/www/js/main.js
@@ -99,6 +99,11 @@
})
})*/
});
+ $("#doorBtn").click(function(){
+ app.checkBefore(function() {
+ showRet(DOOR_URl);
+ })
+ })
$('#usersec').click(function() {
app.checkBefore(function() {
app.checkOther(function() {
@@ -107,6 +112,13 @@
})
});
this.initData();
+ this.backBtn();
+ },
+ backBtn: function(){
+ document.addEventListener("backbutton", function(e){
+ e.preventDefault();
+ navigator.app.exitApp();
+ }, false);
},
initTab: function() {
$("#maincontent").css("top", $("#maintop").height())
@@ -319,3 +331,47 @@
}
};
app.initialize();
+
+function showRet(url) {
+ if(isEmpty(url)){
+ return;
+ }
+ var userid = window.localStorage.getItem("userid");
+ //if (url.indexOf("yy.dlsmk.cn")>=0) {
+ if(url.indexOf("?")>0){
+ url=url+'&userid='+userid;
+ }else{
+ url=url+'?userid='+userid;
+ }
+ //}
+ console.log(url)
+ var inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', {
+ statusbar: {
+ color: '#03a9f4ff'
+ },
+ toolbar: {
+ height: 44,
+ color: '#03a9f4ff'
+ },
+ title: {
+ color: '#ffffffff',
+ showPageTitle: true
+ },
+ backButton: {
+ image: 'back.png',
+ imagePressed: 'back.png',
+ align: 'left',
+ event: 'backPressed'
+ },
+ closeButton: {
+ image: 'close.png',
+ imagePressed: 'close.png',
+ align: 'left',
+ event: 'closePressed'
+ },
+ backButtonCanClose: true
+ }).addEventListener('closePressed', function(params){
+ inAppBrowserRef.close();
+ //window.location = "main.html"
+ });
+ }
diff --git a/www/js/qrcode.js b/www/js/qrcode.js
index 4664a9b..1b5a036 100644
--- a/www/js/qrcode.js
+++ b/www/js/qrcode.js
@@ -21,8 +21,8 @@
$.hideLoading();
var qrcode = new QRCode(document.getElementById("qrcode"), {
text: ret.qrcode,
- width: 150,
- height: 150,
+ width: 200,
+ height: 200,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.L
diff --git a/www/js/register.js b/www/js/register.js
index d10558e..f53220a 100644
--- a/www/js/register.js
+++ b/www/js/register.js
@@ -27,7 +27,6 @@
"platform":device.name+","+device.platform+","+device.version,
"uuid":device.uuid
}
- console.log(param)
ICheckCode(param,function(ok,ret){
if(ok){
$.hideLoading();
diff --git a/www/js/server.js b/www/js/server.js
index c8eb688..64a6da6 100644
--- a/www/js/server.js
+++ b/www/js/server.js
@@ -1,10 +1,11 @@
var dev = false;
var SERVER = "https://yy.dlsmk.cn/payapi/mobileapi";
+var DOOR_URl = "http://172.28.43.8:8099/door/app/appMintUIindex";//门禁服务地址
var GLOBAL_TODAY="";
var GLOBAL_YESTERDAY="";
var CURRENT_INDEX=1;
if (dev) {
- SERVER = "http://172.28.201.70:10010/payapi/mobileapi";
+ SERVER = "http://172.28.43.7:8099/payapi/mobileapi";
}
function V1Qrcode(callback) {
diff --git a/www/js/signxycheck.js b/www/js/signxycheck.js
index 4e52298..dedeb88 100644
--- a/www/js/signxycheck.js
+++ b/www/js/signxycheck.js
@@ -1,11 +1,13 @@
var db = null;
+var canCheck = false;
+var wait = 5;
var app = {
-
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
+ canCheck = false;
+ wait=5;
},
-
onDeviceReady: function() {
$.showLoading("加载中");
V1Bxy(function(ok, ret, err) {
@@ -15,6 +17,7 @@
$("#content").html(ret.page);
if (isEmpty(ret.signed) || ret.signed != 'yes') {
$("#btn").show();
+ app.checkTime();
$("#content").css("bottom", "135px");
} else {
$("#content").css("bottom", "10px");
@@ -35,6 +38,9 @@
})
},
agreeXY: function() {
+ if(!canCheck){
+ return;
+ }
var agree = $("input[type=checkbox]:checked").val();
if (isEmpty(agree)) {
$.alert("请同意签约代扣协议", "提示");
@@ -58,6 +64,20 @@
$.alert("请求失败了:" + ret.status + "请稍后再试", "错误");
}
})
+ },
+ checkTime: function(){
+ if (wait == 0) {
+ $("#signBtn").text("签约代扣协议");
+ $("#signBtn").addClass("aui-btn-info");
+ canCheck = true;
+ }else{
+ $("#signBtn").text(wait+"s 签约代扣协议");
+ wait--;
+ setTimeout(function() {
+ app.checkTime();
+ },1000)
+ }
}
+
};
app.initialize();
\ No newline at end of file
diff --git a/www/main.html b/www/main.html
index b6a2d8c..e788ea0 100644
--- a/www/main.html
+++ b/www/main.html
@@ -44,6 +44,10 @@
<div class="center-in"><img src="img/icon_securty.png" style="width:28px;height: 28px"></div>
<div class="aui-grid-label" style="margin-top:10px;">账户安全</div>
</div>
+ <div class="aui-col-xs-4" id="doorBtn">
+ <div class="center-in"><img src="img/icon_door.png" style="width:28px;height: 28px"></div>
+ <div class="aui-grid-label" style="margin-top:10px;">远程开门</div>
+ </div>
</div>
</div>
</section>
diff --git a/www/signxycheck.html b/www/signxycheck.html
index ece02b5..17a1989 100644
--- a/www/signxycheck.html
+++ b/www/signxycheck.html
@@ -33,7 +33,7 @@
</label>
</div>
<section class="aui-content-padded" style="margin-top: 20px;">
- <div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="app.agreeXY()">签约代扣协议</div>
+ <div class="aui-btn aui-btn-block " tapmode onclick="app.agreeXY()" id="signBtn">签约代扣协议</div>
</section>
</div>
</body>