<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">

<head>
  <meta charset="UTF-8">
  <title>欢迎页面-X-admin2.2</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
  <link rel="stylesheet" href="./css/font.css">
  <link rel="stylesheet" href="./css/xadmin.css">
  <script src="./layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="./js/xadmin.js"></script>
</head>

<body>
<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-body ">
          <table class="layui-table layui-form">
            <thead>
            <tr>
              <th>序列号</th>
              <th>留言者</th>
              <th>内容</th>
              <th>时间</th>
              <th>操作</th>


            </tr>
            </thead>
            <tbody>
            <tr th:each="message,iterStat : ${pageInfo.list}" >

              <td th:text="${iterStat.count}">1</td>
              <td th:text="${message.name}">摸鱼方法</td>
              <td th:text="${message.content}">摸鱼方法</td>
              <td th:text="${#dates.format(message.createTime,'yyyy-MM-dd')}">摸鱼方法</td>
              <td>
                <a title="删除" onclick="return member_del()" th:href="@{/admin/message/{id}/delete(id=${message.id})}">
                  <button class="layui-btn layui-btn-danger">
                    <i class="layui-icon"></i>删除</button>
                </a>
              </td>

            </tr>
            </tbody>
          </table>
        </div>
        <div class="layui-card-body ">
          <div class="page">
            <div>
              <a class="num" th:href="@{/admin/message}">首页</a>
              <a class="prev"
                 th:href="@{/admin/message(pagenum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">&lt;&lt;</a>
              <a class="num" th:text="${page}">1</a>
              <a class="next"
                 th:href="@{/admin/message(pagenum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">&gt;&gt;</a>
              <a class="num" th:href="@{/admin/message(pagenum=${pageInfo.pages})}">尾页</a>
            </div>

          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
<script>layui.use(['laydate', 'form'],
        function () {
          var laydate = layui.laydate;

          //执行一个laydate实例
          laydate.render({
            elem: '#start' //指定元素
          });

          //执行一个laydate实例
          laydate.render({
            elem: '#end' //指定元素
          });
        });

function member_del() {

  var flag = false;
  if (confirm("您确定删除吗?")){
    flag = true;
  }else {
    flag = false;
  }
  return flag;
}</script>

</html>