0

我有两排 8 个产品(每排 4 个),我想让它按价格高到低排序,所以它看起来首先是价格较高的产品,然后是价格较低的产品。我怎样才能实现它?请提供代码示例。

(div class="可折叠">

      <c:forEach items="${releasesGenre.value}" var="release" varStatus="status" end="3">

        <div class="productItem">

          <c:if test="${release.affiliateThumbnail ne null}">
            <div class="af lrg" style="background:url(/resources/images/affiliates/${release.affiliateThumbnail}) no-repeat;"></div>
          </c:if>

          <div class="coverArt">
            <a class="productlink" href="/product/<str:seourl args1="${release.artist.name}" args2="${release.name}"/>?id=${release.id}">
              <img src="${ release.imagePath }" width="134" height="134" alt="<c:out value="${release.name}"/> Image" />
            </a>
          </div>
          <div class="buy">
            <a href="#" id="buy_${ release.id }">Buy</a>
          </div>

          <div class="artistName">
            <a class="productlink" href="/product/<str:seourl args1="${release.artist.name}" args2="${release.name}"/>?id=${release.id}"><c:out value="${release.artist.name}"/></a>
          </div>

          <div class="productName">
            <a class="productlink" href="/product/<str:seourl args1="${release.artist.name}" args2="${release.name}"/>?id=${release.id}"><c:out value="${release.name}"/></a>
            <%--<span class="fileType"> (${ release.fileType }) </span>--%>
          </div>

          <div class="price">
            <c:choose>
              <c:when test="${release.free}">${store.currency.htmlSymbol}FREE</c:when>
              <c:otherwise>
              ${store.currency.htmlSymbol}${release.productPrices[store.id].price} ${ release.productPrices[storeId].price }
              </c:otherwise>
            </c:choose>
          </div>

       </div>

4

0 回答 0