|
楼主 |
发表于 2017-5-9 11:12:58
|
显示全部楼层
Model.prototype.button4Click = function(event){
var url = encodeURI("http://127.0.0.1:24010/ZKIDROnline/ScanReadIdCardInfo?OP-DEV=1&CMD-URL=4");
$.ajax({
"type" : "get",
"url" : url,
"success" : function(data) {
var jsons = eval('(' + data + ')');
if(jsons.Certificate.Sex=="女"){
$("[name=name_y]").val(jsons.Certificate.Name);
$("[name=Nationality_y]").val(jsons.Certificate.Nation);
$("[name=HKaddress_y]").val(jsons.Certificate.Address);
$("[name=PapersCode_y]").val(jsons.Certificate.IDNumber);
var address = jsons.Certificate.Address;
var addressStr = address.substring(0,3);
$("[name=Huk_y]").val(addressStr);
var birthdayStr = jsons.Certificate.Birthday;
var year = birthdayStr.substring(0,4);
var month = birthdayStr.substring(4,6);
var day = birthdayStr.substring(6);
var birthdayStr2 = year+"-"+month+"-"+day;
/* var birthdayDate = justep.Date.fromString(birthdayStr2, 'yyyy-MM-dd');
alert(typeof birthdayDate);*/
$("[name=Birthday_y]").val(birthdayStr2);
var Birthday = jsons.Certificate.Birthday;
var BirthdayStr = Birthday.substring(0,4);
var BirthdayInt = parseInt(BirthdayStr);
var mydate = new Date();
var mydateStr = "" + mydate.getFullYear();
var mydateInt = parseInt(mydateStr);
alert(mydateInt-BirthdayInt);
var Age_y = mydateInt-BirthdayInt;
// alert(typeof Age_y);
$("[name=Age_y]").val(Age_y);
// $("[name=name_y]").val(jsons.Certificate.Base64Photo);
} else{
alert("请注意此处采集女方信息");
}
},
"error" : function(xhr, txt) {
alert(txt);
}
});
//this.comp("mainDa")
};
[img][/img] |
|