截流自动化的商城平台
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.

add.html 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {layout name="layout2" /}
  2. <link href="__PUBLIC__/static/lib/layui/layeditor/layedit.css" rel="stylesheet"/>
  3. <script src="__PUBLIC__/static/lib/layui/layeditor/index.js"></script>
  4. <script src="__PUBLIC__/static/lib/layui/layeditor/ace/ace.js"></script>
  5. <style>
  6. .layui-form-item .layui-input-inline { width: 340px; }
  7. </style>
  8. <div class="layui-card layui-form" style="box-shadow:none;">
  9. <div class="layui-card-body">
  10. <div class="layui-form-item">
  11. <label for="title" class="layui-form-label"><span style="color:red;">*</span>帮助标题:</label>
  12. <div class="layui-input-inline">
  13. <input type="text" name="title" id="title" lay-verType="tips" lay-verify="required" autocomplete="off" class="layui-input">
  14. </div>
  15. </div>
  16. <div class="layui-form-item">
  17. <label for="cid" class="layui-form-label"><span style="color:red;">*</span>帮助分类:</label>
  18. <div class="layui-input-inline">
  19. <select name="cid" id="cid" lay-verType="tips" lay-verify="required">
  20. <option value="">全部</option>
  21. {volist name="category" id="vo"}
  22. <option value="{$vo.id}">{$vo.name}</option>
  23. {/volist}
  24. </select>
  25. </div>
  26. </div>
  27. <div class="layui-form-item">
  28. <label for="intro" class="layui-form-label">帮助简介:</label>
  29. <div class="layui-input-inline">
  30. <input type="text" name="intro" id="intro" autocomplete="off" class="layui-input">
  31. </div>
  32. </div>
  33. <div class="layui-form-item">
  34. <label for="sort" class="layui-form-label">帮助排序:</label>
  35. <div class="layui-input-inline">
  36. <input type="text" name="sort" id="sort" autocomplete="off" class="layui-input">
  37. </div>
  38. </div>
  39. <div class="layui-form-item">
  40. <label class="layui-form-label">封面图:</label>
  41. <div class="layui-input-block">
  42. <div class="like-upload-image" switch-tab="0" lay-verType="tips">
  43. <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
  44. </div>
  45. <div class="layui-form-mid layui-word-aux">建议尺寸:200*150像素</div>
  46. </div>
  47. </div>
  48. <div class="layui-form-item">
  49. <label class="layui-form-label">帮助状态:</label>
  50. <div class="layui-input-inline">
  51. <input type="radio" name="is_show" value="1" title="显示">
  52. <input type="radio" name="is_show" value="0" title="隐藏" checked>
  53. </div>
  54. </div>
  55. <div class="layui-form-item">
  56. <label for="content" class="layui-form-label">帮助内容:</label>
  57. <div class="layui-input-block">
  58. <textarea name="content" id="content" lay-verify="content"></textarea>
  59. </div>
  60. </div>
  61. <div class="layui-form-item layui-hide">
  62. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  63. </div>
  64. </div>
  65. </div>
  66. <script>
  67. layui.config({
  68. base: "/static/lib/"
  69. }).extend({
  70. likeedit: "likeedit/likeedit"
  71. }).use(["layEditor", "form"], function(){
  72. var form = layui.form;
  73. var layEditor = layui.layEditor;
  74. layEditor.set({
  75. uploadImage: {
  76. url: '{:url("file/lists")}?type=10'
  77. },
  78. })
  79. var ieditor = layEditor.build('content')
  80. form.verify({
  81. content: function(value) {
  82. return layEditor.sync(ieditor);
  83. }
  84. });
  85. like.delUpload();
  86. $(document).on("click", ".add-upload-image", function () {
  87. like.imageUpload({
  88. limit: 1,
  89. field: "image",
  90. that: $(this)
  91. });
  92. });
  93. })
  94. </script>