|
@@ -86,7 +86,7 @@
|
|
|
<div class="formControls col-2">
|
|
|
<input id="couponLimitHours" type="text" name="couponLimitHours" id="couponLimitHours" placeholder="" value="${cType.couponLimitHours }" class="input-text" style="width:90%"></div>
|
|
|
</div>
|
|
|
- <%--<div class="row cl">
|
|
|
+ <div class="row cl">
|
|
|
|
|
|
<label class="form-label col-2"><span class="c-red">*</span>优惠券截止时间:</label>
|
|
|
<div class="formControls col-4">
|
|
@@ -94,7 +94,7 @@
|
|
|
readonly name="couponEndTime" id=couponEndTime datatype="*" nullmsg="请输入截止时间!" style="width:90%"
|
|
|
value="<fmt:formatDate value='${cType.couponEndDate }' pattern='YYYY-MM-dd HH:MM:ss'/>">
|
|
|
</div>
|
|
|
- </div>--%>
|
|
|
+ </div>
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-3"><strong>【优惠券领取条件】</strong></label>
|
|
|
</div>
|
|
@@ -121,11 +121,22 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>消费总金额:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <input id="couponConsumeEnough" name="couponConsumeEnough" type="text" class="input-text" value="${cType.couponConsumeEnough / 100}" placeholder="消费总金额要求(满足条件才能领券)">
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>消费总金额:</label>
|
|
|
+ <div class="formControls col-2">
|
|
|
+ <input id="couponConsumeEnough" name="couponConsumeEnough" type="text" class="input-text" value="${cType.couponConsumeEnough / 100}" placeholder="消费总金额要求(满足条件才能领券)">
|
|
|
+ </div>
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>是否限制来源:</label>
|
|
|
+ <div class="formControls col-2">
|
|
|
+ 是:<input name="couponIsSource" type="radio" <c:if test="${cType.couponIsSource == 1 }">checked</c:if> value="1" onclick="checkSource();">
|
|
|
+ 否:<input name="couponIsSource" type="radio" <c:if test="${cType.couponIsSource == 2 }">checked</c:if> value="2" onclick="checkSource();">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>限制来源:</label>
|
|
|
+ <div class="formControls col-2">
|
|
|
+ <input id="couponSourceName" name="couponSourceName" type="text" class="input-text" style="width:90%" value="${cType.couponSourceName}" placeholder="限制来源" <c:if test="${cType.couponIsSource == 2 }">disabled="disabled"</c:if>>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-
|
|
|
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-3"><strong>【其他】</strong></label>
|
|
@@ -182,6 +193,17 @@ $(function(){
|
|
|
}
|
|
|
}); */
|
|
|
});
|
|
|
+
|
|
|
+function checkSource() {
|
|
|
+ var val=$('input:radio[name="couponIsSource"]:checked').val();
|
|
|
+ if (val == 1) {
|
|
|
+ $('#couponSourceName').attr('disabled',false);
|
|
|
+ } else {
|
|
|
+ $('#couponSourceName').val("");
|
|
|
+ $('#couponSourceName').attr('disabled',true);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function checkForm(){
|
|
|
//名称验证
|
|
|
if(!commonTypeJdg('couponName',null,null,true)){
|
|
@@ -222,10 +244,10 @@ function checkForm(){
|
|
|
return false;
|
|
|
}
|
|
|
//截止时间验证
|
|
|
- /*if(!commonTypeJdg('couponEndTime',null,null,true)){
|
|
|
+ if(!commonTypeJdg('couponEndTime',null,null,true)){
|
|
|
layer.msg("截止时间不能为空",{icon: 2,time:2000});
|
|
|
return false;
|
|
|
- }*/
|
|
|
+ }
|
|
|
//有效天数验证
|
|
|
if(!commonTypeJdg('couponGetDays','pInteger',null,true)){
|
|
|
layer.msg("有效天数不能为空!且只能是数字",{icon: 2,time:2000});
|
|
@@ -236,6 +258,13 @@ function checkForm(){
|
|
|
layer.msg("领券后有效时长不能为空!且只能是数字",{icon: 2,time:2000});
|
|
|
return false;
|
|
|
}
|
|
|
+ var val=$('input:radio[name="couponIsSource"]:checked').val();
|
|
|
+ if (val == 1) {
|
|
|
+ if(!commonTypeJdg('couponSourceName',null,null,true)){
|
|
|
+ layer.msg("优惠券限制来源不能为空",{icon: 2,time:2000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//减免额不能为空乘100 取整
|
|
|
var couponReduce = $("#couponReduce").val();
|