Browse Source

查看优惠券

chao 3 years ago
parent
commit
57caffc8fb

+ 87 - 9
src/main/webapp/WEB-INF/views/modules/coupon/productCouponDetails.jsp

@@ -1,16 +1,94 @@
-<%--
-  Created by IntelliJ IDEA.
-  User: Administrator
-  Date: 2021/8/20
-  Time: 10:54
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <html>
 <head>
-    <title>Title</title>
+    <title>查看优惠券</title>
+    <meta name="decorator" content="default"/>
+    <style>
+    ul,li{list-style:none;margin:0;padding:0;}
+        .controller{padding:20px;max-width:880px;margin:0 auto;}
+        .productDetail{display:flex;align-items:center;border:1px solid #eee;padding:12px;margin:0 auto 30px;}
+        .productDetail .img{width:60px;height:60px;margin-right:20px;background:eee;}
+        .productDetail .img img{height:100%;}
+        .productDetail p{margin:0;line-height:22px;}
+        .couponList{margin:20px auto;}
+        .couponList h4{margin-bottom:10px;}
+        .couponList ul:after{content:"";display:table;clear:both}
+        .couponList ul li{float:left;list-style:none;list-style-position:inside;border:1px solid #eee;margin:0 20px 20px 0;width:250px;padding:10px}
+        .couponList ul span{display:inline-block;width:100%;padding:2px}
+        .couponList ul span.couponDesc{min-height:72px;}
+    </style>
 </head>
 <body>
+<input type="hidden" id="ctx" value="${ctx}">
+<input type="hidden" id="productId" value="${product.productID}">
+<div class="controller">
+    <div class="productDetail">
+        <div class="img"><img src="${product.mainImage}" alt=""></div>
+        <div class="detail">
+            <p>商品名称:<a href="https://www.caimei365.com/product-${product.productID}.html">${product.name}</a></p>
+            <p>供应商:<span>${product.shopName}</span></p>
+            <p>机构价:<span>${product.price1}</span></p>
+        </div>
+    </div>
+    <div class="couponList">
+        <h4>普通优惠券(6)</h4>
+        <ul>
+            <c:forEach items="${ordinaryCoupons}" var="coupon">
+                <li><span class="couponDesc">
+                    <span>${coupon.couponName}</span>
+                    <c:if test="${not empty coupon.redemptionCode}">
+                        <span>兑换码:${coupon.redemptionCode}</span>
+                    </c:if>
+                    <span>${coupon.couponDesc}</span>
+                    <span>有效期:${coupon.startDate+' - '+${coupon.endDate}</span>
+                </span></li>
+            </c:forEach>
 
+<!--            <li><span class="couponDesc">
+                <span>用户专享券¥100.00 满200.00可用</span>
+                <span>兑换码:123</span>
+                <span>全商城商品通用</span>
+                <span>有效期:2021-08-04 - 2021-08-31</span>
+            </span></li>
+            <li><span class="couponDesc">
+                <span>用户专享券¥100.00 满200.00可用</span>
+                <span>兑换码:123</span>
+                <span>全商城商品通用</span>
+                <span>有效期:2021-08-04 - 2021-08-31</span>
+            </span></li>
+            <li><span class="couponDesc">
+                <span>用户专享券¥100.00 满200.00可用</span>
+                <span>兑换码:123</span>
+                <span>全商城商品通用</span>
+                <span>有效期:2021-08-04 - 2021-08-31</span>
+            </span></li> -->
+        </ul>
+    </div>
+    <div class="couponList">
+        <h4>兑换优惠券(2)</h4>
+        <ul>
+<!--            <li><span class="couponDesc">
+                <span>用户专享券¥100.00 满200.00可用</span>
+                <span>兑换码:123</span>
+                <span>全商城商品通用</span>
+                <span>有效期:2021-08-04 - 2021-08-31</span>
+            </span></li>
+            <li><span class="couponDesc">
+                <span>用户专享券¥100.00 满200.00可用</span>
+                <span>兑换码:123</span>
+                <span>全商城商品通用</span>
+                <span>有效期:2021-08-04 - 2021-08-31</span>
+            </span></li>
+            <li><span class="couponDesc">
+                <span>用户专享券¥100.00 满200.00可用</span>
+                <span>兑换码:123</span>
+                <span>全商城商品通用</span>
+                <span>有效期:2021-08-04 - 2021-08-31</span>
+            </span></li> -->
+        </ul>
+    </div>
+</div>
 </body>
 </html>

+ 5 - 0
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -458,13 +458,18 @@ function setPageCoupon() {
     var html = '<li><label><input type="radio" name="clubCouponId" value="0"><span class="couponDesc none">不使用优惠券</span></label></li>';
     selectCoupons.forEach(function(item){
         var checked = '';
+        var redemptionCode = '';
         if (clubCouponId === item.clubCouponId) {
             checked = 'checked="checked"';
         }
+        if (!isNaN(item.redemptionCode)) {
+            redemptionCode = '<span>兑换码:'+item.redemptionCode+'</span>'';
+        }
         html += '<li><label>';
         html += '       <input type="radio" name="clubCouponId" value="'+item.clubCouponId +'" '+checked+'>';
         html += '       <span class="couponDesc">';
         html += '            <span>'+item.couponName+'</span>';
+        html += redemptionCode;
         html += '            <span>'+item.couponDesc+'</span>';
         html += '            <span>有效期:'+item.startDate+' - '+item.endDate+'</span>';
         html += '</span></label></li>';