ソースを参照

待确认订单优惠券

chao 3 年 前
コミット
4a6f741bcd
1 ファイル変更15 行追加8 行削除
  1. 15 8
      src/main/webapp/static/modules/bulkpurchase/orderForm.js

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

@@ -312,13 +312,16 @@ function setSingleSelect(items) {
 
 function getUserCoupons(userId) {
     totalCoupons = [];
-    $.get($("#ctx").val() + "/order/clubCouponList?userId="+userId, function(data) {
-        if (data.code * 1 === 0) {
-            totalCoupons = data.couponList;
-            // 展示可选优惠券列表
-            getShownCouponList();
-        }
-    })
+    // 待确认订单 或新订单 才能修改优惠券
+    if (!orderStatus) {
+        $.get($("#ctx").val() + "/order/clubCouponList?userId="+userId, function(data) {
+            if (data.code * 1 === 0) {
+                totalCoupons = data.couponList;
+                // 展示可选优惠券列表
+                getShownCouponList();
+            }
+        })
+    }
 }
 /************************添加会所 end**********************************************************/
 
@@ -453,6 +456,10 @@ function getShownCouponList(){
 
 // 设置页面显示
 function setPageCoupon() {
+    // 非待确认订单,不设置优惠券显示
+    if (orderStatus) {
+        return;
+    }
     var clubCouponId = $("#clubCouponId").val()*1;
     var html = '<li><label><input type="radio" name="clubCouponId" value="0"><span class="couponDesc none">不使用优惠券</span></label></li>';
     selectCoupons.forEach(function(item){
@@ -474,7 +481,7 @@ function setPageCoupon() {
         html += '</span></label></li>';
     });
     $("#couponBox").find(".couponContent").html(html);
-    if (clubCouponId > 0 && !orderStatus) {
+    if (clubCouponId > 0) {
         $("#couponBox").find("input[name=clubCouponId][checked=checked]").trigger("change");
     }
 }