|
@@ -11,1309 +11,987 @@
|
|
|
padding: 20px 20px 0;
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-
|
|
|
.couponType {
|
|
|
margin-right: 15px;
|
|
|
}
|
|
|
</style>
|
|
|
- <script type="text/javascript">
|
|
|
- $(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>
|
|
|
</head>
|
|
|
<body>
|
|
|
<ul class="nav nav-tabs">
|
|
|
<li class="active"><a href="${ctx}/vip/cmCoupon/">超级会员专属优惠券</a></li>
|
|
|
- <li class="active"><a href="${ctx}/vip/cmCoupon/form">${not empty cmCoupon.id?'编辑':'添加'}</a>
|
|
|
+ <li class="active"><a href="${ctx}/vip/cmCoupon/form?id=${cmVipCoupon.id}">${not empty cmVipCoupon.id?'编辑':'添加'}</a>
|
|
|
</li>
|
|
|
-</ul>
|
|
|
-<br/>
|
|
|
-
|
|
|
-<form:form id="inputForm" modelAttribute="svipcouponForm"
|
|
|
- action="${ctx}/vip/cmCoupon/save?couponId1=${svipcouponForm.couponId1}" method="post"
|
|
|
- class="form-horizontal">
|
|
|
-<sys:message content="${message}"/>
|
|
|
-<div class="control-group">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠月份:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:input path="month" type="text" maxlength="20" class="input-medium Wdate" value="${useTime}"
|
|
|
- onclick="WdatePicker({dateFmt:'yyyy-MM',isShowClear:false});"/>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-
|
|
|
-<div class="coupon-wrap" id="couponWrap1">
|
|
|
+</ul><br>
|
|
|
+<form:form id="inputForm" modelAttribute="svipcouponForm" action="${ctx}/vip/cmCoupon/save?couponId1=${svipcouponForm.couponId1}" method="post" class="form-horizontal">
|
|
|
+ <sys:message content="${message}"/>
|
|
|
+ <form:hidden path="id" value="${cmVipCoupon.id}"/>
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label"><font color="red">*</font><b>优惠券1:</b></label>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠月份:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="couponType1" class="couponType" label="请选择" value="99"
|
|
|
- checked="true"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType1" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType1" class="couponType" label="品类券" value="1"
|
|
|
- onclick="cType(1)"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType1" class="couponType" label="店铺券" value="3"
|
|
|
- onclick="cType(1)"></form:radiobutton>
|
|
|
+ <form:input path="month" type="text" maxlength="20" class="input-medium Wdate" value="${useTime}"
|
|
|
+ onclick="WdatePicker({dateFmt:'yyyy-MM',isShowClear:false});"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <form:hidden path="couponId1" id="couponId1"/>
|
|
|
- <div class="control-group coupon-line l0" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
- <div class="controls">
|
|
|
- <a href="javascript:void(0);" onclick="showSelectShop(1)" id="chooseShop1">请选择供应商</a>
|
|
|
- <form:hidden path="shopId1"/>
|
|
|
- <table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>机构名称</th>
|
|
|
- <th>机构简称</th>
|
|
|
- <th>联系人</th>
|
|
|
- <th>手机号</th>
|
|
|
- <th>操作</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody class="hotSearchShop"></tbody>
|
|
|
- </table>
|
|
|
+ <div class="coupon-wrap" id="couponWrap1">
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label"><font color="red">*</font><b>优惠券1:</b></label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="couponType1" class="couponType" label="请选择" value="" checked="true"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType1" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType1" class="couponType" label="品类券" value="1" onclick="cType(1)"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType1" class="couponType" label="店铺券" value="3" onclick="cType(1)"></form:radiobutton>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="control-group coupon-line l1" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:input path="couponAmount1" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
+ <form:hidden path="couponId1" id="couponId1"/>
|
|
|
+ <div class="control-group coupon-line l0" ${svipcouponForm.couponType1 ne '3' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <a href="javascript:void(0);" onclick="showSelectShop(1)" id="chooseShop1">请选择供应商</a>
|
|
|
+ <form:hidden path="shopId1"/>
|
|
|
+ <table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchShop"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l2" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
- <div class="controls"> 订单商品总额满
|
|
|
- <form:input path="touchPrice1" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
+ <div class="control-group coupon-line l1" ${empty svipcouponForm.couponId1 ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:input path="couponAmount1" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l3" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="categoryType1" value="1" label="产品"
|
|
|
- checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
- <form:radiobutton path="categoryType1" value="2" label="仪器"/>
|
|
|
+ <div class="control-group coupon-line l2" ${empty svipcouponForm.couponId1 ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
+ <div class="controls"> 订单商品总额满
|
|
|
+ <form:input path="touchPrice1" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l4" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="productType1" value="1" label="全商城商品" onclick="productShow(value,1)"
|
|
|
- checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
- <form:radiobutton path="productType1" value="2" label="指定商品" onclick="productShow(value,1)"/>
|
|
|
+ <div class="control-group coupon-line l3" ${svipcouponForm.couponType1 ne '1' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="categoryType1" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType1" value="2" label="仪器"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group coupon-line l4" ${svipcouponForm.couponType1 ne '0' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="productType1" value="1" label="全商城商品" onclick="productShow(value,1)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType1" value="2" label="指定商品" onclick="productShow(value,1)"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="productData1" hidden="hidden">
|
|
|
+ <form:hidden path="productInfo1" id="productInfo1"/>
|
|
|
+ <div class="control-group">
|
|
|
+ <input class="btn del" style="width: 50px" onclick="batchDeletion(1)" value="删除"/>
|
|
|
+ <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(1)" value="添加"/>
|
|
|
+ <br><br>
|
|
|
+ <table class="contentTableProduct table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchProduct"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="productData1" hidden="hidden">
|
|
|
- <form:hidden path="productInfo1" id="productInfo1"/>
|
|
|
- <%-- <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="pcBanner1" 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="appletsBanner1" 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="coupon-wrap" id="couponWrap2">
|
|
|
<div class="control-group">
|
|
|
- <input
|
|
|
- class="btn" class="del" style="width: 50px" onclick="batchDeletion(1)" value="删除"/>
|
|
|
- <%-- <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort(1)" value="一键排序"/> --%>
|
|
|
- <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(1)" value="添加"/>
|
|
|
- <br><br>
|
|
|
- <table class="contentTableProduct 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 class="hotSearchProduct"></tbody>
|
|
|
- </table>
|
|
|
+ <label class="control-label"><font color="red">*</font><b>优惠券2:</b></label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="couponType2" class="couponType" label="请选择" value="" checked="true"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType2" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType2" class="couponType" label="品类券" value="1" onclick="cType(2)"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType2" class="couponType" label="店铺券" value="3" onclick="cType(2)"></form:radiobutton>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
-</div>
|
|
|
-<div class="coupon-wrap" id="couponWrap2">
|
|
|
- <div class="control-group">
|
|
|
- <label class="control-label"><font color="red">*</font><b>优惠券2:</b></label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="couponType2" class="couponType" label="请选择" value="99"
|
|
|
- checked="true"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType2" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType2" class="couponType" label="品类券" value="1"
|
|
|
- onclick="cType(2)"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType2" class="couponType" label="店铺券" value="3"
|
|
|
- onclick="cType(2)"></form:radiobutton>
|
|
|
+ <form:hidden path="couponId2" id="couponId2"/>
|
|
|
+ <div class="control-group coupon-line l0" ${svipcouponForm.couponType2 ne '3' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <a href="javascript:void(0);" onclick="showSelectShop(2)" id="chooseShop2">请选择供应商</a>
|
|
|
+ <form:hidden path="shopId2"/>
|
|
|
+ <table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchShop"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <form:hidden path="couponId2" id="couponId2"/>
|
|
|
- <div class="control-group coupon-line l0" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
- <div class="controls">
|
|
|
- <a href="javascript:void(0);" onclick="showSelectShop(2)" id="chooseShop2">请选择供应商</a>
|
|
|
- <form:hidden path="shopId2"/>
|
|
|
- <table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>机构名称</th>
|
|
|
- <th>机构简称</th>
|
|
|
- <th>联系人</th>
|
|
|
- <th>手机号</th>
|
|
|
- <th>操作</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody class="hotSearchShop"></tbody>
|
|
|
- </table>
|
|
|
+ <div class="control-group coupon-line l1" ${empty svipcouponForm.couponId2 ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:input path="couponAmount2" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l1" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:input path="couponAmount2" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
+ <div class="control-group coupon-line l2" ${empty svipcouponForm.couponId2 ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
+ <div class="controls"> 订单商品总额满
|
|
|
+ <form:input path="touchPrice2" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l2" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
- <div class="controls"> 订单商品总额满
|
|
|
- <form:input path="touchPrice2" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
+ <div class="control-group coupon-line l3" ${svipcouponForm.couponType2 ne '1' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="categoryType2" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType2" value="2" label="仪器"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l3" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="categoryType2" value="1" label="产品"
|
|
|
- checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
- <form:radiobutton path="categoryType2" value="2" label="仪器"/>
|
|
|
+ <div class="control-group coupon-line l4" ${svipcouponForm.couponType2 ne '0' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="productType2" value="1" label="全商城商品" onclick="productShow(value,2)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType2" value="2" label="指定商品" onclick="productShow(value,2)"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l4" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="productType2" value="1" label="全商城商品" onclick="productShow(value,2)"
|
|
|
- checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
- <form:radiobutton path="productType2" value="2" label="指定商品" onclick="productShow(value,2)"/>
|
|
|
+ <div class="productData2" hidden="hidden">
|
|
|
+ <form:hidden path="productInfo2" id="productInfo2"/>
|
|
|
+ <div class="control-group">
|
|
|
+ <input class="btn del" style="width: 50px" onclick="batchDeletion(2)" value="删除"/>
|
|
|
+ <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(2)" value="添加"/>
|
|
|
+ <br><br>
|
|
|
+ <table class="contentTableProduct table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchProduct"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="productData2" hidden="hidden">
|
|
|
- <form:hidden path="productInfo2" id="productInfo2"/>
|
|
|
- <%-- <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="pcBanner2" 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="appletsBanner2" 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="coupon-wrap" id="couponWrap3">
|
|
|
<div class="control-group">
|
|
|
- <input
|
|
|
- class="btn" class="del" style="width: 50px" onclick="batchDeletion(2)" value="删除"/>
|
|
|
- <%-- <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort(2)" value="一键排序"/> --%>
|
|
|
- <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(2)" value="添加"/>
|
|
|
- <br><br>
|
|
|
- <table class="contentTableProduct 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 class="hotSearchProduct"></tbody>
|
|
|
- </table>
|
|
|
+ <label class="control-label"><font color="red">*</font><b>优惠券3:</b></label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="couponType3" class="couponType" label="请选择" value="" checked="true"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType3" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType3" class="couponType" label="品类券" value="1" onclick="cType(3)"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType3" class="couponType" label="店铺券" value="3" onclick="cType(3)"></form:radiobutton>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
-</div>
|
|
|
-<div class="coupon-wrap" id="couponWrap3">
|
|
|
- <div class="control-group">
|
|
|
- <label class="control-label"><font color="red">*</font><b>优惠券3:</b></label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="couponType3" class="couponType" label="请选择" value="99"
|
|
|
- checked="true"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType3" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType3" class="couponType" label="品类券" value="1"
|
|
|
- onclick="cType(3)"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType3" class="couponType" label="店铺券" value="3"
|
|
|
- onclick="cType(3)"></form:radiobutton>
|
|
|
+ <form:hidden path="couponId3" id="couponId3"/>
|
|
|
+ <div class="control-group coupon-line l0" ${svipcouponForm.couponType3 ne '3' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <a href="javascript:void(0);" onclick="showSelectShop(3)" id="chooseShop3">请选择供应商</a>
|
|
|
+ <form:hidden path="shopId3"/>
|
|
|
+ <table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchShop"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <form:hidden path="couponId3" id="couponId3"/>
|
|
|
- <div class="control-group coupon-line l0" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
- <div class="controls">
|
|
|
- <a href="javascript:void(0);" onclick="showSelectShop(3)" id="chooseShop3">请选择供应商</a>
|
|
|
- <form:hidden path="shopId3"/>
|
|
|
- <table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>机构名称</th>
|
|
|
- <th>机构简称</th>
|
|
|
- <th>联系人</th>
|
|
|
- <th>手机号</th>
|
|
|
- <th>操作</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody class="hotSearchShop"></tbody>
|
|
|
- </table>
|
|
|
+ <div class="control-group coupon-line l1" ${empty svipcouponForm.couponId3 ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:input path="couponAmount3" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l1" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:input path="couponAmount3" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
+ <div class="control-group coupon-line l2" ${empty svipcouponForm.couponId3 ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
+ <div class="controls"> 订单商品总额满
|
|
|
+ <form:input path="touchPrice3" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l2" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
- <div class="controls"> 订单商品总额满
|
|
|
- <form:input path="touchPrice3" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
+ <div class="control-group coupon-line l3" ${svipcouponForm.couponType3 ne '1' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="categoryType3" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType3" value="2" label="仪器"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l3" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="categoryType3" value="1" label="产品"
|
|
|
- checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
- <form:radiobutton path="categoryType3" value="2" label="仪器"/>
|
|
|
+ <div class="control-group coupon-line l4" ${svipcouponForm.couponType3 ne '0' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="productType3" value="1" label="全商城商品" onclick="productShow(value,3)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType3" value="2" label="指定商品" onclick="productShow(value,3)"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="control-group coupon-line l4" style="display:none">
|
|
|
- <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="productType3" value="1" label="全商城商品" onclick="productShow(value,3)"
|
|
|
- checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
- <form:radiobutton path="productType3" value="2" label="指定商品" onclick="productShow(value,3)"/>
|
|
|
+ <div class="productData3" hidden="hidden">
|
|
|
+ <form:hidden path="productInfo3" id="productInfo3"/>
|
|
|
+ <div class="control-group">
|
|
|
+ <input class="btn del" style="width: 50px" onclick="batchDeletion(3)" value="删除"/>
|
|
|
+ <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(3)" value="添加"/>
|
|
|
+ <br><br>
|
|
|
+ <table class="contentTableProduct table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchProduct"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="productData3" hidden="hidden">
|
|
|
- <form:hidden path="productInfo3" id="productInfo3"/>
|
|
|
- <%-- <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="pcBanner3" 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="appletsBanner3" 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="coupon-wrap" id="couponWrap4">
|
|
|
<div class="control-group">
|
|
|
- <input
|
|
|
- class="btn" class="del" style="width: 50px" onclick="batchDeletion(3)" value="删除"/>
|
|
|
- <%-- <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort(3)" value="一键排序"/> --%>
|
|
|
- <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(3)" value="添加"/>
|
|
|
- <br><br>
|
|
|
- <table class="contentTableProduct 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 class="hotSearchProduct"></tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-</div>
|
|
|
-<div class="coupon-wrap" id="couponWrap4">
|
|
|
- <div class="control-group">
|
|
|
- <label class="control-label"><font color="red">*</font><b>优惠券4:</b></label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="couponType4" class="couponType" label="请选择" value="99"
|
|
|
- checked="true"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType4" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType4" class="couponType" label="品类券" value="1"
|
|
|
- onclick="cType(4)"></form:radiobutton>
|
|
|
- <form:radiobutton path="couponType4" class="couponType" label="店铺券" value="3"
|
|
|
- onclick="cType(4)"></form:radiobutton>
|
|
|
+ <label class="control-label"><font color="red">*</font><b>优惠券4:</b></label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="couponType4" class="couponType" label="请选择" value="" checked="true"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType4" class="couponType" label="活动券" value="0"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType4" class="couponType" label="品类券" value="1" onclick="cType(1)"></form:radiobutton>
|
|
|
+ <form:radiobutton path="couponType4" class="couponType" label="店铺券" value="3" onclick="cType(1)"></form:radiobutton>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <form:hidden path="couponId4" id="couponId4"/>
|
|
|
- <c:if test="${svipcouponForm.shopId4 != null}">
|
|
|
- <div class="control-group coupon-line l0">
|
|
|
- </c:if>
|
|
|
- <div class="control-group coupon-line l0" style="display:none">
|
|
|
+ <form:hidden path="couponId1" id="couponId4"/>
|
|
|
+ <div class="control-group coupon-line l0" ${svipcouponForm.couponType4 ne '3' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>供应商:</label>
|
|
|
<div class="controls">
|
|
|
<a href="javascript:void(0);" onclick="showSelectShop(4)" id="chooseShop4">请选择供应商</a>
|
|
|
<form:hidden path="shopId4"/>
|
|
|
<table class="contentTableShop table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>机构名称</th>
|
|
|
- <th>机构简称</th>
|
|
|
- <th>联系人</th>
|
|
|
- <th>手机号</th>
|
|
|
- <th>操作</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
+ <thead></thead>
|
|
|
<tbody class="hotSearchShop"></tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="control-group coupon-line l1" style="display:none">
|
|
|
+ <div class="control-group coupon-line l1" ${empty svipcouponForm.couponId4 ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠券金额:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="couponAmount4" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="control-group coupon-line l2" style="display:none">
|
|
|
+ <div class="control-group coupon-line l2" ${empty svipcouponForm.couponId4 ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠条件:</label>
|
|
|
- <div class="controls"> 订单商品总额满
|
|
|
+ <div class="controls"> 订单商品总额满
|
|
|
<form:input path="touchPrice4" htmlEscape="false" maxlength="20" class="input-medium required"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <c:if test="${svipcouponForm.categoryType4 eq '1' or svipcouponForm.categoryType4 eq '2'}">
|
|
|
- <div class="control-group coupon-line l3" style="display:none">
|
|
|
- </c:if>
|
|
|
- <div class="control-group coupon-line l3" style="display:none">
|
|
|
+ <div class="control-group coupon-line l3" ${svipcouponForm.couponType4 ne '1' ? 'style="display:none"':''}>
|
|
|
<label class="control-label"><font color="red">*</font>优惠品类:</label>
|
|
|
<div class="controls">
|
|
|
- <form:radiobutton path="categoryType4" value="1" label="产品"
|
|
|
- checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
+ <form:radiobutton path="categoryType4" value="1" label="产品" checked="${empty cmCoupon.categoryType ? true:false}"/>
|
|
|
<form:radiobutton path="categoryType4" value="2" label="仪器"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <c:if test="${svipcouponForm.couponType4 eq '0'}">
|
|
|
- <div class="control-group coupon-line l4">
|
|
|
- </c:if>
|
|
|
- <c:if test="${svipcouponForm.couponType4 ne '0'}">
|
|
|
- <div class="control-group coupon-line l4" style="display:none">
|
|
|
- </c:if>
|
|
|
-
|
|
|
- <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
- <div class="controls">
|
|
|
- <form:radiobutton path="productType4" value="1" label="全商城商品" onclick="productShow(value,4)"
|
|
|
- checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
- <form:radiobutton path="productType4" value="2" label="指定商品" onclick="productShow(value,4)"/>
|
|
|
- </div>
|
|
|
+ <div class="control-group coupon-line l4" ${svipcouponForm.couponType4 ne '0' ? 'style="display:none"':''}>
|
|
|
+ <label class="control-label"><font color="red">*</font>优惠商品:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <form:radiobutton path="productType4" value="1" label="全商城商品" onclick="productShow(value,4)" checked="${empty cmCoupon.productType ? true:false}"/>
|
|
|
+ <form:radiobutton path="productType4" value="2" label="指定商品" onclick="productShow(value,4)"/>
|
|
|
</div>
|
|
|
-
|
|
|
- <c:if test="${svipcouponForm.productType4 eq '2'}">
|
|
|
- <div class="productData4">
|
|
|
- </c:if>
|
|
|
- <c:if test="${svipcouponForm.couponType4 eq '99'}">
|
|
|
- <div class="productData4" hidden="hidden">
|
|
|
- </c:if>
|
|
|
+ </div>
|
|
|
+ <div class="productData4" hidden="hidden">
|
|
|
<form:hidden path="productInfo4" id="productInfo4"/>
|
|
|
- <%-- <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="pcBanner4" 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="appletsBanner4" 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" class="del" style="width: 50px" onclick="batchDeletion(4)" value="删除"/>
|
|
|
- <%-- <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort(4)" value="一键排序"/> --%>
|
|
|
- <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(4)" value="添加"/>
|
|
|
- <br><br>
|
|
|
- <table class="contentTableProduct 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 class="hotSearchProduct"></tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-actions">
|
|
|
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
|
- <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
|
|
+ <div class="control-group">
|
|
|
+ <input class="btn del" style="width: 50px" onclick="batchDeletion(4)" value="删除"/>
|
|
|
+ <input class="btn btn-primary" style="width: 50px" onclick="showSelectProduct(4)" value="添加"/>
|
|
|
+ <br><br>
|
|
|
+ <table class="contentTableProduct table table-striped table-bordered table-condensed" hidden="hidden">
|
|
|
+ <thead></thead>
|
|
|
+ <tbody class="hotSearchProduct"></tbody>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
- </form:form>
|
|
|
-
|
|
|
-
|
|
|
- <script>
|
|
|
-
|
|
|
-
|
|
|
- $("body").on("change", ".couponType", function () {
|
|
|
- var value = $(this).parent().find('input.couponType:checked').val() * 1;
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line").hide();
|
|
|
- if (0 === value) {
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l1").show();
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l2").show();
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l4").show();
|
|
|
- } else if (1 === value) {
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l1").show();
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l2").show();
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l3").show();
|
|
|
- } else if (3 === value) {
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l0").show();
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l1").show();
|
|
|
- $(this).parents(".coupon-wrap").find(".coupon-line.l2").show();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- function cType(id) {
|
|
|
- $("#couponWrap" + id).find(".productData" + id).hide();
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-actions">
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
|
+ <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
|
|
+ </div>
|
|
|
+</form:form>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+ $(document).ready(function () {
|
|
|
+ $("#inputForm").validate({
|
|
|
+ submitHandler: function (form) {
|
|
|
+ if (imageList1.length > 0) {
|
|
|
+ var productInfo1 = JSON.stringify(imageList1);
|
|
|
+ $('#productInfo1').val(productInfo1);
|
|
|
}
|
|
|
-
|
|
|
- // 点击添加供应商
|
|
|
- function showSelectShop(id) {
|
|
|
- var url = "${ctx}/coupon/cmCoupon/toAddShop";
|
|
|
- var title = '';
|
|
|
- title = "选择供应商";
|
|
|
- top.$.jBox("iframe:" + url, {
|
|
|
- iframeScrolling: 'yes',
|
|
|
- width: $(top.document).width() - 400,
|
|
|
- height: $(top.document).height() - 160,
|
|
|
- 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);
|
|
|
- appendShopOrderHead(items, id);
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
+ if (imageList2.length > 0) {
|
|
|
+ var productInfo2 = JSON.stringify(imageList2);
|
|
|
+ $('#productInfo2').val(productInfo2);
|
|
|
}
|
|
|
-
|
|
|
- $(function () {
|
|
|
- //店铺券供应商回显
|
|
|
- if (${not empty svipcouponForm.shop1}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop1.shopID}",
|
|
|
- "name": "${svipcouponForm.shop1.name}",
|
|
|
- "sname": "${svipcouponForm.shop1.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop1.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop1.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 1);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $(function () {
|
|
|
- //店铺券供应商回显
|
|
|
- if (${not empty svipcouponForm.shop2}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop2.shopID}",
|
|
|
- "name": "${svipcouponForm.shop2.name}",
|
|
|
- "sname": "${svipcouponForm.shop2.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop2.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop2.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 2);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- $(function () {
|
|
|
- //店铺券供应商回显
|
|
|
- if (${not empty svipcouponForm.shop3}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop3.shopID}",
|
|
|
- "name": "${svipcouponForm.shop3.name}",
|
|
|
- "sname": "${svipcouponForm.shop3.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop3.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop3.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 3);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $(function () {
|
|
|
- //店铺券供应商回显
|
|
|
- if (${not empty svipcouponForm.shop4}) {
|
|
|
- var shop = {
|
|
|
- "shopId": "${svipcouponForm.shop4.shopID}",
|
|
|
- "name": "${svipcouponForm.shop4.name}",
|
|
|
- "sname": "${svipcouponForm.shop4.sname}",
|
|
|
- "linkMan": "${svipcouponForm.shop4.linkMan}",
|
|
|
- "contractMobile": "${svipcouponForm.shop4.contractMobile}"
|
|
|
- }
|
|
|
- appendShopOrderHead(shop, 4);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- // $(function () {
|
|
|
- // $('.upload-content-image .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
|
- // $('.upload-content-image .conList .btn:nth-of-type(2)').after('<img class="cancel-upload-image" src="/static/images/close-btn1.png">').remove();
|
|
|
- // $('.upload-content-image .conList').find('.cancel-upload-image').hide();
|
|
|
- // var observeEleImage = document.getElementsByClassName('upload-content-image')[0];
|
|
|
- // var observeEleImage1 = document.getElementsByClassName('upload-content-image')[1];
|
|
|
- // var MutationObserverImage = window.MutationObserver || window.WebKitMutationObserver;
|
|
|
- // var MutationObserverConfigImage = {
|
|
|
- // childList: true,
|
|
|
- // subtree: true,
|
|
|
- // characterData: true
|
|
|
- // };
|
|
|
- // var observerImage = new MutationObserverImage(function (mutations) {
|
|
|
- // $.each(mutations, function (index, item) {
|
|
|
- // if (item.type === 'childList') {
|
|
|
- // // 在创建新的 element 时调用
|
|
|
- // var target = $(item.target),
|
|
|
- // thisWrapper = target.closest('.conList'),
|
|
|
- // nextEle = thisWrapper.next();
|
|
|
- // thisWrapper.find('li').css('z-index', 99);
|
|
|
- // thisWrapper.find('.cancel-upload-image').show();
|
|
|
- // if (nextEle.hasClass('hide-pic-image')) {
|
|
|
- // nextEle.removeClass('hide-pic-image');
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // });
|
|
|
- // observerImage.observe(observeEleImage, MutationObserverConfigImage);
|
|
|
- // observerImage.observe(observeEleImage1, MutationObserverConfigImage);
|
|
|
- //
|
|
|
- // $('body').on('click', '.upload-content-image li', function () {
|
|
|
- // var index = $(this).closest('.conList').index() + 1,
|
|
|
- // str = 'remarkImage' + index + 'FinderOpen';
|
|
|
- // eval(str + '()');
|
|
|
- // });
|
|
|
- // $('body').on('click', '.cancel-upload-image', function () {
|
|
|
- // var wrapper = $(this).closest('.conList');
|
|
|
- // wrapper.find('li').css('z-index', '-1');
|
|
|
- // wrapper.find('input').val('');
|
|
|
- // $(this).hide();
|
|
|
- // wrapper.removeClass("hide-pic-image");
|
|
|
- // wrapper.parent().append(wrapper.clone());
|
|
|
- // wrapper.remove();
|
|
|
- // $(".conList").each(function (i, ele) {
|
|
|
- // if ($(ele).find("input.input-xlarge").val()) {
|
|
|
- // $(ele).next().removeClass("hide-pic-image")
|
|
|
- // }
|
|
|
- // })
|
|
|
- // });
|
|
|
- // $(window).on("load", function () {
|
|
|
- // setTimeout(function () {
|
|
|
- // var input = $("#pcBanner");
|
|
|
- // if (input.val()) {
|
|
|
- // input.next().find("li").css("z-index", "99");
|
|
|
- // input.parents(".conList").find(".cancel-upload-image").show();
|
|
|
- // input.parents(".conList").next().removeClass("hide-pic-image")
|
|
|
- // }
|
|
|
- // input = $("#appletsBanner");
|
|
|
- // if (input.val()) {
|
|
|
- // input.next().find("li").css("z-index", "99");
|
|
|
- // input.parents(".conList").find(".cancel-upload-image").show();
|
|
|
- // input.parents(".conList").next().removeClass("hide-pic-image")
|
|
|
- // }
|
|
|
- // }, 500);
|
|
|
- // });
|
|
|
- // // productShow(value,id)
|
|
|
- // });
|
|
|
-
|
|
|
-
|
|
|
- function productShow(value, id) {
|
|
|
- if (value == 2) {
|
|
|
- $(".productData" + id).show();
|
|
|
- } else {
|
|
|
- $(".productData" + id).hide();
|
|
|
- }
|
|
|
+ if (imageList3.length > 0) {
|
|
|
+ var productInfo3 = JSON.stringify(imageList3);
|
|
|
+ $('#productInfo3').val(productInfo3);
|
|
|
}
|
|
|
-
|
|
|
- var productIds1 = '';
|
|
|
- var productIds2 = '';
|
|
|
- var productIds3 = '';
|
|
|
- var productIds4 = '';
|
|
|
- var imageList1 = [];
|
|
|
- var imageList2 = [];
|
|
|
- var imageList3 = [];
|
|
|
- var imageList4 = [];
|
|
|
-
|
|
|
- //点击添加
|
|
|
- function showSelectProduct(id) {
|
|
|
- var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=";
|
|
|
- if (id * 1 === 1) {
|
|
|
- url += productIds1;
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- url += productIds2;
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- url += productIds3;
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- url += productIds4;
|
|
|
- }
|
|
|
- var title = '';
|
|
|
- title = "选择商品";
|
|
|
- top.$.jBox("iframe:" + url, {
|
|
|
- iframeScrolling: 'yes',
|
|
|
- width: $(top.document).width() - 400,
|
|
|
- height: $(top.document).height() - 160,
|
|
|
- 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]);
|
|
|
- if (id * 1 === 1) {
|
|
|
- imageList1.push(items[i]);
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- imageList2.push(items[i]);
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- imageList3.push(items[i]);
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- imageList4.push(items[i]);
|
|
|
- }
|
|
|
- $("#couponWrap" + id).find(".contentTableProduct").show();
|
|
|
- $(".del").removeAttr("disabled");
|
|
|
- batchSaveSort(id);
|
|
|
- }
|
|
|
- ;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
+ if (imageList4.length > 0) {
|
|
|
+ var productInfo4 = JSON.stringify(imageList4);
|
|
|
+ $('#productInfo4').val(productInfo4);
|
|
|
}
|
|
|
-
|
|
|
- //产品回显
|
|
|
- $(function () {
|
|
|
- <c:forEach items="${associateList1}" var="associate" varStatus="index">
|
|
|
- imageList1.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
-
|
|
|
- if (imageList1.length > 0) {
|
|
|
- $('#couponWrap1').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(1);
|
|
|
- showSelectProduct(1);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $(function () {
|
|
|
- <c:forEach items="${associateList2}" var="associate" varStatus="index">
|
|
|
- imageList2.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
-
|
|
|
- if (imageList2.length > 0) {
|
|
|
- $('#couponWrap2').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(2);
|
|
|
- showSelectProduct(2);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $(function () {
|
|
|
- <c:forEach items="${associateList3}" var="associate" varStatus="index">
|
|
|
- imageList3.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
-
|
|
|
- if (imageList3.length > 0) {
|
|
|
- $('#couponWrap3').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(3);
|
|
|
- showSelectProduct(3);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $(function () {
|
|
|
- <c:forEach items="${associateList4}" var="associate" varStatus="index">
|
|
|
- imageList4.push({
|
|
|
- id: "${associate.id}",
|
|
|
- productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
- image: "${associate.image}",
|
|
|
- productName: "${associate.productName}",
|
|
|
- shopName: "${associate.shopName}",
|
|
|
- sort: "${associate.sort}",
|
|
|
- pcStatus: "${associate.pcStatus}",
|
|
|
- appletsStatus: "${associate.appletsStatus}",
|
|
|
- addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- });
|
|
|
- </c:forEach>
|
|
|
-
|
|
|
- if (imageList4.length > 0) {
|
|
|
- $('#couponWrap4').find('.contentTableProduct').show();
|
|
|
- batchSaveSort(4);
|
|
|
- showSelectProduct(4);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- //一键排序
|
|
|
- function batchSaveSort(id) {
|
|
|
- if (id * 1 === 1) {
|
|
|
- imageList1.sort(sort);
|
|
|
- insertHtmlProduct(imageList1, id);
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- imageList2.sort(sort);
|
|
|
- insertHtmlProduct(imageList2, id);
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- imageList3.sort(sort);
|
|
|
- insertHtmlProduct(imageList3, id);
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- imageList4.sort(sort);
|
|
|
- insertHtmlProduct(imageList4, id);
|
|
|
+ var couponType1 = $("#couponType1").val();
|
|
|
+ var shopId1 = $("#shopId1").val();
|
|
|
+ if (couponType1 == 3) {
|
|
|
+ if (shopId1 == "" || shopId1 == null) {
|
|
|
+ alert("店铺券供应商不能为空 !");
|
|
|
+ return false;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- //根据sort值 从小到大排序
|
|
|
- function sort(a, b) {
|
|
|
- return a.sort - b.sort;
|
|
|
+ var month = $("#month").val();
|
|
|
+ // 判断月份 ...
|
|
|
+ if (month == null || month == "") {
|
|
|
+ alert("请选择生效时间! ");
|
|
|
+ return false;
|
|
|
}
|
|
|
-
|
|
|
- //相关图片列表数据
|
|
|
- function appendProductOrderHead(data, index, id) {
|
|
|
- var html = '<tr id ="ai' + index + '">' +
|
|
|
- '<td>' +
|
|
|
- '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- data.productName +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- data.shopName +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.pcStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ',' + id + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ',' + id + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.appletsStatus == 1 ? (
|
|
|
- '<font color="green">已启用</font> ' +
|
|
|
- '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ',' + id + ');" >' +
|
|
|
- '停用</a>'
|
|
|
- ) : (
|
|
|
- '<font color="red">已停用</font> ' +
|
|
|
- '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ',' + id + ');">' +
|
|
|
- '启用</a>'
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<input name="sort" style="width:50px;" value="' + data.sort + '" onkeyup="onlynum(this)" onchange="changeSort(' + index + ',this,' + id + ')"></td>' +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- (data.addTime == '' ? (
|
|
|
- '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
|
|
|
- ) : (
|
|
|
- data.addTime
|
|
|
- )) +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<a href="javascript:;" onclick="delect(' + index + ',' + id + ')">删除</a>' +
|
|
|
- '</td>' +
|
|
|
- '</tr>';
|
|
|
- return html;
|
|
|
+ var couponAmount1 = $("#couponAmount1").val() * 1;
|
|
|
+ var touchPrice1 = $("#touchPrice1").val() * 1;
|
|
|
+ if (couponAmount1 == "") {
|
|
|
+ alertx("【优惠券1】优惠券金额不能为空");
|
|
|
+ return false;
|
|
|
}
|
|
|
-
|
|
|
- function insertHtmlProduct(list, id) {
|
|
|
- var html = '';
|
|
|
- tempIds = '';
|
|
|
- if (list && list.length > 0) {
|
|
|
- list.forEach(function (item, index) {
|
|
|
- html += appendProductOrderHead(item, index, id);
|
|
|
- tempIds += "," + item.productId;
|
|
|
- });
|
|
|
- }
|
|
|
- if (id * 1 === 1) {
|
|
|
- productIds1 = tempIds;
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- productIds2 = tempIds;
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- productIds3 = tempIds;
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- productIds4 = tempIds;
|
|
|
- }
|
|
|
- $("#couponWrap" + id).find(".hotSearchProduct").html(html);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".contentTableShop thead").html('<tr><th>机构名称</th><th>机构简称</th><th>联系人</th><th>手机号</th><th>操作</th></tr>');
|
|
|
+ $(".contentTableProduct thead").html('<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>');
|
|
|
+
|
|
|
+ $("body").on("change", ".couponType", function () {
|
|
|
+ var value = $(this).parent().find('input.couponType:checked').val() * 1;
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line").hide();
|
|
|
+ if (0 === value) {
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l1").show();
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l2").show();
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l4").show();
|
|
|
+ } else if (1 === value) {
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l1").show();
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l2").show();
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l3").show();
|
|
|
+ } else if (3 === value) {
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l0").show();
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l1").show();
|
|
|
+ $(this).parents(".coupon-wrap").find(".coupon-line.l2").show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function cType(id) {
|
|
|
+ $("#couponWrap" + id).find(".productData" + id).hide();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点击添加供应商
|
|
|
+ function showSelectShop(id) {
|
|
|
+ var url = "${ctx}/coupon/cmCoupon/toAddShop";
|
|
|
+ var title = '';
|
|
|
+ title = "选择供应商";
|
|
|
+ top.$.jBox("iframe:" + url, {
|
|
|
+ iframeScrolling: 'yes',
|
|
|
+ width: $(top.document).width() - 400,
|
|
|
+ height: $(top.document).height() - 160,
|
|
|
+ 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);
|
|
|
+ appendShopOrderHead(items, id);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ //店铺券供应商回显
|
|
|
+ if (${not empty svipcouponForm.shop1}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop1.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop1.name}",
|
|
|
+ "sname": "${svipcouponForm.shop1.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop1.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop1.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 1);
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.shop2}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop2.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop2.name}",
|
|
|
+ "sname": "${svipcouponForm.shop2.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop2.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop2.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 2);
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.shop3}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop3.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop3.name}",
|
|
|
+ "sname": "${svipcouponForm.shop3.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop3.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop3.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 3);
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.shop4}) {
|
|
|
+ var shop = {
|
|
|
+ "shopId": "${svipcouponForm.shop4.shopID}",
|
|
|
+ "name": "${svipcouponForm.shop4.name}",
|
|
|
+ "sname": "${svipcouponForm.shop4.sname}",
|
|
|
+ "linkMan": "${svipcouponForm.shop4.linkMan}",
|
|
|
+ "contractMobile": "${svipcouponForm.shop4.contractMobile}"
|
|
|
+ }
|
|
|
+ appendShopOrderHead(shop, 4);
|
|
|
+ }
|
|
|
+ //产品回显
|
|
|
+ if (${not empty svipcouponForm.associateList1}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList1}" var="associate" varStatus="index">
|
|
|
+ imageList1.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList1.length > 0) {
|
|
|
+ $('#couponWrap1').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(1);
|
|
|
+ showSelectProduct(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.associateList2}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList2}" var="associate" varStatus="index">
|
|
|
+ imageList2.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList2.length > 0) {
|
|
|
+ $('#couponWrap2').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(2);
|
|
|
+ showSelectProduct(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.associateList3}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList3}" var="associate" varStatus="index">
|
|
|
+ imageList3.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList3.length > 0) {
|
|
|
+ $('#couponWrap3').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(3);
|
|
|
+ showSelectProduct(3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (${not empty svipcouponForm.associateList4}) {
|
|
|
+ <c:forEach items="${svipcouponForm.associateList4}" var="associate" varStatus="index">
|
|
|
+ imageList4.push({
|
|
|
+ id: "${associate.id}",
|
|
|
+ productId: "${empty associate.productId ? "":associate.productId}",
|
|
|
+ image: "${associate.image}",
|
|
|
+ productName: "${associate.productName}",
|
|
|
+ shopName: "${associate.shopName}",
|
|
|
+ sort: "${associate.sort}",
|
|
|
+ pcStatus: "${associate.pcStatus}",
|
|
|
+ appletsStatus: "${associate.appletsStatus}",
|
|
|
+ addTime: "<fmt:formatDate value="${associate.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ });
|
|
|
+ </c:forEach>
|
|
|
+ if (imageList4.length > 0) {
|
|
|
+ $('#couponWrap4').find('.contentTableProduct').show();
|
|
|
+ batchSaveSort(4);
|
|
|
+ showSelectProduct(4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- function changeSort(index, sortThis, id) {
|
|
|
- var sort = sortThis.value;
|
|
|
- if (sort > 0) {
|
|
|
- var image;
|
|
|
+ function productShow(value, id) {
|
|
|
+ if (value == 2) {
|
|
|
+ $(".productData" + id).show();
|
|
|
+ } else {
|
|
|
+ $(".productData" + id).hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var productIds1 = '';
|
|
|
+ var productIds2 = '';
|
|
|
+ var productIds3 = '';
|
|
|
+ var productIds4 = '';
|
|
|
+ var imageList1 = [];
|
|
|
+ var imageList2 = [];
|
|
|
+ var imageList3 = [];
|
|
|
+ var imageList4 = [];
|
|
|
+
|
|
|
+ //点击添加
|
|
|
+ function showSelectProduct(id) {
|
|
|
+ var url = "${ctx}/coupon/cmCoupon/toAddProduct?productIds=";
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ url += productIds1;
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ url += productIds2;
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ url += productIds3;
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ url += productIds4;
|
|
|
+ }
|
|
|
+ var title = '';
|
|
|
+ title = "选择商品";
|
|
|
+ top.$.jBox("iframe:" + url, {
|
|
|
+ iframeScrolling: 'yes',
|
|
|
+ width: $(top.document).width() - 400,
|
|
|
+ height: $(top.document).height() - 160,
|
|
|
+ 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]);
|
|
|
if (id * 1 === 1) {
|
|
|
- image = imageList1[index];
|
|
|
+ imageList1.push(items[i]);
|
|
|
}
|
|
|
if (id * 1 === 2) {
|
|
|
- image = imageList2[index];
|
|
|
+ imageList2.push(items[i]);
|
|
|
}
|
|
|
if (id * 1 === 3) {
|
|
|
- image = imageList3[index];
|
|
|
+ imageList3.push(items[i]);
|
|
|
}
|
|
|
if (id * 1 === 4) {
|
|
|
- image = imageList4[index];
|
|
|
- }
|
|
|
- if (image) {
|
|
|
- image.sort = sort;
|
|
|
+ imageList4.push(items[i]);
|
|
|
}
|
|
|
+ $("#couponWrap" + id).find(".contentTableProduct").show();
|
|
|
+ $(".del").removeAttr("disabled");
|
|
|
+ batchSaveSort(id);
|
|
|
}
|
|
|
+ ;
|
|
|
}
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- function updatePcStatus(status, index, id) {
|
|
|
- var image;
|
|
|
- if (id * 1 === 1) {
|
|
|
- image = imageList1[index];
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- image = imageList2[index];
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- image = imageList3[index];
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- image = imageList4[index];
|
|
|
- }
|
|
|
- if (image) {
|
|
|
- confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
|
|
|
- image.pcStatus = status;
|
|
|
- batchSaveSort(id);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ //一键排序
|
|
|
+ function batchSaveSort(id) {
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ imageList1.sort(sort);
|
|
|
+ insertHtmlProduct(imageList1, id);
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ imageList2.sort(sort);
|
|
|
+ insertHtmlProduct(imageList2, id);
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ imageList3.sort(sort);
|
|
|
+ insertHtmlProduct(imageList3, id);
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ imageList4.sort(sort);
|
|
|
+ insertHtmlProduct(imageList4, id);
|
|
|
+ }
|
|
|
|
|
|
- function updateAppletsStatus(status, index, id) {
|
|
|
- var image;
|
|
|
- if (id * 1 === 1) {
|
|
|
- image = imageList1[index];
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- image = imageList2[index];
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- image = imageList3[index];
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据sort值 从小到大排序
|
|
|
+ function sort(a, b) {
|
|
|
+ return a.sort - b.sort;
|
|
|
+ }
|
|
|
+
|
|
|
+ //相关图片列表数据
|
|
|
+ function appendProductOrderHead(data, index, id) {
|
|
|
+ var html = '<tr id ="ai' + index + '">' +
|
|
|
+ '<td>' +
|
|
|
+ '<input class="check-item" type="checkbox" name="info" value="' + index + '"/>' + (index + 1) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<img src="' + data.image + '" width="60px" border="none" title="启用">' +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ data.productName +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ data.shopName +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ (data.pcStatus == 1 ? (
|
|
|
+ '<font color="green">已启用</font>' +
|
|
|
+ '<a href="javascript:void(0);" onclick="updatePcStatus(0,' + index + ',' + id + ');" >' +
|
|
|
+ '停用</a>'
|
|
|
+ ) : (
|
|
|
+ '<font color="red">已停用</font>' +
|
|
|
+ '<a href="javascript:void(0)" onclick="updatePcStatus(1,' + index + ',' + id + ');">' +
|
|
|
+ '启用</a>'
|
|
|
+ )) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ (data.appletsStatus == 1 ? (
|
|
|
+ '<font color="green">已启用</font>' +
|
|
|
+ '<a href="javascript:void(0);" onclick="updateAppletsStatus(0,' + index + ',' + id + ');" >' +
|
|
|
+ '停用</a>'
|
|
|
+ ) : (
|
|
|
+ '<font color="red">已停用</font>' +
|
|
|
+ '<a href="javascript:void(0)" onclick="updateAppletsStatus(1,' + index + ',' + id + ');">' +
|
|
|
+ '启用</a>'
|
|
|
+ )) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<input name="sort" style="width:50px;" value="' + data.sort + '" onkeyup="onlynum(this)" onchange="changeSort(' + index + ',this,' + id + ')"></td>' +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ (data.addTime == '' ? (
|
|
|
+ '<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd HH:mm:ss"/>'
|
|
|
+ ) : (
|
|
|
+ data.addTime
|
|
|
+ )) +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<a href="javascript:;" onclick="delect(' + index + ',' + id + ')">删除</a>' +
|
|
|
+ '</td>' +
|
|
|
+ '</tr>';
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+
|
|
|
+ function insertHtmlProduct(list, id) {
|
|
|
+ var html = '';
|
|
|
+ tempIds = '';
|
|
|
+ if (list && list.length > 0) {
|
|
|
+ list.forEach(function (item, index) {
|
|
|
+ html += appendProductOrderHead(item, index, id);
|
|
|
+ tempIds += "," + item.productId;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ productIds1 = tempIds;
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ productIds2 = tempIds;
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ productIds3 = tempIds;
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ productIds4 = tempIds;
|
|
|
+ }
|
|
|
+ $("#couponWrap" + id).find(".hotSearchProduct").html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ function changeSort(index, sortThis, id) {
|
|
|
+ var sort = sortThis.value;
|
|
|
+ if (sort > 0) {
|
|
|
+ var image;
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ image = imageList1[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ image = imageList2[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ image = imageList3[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ image = imageList4[index];
|
|
|
+ }
|
|
|
+ if (image) {
|
|
|
+ image.sort = sort;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function updatePcStatus(status, index, id) {
|
|
|
+ var image;
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ image = imageList1[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ image = imageList2[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ image = imageList3[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ image = imageList4[index];
|
|
|
+ }
|
|
|
+ if (image) {
|
|
|
+ confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
|
|
|
+ image.pcStatus = status;
|
|
|
+ batchSaveSort(id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function updateAppletsStatus(status, index, id) {
|
|
|
+ var image;
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ image = imageList1[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ image = imageList2[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ image = imageList3[index];
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ image = imageList4[index];
|
|
|
+ }
|
|
|
+ if (image) {
|
|
|
+ confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
|
|
|
+ image.appletsStatus = status;
|
|
|
+ batchSaveSort(id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ */
|
|
|
+ function batchDeletion(id) {
|
|
|
+ var index = -1;
|
|
|
+ var i = 1;
|
|
|
+ return confirmx("确定删除吗?", function () {
|
|
|
+ $('input[name="info"]:checked').each(function () {
|
|
|
+ var thisIndex = $(this).val();
|
|
|
+ if (index >= 0 && index < thisIndex) {
|
|
|
+ thisIndex = thisIndex - i;
|
|
|
+ i++;
|
|
|
+ } else {
|
|
|
+ index = thisIndex;
|
|
|
+ }
|
|
|
+ var image, tempList;
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ image = imageList1[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds1 = productIds1.replace(image.productId, "");
|
|
|
+ }
|
|
|
+ imageList1.splice(thisIndex, 1);
|
|
|
+ tempList = imageList1;
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ image = imageList2[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds2 = productIds2.replace(image.productId, "");
|
|
|
}
|
|
|
- if (id * 1 === 4) {
|
|
|
- image = imageList4[index];
|
|
|
+ imageList2.splice(thisIndex, 1);
|
|
|
+ tempList = imageList2;
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ image = imageList3[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds3 = productIds3.replace(image.productId, "");
|
|
|
}
|
|
|
- if (image) {
|
|
|
- confirmx(status == 0 ? '确定停用吗?' : '确定启用吗?', function () {
|
|
|
- image.appletsStatus = status;
|
|
|
- batchSaveSort(id);
|
|
|
- });
|
|
|
+ imageList3.splice(thisIndex, 1);
|
|
|
+ tempList = imageList3;
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ image = imageList4[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds4 = productIds4.replace(image.productId, "");
|
|
|
}
|
|
|
+ imageList4.splice(thisIndex, 1);
|
|
|
+ tempList = imageList4;
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除
|
|
|
- */
|
|
|
- function batchDeletion(id) {
|
|
|
- var index = -1;
|
|
|
- var i = 1;
|
|
|
- return confirmx("确定删除吗?", function () {
|
|
|
- $('input[name="info"]:checked').each(function () {
|
|
|
- var thisIndex = $(this).val();
|
|
|
- if (index >= 0 && index < thisIndex) {
|
|
|
- thisIndex = thisIndex - i;
|
|
|
- i++;
|
|
|
- } else {
|
|
|
- index = thisIndex;
|
|
|
- }
|
|
|
- var image, tempList;
|
|
|
- if (id * 1 === 1) {
|
|
|
- image = imageList1[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds1 = productIds1.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList1.splice(thisIndex, 1);
|
|
|
- tempList = imageList1;
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- image = imageList2[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds2 = productIds2.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList2.splice(thisIndex, 1);
|
|
|
- tempList = imageList2;
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- image = imageList3[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds3 = productIds3.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList3.splice(thisIndex, 1);
|
|
|
- tempList = imageList3;
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- image = imageList4[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds4 = productIds4.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList4.splice(thisIndex, 1);
|
|
|
- tempList = imageList4;
|
|
|
- }
|
|
|
- insertHtmlProduct(tempList, id);
|
|
|
- if (tempList.length == 0) {
|
|
|
- $("#couponWrap" + id).find('.contentTableProduct').hide();
|
|
|
- $(".del").attr("disabled", "disabled");
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ insertHtmlProduct(tempList, id);
|
|
|
+ if (tempList.length == 0) {
|
|
|
+ $("#couponWrap" + id).find('.contentTableProduct').hide();
|
|
|
+ $(".del").attr("disabled", "disabled");
|
|
|
}
|
|
|
-
|
|
|
- function appendShopOrderHead(data, id) {
|
|
|
- var html = '<tr>' +
|
|
|
- '<td>' +
|
|
|
- data.name +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- data.sname +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- data.linkMan +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- data.contractMobile +
|
|
|
- '</td>' +
|
|
|
- '<td>' +
|
|
|
- '<a href="javascript:;" onclick="delectShop(' + id + ')">删除</a>' +
|
|
|
- '</td>' +
|
|
|
- '</tr>';
|
|
|
- $("#couponWrap" + id).find(".hotSearchShop").html(html);
|
|
|
- $("#chooseShop" + id).hide();
|
|
|
- $("#couponWrap" + id).find(".contentTableShop").show();
|
|
|
- $("#shopId" + id).val(data.shopId);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function appendShopOrderHead(data, id) {
|
|
|
+ var html = '<tr>' +
|
|
|
+ '<td>' +
|
|
|
+ data.name +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ data.sname +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ data.linkMan +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ data.contractMobile +
|
|
|
+ '</td>' +
|
|
|
+ '<td>' +
|
|
|
+ '<a href="javascript:;" onclick="delectShop(' + id + ')">删除</a>' +
|
|
|
+ '</td>' +
|
|
|
+ '</tr>';
|
|
|
+ $("#couponWrap" + id).find(".hotSearchShop").html(html);
|
|
|
+ $("#chooseShop" + id).hide();
|
|
|
+ $("#couponWrap" + id).find(".contentTableShop").show();
|
|
|
+ $("#shopId" + id).val(data.shopId);
|
|
|
+ }
|
|
|
+
|
|
|
+ function delectShop(id) {
|
|
|
+ return confirmx("确定删除吗?", function () {
|
|
|
+ $("#chooseShop" + id).show();
|
|
|
+ $("#couponWrap" + id).find(".contentTableShop").hide();
|
|
|
+ $("#shopId" + id).val("");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除操作
|
|
|
+ */
|
|
|
+ function delect(index, id) {
|
|
|
+ return confirmx("确定删除吗?", function () {
|
|
|
+ var image;
|
|
|
+ if (id * 1 === 1) {
|
|
|
+ image = imageList1[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds1 = productIds1.replace(image.productId, "");
|
|
|
}
|
|
|
-
|
|
|
- function delectShop(id) {
|
|
|
- return confirmx("确定删除吗?", function () {
|
|
|
- $("#chooseShop" + id).show();
|
|
|
- $("#couponWrap" + id).find(".contentTableShop").hide();
|
|
|
- $("#shopId" + id).val("");
|
|
|
- });
|
|
|
+ imageList1.splice(index, 1);
|
|
|
+ insertHtmlProduct(imageList1, id);
|
|
|
+ if (imageList1.length == 0) {
|
|
|
+ $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
+ $(".del").attr("disabled", "disabled");
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除操作
|
|
|
- */
|
|
|
- function delect(index, id) {
|
|
|
- return confirmx("确定删除吗?", function () {
|
|
|
- var image;
|
|
|
- if (id * 1 === 1) {
|
|
|
- image = imageList1[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds1 = productIds1.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList1.splice(index, 1);
|
|
|
- insertHtmlProduct(imageList1, id);
|
|
|
- if (imageList1.length == 0) {
|
|
|
- $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
- $(".del").attr("disabled", "disabled");
|
|
|
- }
|
|
|
- }
|
|
|
- if (id * 1 === 2) {
|
|
|
- image = imageList2[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds2 = productIds2.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList2.splice(index, 1);
|
|
|
- insertHtmlProduct(imageList2, id);
|
|
|
- if (imageList2.length == 0) {
|
|
|
- $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
- $(".del").attr("disabled", "disabled");
|
|
|
- }
|
|
|
- }
|
|
|
- if (id * 1 === 3) {
|
|
|
- image = imageList3[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds3 = productIds3.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList3.splice(index, 1);
|
|
|
- insertHtmlProduct(imageList3, id);
|
|
|
- if (imageList3.length == 0) {
|
|
|
- $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
- $(".del").attr("disabled", "disabled");
|
|
|
- }
|
|
|
- }
|
|
|
- if (id * 1 === 4) {
|
|
|
- image = imageList4[index];
|
|
|
- if (image.productId != '') {
|
|
|
- productIds4 = productIds4.replace(image.productId, "");
|
|
|
- }
|
|
|
- imageList4.splice(index, 1);
|
|
|
- insertHtmlProduct(imageList4, id);
|
|
|
- if (imageList4.length == 0) {
|
|
|
- $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
- $(".del").attr("disabled", "disabled");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ if (id * 1 === 2) {
|
|
|
+ image = imageList2[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds2 = productIds2.replace(image.productId, "");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- function clickAllSelect(ckb) {
|
|
|
- var isChecked = ckb.checked;
|
|
|
- $(".check-item").attr('checked', isChecked);
|
|
|
+ imageList2.splice(index, 1);
|
|
|
+ insertHtmlProduct(imageList2, id);
|
|
|
+ if (imageList2.length == 0) {
|
|
|
+ $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
+ $(".del").attr("disabled", "disabled");
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * @param obj
|
|
|
- * jquery控制input只能输入数字
|
|
|
- */
|
|
|
- function onlynum(obj) {
|
|
|
- obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
+ }
|
|
|
+ if (id * 1 === 3) {
|
|
|
+ image = imageList3[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds3 = productIds3.replace(image.productId, "");
|
|
|
}
|
|
|
-
|
|
|
- $(document).ready(function () {
|
|
|
- //$("#name").focus();
|
|
|
- $("#inputForm").validate({
|
|
|
- submitHandler: function (form) {
|
|
|
-
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ imageList3.splice(index, 1);
|
|
|
+ insertHtmlProduct(imageList3, id);
|
|
|
+ if (imageList3.length == 0) {
|
|
|
+ $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
+ $(".del").attr("disabled", "disabled");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (id * 1 === 4) {
|
|
|
+ image = imageList4[index];
|
|
|
+ if (image.productId != '') {
|
|
|
+ productIds4 = productIds4.replace(image.productId, "");
|
|
|
+ }
|
|
|
+ imageList4.splice(index, 1);
|
|
|
+ insertHtmlProduct(imageList4, id);
|
|
|
+ if (imageList4.length == 0) {
|
|
|
+ $("#couponWrap" + id).find('#contentTableProduct').hide();
|
|
|
+ $(".del").attr("disabled", "disabled");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function clickAllSelect(ckb) {
|
|
|
+ var isChecked = ckb.checked;
|
|
|
+ $(".check-item").attr('checked', isChecked);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param obj
|
|
|
+ * jquery控制input只能输入数字
|
|
|
+ */
|
|
|
+ function onlynum(obj) {
|
|
|
+ obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
+ }
|
|
|
+
|
|
|
+ $(document).ready(function () {
|
|
|
+ //$("#name").focus();
|
|
|
+ $("#inputForm").validate({
|
|
|
+ submitHandler: function (form) {
|
|
|
+
|
|
|
+ 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>
|
|
|
+</script>
|
|
|
</body>
|
|
|
</html>
|