<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
<head>
    <script th:replace="common/head"></script>


    <style>
        .titleSpan {
            margin-left: 10%;
            font-weight: bolder;
        }
    </style>
</head>

    <body>
        <div class="layui-fluid">
            <div class="layui-card">
                <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding:0;">
                    <blockquote class="layui-elem-quote">
                            <span style="font-weight: bolder" >当前小区名称：</span>
                            <span th:text="${residential.name}"/>
                            <span class="titleSpan">小区编号：</span>
                            <span th:text="${residential.residentialNumber}"/>
                            <span class="titleSpan">所属物业：</span>
                            <span th:text="${residential.estatePidName}"/>
                            <span class="titleSpan">小区地址：</span>
                            <span th:text="${residential.region}"/>
                    </blockquote>

                    <!-- 表格+头部按钮 -->
                    <div class="layui-card-body" style="padding:0;">
                        <div style="padding-bottom: 10px;">
                            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" value="1" sptg:security="estate:faceChargeProject:add">添加免费人脸项目</button>
                            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" value="2" sptg:security="estate:faceChargeProject:add">添加收费人脸项目</button>
                        </div>
                        <table id="table-id" lay-filter="table-even"></table>
                        <input type="hidden" id="residential_id" name="residentialId" th:value="${residential.id}"/>
                    </div>
                </div>
            </div>
        </div>

        <script type="text/html" id="table-useradmin-webuser">
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" sptg:security="estate:faceChargeProject:update">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" sptg:security="estate:faceChargeProject:delete">删除</a>
        </script>

        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>

        <!--套餐类型-->
        <script type="text/html" id="type">
            {{#  if(d.type == 1){ }}
            <span>免费</span>
            {{# } else if(d.type == 2){ }}
            <span>付费</span>
            {{#  } }}
        </script>

        <!--收费类型-->
        <script type="text/html" id="typeItem">
            {{#  if(d.typeItem == 11){ }}
            <span>试用</span>
            {{# } else if(d.typeItem == 12){ }}
            <span>长期</span>
            {{# } else if(d.typeItem == 21){ }}
            <span>押金</span>
            {{# } else if(d.typeItem == 22){ }}
            <span>套餐</span>
            {{#  } }}
        </script>

        <!--上架状态-->
<!--        <script type="text/html" id="putStatus">
            {{#  if(d.putStatus == 0){ }}
            <span>上架</span>
            {{# } else if(d.putStatus == 1){ }}
            <span>下架</span>
            {{#  } }}
        </script>-->

        <!-- 机构状态 -->
        <script type="text/html" id="putStatusChange">
            <input type="checkbox" name="putStatusChange" value="{{d.id}},{{d.residentialId}},{{d.type}},{{d.typeItem}}" lay-skin="switch" lay-text="上架|下架" lay-filter="putStatusChange" {{ d.putStatus == 1 ? 'checked' : '' }}>
        </script>

        <script th:src="@{'/js/estate/faceChargeProject-manage.js'}"></script>
    </body>

</html>