config.html 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!-- 公告 -->
  2. <form onchange="changeForm($(this),13)">
  3. <input type="hidden" name="model_id" value="13" />
  4. <h2 class="attr-title">公告</h2>
  5. <div class="layui-form-item">
  6. <label class="layui-form-label sm">背景颜色</label>
  7. <div class="layui-input-block">
  8. <div class="color-wrapper">
  9. <input data-js="color" type="text" name="back_color" value="{$config_info.back_color|default=''}" />
  10. </div>
  11. </div>
  12. </div>
  13. <div class="layui-form-item">
  14. <label class="layui-form-label sm">公告图标</label>
  15. <div class="layui-input-block">
  16. <div class="uploader-wrapper">
  17. <div class="uploader-image-wrapper" {if !isset($config_info.notice_image) || !$config_info.notice_image}style="display:none" {/if}>
  18. <img class='uploader-image' src='{$config_info.notice_image|default=""}' />
  19. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  20. </div>
  21. <div class='uploader-content' {if isset($config_info.notice_image) && $config_info.notice_image}style="display:none" {/if}>
  22. <div class="uploader-icon iconfont">&#xe6bf;</div>
  23. <div class="uploader-text">点击上传</div>
  24. <div class="uploader-notice">94×44</div>
  25. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  26. <input type='hidden' name='notice_image' value='{$config_info.notice_image|default=""}'>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="layui-form-item">
  32. <label class="layui-form-label sm">跳转页面</label>
  33. <div class="layui-input-block">
  34. <input type="text" name="notice_link" value="{$config_info.notice_link|default=''}" placeholder="请输入跳转页面" class="layui-input">
  35. </div>
  36. </div>
  37. {if isset($config_info['notice_title']) && !empty($config_info['notice_title'])}
  38. {foreach name='config_info.notice_title' item='item' key='key'}
  39. <div class="model-item"{if $key==0} id="notice_item"{/if}>
  40. <div class="layui-form-item">
  41. <label class="layui-form-label sm">公告文字</label>
  42. <div class="layui-input-block">
  43. <input type="text" name="notice_title[i_{$key}][text]" value="{$item.text|default=''}" placeholder="请输入公告文字" class="layui-input">
  44. </div>
  45. </div>
  46. <div class="layui-form-item">
  47. <label class="layui-form-label sm">跳转页面</label>
  48. <div class="layui-input-block">
  49. <input type="text" name="notice_title[i_{$key}][link]" value="{$item.link|default=''}" placeholder="请输入跳转页面" class="layui-input">
  50. </div>
  51. </div>
  52. </div>
  53. {/foreach}
  54. {else}
  55. <div class="model-item" id="notice_item">
  56. <div class="layui-form-item">
  57. <label class="layui-form-label sm">公告文字</label>
  58. <div class="layui-input-block">
  59. <input type="text" name="notice_title[i_0][text]" value="" placeholder="请输入公告文字" class="layui-input">
  60. </div>
  61. </div>
  62. <div class="layui-form-item">
  63. <label class="layui-form-label sm">跳转页面</label>
  64. <div class="layui-input-block">
  65. <input type="text" name="notice_title[i_0][link]" value="" placeholder="请输入跳转页面" class="layui-input">
  66. </div>
  67. </div>
  68. </div>
  69. {/if}
  70. <div class="model-btn" onclick="addModel($(this),13)">
  71. <span>+</span>
  72. <span>添加一条公告</span>
  73. </div>
  74. </form>
  75. <script>
  76. if(typeof(loadConfig13)=='undefined'){
  77. function loadConfig13(obj){
  78. obj.find('[data-js="color"]').colorpicker({showOn: 'both'});
  79. }
  80. }
  81. $(function(){
  82. if(typeof(index['i_13'])=='undefined'){
  83. index['i_13']={if isset($config_info['notice_title'])}{:count($config_info['notice_title'])}{else}0{/if};
  84. html['i_13']=$('#notice_item').html()
  85. }
  86. })
  87. </script>