form.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
  2. <div class="layui-card-body">
  3. <div class="layui-row margin-bottom-15">
  4. <label class="layui-col-xs2 think-form-label">图片</label>
  5. <label class="layui-col-xs8 think-form-group-left">
  6. <input name="img" required value='{$vo.img|default=""}' placeholder="请上传图片" class="layui-input">
  7. </label>
  8. <a class="layui-col-xs2 layui-btn think-form-group-right" data-file="btn" data-field="img" data-type="png,jpg,gif">
  9. <i class="layui-icon layui-icon-upload"></i> 上传图片
  10. </a>
  11. </div>
  12. <div class="layui-row margin-bottom-15">
  13. <label class="layui-col-xs2 think-form-label">标题</label>
  14. <label class="layui-col-xs10">
  15. <input name="title" required value='{$vo.title|default=""}' placeholder="请输入标题" class="layui-input">
  16. </label>
  17. </div>
  18. <div class="layui-row margin-bottom-15">
  19. <label class="layui-col-xs2 think-form-label">跳转地址</label>
  20. <label class="layui-col-xs10">
  21. <input name="jump_address" required value='{$vo.jump_address|default=""}' placeholder="请输入跳转地址" class="layui-input">
  22. </label>
  23. <p class="help-block">跳转地址必须带有http或https</p>
  24. </div>
  25. <div class="layui-form-item">
  26. <label class="layui-col-xs2 think-form-label">状态</label>
  27. <div class="layui-input-block">
  28. <label class="think-radio">
  29. {if !isset($vo.id)}
  30. <input checked type="radio" name="is_show" value="1" lay-ignore> 显示
  31. <input type="radio" name="is_show" value="0" lay-ignore> 隐藏
  32. {else}
  33. {if isset($vo.is_show) && $vo.is_show eq 1}
  34. <input checked type="radio" name="is_show" value="1" lay-ignore> 显示
  35. <input type="radio" name="is_show" value="0" lay-ignore> 隐藏
  36. {else}
  37. <input type="radio" name="is_show" value="1" lay-ignore> 显示
  38. <input checked type="radio" name="is_show" value="0" lay-ignore> 隐藏
  39. {/if}
  40. {/if}
  41. </label>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="hr-line-dashed"></div>
  46. <div class="layui-form-item text-center">
  47. {if isset($vo.id)}<input type='hidden' value="<?php echo date('Y-m-d H:i:s'); ?>" name='update_at'>{else}<input type='hidden' value="<?php echo date('Y-m-d H:i:s'); ?>" name='create_at'>{/if}
  48. {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
  49. <button class="layui-btn" type='submit'>保存数据</button>
  50. <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
  51. </div>
  52. </form>
  53. <script>form.render()</script>