微信电子健康卡

您所在的位置:网站首页 电子健康卡静态二维码怎么打印 微信电子健康卡

微信电子健康卡

2024-07-09 10:58| 来源: 网络整理| 查看: 265

静态二维码

通过调用barcodeJs生成二维码

我的二维码 function toUtf8(str) { var out, i, len, c; out = ""; len = str.length; for (i = 0; i < len; i++) { c = str.charCodeAt(i); if ((c >= 0x0001) && (c 0x07FF) { out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } else { out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } } return out; } $(document).ready(function () { generateC39 = function () { $('.barcode39').barcode({ code: 'code39' }); }; generateI25 = function () { $('.barcodeI25').barcode({ code: 'I25' }); }; } ); window.onload = function () { if ($("#mytxt").val() != "") { PrintBarcode(); } } function PrintBarcode() { var barcodeValue = $("#mytxt").val(); if (barcodeValue == "") { alert("请输入条形码内容"); return; } //隐藏域保存获取的条形码 //$("#hidBarcode").html(barcodeValue); //$("#hidBarcode").barcode({ code: 'code39' }); //$("#hidBarcode").empty().barcode(barcodeValue, "code128", { barWidth: 1, barHeight: 80, showHRI: false }); ///二维码 $("#code").empty(); var str = toUtf8($("#mytxt").val()); $("#code").qrcode({ render: "table", width: 200, height: 200, text: str }); //打印的内容 //var prnhtml = ""; //prnhtml += "" + document.getElementById("hidBarcode").outerHTML; + ""; //prnhtml += "" + barcodeValue + ""; //prnhtml += ""; //bdhtml = window.document.body.innerHTML;//获取当前页的html代码 //window.document.body.innerHTML = prnhtml; ////window.print(); //window.document.body.innerHTML = bdhtml; //$("#divShow").html(prnhtml); } .mask { position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777; z-index: 1002; left: 0px; opacity: 0.5; -moz-opacity: 0.5; } function msgbox(title, content, cancel) { $("#ts").show(); var temp = "" + title + "" + content + ""; if (cancel != '1') { alert(cancel); temp += "取消;;"; } temp += "确认"; $("#ts").html(temp); showMask(); } function qx() { $("#ts").hide(); } function qr() { $("#ts").hide(); //alert("点击确认按钮"); } function showMask() { $("#mask").css("height", $(document).height()); $("#mask").css("width", $(document).width()); $("#mask").show(); } //隐藏遮罩层 function hideMask() { $("#mask").hide(); } 请输入内容生成条形码 我的二维码 注:此二维码用于医院消费

动态二维码

/// /// 获取动态健康卡二维码接口 /// /// public string Lx_GetDynamicQRCode() { var result = proxy.GetDynamicQRCode( new GetDynamicQRCodeReq { healthCardId = "56656569FCAC6D78FC04BC0A4F75D96ABD8E16E77666639ABE66564EC0E6B623", idType = "01", idNumber = "410221198908203453", codeType = 0 }, new com.tencent.healthcard.HealthCardOpenAPI.CommonIn { requestId = System.Guid.NewGuid().ToString(), hospitalId = LxAppConfig.GetHospitalId(), appToken = appToken } ); var commonOut = (com.tencent.healthcard.HealthCardOpenAPI.CommonOut)result["commonOut"]; var rsp = (GetDynamicQRCodeRsp)result["rsp"]; return JsonConvert.SerializeObject(rsp); }

获取base64位显示页面



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3