jiexi.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?php
  2. namespace app\index;
  3. class jiexi extends Base
  4. {
  5. function index()
  6. {
  7. ?>
  8. <!doctype html>
  9. <html lang="">
  10. <head>
  11. <meta charset="utf-8">
  12. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/>
  13. <meta name="keywords" content="<?php echo IN_KEYWORDS;?>"/>
  14. <meta name="description" content="<?php echo IN_DESCRIPTION;?> "/>
  15. <title>二维码解析 - <?php echo IN_NAME;?> - 免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
  16. <link rel="stylesheet" href="/static/index/css/font.css"/>
  17. <link rel="stylesheet" type="text/css" href="/static/index/css/bootstrap.min.css"/>
  18. <link rel="stylesheet" type="text/css" href="/static/index/css/base.css"/>
  19. <link rel="stylesheet" type="text/css" href="/static/index/css/main.css"/>
  20. <link rel="stylesheet" type="text/css" href="/static/index/css/h5.css"/>
  21. <link href="/jiexi/css/base.css" rel="stylesheet">
  22. <link href="/jiexi/css/app.css" rel="stylesheet">
  23. <link rel="stylesheet" href="/styles/index.css" />
  24. <script src="/static/index/js/jquery.min.js"></script>
  25. <script src="/static/index/js/bootstrap.min.js"></script>
  26. <script src="/static/index/js/vue.js"></script>
  27. <script src="/static/index/js/js.js"></script>
  28. <script src="/jiexi/js/jquery.min.js"></script>
  29. <script src="/jiexi/js/reqrcode.js"></script>
  30. <script>
  31. isHideFooter = false;
  32. </script>
  33. <style>
  34. .ms-badge12 {
  35. background-color: #ffffff;
  36. /* width: 50px; */
  37. height: 25px;
  38. line-height: 26px;
  39. display: inline-block;
  40. color: #e60000;
  41. border-radius: 10%;
  42. font-size: 12px;
  43. text-align: center;
  44. position: relative;
  45. top: -3px;
  46. left: 0;
  47. }
  48. .container {
  49. width: 1325px;
  50. }
  51. .containerrr {
  52. width: 1140px;
  53. }
  54. .inner-content {
  55. background-color: #fff;
  56. border: 1px solid #eaeaea;
  57. border-radius: 3px;
  58. padding-top: 80px;
  59. padding-bottom: 690px;
  60. margin: 0px auto;
  61. margin-bottom: 66px;
  62. margin-top: 60px;
  63. }
  64. .qrcode {
  65. width:160px;
  66. height:160px;
  67. margin-top:15px;
  68. }
  69. .text{
  70. height: 23px;
  71. }
  72. .button{
  73. height: 29px;
  74. }
  75. .img{
  76. width: 200px;
  77. height: 200px;
  78. }
  79. footer {
  80. position: fixed;
  81. bottom: 0;
  82. left: 0;
  83. right: 0;
  84. }
  85. @media (max-width: 767px) {
  86. footer {
  87. position: static;
  88. }
  89. .container {
  90. width: auto;
  91. }
  92. }
  93. </style>
  94. <style>
  95. #qrcode {
  96. width:160px;
  97. height:160px;
  98. margin-top:15px;
  99. }
  100. #text{
  101. height: 23px;
  102. }
  103. #button{
  104. height: 29px;
  105. }
  106. #img{
  107. width: 200px;
  108. height: 200px;
  109. }
  110. </style>
  111. </head>
  112. <body>
  113. <?php
  114. $this->header();
  115. ?>
  116. <div class="generate_qrcode_box tab-content clearfix j-box-qrcode">
  117. <div id="decode_box">
  118. <div class="col-md-6 decode_upload_box clearfix">
  119. <div class="decode_upload_left">
  120. <lable class="decode_upload_btn_lable">上传二维码解码</lable>:
  121. </div>
  122. <div class="decode_upload_right" style="position: relative;">
  123. <input class="bg_default btn decode_upload_btn" type="file" id="newfile" onchange="changepic(this)"></br>
  124. <img src="/jiexi/jiexi.png" id="img" />
  125. <p class="tips"><span class="text_default">*</span>图片:jpg、jpeg、png </p>
  126. <p class="tips"><span class="text_default">*</span>大小:小于2M </p>
  127. <p class="tips"><span class="text_default">*</span>上传带二维码的图片</p>
  128. </div>
  129. </div>
  130. <div class="col-md-6 decode_results">
  131. <p class="fz_20">解析结果:</p>
  132. <textarea class="form-control decode_results_textarea" id="spantitle"></textarea>
  133. <br>
  134. </div>
  135. </div>
  136. <div class="col-md-12">
  137. </div>
  138. </div>
  139. <script type="text/javascript">
  140. // 解析
  141. var newfile = document.getElementById('newfile');
  142. var getObjectURL = function (file) {
  143. var url = null;
  144. if (window.createObjectURL != undefined) { // basic
  145. url = window.createObjectURL(file);
  146. } else if (window.URL != undefined) { // mozilla(firefox)
  147. url = window.URL.createObjectURL(file);
  148. } else if (window.webkitURL != undefined) { // webkit or chrome
  149. url = window.webkitURL.createObjectURL(file);
  150. }
  151. return url;
  152. }
  153. newfile.onchange = function () {
  154. // 显示图片
  155. var reads = new FileReader();
  156. f = document.getElementById('newfile').files[0];
  157. reads.readAsDataURL(f);
  158. reads.onload = function(e) {
  159. document.getElementById('img').src = this.result;
  160. $("#img").css("display", "block");
  161. };
  162. // console.log(newfile[0]);
  163. console.log(getObjectURL(this.files[0]));// newfile[0]是通过input file上传的二维码图片文件
  164. qrcode.decode(getObjectURL(this.files[0]));
  165. qrcode.callback = function (imgMsg) {
  166. // 获取地址传给span
  167. var divA = document.getElementById("spantitle");
  168. divA.innerHTML = divA.innerHTML+ imgMsg;
  169. }
  170. }
  171. </script>
  172. <?php
  173. $this->footer();
  174. ?> </body>
  175. </html>
  176. <?php
  177. }
  178. }