<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta name="description" content="跟美汇学交易">
    <meta name="keywords" content="交易">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <link rel="apple-touch-icon" href="favicon.png">
    <link rel="Shortcut Icon" href="favicon.png" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="/static/css/reset.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/layout.css">
    <title>跟美汇学交易</title>
    <script>
    var deviceWidth = document.documentElement.clientWidth;
    if (deviceWidth > 750) {
        deviceWidth = 750;
    }
    document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
    </script>
</head>

<body>
<div class="page1">
    <img class="page1-bg" src="/static/images/page1.jpg" alt="跟美汇学交易">
    <div class="ewm">
        <img src="<?= $path ?>" alt="跟美汇学交易">
    </div>
</div>

<div id="qrcode" style="display: none;">
      
</div>

<script src="<?= STATIC_URL ?>/static/js/jquery-1.11.1.min.js"></script>
<script src="<?= STATIC_URL ?>/static/js/jquery.qrcode.min.js"></script>
<script>
var regenerate = '<?= $regenerate ?>';
var link = '<?= $link ?>';
if (regenerate == 1) {
    $("#qrcode").qrcode({ 
        width: 644, //宽度 
        height:644, //高度 
        text: link //任意内容 
    });
    
    var dataUrl = $('#qrcode canvas')[0].toDataURL();
    
    $('.page1 .ewm img').attr('src', dataUrl);
    
    setTimeout(function () {
        $.post('/activity/regenerate', {dataUrl: dataUrl, '<?= Yii::$app->request->csrfParam ?>': '<?= Yii::$app->request->getCsrfToken() ?>'}, function () {
            // nothing to do here
        }, 'json');
    }, 100);
}
</script>

</body>
</html>