|
@@ -66,6 +66,19 @@
|
|
|
//$("#name").focus();
|
|
|
$("#inputForm").validate({
|
|
|
submitHandler: function(form){
|
|
|
+ var image = $("#image").val();
|
|
|
+ if (image == '') {
|
|
|
+ alertx("请上传轮播图");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var jumpType = $("input[name='jumpType']:checked").val();
|
|
|
+ if (3 == jumpType) {
|
|
|
+ var jumpImage = $("#jumpImage").val();
|
|
|
+ if (jumpImage == '') {
|
|
|
+ alertx("请上传跳转图片");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
loading('正在提交,请稍等...');
|
|
|
form.submit();
|
|
|
},
|
|
@@ -108,9 +121,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label">链接:</label>
|
|
|
+ <label class="control-label">跳转方式:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="link" htmlEscape="false" class="input-xxlarge"/>
|
|
|
+ <input type="radio" name="jumpType" value="1" onchange="changeJumpType()" ${(cmHeheImage.jumpType eq null || cmHeheImage.jumpType eq 1 )? "checked" : ""} />链接:
|
|
|
+ <form:input path="jumpLink" htmlEscape="false" class="input-xxlarge"/>
|
|
|
+ </div>
|
|
|
+ <div class="controls" style="margin-top: 10px">
|
|
|
+ <input type="radio" name="jumpType" value="2" onchange="changeJumpType()" ${cmHeheImage.jumpType eq 2 ? "checked" : ""} />产品:
|
|
|
+ <form:select path="jumpProductId" class="select-ele input-xlarge">
|
|
|
+ <form:option value="" label="请选择"/>
|
|
|
+ <form:options items="${productList}" itemLabel="name" itemValue="productId"
|
|
|
+ htmlEscape="false"/>
|
|
|
+ </form:select>
|
|
|
+ </div>
|
|
|
+ <div class="controls upload-content" id="jumpImageBox">
|
|
|
+ <input type="radio" name="jumpType" value="3" onchange="changeJumpType()" ${cmHeheImage.jumpType eq 3 ? "checked" : ""} />图片:
|
|
|
+ <div class="conList iconBox">
|
|
|
+ <form:hidden id="jumpImage" path="jumpImage" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
|
|
|
+ <sys:ckfinder input="jumpImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ <br>
|
|
|
+ <label style="margin-left: 20px">建议图片分辨率750px*1624px</label>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -140,6 +171,7 @@
|
|
|
$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|
|
|
$('.upload-content .conList').find('.cancel-upload').hide();
|
|
|
var observeEle = document.getElementsByClassName('upload-content')[0];
|
|
|
+ var observeEle1 = document.getElementsByClassName('upload-content')[1];
|
|
|
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
|
var MutationObserverConfig = {
|
|
|
childList: true,
|
|
@@ -162,6 +194,7 @@
|
|
|
})
|
|
|
});
|
|
|
observer.observe(observeEle, MutationObserverConfig);
|
|
|
+ observer.observe(observeEle1, MutationObserverConfig);
|
|
|
|
|
|
$('body').on('click', '.cancel-upload', function () {
|
|
|
var wrapper = $(this).closest('.conList');
|
|
@@ -186,8 +219,17 @@
|
|
|
$(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
}
|
|
|
})
|
|
|
+ $("#jumpImageBox").find("input.input-xlarge").each(function (i, ele) {
|
|
|
+ if ($(ele).val()) {
|
|
|
+ $(ele).next().find("li").css("z-index", "99");
|
|
|
+ $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
+ $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
+ }
|
|
|
+ })
|
|
|
}, 200);
|
|
|
});
|
|
|
+
|
|
|
+ changeJumpType();
|
|
|
});
|
|
|
|
|
|
/**
|
|
@@ -197,6 +239,22 @@
|
|
|
function onlynum(obj) {
|
|
|
obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
}
|
|
|
+
|
|
|
+ function changeJumpType() {
|
|
|
+ var jumpType = $("input[name='jumpType']:checked").val();
|
|
|
+ var jumpLink = $("#jumpLink");
|
|
|
+ var jumpProductId = $("#jumpProductId");
|
|
|
+ if (1 == jumpType) {
|
|
|
+ jumpLink.addClass("required");
|
|
|
+ jumpProductId.removeClass("required");
|
|
|
+ }else if (2 == jumpType) {
|
|
|
+ jumpProductId.addClass("required");
|
|
|
+ jumpLink.removeClass("required");
|
|
|
+ } else {
|
|
|
+ jumpProductId.removeClass("required");
|
|
|
+ jumpLink.removeClass("required");
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|