截流自动化的商城平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

edit.html 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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" value="{$detail.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}" {if $detail.cid==$vo.id}selected{/if}>{$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" value="{$detail.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" value="{$detail.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">
  43. {if $detail.image}
  44. <div class="upload-image-div">
  45. <img src="{$detail.image}" alt="img">
  46. <input type="hidden" name="image" value="{$detail.image}">
  47. <div class="del-upload-btn">x</div>
  48. </div>
  49. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image"> + 添加图片</a></div>
  50. {else}
  51. <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
  52. {/if}
  53. </div>
  54. <div class="layui-form-mid layui-word-aux">建议尺寸:200*150像素</div>
  55. </div>
  56. </div>
  57. <div class="layui-form-item">
  58. <label class="layui-form-label">帮助状态:</label>
  59. <div class="layui-input-inline">
  60. <input type="radio" name="is_show" value="1" title="显示" {if $detail.is_show==1}checked{/if}>
  61. <input type="radio" name="is_show" value="0" title="隐藏" {if $detail.is_show==0}checked{/if}>
  62. </div>
  63. </div>
  64. <div class="layui-form-item">
  65. <label for="content" class="layui-form-label">帮助内容:</label>
  66. <div class="layui-input-block">
  67. <textarea name="content" id="content" lay-verify="content">{$detail.content|raw}</textarea>
  68. </div>
  69. </div>
  70. <div class="layui-form-item layui-hide">
  71. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  72. </div>
  73. </div>
  74. </div>
  75. <script>
  76. layui.config({
  77. base: "/static/lib/"
  78. }).extend({
  79. likeedit: "likeedit/likeedit"
  80. }).use(["layEditor", "form"], function(){
  81. var form = layui.form;
  82. var layEditor = layui.layEditor;
  83. layEditor.set({
  84. uploadImage: {
  85. url: '{:url("file/lists")}?type=10'
  86. },
  87. })
  88. var ieditor = layEditor.build('content')
  89. form.verify({
  90. content: function(value) {
  91. return layEditor.sync(ieditor);
  92. }
  93. });
  94. like.delUpload();
  95. $(document).on("click", ".add-upload-image", function () {
  96. like.imageUpload({
  97. limit: 1,
  98. field: "image",
  99. that: $(this)
  100. });
  101. });
  102. })
  103. </script>