designDrawing.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <meta name="format-detection" content="telephone=no">
  10. <meta http-equiv="X-UA-Compatible" content="chrome=1" >
  11. <title>湖南宝悦新型建材有限公司</title>
  12. <style>
  13. *{
  14. outline: 0;
  15. padding: 0;
  16. margin: 0;
  17. border: none;
  18. box-sizing: border-box;
  19. background-size: contain;
  20. background-position: center;
  21. background-repeat: no-repeat;
  22. }
  23. ul,ol{
  24. list-style: none outside none;
  25. }
  26. ul.product-info {
  27. padding: 20px;
  28. }
  29. ul.product-info > li {
  30. line-height: 30px;
  31. font-size: 14px;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <ul class="product-info">
  37. <li>
  38. <label for="">产品名称:</label>
  39. <span id="productName">-</span>
  40. </li>
  41. <li>
  42. <label for="">规&emsp;格:</label>
  43. <span id="specification">-</span>
  44. </li>
  45. <li>
  46. <label for="">编&emsp;码:</label>
  47. <span id="productCode">-</span>
  48. </li>
  49. <li>
  50. <label for="">批次号:</label>
  51. <span id="batchNo">-</span>
  52. </li>
  53. <li>
  54. <label for="">生产日期:</label>
  55. <span id="createTime">-</span>
  56. </li>
  57. <li>
  58. <label for="">产品检验:</label>
  59. <span>合格</span>
  60. </li>
  61. <li>
  62. <label for="">质量等级:</label>
  63. <span>优级</span>
  64. </li>
  65. <li>
  66. <label for="">生产厂家:</label>
  67. <span>湖南宝悦新型建材有限公司</span>
  68. </li>
  69. <li id="designDrawing">
  70. <!-- <img style="width: 100%; margin-top: 20px;" src="./view.jpeg" alt=""> -->
  71. </li>
  72. </ul>
  73. </body>
  74. <script>
  75. function str_to_obj(str){
  76. var obj = {};
  77. var temp = str.split('&');
  78. for(var i = 0; i < temp .length;i++) {
  79. var t = temp[i].split('=');
  80. obj[t[0]]=t[1];
  81. }
  82. return obj
  83. }
  84. var queryObj = str_to_obj(window.location.search.substring(1));
  85. var productName = document.querySelector('#productName');
  86. var specification = document.querySelector('#specification');
  87. var productCode = document.querySelector('#productCode');
  88. var batchNo = document.querySelector('#batchNo');
  89. var createTime = document.querySelector('#createTime');
  90. var designDrawing = document.querySelector('#designDrawing');
  91. if(queryObj.productName){
  92. productName.innerHTML = decodeURIComponent(queryObj.productName);
  93. }
  94. if(queryObj.specification){
  95. specification.innerHTML =decodeURIComponent(queryObj.specification)
  96. }
  97. if(queryObj.productCode){
  98. productCode.innerHTML = queryObj.productCode
  99. }
  100. if(queryObj.batchNo){
  101. batchNo.innerHTML = queryObj.batchNo;
  102. }
  103. if(queryObj.createTime){
  104. createTime.innerHTML = decodeURIComponent(queryObj.createTime);
  105. }
  106. // if(queryObj.de) {
  107. // var _img = document.createElement('img');
  108. // _img.src = window.location.origin + '/' + decodeURIComponent(queryObj.de);
  109. // // _img.src = './view.jpeg';
  110. // _img.style = 'width: 100%; margin-top: 20px;';
  111. // designDrawing.appendChild(_img);
  112. // }
  113. </script>
  114. </html>