jiexi.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. }
  83. @media (max-width: 767px) {
  84. footer {
  85. position: static;
  86. }
  87. .container {
  88. width: auto;
  89. }
  90. }
  91. </style>
  92. <style>
  93. #qrcode {
  94. width:160px;
  95. height:160px;
  96. margin-top:15px;
  97. }
  98. #text{
  99. height: 23px;
  100. }
  101. #button{
  102. height: 29px;
  103. }
  104. #img{
  105. width: 200px;
  106. height: 200px;
  107. }
  108. </style>
  109. </head>
  110. <body>
  111. <?php
  112. $this->header();
  113. ?>
  114. <div class="generate_qrcode_box tab-content clearfix">
  115. <div id="decode_box">
  116. <div class="col-md-6 decode_upload_box clearfix">
  117. <div class="decode_upload_left">
  118. <lable class="decode_upload_btn_lable">上传二维码解码</lable>:
  119. </div>
  120. <div class="decode_upload_right" style="position: relative;">
  121. <input class="bg_default btn decode_upload_btn" type="file" id="newfile" onchange="changepic(this)"></br>
  122. <img src="/jiexi/jiexi.png" id="img" />
  123. <p class="tips"><span class="text_default">*</span>图片:jpg、jpeg、png </p>
  124. <p class="tips"><span class="text_default">*</span>大小:小于2M </p>
  125. <p class="tips"><span class="text_default">*</span>上传带二维码的图片</p>
  126. </div>
  127. </div>
  128. <div class="col-md-6 decode_results">
  129. <p class="fz_20">解析结果:</p>
  130. <textarea class="form-control decode_results_textarea" id="spantitle"></textarea>
  131. <br>
  132. </div>
  133. </div>
  134. <div class="col-md-12">
  135. </div>
  136. </div>
  137. <script type="text/javascript">
  138. // 解析
  139. var newfile = document.getElementById('newfile');
  140. var getObjectURL = function (file) {
  141. var url = null;
  142. if (window.createObjectURL != undefined) { // basic
  143. url = window.createObjectURL(file);
  144. } else if (window.URL != undefined) { // mozilla(firefox)
  145. url = window.URL.createObjectURL(file);
  146. } else if (window.webkitURL != undefined) { // webkit or chrome
  147. url = window.webkitURL.createObjectURL(file);
  148. }
  149. return url;
  150. }
  151. newfile.onchange = function () {
  152. // 显示图片
  153. var reads = new FileReader();
  154. f = document.getElementById('newfile').files[0];
  155. reads.readAsDataURL(f);
  156. reads.onload = function(e) {
  157. document.getElementById('img').src = this.result;
  158. $("#img").css("display", "block");
  159. };
  160. // console.log(newfile[0]);
  161. console.log(getObjectURL(this.files[0]));// newfile[0]是通过input file上传的二维码图片文件
  162. qrcode.decode(getObjectURL(this.files[0]));
  163. qrcode.callback = function (imgMsg) {
  164. // 获取地址传给span
  165. var divA = document.getElementById("spantitle");
  166. divA.innerHTML = divA.innerHTML+ imgMsg;
  167. }
  168. }
  169. </script>
  170. <?php
  171. $this->footer();
  172. ?> </body>
  173. </html>
  174. <?php
  175. }
  176. }