jiexi.php 5.2 KB

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