edit.jsp 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <%@ include file="../../common/head.jsp"%>
  9. <script>
  10. $(document).ready(function () {
  11. /* var seApId = '<select id="apId" name="apId" class="form-control" validate="{required:true}" validateMessage="{required:\'请选择对应广告位\'}"> <option value=""> --请选择 -- </option>';
  12. var jsonData = ${jsonAdvPosition};
  13. $.each(jsonData, function(i, item) {
  14. if("${sysAdv.apId }" == item.id ){
  15. seApId += '<option value="'+item.id+'" selected> '+item.apName+' </option>';
  16. }else{
  17. seApId += '<option value="'+item.id+'"> '+item.apName+' </option>';
  18. }
  19. });
  20. seApId += "</select>"
  21. $("#divApId").append(seApId); */
  22. /*
  23. $("#divGoods").hide(); */
  24. //绑定change事件
  25. $(document).on("change", "#advType", function() {
  26. if($("#advType").val() == "goods"){
  27. $("#divGoods").show();
  28. $("#divAdvSrc").hide();
  29. }else{
  30. $("#divGoods").hide();
  31. $("#divAdvSrc").show();
  32. }
  33. });
  34. $("#buttonSubmit").bind("click",function(){
  35. if ($("#editGoodsClassForm").valid()) {
  36. if($("#advType").val() == "goods"){
  37. if($("#goodsId").val() == ""){
  38. layer.alert('请选择商品!');
  39. return;
  40. }
  41. $("#advSrc").val($("#goodsId").val());
  42. }
  43. if($("#advPic").val() == ""){
  44. layer.alert('请上传图片!');
  45. return;
  46. }
  47. $("#editGoodsClassForm").submit();
  48. }
  49. });
  50. /* if("${sysAdv.advType}" == "goods"){
  51. $("#divGoods").show();
  52. $("#divAdvSrc").hide();
  53. $("#goodsId").val('${sysAdv.advSrc }');
  54. $("#goodsName").val('${goodsName }');
  55. } */
  56. });
  57. <%-- ///选择商品p
  58. function selectGooods_radio(){
  59. var index = parent.layer.open({
  60. type: 2,
  61. area: ['800px', '800px'],
  62. fixed: false, //不固定
  63. resize: true,
  64. maxmin: true,
  65. shade: 0.6,
  66. title:'选择商品',
  67. content: '<%=path%>/case/listGoods.cs'
  68. });
  69. } --%>
  70. </script>
  71. <cs:initFile />
  72. </head>
  73. <body>
  74. <div class="wrapper wrapper-content">
  75. <div class="row">
  76. <div class="col-sm-12">
  77. <cs:form_validate formId="editGoodsClassForm" />
  78. <form class="form-horizontal" action="edit.cs"
  79. id="editGoodsClassForm" method="POST" enctype="multipart/form-data">
  80. <!-- <div class="form-group">
  81. <label class="col-sm-3 control-label">对应广告位:</label>
  82. <div class="col-sm-6" id="divApId"></div>
  83. </div> -->
  84. <div class="form-group">
  85. <label class="col-sm-3 control-label">标题:</label>
  86. <div class="col-sm-6">
  87. <input id="id" name="id" value="${sysAdv.id }" class="form-control"
  88. type="hidden"> <input id="advTitle" name="advTitle"
  89. class="form-control" value="${sysAdv.advTitle }"
  90. validate="{required:true}"
  91. validateMessage="{required:'请输入标题'}">
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <label class="col-sm-3 control-label">图片:</label>
  96. <div class="col-sm-6">
  97. <cs:file name="advPic" url="${sysAdv.advPic}" type="130" num="1"></cs:file>
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-sm-3 control-label">权重:</label>
  102. <div class="col-sm-6">
  103. <input id="advSort" name="advSort" value="${sysAdv.advSort }" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" placeholder="请输入数字,正排序" class="form-control"
  104. validate="{required:true,maxlength:10}"
  105. validateMessage="{required:'请输入权重',maxlength:'请输入小于10位的数字'}">
  106. </div>
  107. </div>
  108. <!-- 广告链接类型 关键字搜索-keyword 商品-goods 链接-link-->
  109. <div class="form-group">
  110. <label class="col-sm-3 control-label">链接类型:</label>
  111. <div class="col-sm-6">
  112. <select id="advType" name="advType" class="form-control">
  113. <!-- validate="{required:true}" validateMessage="{required:'请选择广告链接类型'}" -->
  114. <option value="">--请选择 --</option>
  115. <%-- <option value="keyword"
  116. <c:if test="${sysAdv.advType == 'keyword'}">selected</c:if>>
  117. 关键字搜索</option>
  118. <option value="goods"
  119. <c:if test="${sysAdv.advType == 'goods'}">selected</c:if>>
  120. 商品</option> --%>
  121. <option value="link"
  122. <c:if test="${sysAdv.advType == 'link'}">selected</c:if>>
  123. 链接</option>
  124. <option value=""
  125. <c:if test="${empty sysAdv.advType}">selected</c:if>>无链接</option>
  126. </select>
  127. </div>
  128. </div>
  129. <div class="form-group" id="divAdvSrc">
  130. <label class="col-sm-3 control-label">链接地址:</label>
  131. <div class="col-sm-6">
  132. <input id="advSrc" name="advSrc" class="form-control"
  133. value="${sysAdv.advSrc }">
  134. <!-- validate="{required:true}" validateMessage="{required:'请输入链接地址,不能重复'}" -->
  135. </div>
  136. </div>
  137. <!-- <div class="form-group" id="divGoods">
  138. <label class="col-sm-3 control-label">商品:</label>
  139. <div class="col-sm-6">
  140. <div class="input-group">
  141. <input type="hidden" class="form-control" value="" id="goodsId"
  142. placeholder="" name="goodsId"> <input type="text"
  143. class="form-control" value="" id="goodsName" placeholder=""
  144. readonly name="goodsName"> <span
  145. class="input-group-btn">
  146. <button onclick="selectGooods_radio()" type="button"
  147. class="btn btn-primary">选择商品</button>
  148. </span>
  149. </div>
  150. </div>
  151. </div> -->
  152. <%-- <div class="form-group">
  153. <label class="col-sm-3 control-label">排序:</label>
  154. <div class="col-sm-6">
  155. <input id="slideSort" name="slideSort" class="form-control"
  156. value="${sysAdv.slideSort }">
  157. </div>
  158. </div> --%>
  159. <div class="form-group">
  160. <div class="col-sm-4 col-sm-offset-3 pull-left">
  161. <button class="btn btn-default btn-dlg-close">取消</button>
  162. <button class="btn btn-primary" id="buttonSubmit" type="button">提交</button>
  163. </div>
  164. </div>
  165. </form>
  166. </div>
  167. </div>
  168. </div>
  169. </body>
  170. </html>