<!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">主办名称：</label>
        <div class="form-control-static" th:text="${sponsorApplyInfo.name}"></div>
        <label class="col-sm-2 control-label">主办logo：</label>
        <div class="form-control-static">
            <img class="field-detail-avatar" th:src="${sponsorApplyInfo.logo}" alt="">
        </div>
        <label class="col-sm-2 control-label">主办背景图：</label>
        <div class="form-control-static">
            <img class="field-detail-avatar" th:src="${sponsorApplyInfo.background}" alt="">
        </div>
        <label class="col-sm-2 control-label">介绍：</label>
        <div class="form-control-static" th:text="${sponsorApplyInfo.description}"></div>
        <label class="col-sm-2 control-label">姓名：</label>
        <div class="form-control-static" th:text="${sponsorApplyInfo.contactName}"></div>
        <label class="col-sm-2 control-label">身份证号：</label>
        <div class="form-control-static" th:text="${sponsorApplyInfo.contactIdentity}"></div>
        <label class="col-sm-2 control-label">证件正面照：</label>
        <div class="form-control-static">
            <img class="field-detail-avatar-certificates" th:src="${sponsorApplyInfo.contactIdentityObverse}" alt="">
        </div>
        <label class="col-sm-2 control-label">证件反面照：</label>
        <div class="form-control-static">
            <img class="field-detail-avatar-certificates" th:src="${sponsorApplyInfo.contactIdentityReverse}" alt="">
        </div>
        <label class="col-sm-2 control-label">联系方式：</label>
        <div class="form-control-static" th:text="${sponsorApplyInfo.contactEmail}"></div>
    </div>
    <div class="form-group form-btns" th:class="${sponsorApplyInfo.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="#sponsor-reject-form" data-toggle="modal">
                驳 回
            </a>
        </div>
    </div>
    <div id="sponsor-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="sponsorRejectText" 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 + "slime/sponsor/apply";
    var sponsorInfo = [[${sponsorApplyInfo}]]
    var param =  {
        sponsorApplyId:sponsorInfo.sponsorApplyId
    }
    function AdoptSubmit () {
        $.operate.post(prefix + "/approve", param, function (res) {
            location.reload();
        });
    }
    function Reject () {
        param.reject = $('#sponsorRejectText').val();
        $.operate.post(prefix + "/reject", param, function (res) {
            location.reload();
        });
    }

</script>
</html>