<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>二维码</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <style type="text/css">

        .imgStyle{
            width: 200px;
            height: auto;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div align="center">
                <br>
                <img id="wxapp_img" src="" class="imgStyle"/>
                <br>
            </div>
            <form class="layui-form" action="" lay-filter="component-form-element">

                <button class="layui-btn" id="id_save" lay-submit lay-filter="component-form-element"
                        style="display: none">保存
                </button>
            </form>
        </div>
    </div>
</div>

<script src="../../layuiadmin/layui/layui.js"></script>

<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index',
    }).use(['index', 'form',], function () {
        var $ = layui.$
            , admin = layui.admin
            , form = layui.form;
        var id = layui.view.getParameterByName('id');
        admin.req({
            url: '/activity/activity/code/?id=' + id,
            type:'post',
            done: function (res) {
                $('#wxapp_img').attr('src', res.data.data);
            }
        });

        form.on('submit(component-form-element)', function (data) {
            parent.layui.onSubmitChild();
            return false;
        });

        parent.layui.submitChild = function () {
            $("#id_save").click();
        };
    });
</script>
</body>
</html>
