<#assign title="我的场地"/>
<#include "/cust/frag.head.ftl" />

<header class="demos-header">
    <h1 class="demos-title">${title}</h1>
</header>

<div class="weui-cells weui-cells_form" id="placeForm">

</div>

<#include "/cust/frag.foot.ftl" />
<script>

    var userId = '${userId}';
    var placeList = ${placeList}.placeList;
    (function ($) {
        placeList.forEach(function (v) {
            bindCell(v);
        });
    })(jQuery);

    function bindCell(v) {
        $('#placeForm').append($('<div class="weui-cell">\n' +
                '        <div class="weui-cell__hd"><label class="weui-label">'+v.placeName+'</label></div>\n' +
                '        <div class="weui-cell__bd">\n' +
                '            <a href="javascript:openQr(\''+v.placeId+'\')" class="weui-btn weui-btn_default">打开二维码</a>\n' +
                '        </div>\n' +
                '    </div>'));
    }

    function openQr(v) {
        window.location.href='/cust/junior_qr.html?userId='+userId + '&placeId=' + v;
    }

</script>