config.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!-- 图片导航 -->
  2. <form onchange="changeForm($(this),12)">
  3. <input type="hidden" name="model_id" value="12" />
  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="ds-icon-radio">
  17. <input type="hidden" name="show_format" value="{$config_info.show_format|default='1'}" />
  18. <ul class="ds-icon">
  19. <li{if !isset($config_info['show_format']) || $config_info['show_format']==1} class="ds-icon-active"{/if} data-val="1" onclick="setRadio($(this))">
  20. <img src="{$Think.HOME_SITE_ROOT}/images/editable_page/four.png">
  21. <div class="text">四列</div>
  22. </li>
  23. <li{if isset($config_info['show_format']) && $config_info['show_format']==2} class="ds-icon-active"{/if} data-val="2" onclick="setRadio($(this))">
  24. <img src="{$Think.HOME_SITE_ROOT}/images/editable_page/five.png">
  25. <div class="text">五列</div>
  26. </li>
  27. </ul>
  28. </div>
  29. </div>
  30. </div>
  31. {if isset($config_info['nav']) && !empty($config_info['nav'])}
  32. {foreach name='config_info.nav' item='item' key='key'}
  33. <div class="model-item"{if $key==0} id="adv_item"{/if}>
  34. <div class="layui-form-item">
  35. <label class="layui-form-label sm">导航图片</label>
  36. <div class="layui-input-block">
  37. <div class="uploader-wrapper">
  38. <div class="uploader-image-wrapper" {if !$item.image}style="display:none" {/if}>
  39. <img class='uploader-image' src='{$item.image|default=""}' />
  40. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  41. </div>
  42. <div class='uploader-content' {if $item.image}style="display:none" {/if}>
  43. <div class="uploader-icon iconfont">&#xe6bf;</div>
  44. <div class="uploader-text">点击上传</div>
  45. <div class="uploader-notice">60×60</div>
  46. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  47. <input type='hidden' name='nav[i_{$key}][image]' value='{$item.image|default=""}'>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label sm">导航文字</label>
  54. <div class="layui-input-block">
  55. <input type="text" name='nav[i_{$key}][text]' value='{$item.text|default=""}' placeholder="请输入导航文字" class="layui-input">
  56. </div>
  57. </div>
  58. <div class="layui-form-item">
  59. <label class="layui-form-label sm">跳转页面</label>
  60. <div class="layui-input-block">
  61. <input type="text" name='nav[i_{$key}][link]' value='{$item.link|default=""}' placeholder="请输入跳转页面" class="layui-input">
  62. </div>
  63. </div>
  64. </div>
  65. {/foreach}
  66. {else}
  67. <div class="model-item" id="nav_item">
  68. <div class="layui-form-item">
  69. <label class="layui-form-label sm">导航图片</label>
  70. <div class="layui-input-block">
  71. <div class="uploader-wrapper">
  72. <div class="uploader-image-wrapper" style="display:none">
  73. <img class='uploader-image' src='' />
  74. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  75. </div>
  76. <div class='uploader-content'>
  77. <div class="uploader-icon iconfont">&#xe6bf;</div>
  78. <div class="uploader-text">点击上传</div>
  79. <div class="uploader-notice">60×60</div>
  80. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  81. <input type='hidden' name='nav[i_0][image]' value=''>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="layui-form-item">
  87. <label class="layui-form-label sm">导航文字</label>
  88. <div class="layui-input-block">
  89. <input type="text" name='nav[i_0][text]' value='' placeholder="请输入导航文字" class="layui-input">
  90. </div>
  91. </div>
  92. <div class="layui-form-item">
  93. <label class="layui-form-label sm">跳转页面</label>
  94. <div class="layui-input-block">
  95. <input type="text" name='nav[i_0][link]' value='' placeholder="请输入跳转页面" class="layui-input">
  96. </div>
  97. </div>
  98. </div>
  99. {/if}
  100. <div class="model-btn" onclick="addModel($(this),12)">
  101. <span>+</span>
  102. <span>添加一个图片导航</span>
  103. </div>
  104. </form>
  105. <script>
  106. if(typeof(loadConfig12)=='undefined'){
  107. function loadConfig12(obj){
  108. obj.find('[data-js="color"]').colorpicker({showOn: 'both'});
  109. }
  110. }
  111. $(function(){
  112. if(typeof(index['i_12'])=='undefined'){
  113. index['i_12']={if isset($config_info['nav'])}{:count($config_info['nav'])}{else}0{/if};
  114. html['i_12']=$('#nav_item').html()
  115. }
  116. })
  117. </script>