{% load staticfiles %}

<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="format-detection" content="telephone=no,email=no,address=no">
        <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
        <title>授权登录二维码</title>

        <link href="//res.wx.qq.com/open/libs/weui/0.4.3/weui.min.css" rel="stylesheet" type="text/css" />

        <style>
            input:required:invalid {
                color: #E64340;
            }
            input:required:valid {
                color: rgb(0, 0, 0);
            }
            .hidden {
                display: none;
            }
            .qr {
                position: fixed;
                left: 50%;
                top: 50%;
                margin-left: -100px;
                margin-top: -100px;
            }
        </style>
    </head>
    <body>
        <div class="container" >
            <img id="qr_logo" class="hidden" src="{% static 'pai2/img/paiai_96_96.png' %}">
            <div id="qr" class="qr"></div>
        </div>

        <script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script src="//cdn.bootcss.com/lrsjng.jquery-qrcode/0.14.0/jquery-qrcode.min.js"></script>
        <script>
            $("#qr").empty().qrcode({
                render: 'image',
                mode: 4,
                image: $("#qr_logo")[0],
                text: '{{ data }}'
            });
        </script>
        <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
        <script type="text/javascript" src="{% static 'pai2/js/jswe-0.0.4.js' %}"></script>
        <script>
            V.initWxData({
                imgUrl: "http://pai.ai/static/pai2/img/paiai_96_96.png",
                link: 'http://pai.ai/we/we_oauth2?redirect_url=http://pai.ai/page/loginqr&scope=snsapi_userinfo',
                desc: "授权登录",
                title: "授权登录",
                timeLine: ""
            }, true);
            V.hideOptionMenu();
        </script>
    </body>
</html>