|
|
【myApps/OBPM版本号】:v5.0
【浏览器类型】:Chrome/其他
【联系方式-QQ】:774777387
【联系电话】: 18079141110
【问题描述】:
场景需求:前台配有高拍仪,身份证阅读器,和手写板,均已安装好驱动和控件,只需调用函数即可,目前在别的系统通过引入js文件即可,现在想集成到天翎上,请问有什么办法么?
附第三方系统js文件:
var obj;
var captrue;
window.$.support.cors = true;//跨域
window.$.ajaxSetup({
xhr: function () {
if (window.ActiveXObject) {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} else {
return new window.XMLHttpRequest();
}
}
});
//解决ie8不兼容getOwnPropertyNames keys 方法
if (!Object.getOwnPropertyNames || !Object.keys) {
Object.keys = Object.getOwnPropertyNames = function (temp) {
var A = [];
for (var key in temp) {
A.push(key);
}
return A;
}
}
layui.use('layer');
var dqjg = false;
var data = [];
$(function () {
startInsert();
$("#signTag").html("身份证读卡器连接中...");
readCardConnect();
obj = document.getElementById("HWPenSign");
obj.HWSetBkColor(0xE0F8E0);
obj.HWSetCtlFrame(2, 0x000000);
setTimeout(function () {
initSign();
}, 1000);
setTimeout(function () {
opencamera();
}, 500);
});
/*新增*/
startInsert = function () {
//打开时重置表单
$("#insertLsh").val('');
$("#insertHphm").val('');
$("#insertHpzl").val('');
$("#insertClsbdh").val('');
$("#insertSign").val('');
$("#insertPhoto").val('');
$("#insertXm").val('');
$("#insertSfzmhm").val('');
$('#upImg').attr('src', '');
document.getElementById("insertLsh").focus();
$("#mytab").empty();
data = [];
};
var signBase64 = '';
var readCardStatus;
window.signComplete = function () {
var stream = obj.HWGetBase64Stream(1);
signBase64 = stream;
};
window.signRestart = function () {
signBase64 = '';
};
window.readCardTimer = window.setInterval(function () {
if (!dqjg) {
readCardConnect();
}
}, 1000);
//签字板
closeSign = function () {
signBase64 = '';
obj.HWClearPenSign(); //重签
};
initSign = function () {
obj.HWInitialize(); //连接,初始化设备
};
//打开签字板页面
opencamera = function () {
$('#upImg').hide();
captrue = document.getElementById("captrue");
setTimeout(function () {
openCamera2();
}, 500);
};
//提交签字
submitSign = function () {
if (signBase64 == '') {
layer.msg('尚未采集到签名', {icon: 7, offset: '10px', skin: 'warning-class'});
return;
}
$.ajax({
url: BASE_URL + "/fastDfsFile/fastDfsDbUploadImageBase64",
type: "get",
cache: false,
async: true,
data: {
base64Str: signBase64
},
headers: {"content-type": "application/x-www-form-urlencoded"},
success: function (res) {
layer.msg('采集成功!', {icon: 1, offset: '10px', skin: 'success-class'});
$('#insertSign').val(res);
//var sfzdkq = document.getElementById("sfzdkq");
//$('#sfzdkq').html("<object id='CertCtl' name='CertCtl' type='application/cert-reader' style='position: absolute;top:93px;left:190px;' width='0' height='0'></object>")
// readCardConnect();
},
error: function () {
}
});
};
getKey = function () {
var lsh = $("#insertLsh").val();
if (event.keyCode == 13) {
if (lsh == '') {
layer.msg("流水号不能为空!", {icon: 7, offset: '10px', skin: 'warning-class'});
return false
}
layer.msg("查询中...");
$("#insertLsh").val('');
applyDetail(lsh);
}
};
|
|