Skip to content

Commit

Permalink
💄 优化数据为空时的缺省显示内容
Browse files Browse the repository at this point in the history
  • Loading branch information
newbee-mall committed Dec 14, 2020
1 parent f5a0539 commit 412de15
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/main/resources/templates/mall/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
<div class="cart_bg">
<th:block th:if="${#lists.isEmpty(myShoppingCartItems)}">
<div class="list center">
<!-- todo 无购物项时 换背景图 -->
无数据
<img style="position: absolute;margin-top: 16px;left: 45%;" th:src="@{/mall/image/null-content.png}">
</div>
</th:block>
<th:block th:unless="${#lists.isEmpty(myShoppingCartItems)}">
Expand Down
53 changes: 30 additions & 23 deletions src/main/resources/templates/mall/my-orders.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ <h1 class="title">我的订单
<div class="box-bd">
<div id="J_orderList">
<ul class="order-list">
<th:block th:if="${#lists.isEmpty(orderPageResult.list)}">
<img style="margin-top: 16px;"
th:src="@{/mall/image/null-content.png}">
<small><a th:href="@{/index}">&nbsp;&nbsp;&nbsp;&nbsp;去购物&gt;</a>
</small>
</th:block>
<th:block th:unless="${#lists.isEmpty(orderPageResult.list)}">
<!-- todo 无订单时 换背景图为无订单 -->
<th:block th:each="order : ${orderPageResult.list}">

<li class="uc-order-item uc-order-item-list">
Expand Down Expand Up @@ -98,29 +103,31 @@ <h1 class="title">我的订单
</th:block>
</ul>
</div>
<div id="J_orderListPages">
<div class="newbee-pagenavi">
<th:block th:if="${orderPageResult.currPage-2 >=1}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage-2}}"
th:text="${orderPageResult.currPage -2}">1</a>
</th:block>
<th:block th:if="${orderPageResult.currPage-1 >=1}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage-1}}"
th:text="${orderPageResult.currPage -1}">1</a>
</th:block>
<a href="##" class="numbers current" th:text="${orderPageResult.currPage}">1</a>
<th:block th:if="${orderPageResult.currPage+1<=orderPageResult.totalPage}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage+1}}"
th:text="${orderPageResult.currPage +1}">1</a></th:block>
<th:block th:if="${orderPageResult.currPage+2<=orderPageResult.totalPage}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage+2}}"
th:text="${orderPageResult.currPage +2}">1</a></th:block>
<th:block th:unless="${#lists.isEmpty(orderPageResult.list)}">
<div id="J_orderListPages">
<div class="newbee-pagenavi">
<th:block th:if="${orderPageResult.currPage-2 >=1}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage-2}}"
th:text="${orderPageResult.currPage -2}">1</a>
</th:block>
<th:block th:if="${orderPageResult.currPage-1 >=1}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage-1}}"
th:text="${orderPageResult.currPage -1}">1</a>
</th:block>
<a href="##" class="numbers current" th:text="${orderPageResult.currPage}">1</a>
<th:block th:if="${orderPageResult.currPage+1<=orderPageResult.totalPage}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage+1}}"
th:text="${orderPageResult.currPage +1}">1</a></th:block>
<th:block th:if="${orderPageResult.currPage+2<=orderPageResult.totalPage}"><a
class="numbers"
th:href="@{'/orders?page=' + ${orderPageResult.currPage+2}}"
th:text="${orderPageResult.currPage +2}">1</a></th:block>
</div>
</div>
</div>
</th:block>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/mall/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="goods_item center">
<div class="main center">
<th:block th:if="${#lists.isEmpty(pageResult.list)}">
未查询到商品
<img style="margin-top: 16px;padding: 16px 20px;" th:src="@{/mall/image/null-content.png}">
</th:block>
<th:block th:unless="${#lists.isEmpty(pageResult.list)}">
<th:block th:each="goods : ${pageResult.list}">
Expand Down

0 comments on commit 412de15

Please sign in to comment.