2024-12-21 17:09:41 +08:00
|
|
|
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
|
|
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2025-01-14 16:01:14 +08:00
|
|
|
|
2024-12-21 17:09:41 +08:00
|
|
|
<head>
|
2024-12-21 18:06:18 +08:00
|
|
|
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
|
2024-12-21 17:09:41 +08:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>我的订单</title>
|
2025-01-14 16:01:14 +08:00
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
2024-12-21 17:09:41 +08:00
|
|
|
</head>
|
2025-01-14 16:01:14 +08:00
|
|
|
|
2024-12-21 17:09:41 +08:00
|
|
|
<body>
|
2025-01-14 16:01:14 +08:00
|
|
|
<div class="container mt-5">
|
|
|
|
<!-- 顶部导航 -->
|
|
|
|
<div class="card shadow">
|
|
|
|
<div class="card-header bg-primary text-white text-center">
|
|
|
|
<h2>电脑商城</h2>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<p class="text-center">你好!<strong>${sessionScope.user.username}</strong></p>
|
|
|
|
<c:if test="${sessionScope.user != null}">
|
|
|
|
<div class="d-grid gap-2 d-md-flex justify-content-md-center">
|
|
|
|
<a href="/computer?action=list" class="btn btn-outline-primary">电脑选购</a>
|
|
|
|
<c:if test="${sessionScope.user.role == 'user'}">
|
|
|
|
<a href="/cart?action=list" class="btn btn-outline-primary">我的购物车</a>
|
|
|
|
<a href="/orders?action=my" class="btn btn-outline-primary">我的订单</a>
|
|
|
|
</c:if>
|
|
|
|
<c:if test="${sessionScope.user.role == 'admin'}">
|
|
|
|
<a href="/user?action=list" class="btn btn-outline-primary">用户列表</a>
|
|
|
|
<a href="/orders?action=all" class="btn btn-outline-primary">所有订单</a>
|
|
|
|
</c:if>
|
|
|
|
<a href="/logout" class="btn btn-danger">退出</a>
|
|
|
|
</div>
|
|
|
|
</c:if>
|
|
|
|
<c:if test="${sessionScope.user == null}">
|
|
|
|
<p class="text-center">请登录后查看更多内容~</p>
|
|
|
|
<div class="d-grid gap-2 d-md-flex justify-content-md-center">
|
|
|
|
<a href="/register" class="btn btn-outline-primary">注册</a>
|
|
|
|
<a href="/login" class="btn btn-outline-primary">登录</a>
|
|
|
|
</div>
|
|
|
|
</c:if>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-12-22 21:02:08 +08:00
|
|
|
|
2025-01-14 16:01:14 +08:00
|
|
|
<h3>我的订单</h3>
|
2024-12-21 17:19:36 +08:00
|
|
|
|
2025-01-14 16:01:14 +08:00
|
|
|
<div style="color: red;">
|
|
|
|
<p>${requestScope.msg}</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-striped table-bordered">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>订单编号</th>
|
|
|
|
<th>用户ID</th>
|
|
|
|
<th>订单日期</th>
|
|
|
|
<th>总金额</th>
|
|
|
|
<th>地址</th>
|
|
|
|
<th>商品信息</th>
|
|
|
|
<th>状态</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<c:forEach var="order" items="${Orders}">
|
|
|
|
<tr>
|
|
|
|
<td>${order.id}</td>
|
|
|
|
<td>${order.userId}</td>
|
|
|
|
<td>${order.orderDate}</td>
|
|
|
|
<td>${order.totalPrice}</td>
|
|
|
|
<td>${order.address}</td>
|
|
|
|
<td>${order.remark}</td>
|
|
|
|
<td>${order.status}</td>
|
|
|
|
</tr>
|
|
|
|
</c:forEach>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2024-12-21 17:19:36 +08:00
|
|
|
</div>
|
2024-12-21 17:09:41 +08:00
|
|
|
</body>
|
2025-01-14 16:01:14 +08:00
|
|
|
|
2024-12-21 17:09:41 +08:00
|
|
|
</html>
|