<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('护照详情')" />
</head>
<body class="gray-bg">
<div class="container-div" th:if="${detail != null}">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title"><h5>护照信息</h5></div>
                <div class="ibox-content">
                    <table class="table table-bordered table-striped">
                        <tbody>
                        <tr><td class="col-sm-2">护照编号</td><td th:text="${detail.passportNo}">-</td></tr>
                        <tr><td>绑定状态</td>
                            <td>
                                <span th:if="${detail.status == 1}" class="label label-info">已绑定</span>
                                <span th:if="${detail.status == 0}" class="label label-default">未绑定</span>
                                <span th:if="${detail.status == 2}" class="label label-warning">已作废</span>
                            </td>
                        </tr>
                        <tr><td>批次号</td><td th:text="${detail.batchNo != null ? detail.batchNo : '-'}">-</td></tr>
                        <tr><td>首次绑定时间</td><td th:text="${detail.boundAt != null ? #dates.format(detail.boundAt, 'yyyy-MM-dd HH:mm:ss') : '-'}">-</td></tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-sm-12" th:if="${detail.userId != null and detail.userId != ''}">
            <div class="ibox">
                <div class="ibox-title"><h5>关联用户信息</h5></div>
                <div class="ibox-content">
                    <table class="table table-bordered table-striped">
                        <tbody>
                        <tr><td class="col-sm-2">用户ID</td><td th:text="${detail.userId}">-</td></tr>
                        <tr><td>昵称</td><td th:text="${detail.nickname}">-</td></tr>
                        <tr><td>手机号</td><td th:text="${detail.mobile}">-</td></tr>
                        <tr><td>真实姓名</td><td th:text="${detail.realName}">-</td></tr>
                        <tr><td>证件号</td><td th:text="${detail.idCard}">-</td></tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-sm-12" th:if="${detail.userId == null or detail.userId == ''}">
            <div class="alert alert-info">当前护照未绑定用户</div>
        </div>
        <div class="col-sm-12" th:if="${detail.badges != null and !#lists.isEmpty(detail.badges)}">
            <div class="ibox">
                <div class="ibox-title"><h5>已领取徽章</h5></div>
                <div class="ibox-content">
                    <table class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>徽章名称</th>
                            <th>图标</th>
                            <th>领取时间</th>
                            <th>获取途径</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="b : ${detail.badges}">
                            <td th:text="${b.badgeName}">-</td>
                            <td>
                                <span th:if="${b.icon != null and (b.icon.startsWith('http') or b.icon.startsWith('/'))}">
                                    <img th:src="${b.icon}" style="max-height:28px;"/>
                                </span>
                                <span th:if="${b.icon != null and !(b.icon.startsWith('http') or b.icon.startsWith('/'))}" th:text="${b.icon}" style="font-size:22px;"></span>
                            </td>
                            <td th:text="${b.claimedAt != null ? #dates.format(b.claimedAt, 'yyyy-MM-dd HH:mm:ss') : '-'}">-</td>
                            <td>
                                <span th:if="${b.source == 1}">绑定护照自动发放</span>
                                <span th:if="${b.source == 2}">购票自动发放</span>
                                <span th:if="${b.source == 3}">补签审核通过</span>
                                <span th:if="${b.source == 4}">现场管理员手动发放</span>
                                <span th:if="${b.source == null or b.source &lt; 1 or b.source &gt; 4}">未知</span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container-div" th:if="${detail == null}">
    <div class="alert alert-warning">未找到护照信息</div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>
