config.html 5.6 KB

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