73 lines
2.2 KiB
Plaintext
73 lines
2.2 KiB
Plaintext
<%@ 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">
|
|
<head>
|
|
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>我的订单</title>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<h2>电脑商城</h2>
|
|
<p>你好!${sessionScope.user.username}</p>
|
|
<c:if test="${sessionScope.user!= null}">
|
|
<a href="/computer?action=list">电脑选购</a>
|
|
<c:if test="${sessionScope.user.role == 'user'}">
|
|
<a href="/cart?action=list">我的购物车</a>
|
|
<a href="/orders?action=my">我的订单</a>
|
|
</c:if>
|
|
|
|
<c:if test="${sessionScope.user.role == 'admin'}">
|
|
<a href="/user?action=list">用户列表</a>
|
|
<a href="/orders?action=all">所有订单</a>
|
|
</c:if>
|
|
<a href="/logout">退出</a>
|
|
|
|
</c:if>
|
|
<c:if test="${sessionScope.user == null}">
|
|
<p>请登录后查看更多内容~</p>
|
|
<br>
|
|
<a href="/register">注册</a>
|
|
<a href="/login">登录</a>
|
|
</c:if>
|
|
</div>
|
|
|
|
<h1>我的订单</h1>
|
|
|
|
<div style="color: red;">
|
|
<p>${requestScope.msg}</p>
|
|
</div>
|
|
<table border="1">
|
|
<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>
|
|
<br/>
|
|
<br>
|
|
|
|
</body>
|
|
</html>
|