config.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <!-- 分类商品列表 -->
  2. <form>
  3. <input type="hidden" name="model_id" value="9" />
  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="range-wrapper">
  17. <input type="range" name="padding_top" value="{$config_info.padding_top|default='0'}" onchange="$(this).next().text($(this).val())">
  18. <span>{$config_info.padding_top|default='0'}</span>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="layui-form-item">
  23. <label class="layui-form-label sm">下边距</label>
  24. <div class="layui-input-block">
  25. <div class="range-wrapper">
  26. <input type="range" name="padding_bottom" value="{$config_info.padding_bottom|default='0'}" onchange="$(this).next().text($(this).val())">
  27. <span>{$config_info.padding_bottom|default='0'}</span>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="model-item">
  32. <div class="layui-form-item">
  33. <label class="layui-form-label sm">左侧背景</label>
  34. <div class="layui-input-block">
  35. <div class="uploader-wrapper">
  36. <div class="uploader-image-wrapper" {if !isset($config_info.back_image) || !$config_info.back_image}style="display:none" {/if}>
  37. <img class='uploader-image' src='{$config_info.back_image|default=""}' />
  38. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  39. </div>
  40. <div class='uploader-content' {if isset($config_info.back_image) && $config_info.back_image}style="display:none" {/if}>
  41. <div class="uploader-icon iconfont">&#xe6bf;</div>
  42. <div class="uploader-text">点击上传</div>
  43. <div class="uploader-notice">200×300</div>
  44. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  45. <input type='hidden' name='back_image' value='{$config_info.back_image|default=""}'>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="layui-form-item">
  51. <label class="layui-form-label sm">大标题</label>
  52. <div class="layui-input-block">
  53. <input type="text" name="title_big" value="{$config_info.title_big|default=''}" placeholder="请输入大标题" class="layui-input">
  54. </div>
  55. </div>
  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="title_small" value="{$config_info.title_small|default=''}" 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. <div data-js="goods_class"><div data-select></div>
  66. <input type="hidden" name="goods_class_1" data-input value="{$config_info.goods_class_1|default='0'}" />
  67. <div data-type="template" data-name="gc_id" data-value="{if isset($config_info['gc_id'])}{:json_encode($config_info['gc_id'])}{/if}"></div>
  68. <table class="dssc-default-table mb15">
  69. <thead>
  70. <tr>
  71. <th class="tl">{$Think.lang.ds_goodsclass}</th>
  72. <th class="w90">{$Think.lang.ds_sort}</th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="model-item">
  83. <div class="layui-form-item">
  84. <label class="layui-form-label sm">中间广告</label>
  85. <div class="layui-input-block">
  86. <div class="uploader-wrapper">
  87. <div class="uploader-image-wrapper" {if !isset($config_info['adv_center']['image']) || !$config_info['adv_center']['image']}style="display:none"{/if}>
  88. <img class='uploader-image' src='{$config_info['adv_center']['image']|default=""}' />
  89. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  90. </div>
  91. <div class='uploader-content' {if isset($config_info['adv_center']['image']) && $config_info['adv_center']['image']}style="display:none"{/if}>
  92. <div class="uploader-icon iconfont">&#xe6bf;</div>
  93. <div class="uploader-text">点击上传</div>
  94. <div class="uploader-notice">600×300</div>
  95. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  96. <input type='hidden' name='adv_center[image]' value="{$config_info['adv_center']['image']|default=""}">
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="layui-form-item">
  102. <label class="layui-form-label sm">跳转页面</label>
  103. <div class="layui-input-block">
  104. <input type="text" name="adv_center[link]" value="" placeholder="请输入跳转页面" class="layui-input">
  105. </div>
  106. </div>
  107. </div>
  108. <div class="model-item">
  109. <div class="layui-form-item">
  110. <label class="layui-form-label sm">右侧广告</label>
  111. <div class="layui-input-block">
  112. <div class="uploader-wrapper">
  113. <div class="uploader-image-wrapper" {if !isset($config_info['adv_right']['image']) || !$config_info['adv_right']['image']}style="display:none"{/if}>
  114. <img class='uploader-image' src='{$config_info['adv_right']['image']|default=""}' />
  115. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  116. </div>
  117. <div class='uploader-content' {if isset($config_info['adv_right']['image']) && $config_info['adv_right']['image']}style="display:none"{/if}>
  118. <div class="uploader-icon iconfont">&#xe6bf;</div>
  119. <div class="uploader-text">点击上传</div>
  120. <div class="uploader-notice">400×300</div>
  121. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  122. <input type='hidden' name='adv_right[image]' value="{$config_info['adv_right']['image']|default=""}">
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="layui-form-item">
  128. <label class="layui-form-label sm">跳转页面</label>
  129. <div class="layui-input-block">
  130. <input type="text" name="adv_right[link]" value="" placeholder="请输入跳转页面" class="layui-input">
  131. </div>
  132. </div>
  133. </div>
  134. <div class="model-item">
  135. <div class="layui-form-item">
  136. <label class="layui-form-label sm">固定商品</label>
  137. <div class="layui-input-block">
  138. <div class="onoff">
  139. <label for="if_fixed_goods_9_1" class="cb-enable{if !isset($config_info.if_fixed_goods) || $config_info.if_fixed_goods==1} selected{/if}" onclick="$(this).parents('form').find('[data-fixed=0]').hide();$(this).parents('form').find('[data-fixed=1]').show()">{$Think.lang.ds_yes}</label>
  140. <label for="if_fixed_goods_9_0" class="cb-disable{if isset($config_info.if_fixed_goods) && $config_info.if_fixed_goods==0} selected{/if}" onclick="$(this).parents('form').find('[data-fixed=0]').show();$(this).parents('form').find('[data-fixed=1]').hide()">{$Think.lang.ds_no}</label>
  141. <input id="if_fixed_goods_9_1"{if !isset($config_info.if_fixed_goods) || $config_info.if_fixed_goods==1} checked="checked"{/if} name="if_fixed_goods" value="1" type="radio">
  142. <input id="if_fixed_goods_9_0"{if isset($config_info.if_fixed_goods) && $config_info.if_fixed_goods==0} checked="checked"{/if} name="if_fixed_goods" value="0" type="radio">
  143. </div>
  144. </div>
  145. </div>
  146. <div class="layui-form-item" data-fixed="1"{if isset($config_info.if_fixed_goods) && $config_info.if_fixed_goods==0} style="display:none"{/if}>
  147. <label class="layui-form-label sm">选择商品</label>
  148. <div class="layui-input-block">
  149. <div class="select-wrapper" data-select="goods">
  150. <span class="text" data-count>请选择</span>
  151. <span class="icon iconfont">&#xe687;</span>
  152. </div>
  153. <div data-content="goods_ids" style="display:none">
  154. {if isset($config_info['goods_id']) && !empty($config_info['goods_id'])}
  155. {foreach name='config_info.goods_id' item='item' key='key'}
  156. <input data-goods="{$key}" type="number" min="0" max="255" size="1" name="goods_id[{$key}][sort]" value="{$item.sort}" />
  157. {/foreach}
  158. {/if}
  159. </div>
  160. </div>
  161. </div>
  162. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_goods) || $config_info.if_fixed_goods==1} style="display:none"{/if}>
  163. <label class="layui-form-label sm">商品分类</label>
  164. <div class="layui-input-block">
  165. <div data-js="goods_class"><div data-select></div><input type="hidden" name="goods_class_2" data-input value="{$config_info.goods_class_2|default='0'}" /></div>
  166. </div>
  167. </div>
  168. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_goods) || $config_info.if_fixed_goods==1} style="display:none"{/if}>
  169. <label class="layui-form-label sm">商品排序</label>
  170. <div class="layui-input-block">
  171. <select name="goods_sort">
  172. <option value="1"{if !isset($config_info.goods_sort) || $config_info.goods_sort==1} selected="selected"{/if}>按新品</option>
  173. <option value="2"{if isset($config_info.goods_sort) && $config_info.goods_sort==2} selected="selected"{/if}>按热销</option>
  174. <option value="3"{if isset($config_info.goods_sort) && $config_info.goods_sort==3} selected="selected"{/if}>按好评</option>
  175. </select>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="model-item">
  180. <div class="layui-form-item">
  181. <label class="layui-form-label sm">固定品牌</label>
  182. <div class="layui-input-block">
  183. <div class="onoff">
  184. <label for="if_fixed_brand_9_1" class="cb-enable{if !isset($config_info.if_fixed_brand) || $config_info.if_fixed_brand==1} selected{/if}" onclick="$(this).parents('form').find('[data-fixed=0]').hide();$(this).parents('form').find('[data-fixed=1]').show()">{$Think.lang.ds_yes}</label>
  185. <label for="if_fixed_brand_9_0" class="cb-disable{if isset($config_info.if_fixed_brand) && $config_info.if_fixed_brand==0} selected{/if}" onclick="$(this).parents('form').find('[data-fixed=0]').show();$(this).parents('form').find('[data-fixed=1]').hide()">{$Think.lang.ds_no}</label>
  186. <input id="if_fixed_brand_9_1"{if !isset($config_info.if_fixed_brand) || $config_info.if_fixed_brand==1} checked="checked"{/if} name="if_fixed_brand" value="1" type="radio">
  187. <input id="if_fixed_brand_9_0"{if isset($config_info.if_fixed_brand) && $config_info.if_fixed_brand==0} checked="checked"{/if} name="if_fixed_brand" value="0" type="radio">
  188. </div>
  189. </div>
  190. </div>
  191. <div class="layui-form-item" data-fixed="1"{if isset($config_info.if_fixed_brand) && $config_info.if_fixed_brand==0} style="display:none"{/if}>
  192. <label class="layui-form-label sm">选择品牌</label>
  193. <div class="layui-input-block">
  194. <div class="select-wrapper" data-select="brand">
  195. <span class="text" data-count>请选择</span>
  196. <span class="icon iconfont">&#xe687;</span>
  197. </div>
  198. <div data-content="brand_ids" style="display:none">
  199. {if isset($config_info['brand_id']) && !empty($config_info['brand_id'])}
  200. {foreach name='config_info.brand_id' item='item' key='key'}
  201. <input data-brand="{$key}" type="number" min="0" max="255" size="1" name="brand_id[{$key}][sort]" value="{$item.sort}" />
  202. {/foreach}
  203. {/if}
  204. </div>
  205. </div>
  206. </div>
  207. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_brand) || $config_info.if_fixed_brand==1} style="display:none"{/if}>
  208. <label class="layui-form-label sm">商品分类</label>
  209. <div class="layui-input-block">
  210. <div data-js="goods_class"><div data-select></div><input type="hidden" name="goods_class_3" data-input value="{$config_info.goods_class_3|default='0'}" /></div>
  211. </div>
  212. </div>
  213. </div>
  214. </form>
  215. <script>
  216. if(typeof(loadConfig9)=='undefined'){
  217. function loadConfig9(obj){
  218. obj.find('[data-js="color"]').colorpicker({showOn: 'both'});
  219. var id=obj.attr('data-id')
  220. var i=0
  221. obj.find('[data-js="goods_class"]').each(function(){
  222. $(this).attr('id','goods_class_'+i+'_'+id)
  223. var gc_id=parseInt($('#goods_class_'+i+'_'+id).find('*[data-input]').val())
  224. if(gc_id){
  225. getGoodsClass(gc_id,'goods_class_'+i+'_'+id)
  226. }else{
  227. loadGoodsClass(1,0,'goods_class_'+i+'_'+id)
  228. }
  229. i++
  230. })
  231. var i=0
  232. obj.find('[data-select="goods"]').each(function(){
  233. $(this).attr('id','select_goods_'+i+'_'+id)
  234. i++
  235. })
  236. obj.find('*[data-select="goods"]').click(function(){
  237. var goods_id=''
  238. $(this).parent().find('*[data-content="goods_ids"] input').each(function(){
  239. goods_id+='&goods_id['+$(this).attr('data-goods')+'][sort]='+$(this).val()
  240. })
  241. dsLayerOpen('{:url(request()->controller()."/search_goods")}?id='+$(this).attr('id')+goods_id,'选择商品')
  242. })
  243. var i=0
  244. obj.find('[data-select="brand"]').each(function(){
  245. $(this).attr('id','select_brand_'+i+'_'+id)
  246. i++
  247. })
  248. obj.find('*[data-select="brand"]').click(function(){
  249. var brand_id=''
  250. $(this).parent().find('*[data-content="brand_ids"] input').each(function(){
  251. brand_id+='&brand_id['+$(this).attr('data-brand')+'][sort]='+$(this).val()
  252. })
  253. dsLayerOpen('{:url(request()->controller()."/search_brand")}?id='+$(this).attr('id')+brand_id,'选择品牌')
  254. })
  255. obj.find('.onoff').each(function(){
  256. $(this).find(".cb-enable").click(function() {
  257. var parent = $(this).parents('.onoff');
  258. $('.cb-disable', parent).removeClass('selected');
  259. $(this).addClass('selected');
  260. $('.checkbox', parent).prop('checked', true);
  261. });
  262. $(this).find(".cb-disable").click(function() {
  263. var parent = $(this).parents('.onoff');
  264. $('.cb-enable', parent).removeClass('selected');
  265. $(this).addClass('selected');
  266. $('.checkbox', parent).prop('checked', false);
  267. });
  268. })
  269. }
  270. }
  271. if(typeof(saveGoods)=='undefined'){
  272. function saveGoods(html,id,count){
  273. $('#'+id).parent().find('[data-content="goods_ids"]').html(html)
  274. $('#'+id).parent().find('[data-count]').text(count?('已选择'+count+'个'):'请选择')
  275. $('#'+id).parents('form').change()
  276. }
  277. }
  278. if(typeof(saveBrand)=='undefined'){
  279. function saveBrand(html,id,count){
  280. $('#'+id).parent().find('[data-content="brand_ids"]').html(html)
  281. $('#'+id).parent().find('[data-count]').text(count?('已选择'+count+'个'):'请选择')
  282. $('#'+id).parents('form').change()
  283. }
  284. }
  285. </script>