fix<优化下单逻辑>

master
liyansheng 2024-12-21 17:11:50 +08:00
parent ddfc9270aa
commit 9dfe3a62aa
1 changed files with 32 additions and 26 deletions

View File

@ -10,35 +10,41 @@
<body>
<h1>购物车</h1>
<a href="/">主页</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<c:forEach var="computer" items="${computers}">
<c:if test="${not empty computers}">
<table border="1">
<thead>
<tr>
<td>${computer.id}</td>
<td>${computer.name}</td>
<td>${computer.price}</td>
<td>
<a href="/cart?action=remove&id=${computer.id}">移出</a>
</td>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Actions</th>
</tr>
</c:forEach>
</tbody>
</table>
<hr>
<a href="/orders?action=add">
<button>一键下单</button>
</a>
</thead>
<tbody>
<c:forEach var="computer" items="${computers}">
<tr>
<td>${computer.id}</td>
<td>${computer.name}</td>
<td>${computer.price}</td>
<td>
<a href="/cart?action=remove&id=${computer.id}">移出</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<hr>
</c:if>
<c:if test="${not empty computers}">
<a href="/orders?action=add">
<button>一键下单</button>
</a>
</c:if>
<c:if test="${empty computers}">
<p>购物车为空,暂无商品可下单。</p>
</c:if>
<br>
<br/>
<br>
</body>
</html>
</html>