| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>需维修请微信扫码</title>
- <style media="all">
- .codeBox {
- margin: 0 auto!important;
- -webkit-print-color-adjust: exact;
- color: #000;
- }
-
- div.wrapper-content {
- padding: 0px;
- }
-
- @media print {
- .codeBox {
- -webkit-print-color-adjust: exact;
- page-break-after: avoid;
- }
-
- }
-
- .logo_img,
- .promptMsg {
- display: none;
- }
-
- .qr_print {
- position: absolute;
- right: 10%;
- top: 0;
- }
- </style>
- </head>
- <body class="gray-bg">
- <div class="wrapper-content animated fadeInRight">
- <input type="hidden" id="qrCode" />
- <!--startprint-->
- <div class="codeBox" style="margin: 0 auto; width: 380px; height: 410px; text-align: center;">
- <!-- <p style="font-size: 24px; font-family:微软雅黑; color: #000;margin-top: 26px;margin-bottom: 5px;letter-spacing: 6px;">需维修请微信扫码</p> -->
- <p style="font-size: 24px; font-family:微软雅黑; color: #000;margin-top: 26px;margin-bottom: 5px;letter-spacing: 15px;margin-left:28px">请使用APP扫码</p>
- <p style="font-size: 12px; font-family:微软雅黑; color: #000;margin-top: 2px;margin-bottom: 10px;letter-spacing: 0px;">(首次扫码时请先下载APP后再进行扫码)</p>
- <div id="codeHtml" style="z-index: 9999999;position: relative;">
- <div id="code"></div>
- </div>
- <p style="font-size: 18px; font-weight: bold; font-family: 微软雅黑; padding: 0; margin: 16px auto 0 auto; width: 230px; text-align: justify; height: 22px; line-height: 22px;">
- <span id="proName"></span><i style="display: inline-block; width: 100%"></i>
- </p>
- <p style="font-size: 16px; color: #333333; font-family: 微软雅黑; text-align: center; width: 230px; padding: 0; margin: 5px auto 0 auto;">技术支持</p>
- <!-- <img src='../../img/floor_logo.png' class="logo_img" style="width: 230px;height: 44px;margin-top: 16px;margin-bottom: 0px;"> -->
- <p class="promptMsg" style="margin-top: 10px;font-size: 18px;font-family: 微软雅黑">
- <span class="line" style="display: inline-block;width: 230px;border-bottom: 2px solid #000;padding: 0 1px;text-align: center;margin-bottom: -4px;"></span>
- </p>
- </div>
- <!--endprint-->
- <p class="qr_print"><button class="btns" id="print" onclick="stamp()">打印二维码</button></p>
- </div>
- <link rel="stylesheet" href="../../css/init.css" />
- <link rel="stylesheet" href="../../css/Table/table1.css" />
- <script src="../../Script/Common/huayi.load.js"></script>
- <script src="../../Script/Common/huayi.config.js"></script>
- <script src="../js/qrcode.min.js"></script>
- <script>
- var ids = helper.request.queryString("ids");
- var floorName = helper.request.queryString("floorName"); //楼层名称
- var remark = helper.request.queryString("remark"); //备注
- var projectname = helper.request.queryString("proname"); //项目名称
- $('#proName').text(decodeURIComponent(projectname));
- var qrUrl = "http://wechat.nuodajituan.com/index.html?menucode=KSBX&id=" + ids + "&type=1"; //楼层
- $('.promptMsg .line').html(decodeURIComponent(floorName) + ' ' + decodeURIComponent(remark));
- $('#qrCode').val(qrUrl);
- $(document).ready(function() {
- makeCode();
- })
- $("#codeHtml").html('<div id="code"></div>');
- var qrcode = new QRCode(document.getElementById("code"), {
- render: 'canva',
- width: 230, //宽度
- height: 230, //高度
- text: toUtf8(name) //任意内容 :中文存在乱码,需要转换编码
- })
- 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 <= 0x007F)) {
- out += str.charAt(i);
- } else if(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;
- }
- function makeCode() {
- var elText = document.getElementById("qrCode");
- if(!elText.value) {
- elText.focus();
- return;
- }
- qrcode.makeCode(elText.value);
- var canvas = $('#code canvas');
- var img = canvas[0].toDataURL("image/png");
- $('#code').html("<img src='" + img + "'>");
- $('.logo_img').show();
- $('.promptMsg').show();
- }
- function stamp() {
- var bdhtml = window.document.body.innerHTML;
- var sprnstr = "<!--startprint-->";
- var eprnstr = "<!--endprint-->";
- var prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
- prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
- var newWindow = window.open("打印二维码", "_self");
- newWindow.document.write(prnhtml);
- // newWindow.document.close();
- // setTimeout(function(){
- newWindow.print();
- newWindow.close();
- // newWindow.document.body.innerHTML=bdhtml;
- // }, 10);
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- }
-
- </script>
- </body>
- </html>
|