|
@@ -5,16 +5,132 @@
|
|
|
<head>
|
|
|
<title>优惠券管理</title>
|
|
|
<meta name="decorator" content="default"/>
|
|
|
- <style>
|
|
|
- .coupon-wrap {
|
|
|
- border: 1px solid #aaa;
|
|
|
- padding: 20px 20px 0;
|
|
|
- margin-bottom: 20px;
|
|
|
- }
|
|
|
- .couponType {
|
|
|
- margin-right: 15px;
|
|
|
+<style>
|
|
|
+ .coupon-wrap {
|
|
|
+ border: 1px solid #aaa;
|
|
|
+ padding: 20px 20px 0;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ .couponType {
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<script type="text/javascript">
|
|
|
+ $(document).ready(function () {
|
|
|
+ var dateList = [];
|
|
|
+ if (${not empty useDateList}) {
|
|
|
+ <c:forEach items="${useDateList}" var="date" varStatus="index">
|
|
|
+ dateList.push("${date}");
|
|
|
+ </c:forEach>
|
|
|
}
|
|
|
- </style>
|
|
|
+ $("#inputForm").validate({
|
|
|
+ submitHandler: function (form) {
|
|
|
+ if (imageList1.length > 0) {
|
|
|
+ var productInfo1 = JSON.stringify(imageList1);
|
|
|
+ $('#productInfo1').val(productInfo1);
|
|
|
+ }
|
|
|
+ if (imageList2.length > 0) {
|
|
|
+ var productInfo2 = JSON.stringify(imageList2);
|
|
|
+ $('#productInfo2').val(productInfo2);
|
|
|
+ }
|
|
|
+ if (imageList3.length > 0) {
|
|
|
+ var productInfo3 = JSON.stringify(imageList3);
|
|
|
+ $('#productInfo3').val(productInfo3);
|
|
|
+ }
|
|
|
+ if (imageList4.length > 0) {
|
|
|
+ var productInfo4 = JSON.stringify(imageList4);
|
|
|
+ $('#productInfo4').val(productInfo4);
|
|
|
+ }
|
|
|
+ var couponType1 = $("#couponType1").val();
|
|
|
+ var shopId1 = $("#shopId1").val();
|
|
|
+ if (couponType1 == 3) {
|
|
|
+ if (shopId1 == "" || shopId1 == null) {
|
|
|
+ alert("店铺券供应商不能为空 !");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var month = $("#month").val();
|
|
|
+ // 判断月份 ...
|
|
|
+ if (month == null || month == "") {
|
|
|
+ alert("请选择生效时间! ");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var vipId = $("#id").val();
|
|
|
+ if (!vipId && dateList.indexOf(month)>=0){
|
|
|
+ alert("已存在该月优惠券,请修改月份!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount1 = $("#couponAmount1").val() * 1;
|
|
|
+ var touchPrice1 = $("#touchPrice1").val() * 1;
|
|
|
+ if (couponAmount1 == "") {
|
|
|
+ alertx("【优惠券1】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice1 == "") {
|
|
|
+ alertx("【优惠券1】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount1 >= touchPrice1) {
|
|
|
+ alertx("【优惠券1】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount2 = $("#couponAmount2").val() * 1;
|
|
|
+ var touchPrice2 = $("#touchPrice2").val() * 1;
|
|
|
+ if (couponAmount2 == "") {
|
|
|
+ alertx("【优惠券2】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice2 == "") {
|
|
|
+ alertx("【优惠券2】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount2 >= touchPrice2) {
|
|
|
+ alertx("【优惠券2】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount3 = $("#couponAmount3").val() * 1;
|
|
|
+ var touchPrice3 = $("#touchPrice3").val() * 1;
|
|
|
+ if (couponAmount3 == "") {
|
|
|
+ alertx("【优惠券3】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice3 == "") {
|
|
|
+ alertx("【优惠券3】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount3 >= touchPrice3) {
|
|
|
+ alertx("【优惠券3】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var couponAmount4 = $("#couponAmount4").val() * 1;
|
|
|
+ var touchPrice4 = $("#touchPrice4").val() * 1;
|
|
|
+ if (couponAmount4 == "") {
|
|
|
+ alertx("【优惠券4】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (touchPrice4 == "") {
|
|
|
+ alertx("【优惠券4】优惠条件不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (couponAmount4 >= touchPrice4) {
|
|
|
+ alertx("【优惠券4】优惠券金额必须小于优惠条件金额");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function (error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<ul class="nav nav-tabs">
|
|
@@ -865,109 +981,6 @@
|
|
|
obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
}
|
|
|
|
|
|
- $(document).ready(function () {
|
|
|
- $("#inputForm").validate({
|
|
|
- submitHandler: function (form) {
|
|
|
- if (imageList1.length > 0) {
|
|
|
- var productInfo1 = JSON.stringify(imageList1);
|
|
|
- $('#productInfo1').val(productInfo1);
|
|
|
- }
|
|
|
- if (imageList2.length > 0) {
|
|
|
- var productInfo2 = JSON.stringify(imageList2);
|
|
|
- $('#productInfo2').val(productInfo2);
|
|
|
- }
|
|
|
- if (imageList3.length > 0) {
|
|
|
- var productInfo3 = JSON.stringify(imageList3);
|
|
|
- $('#productInfo3').val(productInfo3);
|
|
|
- }
|
|
|
- if (imageList4.length > 0) {
|
|
|
- var productInfo4 = JSON.stringify(imageList4);
|
|
|
- $('#productInfo4').val(productInfo4);
|
|
|
- }
|
|
|
- var couponType1 = $("#couponType1").val();
|
|
|
- var shopId1 = $("#shopId1").val();
|
|
|
- if (couponType1 == 3) {
|
|
|
- if (shopId1 == "" || shopId1 == null) {
|
|
|
- alert("店铺券供应商不能为空 !");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- var month = $("#month").val();
|
|
|
- // 判断月份 ...
|
|
|
- if (month == null || month == "") {
|
|
|
- alert("请选择生效时间! ");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount1 = $("#couponAmount1").val() * 1;
|
|
|
- var touchPrice1 = $("#touchPrice1").val() * 1;
|
|
|
- if (couponAmount1 == "") {
|
|
|
- alertx("【优惠券1】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice1 == "") {
|
|
|
- alertx("【优惠券1】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount1 >= touchPrice1) {
|
|
|
- alertx("【优惠券1】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount2 = $("#couponAmount2").val() * 1;
|
|
|
- var touchPrice2 = $("#touchPrice2").val() * 1;
|
|
|
- if (couponAmount2 == "") {
|
|
|
- alertx("【优惠券2】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice2 == "") {
|
|
|
- alertx("【优惠券2】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount2 >= touchPrice2) {
|
|
|
- alertx("【优惠券2】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount3 = $("#couponAmount3").val() * 1;
|
|
|
- var touchPrice3 = $("#touchPrice3").val() * 1;
|
|
|
- if (couponAmount3 == "") {
|
|
|
- alertx("【优惠券3】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice3 == "") {
|
|
|
- alertx("【优惠券3】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount3 >= touchPrice3) {
|
|
|
- alertx("【优惠券3】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- var couponAmount4 = $("#couponAmount4").val() * 1;
|
|
|
- var touchPrice4 = $("#touchPrice4").val() * 1;
|
|
|
- if (couponAmount4 == "") {
|
|
|
- alertx("【优惠券4】优惠券金额不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (touchPrice4 == "") {
|
|
|
- alertx("【优惠券4】优惠条件不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (couponAmount4 >= touchPrice4) {
|
|
|
- alertx("【优惠券4】优惠券金额必须小于优惠条件金额");
|
|
|
- return false;
|
|
|
- }
|
|
|
- loading('正在提交,请稍等...');
|
|
|
- form.submit();
|
|
|
- },
|
|
|
- errorContainer: "#messageBox",
|
|
|
- errorPlacement: function (error, element) {
|
|
|
- $("#messageBox").text("输入有误,请先更正。");
|
|
|
- if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
|
|
|
- error.appendTo(element.parent().parent());
|
|
|
- } else {
|
|
|
- error.insertAfter(element);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|