Przeglądaj źródła

修改订单优惠券

chao 3 lat temu
rodzic
commit
038718f17d

+ 20 - 2
src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp

@@ -317,7 +317,7 @@
     <br>
     <!-- 优惠券 -->
     <div id="couponBox">
-        <div style="margin-top:20px;font-size:15px;border-bottom:2px solid #050202"><b>优惠券</b><input id="redeemCoupons" class="btn btn-primary" type="button" onclick="alertx('请您先选择会所!')" value="兑换优惠券" style="padding:1px 10px;margin:2px 30px;"></div>
+        <div style="margin-top:20px;font-size:15px;border-bottom:2px solid #050202"><b>优惠券</b><input id="redeemCoupons" class="btn btn-primary" type="button" value="兑换优惠券" style="padding:1px 10px;margin:2px 30px;"></div>
         <!-- $('input[name=clubCouponId]:checked').val() -->
         <ul class="couponContent">
             <li><label><input type="radio" name="clubCouponId" value="0"><span class="couponDesc">不使用优惠券</span></label></li>
@@ -352,7 +352,8 @@
             <from:hidden path="promotionFullReduction" />
         </td>
         <td style="text-align:right;">优惠券抵扣:</td>
-        <td><span class="couponPrice">0.00</span>元 <from:hidden path="couponAmount"/> </td>
+        <td><span class="couponPrice"><fmt:formatNumber value="${empty order.couponAmount?'0.00':(order.couponAmount)}" pattern="#0.00"/></span>元 
+            <from:hidden path="couponAmount"/></td>
         <td>商品总数</td>
         <td><span class="productCount">${empty order.productCount?'0':(order.productCount)}</span>
             <from:hidden path="productCount" />
@@ -614,6 +615,23 @@
       <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)" />
     </div>
 </form:form>
+    
+<style>
+    
+</style>
+<div id="redeemCouponsPop">
+    <div class="content">
+        <div>
+            <span>兑换优惠券</span>
+            <a href="javascript:;" class="close">X</a>
+        </div>
+        <div class="con">
+            <p>兑换码:<input type="text" max="16" placeholder="请输入16位兑换码"></p>
+            <p><a href="javascript:;" class="sub">立即兑换</a></p>
+        </div>
+    </div>
+</div>
+
 <script type="text/javascript">
         $(document).ready(function () {
             $("#name").focus();

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

@@ -322,6 +322,21 @@ function getUserCoupons(userId) {
 }
 /************************添加会所 end**********************************************************/
 
+// 兑换优惠券
+$("#redeemCoupons").on("click", function(){
+    var userId = $("#inputForm").find("[name*='bpOrderUserinfo.userId']").val();
+    if (userId && userId*1 > 0) {
+        
+        
+        
+        
+        
+                    // 获取用户总优惠券
+                    getUserCoupons(userId);
+    } else {
+        alertx('请您先选择会所!');
+    }
+});
 
 /************************商品相关  start**********************************************************/