zhijiezhao 3 years ago
parent
commit
bfb486f02a
1 changed files with 17 additions and 28 deletions
  1. 17 28
      src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp

+ 17 - 28
src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp

@@ -291,7 +291,7 @@
         <div class="control-group">
             <input class="btn" id="del" style="width: 50px" onclick="batchDeletion()" value="删除"/>&nbsp;&nbsp;&nbsp;&nbsp;
             <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
-            <input class="btn btn-primary" style="width: 50px" onclick="showSelect()" value="添加"/>
+            <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct()" value="添加"/>
             <br><br>
             <table id="contentTable" class="table table-striped table-bordered table-condensed" hidden="hidden">
                 <thead>
@@ -461,7 +461,7 @@
                     for (var i = 0; i < items.length; i++) {
                         console.log(items[i]);
                         imageList.push(items[i]);
-                        $('#contentTableProduct').show();
+                        $('#contentTable').show();
                         $("#del").removeAttr("disabled");
                         batchSaveSort();
                     };
@@ -545,7 +545,7 @@
             html += appendProductOrderHead(item, index);
             productIds += "," + item.productId;
         });
-        $("#hotSearchProduct").html(html);
+        $("#hotSearch").html(html);
     }
 
     function changeSort(index, sortThis) {
@@ -698,36 +698,21 @@
         }
     }
 
-    //点击添加
-    function showSelect() {
-        var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=" + productIds;
+    function showSelect(couponId) {
+        if (couponId == null){
+            alertx("暂未生成兑换码");
+            return false;
+        }
+        var url = "${ctx}/coupon/cmCoupon/redemptionCode?couponId=" + couponId;
         var title = '';
-        title = "选择商品";
+        title = "查看兑换码";
         top.$.jBox("iframe:" + url, {
             iframeScrolling: 'yes',
-            width: $(top.document).width() - 400,
-            height: $(top.document).height() - 160,
+            width: $(top.document).width() - 750,
+            height: $(top.document).height() - 300,
             persistent: true,
             title: title,
-            buttons: {"确定": '1', "取消": '-1'},
-            submit: function (v, h, f) {
-                //确定
-                var $jboxFrame = top.$('#jbox-iframe');
-                var $mainFrame = top.$('#mainFrame');
-                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
-                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
-                    console.log(items);
-                    console.log(items[0]);
-                    for (var i = 0; i < items.length; i++) {
-                        console.log(items[i]);
-                        imageList.push(items[i]);
-                        $('#contentTable').show();
-                        $("#del").removeAttr("disabled");
-                        batchSaveSort();
-                    };
-                }
-                return true;
-            }
+            buttons: {"确定": '1'}
         });
     }
 
@@ -922,21 +907,25 @@
             $("#couponCategory").show();
             $("#couponClub").hide();
             $("#couponShop").hide();
+            $(".productData").hide();
         } else if (couponType == 2) {
             $("#eventVoucher").hide();
             $("#couponCategory").hide();
             $("#couponClub").show();
             $("#couponShop").hide();
+            $(".productData").hide();
         } else if (couponType == 3) {
             $("#eventVoucher").hide();
             $("#couponCategory").hide();
             $("#couponClub").hide();
             $("#couponShop").show();
+            $(".productData").hide();
         } else {
             $("#eventVoucher").hide();
             $("#couponCategory").hide();
             $("#couponClub").hide();
             $("#couponShop").hide();
+            $(".productData").hide();
         }
     }