截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {layout name="layout2" /}
  2. <style>
  3. .layui-form-label {
  4. color: #6a6f6c;
  5. width: 140px;
  6. }
  7. .layui-input-block{
  8. margin-left:170px;
  9. }
  10. .reqRed::before {
  11. content: '*';
  12. color: red;
  13. }
  14. </style>
  15. <div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
  16. <input type="hidden" name="id" value="{$detail.id}" />
  17. <div class="layui-form-item">
  18. <label class="layui-form-label reqRed">分类名称:</label>
  19. <div class="layui-input-inline">
  20. <input type="text" name="name" value="{$detail.name}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
  21. </div>
  22. </div>
  23. <div class="layui-form-item">
  24. <label class="layui-form-label reqRed">上级分类:</label>
  25. <div class="layui-input-inline">
  26. <select name="pid" lay-verify="required" placeholder="请选择" lay-filter="search_pid">
  27. <option value="0" data-level="1">顶级分类</option>
  28. {foreach $category_list as $item => $val}
  29. <option value="{$item}" data-level="{$val.level}" {if $detail.pid == $item}selected{/if}>{$val.name}</option>
  30. {/foreach}
  31. </select>
  32. </div>
  33. </div>
  34. <div class="layui-form-item {if $detail.pid !=0}layui-hide{/if}" id="bg_image">
  35. <label class="layui-form-label">首页分类背景图:</label>
  36. <div class="layui-input-inline">
  37. <div class="like-upload-image">
  38. {if $detail.bg_image}
  39. <div class="upload-image-div">
  40. <img src="{$detail.bg_image}" alt="img">
  41. <input type="hidden" name="bg_image" value="{$detail.bg_image}">
  42. <div class="del-upload-btn">x</div>
  43. </div>
  44. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="bgimage"> + 添加图片</a></div>
  45. {else}
  46. <div class="upload-image-elem"><a class="add-upload-image" id="bgimage"> + 添加图片</a></div>
  47. {/if}
  48. </div>
  49. </div>
  50. </div>
  51. <div class="layui-form-item">
  52. <label class="layui-form-label"></label>
  53. <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片。顶级类可以设置首页分类背景图</span>
  54. </div>
  55. <div class="layui-form-item">
  56. <label class="layui-form-label">分类图标:</label>
  57. <div class="layui-input-inline">
  58. <div class="like-upload-image">
  59. {if $detail.image}
  60. <div class="upload-image-div">
  61. <img src="{$detail.image}" alt="img">
  62. <input type="hidden" name="image" value="{$detail.image}">
  63. <div class="del-upload-btn">x</div>
  64. </div>
  65. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="image"> + 添加图片</a></div>
  66. {else}
  67. <div class="upload-image-elem"><a class="add-upload-image" id="image"> + 添加图片</a></div>
  68. {/if}
  69. </div>
  70. </div>
  71. </div>
  72. <div class="layui-form-item">
  73. <label class="layui-form-label"></label>
  74. <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</span>
  75. </div>
  76. <div class="layui-form-item">
  77. <label class="layui-form-label">排序:</label>
  78. <div class="layui-input-inline">
  79. <input type="number" name="sort" value="{$detail.sort}" class="layui-input">
  80. </div>
  81. </div>
  82. <div class="layui-form-item">
  83. <label class="layui-form-label"></label>
  84. <span style="color: #a3a3a3;font-size: 9px">排序值必须为整数;数值越小,越靠前</span>
  85. </div>
  86. <div class="layui-form-item">
  87. <label class="layui-form-label">显示状态:</label>
  88. <div class="layui-input-inline">
  89. <input type="radio" name="is_show" value="1" title="显示" {if $detail.is_show==1}checked{/if} />
  90. <input type="radio" name="is_show" value="0" title="不显示" {if $detail.is_show==0}checked{/if}>
  91. </div>
  92. </div>
  93. <div class="layui-form-item">
  94. <label class="layui-form-label">分类描述:</label>
  95. <div class="layui-input-inline">
  96. <textarea name="remark" autocomplete="off" class="layui-textarea">{$detail.remark}</textarea>
  97. </div>
  98. </div>
  99. <div class="layui-form-item layui-hide">
  100. <input type="button" lay-submit lay-filter="edit-goods_category-submit" id="edit-goods_category-submit" value="确认">
  101. </div>
  102. </div>
  103. <script>
  104. layui.config({
  105. version:"{$front_version}",
  106. base: '/static/lib' //静态资源所在路径
  107. }).use(['form'], function(){
  108. var $ = layui.$
  109. ,form = layui.form;
  110. //监听上级分类选择
  111. form.on('select(search_pid)', function(data){
  112. if(data.value != 0) {
  113. // 只有顶级类才可以设置首页分类背景图,,其它级别分类隐藏上传设置
  114. $('#bg_image').addClass('layui-hide');
  115. }else{
  116. $('#bg_image').removeClass('layui-hide');
  117. }
  118. });
  119. // 图片上传
  120. like.delUpload();
  121. // 分类图标
  122. $(document).on("click", "#image", function () {
  123. like.imageUpload({
  124. limit: 1,
  125. field: "image",
  126. that: $(this)
  127. });
  128. })
  129. // 首页分类背景图
  130. $(document).on("click", "#bgimage", function () {
  131. like.imageUpload({
  132. limit: 1,
  133. field: "bg_image",
  134. that: $(this)
  135. });
  136. })
  137. })
  138. </script>