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> <body>
<h1>购物车</h1> <h1>购物车</h1>
<a href="/">主页</a> <a href="/">主页</a>
<table border="1"> <c:if test="${not empty computers}">
<thead> <table border="1">
<tr> <thead>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<c:forEach var="computer" items="${computers}">
<tr> <tr>
<td>${computer.id}</td> <th>ID</th>
<td>${computer.name}</td> <th>Name</th>
<td>${computer.price}</td> <th>Price</th>
<td> <th>Actions</th>
<a href="/cart?action=remove&id=${computer.id}">移出</a>
</td>
</tr> </tr>
</c:forEach> </thead>
</tbody> <tbody>
</table> <c:forEach var="computer" items="${computers}">
<hr> <tr>
<a href="/orders?action=add"> <td>${computer.id}</td>
<button>一键下单</button> <td>${computer.name}</td>
</a> <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/> <br/>
<br> <br>
</body> </body>
</html> </html>