You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
1.7 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width" />
  5. <title>CardPrint</title>
  6. @Html.AppendJsFile("/Content/jquery/jquery-1.10.2.min.js", "/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js")
  7. <script src="/Content/js/qrcode.min.js"></script>
  8. <link href="~/Content/cardprint/CardPrint.css" rel="stylesheet" />
  9. <script>
  10. function request(d) {
  11. for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) {
  12. var b = c[a].split("=");
  13. if (b[0] == d)
  14. if ("undefined" == unescape(b[1])) break;
  15. else return unescape(b[1])
  16. }
  17. return ""
  18. };
  19. </script>
  20. </head>
  21. <body style="">
  22. <div id="qrcodeBox" style="text-align:center;margin-top:20px;">
  23. <div class="qrcodeBox" style="display:inline-block">
  24. <div id="qrcode" style="margin:0 auto 5px;"></div>
  25. <div class="qrcodeTxt" style="font-size:12px;"></div>
  26. </div>
  27. </div>
  28. <div id="btnprint" type="button" class="btns" value="打印">打印</div>
  29. <script>
  30. //标签打印
  31. var qrcode = new QRCode(document.getElementById("qrcode"), {
  32. width: 80,
  33. height: 80
  34. });
  35. var keyValue = request('keyValue');//二维码
  36. var aName = request('aName');
  37. $('.qrcodeTxt').html(unescape( aName));
  38. $(function () {
  39. qrcode.makeCode(keyValue);
  40. $("#btnprint").on("click", function () {
  41. AddPrintContent3()
  42. });
  43. });
  44. // 打印表单
  45. function AddPrintContent3() {
  46. $('#btnprint').css('display', 'none')
  47. window.print();
  48. $('#btnprint').css('display', 'block')
  49. }
  50. </script>
  51. </body>
  52. </html>