Parcourir la source

价值优惠券

zhijiezhao il y a 3 ans
Parent
commit
fbae91620d

+ 9 - 0
src/main/java/com/caimei/modules/coupon/entity/CmCoupon.java

@@ -48,6 +48,7 @@ public class CmCoupon extends DataEntity<CmCoupon> {
     private String couponDesc;        //描述
     private String redemptionCode;      //兑换码
     private CmCouponClub couponClub;
+    private Integer moneyCouponType; //价值优惠券属性 1,意向券,2,定向券
     private Integer moneyCouponFlag; //是否是价值优惠券,1是,2不是
     private Double moneyCouponPrice; //价值优惠券购买金额
     private NewCmShop shop;
@@ -80,6 +81,14 @@ public class CmCoupon extends DataEntity<CmCoupon> {
         this.moneyCouponPrice = moneyCouponPrice;
     }
 
+    public Integer getMoneyCouponType() {
+        return moneyCouponType;
+    }
+
+    public void setMoneyCouponType(Integer moneyCouponType) {
+        this.moneyCouponType = moneyCouponType;
+    }
+
     @Length(min = 0, max = 50, message = "活动主题长度必须介于 0 和 50 之间")
     public String getName() {
         return name;

+ 4 - 1
src/main/resources/mappings/modules/coupon/CmCouponMapper.xml

@@ -24,6 +24,7 @@
 		a.couponsMode AS "couponsMode",
 		a.moneyCouponPrice AS "moneyCouponPrice",
 		a.moneyCouponFlag AS "moneyCouponFlag",
+		a.moneyCouponType as "moneyCouponType",
 		a.createDate AS "createDate",
 		a.delFlag AS "delFlag"
 	</sql>
@@ -159,6 +160,7 @@
 			createDate,
 			moneyCouponPrice,
 			moneyCouponFlag,
+			moneyCouponType,
 			delFlag
 		) VALUES (
 			#{name},
@@ -206,7 +208,8 @@
 			appletsBanner = #{appletsBanner},
 			categoryType = #{categoryType},
 			couponsMode = #{couponsMode},
-			moneyCouponPrice = #{moneyCouponPrice}
+			moneyCouponPrice = #{moneyCouponPrice},
+			moneyCouponType = #{moneyCouponType}
 		WHERE id = #{id}
 	</update>
 	

+ 64 - 46
src/main/webapp/WEB-INF/views/modules/coupon/MoneyCouponForm.jsp

@@ -197,6 +197,13 @@
             <input type="number" id="usePeriod" name="usePeriod" value="${cmCoupon.usePeriod}" min="1" required> 天
         </div>
     </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>优惠券属性:</label>
+        <div class="controls">
+            <form:radiobutton path="moneyCouponType" value="1" label="意向券" class="required" onclick="moneyCouponShow()"/>
+            <form:radiobutton path="moneyCouponType" value="2" label="定向券" class="required" onclick="moneyCouponShow()"/>
+        </div>
+    </div>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>优惠券类型:</label>
         <div class="controls">
@@ -210,55 +217,10 @@
         <div class="control-group">
             <label class="control-label"><font color="red">*</font>优惠商品:</label>
             <div class="controls">
-                <form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}"/>
+                <form:radiobutton path="productType" value="1" label="全商城商品" onclick="productShow()" checked ="${empty cmCoupon.productType ? true:false}" />
                 <form:radiobutton path="productType" value="2" label="指定商品" onclick="productShow()"/>
             </div>
         </div>
-        <div class="productData" hidden="hidden">
-            <div class="control-group">
-                <label class="control-label"><font color="red">*</font>网站活动页banner:</label>
-                <div class="controls upload-content-image iconBox">
-                    <div class="conList">
-                        <form:hidden id="pcBanner" path="pcBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                        <sys:ckfinder input="pcBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
-                        <br>
-                    </div>
-                </div>
-            </div>
-            <div class="control-group">
-                <label class="control-label"><font color="red">*</font>小程序活动页banner:</label>
-                <div class="controls upload-content-image iconBox">
-                    <div class="conList">
-                        <form:hidden id="appletsBanner" path="appletsBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                        <sys:ckfinder input="appletsBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
-                        <br>
-                    </div>
-                </div>
-            </div>
-            <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="showSelectProduct()" value="添加"/>
-                <br><br>
-                <table id="contentTableProduct" class="table table-striped table-bordered table-condensed" hidden="hidden">
-                    <thead>
-                    <tr>
-                        <th style="width:20px;"><input class="check-all" type="checkbox" onclick="clickAllSelect(this)"/> 全选
-                        </th>
-                        <th>商品图片</th>
-                        <th>商品名称</th>
-                        <th>供应商</th>
-                        <th>网站状态</th>
-                        <th>小程序状态</th>
-                        <th>排序</th>
-                        <th>添加时间</th>
-                        <th>操作</th>
-                    </tr>
-                    </thead>
-                    <tbody id="hotSearchProduct"></tbody>
-                </table>
-            </div>
-        </div>
     </div>
     <div class="control-group" id="couponCategory" hidden="hidden">
         <label class="control-label"><font color="red">*</font>优惠品类:</label>
@@ -305,6 +267,51 @@
             </table>
         </div>
     </div>
+    <div class="productData" hidden="hidden">
+        <div class="control-group">
+            <label class="control-label"><font color="red">*</font>网站活动页banner:</label>
+            <div class="controls upload-content-image iconBox">
+                <div class="conList">
+                    <form:hidden id="pcBanner" path="pcBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                    <sys:ckfinder input="pcBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                    <br>
+                </div>
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label"><font color="red">*</font>小程序活动页banner:</label>
+            <div class="controls upload-content-image iconBox">
+                <div class="conList">
+                    <form:hidden id="appletsBanner" path="appletsBanner" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+                    <sys:ckfinder input="appletsBanner" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                    <br>
+                </div>
+            </div>
+        </div>
+        <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="添加"/>
+            <br><br>
+            <table id="contentTable" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th style="width:20px;"><input class="check-all" type="checkbox" onclick="clickAllSelect(this)"/> 全选
+                    </th>
+                    <th>商品图片</th>
+                    <th>商品名称</th>
+                    <th>供应商</th>
+                    <th>网站状态</th>
+                    <th>小程序状态</th>
+                    <th>排序</th>
+                    <th>添加时间</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearch"></tbody>
+            </table>
+        </div>
+    </div>
     <div class="form-actions">
         <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
         <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
@@ -907,6 +914,17 @@
             $("#couponShop").hide();
         }
     }
+
+    function moneyCouponShow() {
+        var couponType = $("input[name='moneyCouponType']:checked").val();
+        if (couponType == 1) {
+            // $("#money").show();
+
+        } else {
+            // $("#money").hide();
+
+        }
+    }
 </script>
 </body>
 </html>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -540,6 +540,7 @@
     <tr>
         <td>
             应收金额:<fmt:formatNumber value="${order.payableAmount}" type="currency"/>
+            <br/>
             <span style="color: red">
                 <c:if test="${order.balancePayFee gt 0}">
                     <a href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${order.userID}"