藍(lán)牙身份證閱讀器系列微信藍(lán)牙小程序SDK二次開發(fā)包下載
廣東東信智能科技有限公司藍(lán)牙身份證閱讀器藍(lán)牙手持便攜式身份證讀卡器EST-100GB開發(fā)包,支持微信小程序無縫對(duì)接,支持蘋果手機(jī)IOS、華為、榮耀、Oppo、Vivo、小米等多種品牌手機(jī)使用。
版本:V2019.07.05
EST-100GB藍(lán)牙身份證閱讀器機(jī)具率先支持微信小程序中讀取身份證信息,以及同時(shí)支持通過USB連電腦使用、USB連安卓終端使用,藍(lán)牙連接安卓終端使用,一款設(shè)備,多種用途,更加方便快捷。
以下為微信小程序中部分代碼:
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
//將Uint8Array轉(zhuǎn)換為str
function uint8ArrayToStr(uint8Arrys) {
//數(shù)組與中文之間的轉(zhuǎn)換---start
// var testStr = str2arrayBuffer('中文轉(zhuǎn)換測(cè)試dvadsgaag550!#')
// var strUint8Array = new Uint8Array(testStr)
var strArrayBuffer = arrayToBuffer(uint8Arrys)//將Uint8Array轉(zhuǎn)換為ArrayBuffer
var strUint16Array = new Uint16Array(strArrayBuffer)//將ArrayBuffer轉(zhuǎn)換為Uint16Array
var testStrNew = array2Str(strUint16Array)//將Uint16Array轉(zhuǎn)換為漢字
return testStrNew.replace(/(^\s+)|(\s+$)/g, "");
}
function array2Str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}
// function str2arrayBuffer(str) {
// var buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char
// var bufView = new Uint16Array(buf);
// for (var i = 0, strLen = str.length; i < strLen; i++) {
// bufView[i] = str.charCodeAt(i);
// }
// return buf;
// }
function arrayToBuffer(array) {
var buffer = new ArrayBuffer(array.length)
var dataView8 = new Uint8Array(buffer)
for (var i = 0; i < array.length; i++) {
dataView8[i] = array[i]
}
return buffer
}
function stringToArrayBuffer(hexString){
var typedArray3 = new Uint8Array(hexString.match(/[\da-f]{2}/gi).map(function (h) {
return parseInt(h, 16)
}))
var buffer3 = typedArray3.buffer
return buffer3
}
//數(shù)組與中文之間的轉(zhuǎn)換---stop
//性別轉(zhuǎn)換
function getSexFromCode(strSexCode)
{
if ('0' == strSexCode.charAt(0)) {
return "未知";
}
else if ('1' == strSexCode.charAt(0)) {
return "男";
}
else if ('2' == strSexCode.charAt(0)) {
return "女";
}
else if ('9' == strSexCode.charAt(0)) {
return "未說明";
}
return "未定義";
}
//民族轉(zhuǎn)換
function getNationFromCode(strNationCode)
{
if (strNationCode == ("01")) {
return "漢";
}
else if (strNationCode == ("02")) {
return "蒙古";
}
else if (strNationCode == ("03")) {
return "回";
}
else if (strNationCode == ("04")) {
return "藏";
}
else if (strNationCode == ("05")) {
return "維吾爾";
}
else if (strNationCode == ("06")) {
return "苗";
}
else if (strNationCode == ("07")) {
return "彝";
}
else if (strNationCode == ("08")) {
return "壯";
}
else if (strNationCode == ("09")) {
return "布依";
}
else if (strNationCode == ("10")) {
return "朝鮮";
}
else if (strNationCode == ("11")) {
return "滿";
}
else if (strNationCode == ("12")) {
return "侗";
}
else if (strNationCode == ("13")) {
return "瑤";
}
else if (strNationCode == ("14")) {
return "白";
}
else if (strNationCode == ("15")) {
return "土家";
}
else if (strNationCode == ("16")) {
return "哈尼";
}
else if (strNationCode == ("17")) {
return "哈薩克";
}
else if (strNationCode == ("18")) {
return "傣";
}
else if (strNationCode == ("19")) {
return "黎";
}
else if (strNationCode == ("20")) {
return "傈僳";
}
else if (strNationCode == ("21")) {
return "佤";
}
else if (strNationCode == ("22")) {
return "畬";
}
else if (strNationCode == ("23")) {
return "高山";
}
else if (strNationCode == ("24")) {
return "拉祜";
}
else if (strNationCode == ("25")) {
return "水";
}
else if (strNationCode == ("26")) {
return "東鄉(xiāng)";
}
else if (strNationCode == ("27")) {
return "納西";
}
else if (strNationCode == ("28")) {
return "景頗";
}
else if (strNationCode == ("29")) {
return "柯爾克孜";
}
else if (strNationCode == ("30")) {
return "土";
}
else if (strNationCode == ("31")) {
return "達(dá)斡爾";
}
else if (strNationCode == ("32")) {
return "仫佬";
}
else if (strNationCode == ("33")) {
return "羌";
}
else if (strNationCode == ("34")) {
return "布朗";
}
else if (strNationCode == ("35")) {
return "撒拉";
}
else if (strNationCode == ("36")) {
return "毛南";
}
else if (strNationCode == ("37")) {
return "仡佬";
}
else if (strNationCode == ("38")) {
return "錫伯";
}
else if (strNationCode == ("39")) {
return "阿昌";
}
else if (strNationCode == ("40")) {
return "普米";
}
else if (strNationCode == ("41")) {
return "塔吉克";
}
else if (strNationCode == ("42")) {
return "怒";
}
else if (strNationCode == ("43")) {
return "烏孜別克";
}
else if (strNationCode == ("44")) {
return "俄羅斯";
}
else if (strNationCode == ("45")) {
return "鄂溫克";
}
else if (strNationCode == ("46")) {
return "德昂";
}
else if (strNationCode == ("47")) {
return "保安";
}
else if (strNationCode == ("48")) {
return "裕固";
}
else if (strNationCode == ("49")) {
return "京";
}
else if (strNationCode == ("50")) {
return "塔塔爾";
}
else if (strNationCode == ("51")) {
return "獨(dú)龍";
}
else if (strNationCode == ("52")) {
return "鄂倫春";
}
else if (strNationCode == ("53")) {
return "赫哲";
}
else if (strNationCode == ("54")) {
return "門巴";
}
else if (strNationCode == ("55")) {
return "珞巴";
}
else if (strNationCode == ("56")) {
return "基諾";
}
else if (strNationCode == ("97")) {
return "其他";
}
else if (strNationCode == ("98")) {
return "外國血統(tǒng)中國籍人士";
}
return "未知";
}
module.exports = {
formatTime: formatTime,
uint8ArrayToStr: uint8ArrayToStr,
stringToArrayBuffer: stringToArrayBuffer,
getSexFromCode: getSexFromCode,
getNationFromCode: getNationFromCode
}
- 廣東潮州市圖書館自助終端集成社??ㄗx卡器實(shí)現(xiàn)社??o
- EST-100-YP80藥品追溯碼掃碼一體機(jī)
- 全國多部門發(fā)文加強(qiáng)藥品追溯碼溯源管理 強(qiáng)化全鏈條監(jiān)管
- EST-100-YP30藥品溯源追溯碼掃碼一體機(jī)
- 身份證閱讀器軟件英文、繁體系統(tǒng)中文顯示亂碼問題解決辦
- Donsee Harmony鴻蒙二次開發(fā)API文檔(DonseeDeviceLib.
- Python調(diào)用東信QR-M20二維碼掃碼模組示例
- 東信公司2024年國慶節(jié)放假通知
- QR-M20/QR-M30/QR-M10二維碼掃碼模組SDK二次開發(fā)包下載
- 東信公司2024年中秋節(jié)放假通知