<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('场地审核详情')"/>
    <style>
        .field-detail-avatar{
            width: 146px;
            height: 146px;
        }
        .field-detail-avatar-certificates{
            width: 300px;
            height: 200px;
        }
        .form-btns{
            padding-bottom: 20px;
        }
        .field-detail-content{
            display: flex;
        }
    </style>
</head>
<body class="white-bg">
    <div class="field-detail">
        <div class="field-detail-content row">
            <form class="form-horizontal col-md-6" id="signupForm">
                <div class="form-group">
                    <label class="col-md-3 control-label">场地名称：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.name}"></div>
                    <label class="col-md-3 control-label">场地logo：</label>
                    <div class="form-control-static col-md-9">
                        <img class="field-detail-avatar" th:src="${fieldApplyInfo.logo}" alt="">
                    </div>
                    <label class="col-md-3 control-label">场地背景图：</label>
                    <div class="form-control-static col-md-9">
                        <img class="field-detail-avatar" th:src="${fieldApplyInfo.background}" alt="">
                    </div>
                    <label class="col-md-3 control-label">场地创建时间：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.builtDate}"></div>
                    <label class="col-md-3 control-label">地区：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.provinceName + fieldApplyInfo.cityName + fieldApplyInfo.districtName}"></div>
                    <label class="col-md-3 control-label">坐标：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.longitude + ',' + fieldApplyInfo.latitude}"></div>
                    <label class="col-md-3 control-label">地址详情：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.address}"></div>
                    <label class="col-md-3 control-label">介绍：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.description}"></div>
                    <label class="col-md-3 control-label">场地负责人姓名：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.contactName}"></div>
                    <label class="col-md-3 control-label">联系方式：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.contactEmail}"></div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">企业名称：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.companyName}"></div>
                    <label class="col-md-3 control-label">营业执照编号：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.licenseCode}"></div>
                    <label class="col-md-3 control-label">营业执照：</label>
                    <div class="form-control-static col-md-9" >
                        <img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.licenseImg}" alt="">
                    </div>
                    <label class="col-md-3 control-label">法人代表名称：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.legalName}"></div>
                    <label class="col-md-3 control-label">法人代表身份证号：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.legalIdentity}"></div>
                    <label class="col-md-3 control-label">法人证件正面照：</label>
                    <div class="form-control-static col-md-9">
                        <img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.legalIdentityObverse}" alt="">
                    </div>
                    <label class="col-md-3 control-label">法人证件反面照：</label>
                    <div class="form-control-static col-md-9">
                        <img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.legalIdentityReverse}" alt="">
                    </div>
                </div>
            </form>

            <form class="form-horizontal col-md-6" th:if="${fieldApplyInfo.applyType == 'claim'}">
                <div class="form-group">
                    <label class="col-md-3 control-label">场地名称：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.name}"></div>
                    <label class="col-md-3 control-label">场地logo：</label>
                    <div class="form-control-static col-md-9">
                        <img class="field-detail-avatar" th:src="${fieldApplyInfo.fieldVo.logo}" alt="">
                    </div>
                    <label class="col-md-3 control-label">场地背景图：</label>
                    <div class="form-control-static col-md-9">
                        <img class="field-detail-avatar" th:src="${fieldApplyInfo.fieldVo.background}" alt="">
                    </div>
                    <label class="col-md-3 control-label">场地创建时间：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.builtDate}"></div>
                    <label class="col-md-3 control-label">地区：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.provinceName + fieldApplyInfo.fieldVo.cityName + fieldApplyInfo.fieldVo.districtName}"></div>
                    <label class="col-md-3 control-label">坐标：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.longitude + ',' + fieldApplyInfo.fieldVo.latitude}"></div>
                    <label class="col-md-3 control-label">地址详情：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.address}"></div>
                    <label class="col-md-3 control-label">介绍：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.description}"></div>
                    <label class="col-md-3 control-label">场地负责人姓名：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.contactName}"></div>
                    <label class="col-md-3 control-label">联系方式：</label>
                    <div class="form-control-static col-md-9" th:text="${fieldApplyInfo.fieldVo.contactEmail}"></div>
                </div>
            </form>
        </div>
        <div class="field-detail-btn">
            <div class="form-group form-btns" th:if="${fieldApplyInfo.applyStatus == 0}">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="button" class="btn btn-sm btn-primary" onclick="AdoptSubmit()">审核通过</button>&nbsp;
                    <a class="btn btn-sm btn-danger" href="#field-reject-form" data-toggle="modal">
                        驳 回
                    </a>
                </div>
            </div>
            <div id="field-reject-form" class="modal fade" aria-hidden="true">
                <div class="modal-dialog" style="width:33%;">
                    <div class="modal-content" style="padding:0 20px;">
                        <div class="modal-body">
                            <div class="row">
                                <div>
                                    <h3 class="m-t-none m-b text-center">驳回原因</h3>
                                    <div class="form-group">
                                        <textarea id="fieldRejectText" rows="3" name="reason" placeholder="请输入驳回原因" class="form-control"></textarea>
                                    </div>
                                    <div class="text-center" style="margin-bottom: -15px;margin-top: 10px;">
                                        <button class="btn btn-sm btn-primary m-t-n-xs" type="button" onclick="Reject()">
                                            <strong>确认驳回</strong>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "slime/field/apply";
    var fieldInfo = [[${fieldApplyInfo}]]
    var param =  {
        fieldApplyId:fieldInfo.fieldApplyId
    }
    function AdoptSubmit () {
        $.operate.post(prefix + "/approve", param, function (res) {
            location.reload();
        });
    }
    function Reject () {
        param.reject = $('#fieldRejectText').val();
        $.operate.post(prefix + "/reject", param, function (res) {
            location.reload();
        });
    }

</script>
</html>