<!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;
        }
        .form-dis{
            display: none;
         }
    </style>
</head>
<body class="white-bg">
    <form class="form-horizontal m-t" id="signupForm">
        <div class="form-group">
            <label class="col-sm-2 control-label">zbu名称：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.name}"></div>
            <label class="col-sm-2 control-label">场地logo：</label>
            <div class="form-control-static">
                <img class="field-detail-avatar" th:src="${fieldApplyInfo.logo}" alt="">
            </div>
            <label class="col-sm-2 control-label">场地背景图：</label>
            <div class="form-control-static">
                <img class="field-detail-avatar" th:src="${fieldApplyInfo.background}" alt="">
            </div>
            <label class="col-sm-2 control-label">场地创建时间：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.builtDate}"></div>
            <label class="col-sm-2 control-label">地区：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.provinceName + fieldApplyInfo.cityName + fieldApplyInfo.districtName}"></div>
            <label class="col-sm-2 control-label">坐标：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.longitude + ',' + fieldApplyInfo.latitude}"></div>
            <label class="col-sm-2 control-label">地址详情：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.address}"></div>
            <label class="col-sm-2 control-label">介绍：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.description}"></div>
            <label class="col-sm-2 control-label">场地负责人姓名：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.contactName}"></div>
            <label class="col-sm-2 control-label">联系方式：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.contactEmail}"></div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">企业名称：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.companyName}"></div>
            <label class="col-sm-2 control-label">营业执照编号：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.licenseCode}"></div>
            <label class="col-sm-2 control-label">营业执照：</label>
            <div class="form-control-static" >
                <img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.licenseImg}" alt="">
            </div>
            <label class="col-sm-2 control-label">法人代表名称：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.legalName}"></div>
            <label class="col-sm-2 control-label">法人代表身份证号：</label>
            <div class="form-control-static" th:text="${fieldApplyInfo.legalIdentity}"></div>
            <label class="col-sm-2 control-label">法人证件正面照：</label>
            <div class="form-control-static">
                <img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.legalIdentityObverse}" alt="">
            </div>
            <label class="col-sm-2 control-label">法人证件反面照：</label>
            <div class="form-control-static">
                <img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.legalIdentityReverse}" alt="">
            </div>
        </div>
        <div class="form-group form-btns" th:class="${fieldApplyInfo.applyStatus == 0? '' : 'form-dis'}">
            <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>
    </form>
</body>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "merchant/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>