• 查看作者
  • HTML二维码解析源码

    [aru_1]先说一下,转载的!转载的!转载的!通过大佬搞到手的JS二维码解析。速度效率都还不错。
    见下面源码保存为html格式即可。

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>二维码解析接口 - stext-API</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <style type="text/css">
    body{margin: 0;}
    .module-content{
    min-width: 770px;
    max-width: 1000px;
    width: 100%;
    color: #000;
    margin: 0 auto;
    }
    .module-head{
    text-align: center;
    font-weight: 500;
    margin: 0;
    font-size: 30px;
    height: 100px;
    line-height: 100px;
    color: #000;
    }
    .box h3{
    font-weight: 300;
    margin: 0;
    font-size: 20px;
    height: 60px;
    line-height: 60px;
    color: #000;
    }
    .url-box{
    height: 30px;
    line-height: 30px;
    font-size: 14px;
    }
    #file{
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 10;
    }
    </style>
    </head>
    <body>
    <div class="module-content">
    <!--解析二维码-->
    <h1 class="module-head">解析二维码</h1>
    <div class="box">
    <h3>点击二维码解析</h3>
    <img onClick="getUrl(this,'img-url')" src="https://stext.cn/wp-content/uploads/2019/09/20190909_035633_16.png"/>
    <p class="url-box" id="urlBox"></p>
    </div>
    <div class="box">
    <h3>上传二维码解析</h3>
    <div style="position: relative;">
    <img style="width: 120px;height: 120px;" src="https://puui.qpic.cn/fans_admin/0/3_1474982358_1567936854640/0"/>
    <input type="file" onChange="getUrl(this,'file-url')" name="" id="file" value="" />
    <p class="url-box" id="urlBox"></p>
    </div>
    </div>
    </div>
    <!--- 这里的js文件采用CDN加速弱网加速技术,有效节省本地带宽资源 ;该服务由stext-API提供技术支持!--->
    <script src="https://api.stext.cn/qrjs/llqrcode.js" type="text/javascript" charset="utf-8"></script>
    <script src="https://api.stext.cn/qrjs/analyticCode.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    function getUrl(e,param){
    analyticCode.getUrl(param,e,function(url1,url2){
    e.nextElementSibling.innerHTML = url1;
    e.previousElementSibling.src = url2;
    });
    }
    </script>
    </body>
    </html>

  • 0
  • 0
  • 0
  • 8.13w
  • 单栏布局 侧栏位置: