zhijiezhao 3 years ago
parent
commit
4b86776081

+ 3 - 0
src/main/java/com/caimei/modules/coupon/web/CmCouponController.java

@@ -139,6 +139,9 @@ public class CmCouponController extends BaseController {
         if ("1".equals(cmCoupon.getCouponsMode())) {
             return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/codeCouponList";
         }
+        if(null!=cmCoupon.getMoneyCouponFlag()&&1==(cmCoupon.getMoneyCouponFlag())){
+            return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?moneyCouponFlag=1&&couponType=5";
+        }
         return "redirect:" + Global.getAdminPath() + "/coupon/cmCoupon/list?couponType=" + cmCoupon.getCouponType();
     }
 

+ 25 - 6
src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp

@@ -698,17 +698,36 @@
         }
     }
 
-    function showSelect(couponId) {
-        var url = "${ctx}/coupon/cmCoupon/redemptionCode?couponId=" + couponId;
+    //点击添加
+    function showSelect() {
+        var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=" + productIds;
         var title = '';
-        title = "查看兑换码";
+        title = "选择商品";
         top.$.jBox("iframe:" + url, {
             iframeScrolling: 'yes',
-            width: $(top.document).width() - 750,
-            height: $(top.document).height() - 300,
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
             persistent: true,
             title: title,
-            buttons: {"确定": '1'}
+            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;
+            }
         });
     }
 

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/coupon/cmMoneyCouponList.jsp

@@ -127,7 +127,7 @@
 <%--					<c:if test="${cmCoupon.status ne 2}">--%>
 <%--						<a href="${ctx}/coupon/cmCoupon/close?id=${cmCoupon.id}" onclick="return confirmx('确定关闭该活动吗?', this.href)">关闭</a>--%>
 <%--					</c:if>--%>
-					<a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}" onclick="return confirmx('确定删除该活动吗?', this.href)">删除</a>
+					<a href="${ctx}/coupon/cmCoupon/delete?id=${cmCoupon.id}&moneyCouponFlag=1" onclick="return confirmx('确定删除该优惠券吗?', this.href)">删除</a>
 					<a href="${ctx}/coupon/cmCouponClub/list?couponId=${cmCoupon.id}&couponType=0">领取用户</a>
 				</td>
 			</tr>