config.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <!-- 两列分类商品列表 -->
  2. <form>
  3. <input type="hidden" name="model_id" value="10" />
  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_l) || !$config_info.back_image_l}style="display:none" {/if}>
  37. <img class='uploader-image' src='{$config_info.back_image_l|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_l) && $config_info.back_image_l}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_l' value='{$config_info.back_image_l|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_l" value="{$config_info.title_big_l|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_l" value="{$config_info.title_small_l|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_l" data-input value="{$config_info.goods_class_1_l|default='0'}" />
  67. <div data-type="template" data-name="gc_id_l" data-value="{if isset($config_info['gc_id_l'])}{:json_encode($config_info['gc_id_l'])}{/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_right_l'][0]['image']) || !$config_info['adv_right_l'][0]['image']}style="display:none"{/if}>
  88. <img class='uploader-image' src='{$config_info['adv_right_l'][0]['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_right_l'][0]['image']) && $config_info['adv_right_l'][0]['image']}style="display:none"{/if}>
  92. <div class="uploader-icon iconfont">&#xe6bf;</div>
  93. <div class="uploader-text">点击上传</div>
  94. <div class="uploader-notice">395×300</div>
  95. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  96. <input type='hidden' name='adv_right_l[i_0][image]' value="{$config_info['adv_right_l'][0]['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_right_l[i_0][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="onoff">
  113. <label for="if_fixed_goods_10_l_1" class="cb-enable{if !isset($config_info.if_fixed_goods_l) || $config_info.if_fixed_goods_l==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>
  114. <label for="if_fixed_goods_10_l_0" class="cb-disable{if isset($config_info.if_fixed_goods_l) && $config_info.if_fixed_goods_l==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>
  115. <input id="if_fixed_goods_10_l_1"{if !isset($config_info.if_fixed_goods_l) || $config_info.if_fixed_goods_l==1} checked="checked"{/if} name="if_fixed_goods_l" value="1" type="radio">
  116. <input id="if_fixed_goods_10_l_0"{if isset($config_info.if_fixed_goods_l) && $config_info.if_fixed_goods_l==0} checked="checked"{/if} name="if_fixed_goods_l" value="0" type="radio">
  117. </div>
  118. </div>
  119. </div>
  120. <div class="layui-form-item" data-fixed="1"{if isset($config_info.if_fixed_goods_l) && $config_info.if_fixed_goods_l==0} style="display:none"{/if}>
  121. <label class="layui-form-label sm">选择商品</label>
  122. <div class="layui-input-block">
  123. <div class="select-wrapper" data-select="goods">
  124. <span class="text" data-count>请选择</span>
  125. <span class="icon iconfont">&#xe687;</span>
  126. </div>
  127. <div data-content="goods_ids" style="display:none">
  128. {if isset($config_info['goods_id_l']) && !empty($config_info['goods_id_l'])}
  129. {foreach name='config_info.goods_id_l' item='item' key='key'}
  130. <input data-goods="{$key}" type="number" min="0" max="255" size="1" name="goods_id_l[{$key}][sort]" value="{$item.sort}" />
  131. {/foreach}
  132. {/if}
  133. </div>
  134. </div>
  135. </div>
  136. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_goods_l) || $config_info.if_fixed_goods_l==1} style="display:none"{/if}>
  137. <label class="layui-form-label sm">商品分类</label>
  138. <div class="layui-input-block">
  139. <div data-js="goods_class"><div data-select></div><input type="hidden" name="goods_class_2_l" data-input value="{$config_info.goods_class_2_l|default='0'}" /></div>
  140. </div>
  141. </div>
  142. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_goods_l) || $config_info.if_fixed_goods_l==1} style="display:none"{/if}>
  143. <label class="layui-form-label sm">商品排序</label>
  144. <div class="layui-input-block">
  145. <select name="goods_sort_l">
  146. <option value="1"{if !isset($config_info.goods_sort_l) || $config_info.goods_sort_l==1} selected="selected"{/if}>按新品</option>
  147. <option value="2"{if isset($config_info.goods_sort_l) && $config_info.goods_sort_l==2} selected="selected"{/if}>按热销</option>
  148. <option value="3"{if isset($config_info.goods_sort_l) && $config_info.goods_sort_l==3} selected="selected"{/if}>按好评</option>
  149. </select>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="model-item">
  154. <div class="layui-form-item">
  155. <label class="layui-form-label sm">固定品牌</label>
  156. <div class="layui-input-block">
  157. <div class="onoff">
  158. <label for="if_fixed_brand_10_l_1" class="cb-enable{if !isset($config_info.if_fixed_brand_l) || $config_info.if_fixed_brand_l==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>
  159. <label for="if_fixed_brand_10_l_0" class="cb-disable{if isset($config_info.if_fixed_brand_l) && $config_info.if_fixed_brand_l==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>
  160. <input id="if_fixed_brand_10_l_1"{if !isset($config_info.if_fixed_brand_l) || $config_info.if_fixed_brand_l==1} checked="checked"{/if} name="if_fixed_brand_l" value="1" type="radio">
  161. <input id="if_fixed_brand_10_l_0"{if isset($config_info.if_fixed_brand_l) && $config_info.if_fixed_brand_l==0} checked="checked"{/if} name="if_fixed_brand_l" value="0" type="radio">
  162. </div>
  163. </div>
  164. </div>
  165. <div class="layui-form-item" data-fixed="1"{if isset($config_info.if_fixed_brand_l) && $config_info.if_fixed_brand_l==0} style="display:none"{/if}>
  166. <label class="layui-form-label sm">选择品牌</label>
  167. <div class="layui-input-block">
  168. <div class="select-wrapper" data-select="brand">
  169. <span class="text" data-count>请选择</span>
  170. <span class="icon iconfont">&#xe687;</span>
  171. </div>
  172. <div data-content="brand_ids" style="display:none">
  173. {if isset($config_info['brand_id_l']) && !empty($config_info['brand_id_l'])}
  174. {foreach name='config_info.brand_id_l' item='item' key='key'}
  175. <input data-brand="{$key}" type="number" min="0" max="255" size="1" name="brand_id_l[{$key}][sort]" value="{$item.sort}" />
  176. {/foreach}
  177. {/if}
  178. </div>
  179. </div>
  180. </div>
  181. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_brand_l) || $config_info.if_fixed_brand_l==1} style="display:none"{/if}>
  182. <label class="layui-form-label sm">商品分类</label>
  183. <div class="layui-input-block">
  184. <div data-js="goods_class"><div data-select></div><input type="hidden" name="goods_class_3_l" data-input value="{$config_info.goods_class_3_l|default='0'}" /></div>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="model-item">
  189. <div class="layui-form-item">
  190. <label class="layui-form-label sm">左侧背景</label>
  191. <div class="layui-input-block">
  192. <div class="uploader-wrapper">
  193. <div class="uploader-image-wrapper" {if !isset($config_info.back_image_r) || !$config_info.back_image_r}style="display:none" {/if}>
  194. <img class='uploader-image' src='{$config_info.back_image_r|default=""}' />
  195. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  196. </div>
  197. <div class='uploader-content' {if isset($config_info.back_image_r) && $config_info.back_image_r}style="display:none" {/if}>
  198. <div class="uploader-icon iconfont">&#xe6bf;</div>
  199. <div class="uploader-text">点击上传</div>
  200. <div class="uploader-notice">200×300</div>
  201. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  202. <input type='hidden' name='back_image_r' value='{$config_info.back_image_r|default=""}'>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="layui-form-item">
  208. <label class="layui-form-label sm">大标题</label>
  209. <div class="layui-input-block">
  210. <input type="text" name="title_big_r" value="{$config_info.title_big_r|default=''}" placeholder="请输入大标题" class="layui-input">
  211. </div>
  212. </div>
  213. <div class="layui-form-item">
  214. <label class="layui-form-label sm">小标题</label>
  215. <div class="layui-input-block">
  216. <input type="text" name="title_small_r" value="{$config_info.title_small_r|default=''}" placeholder="请输入小标题" class="layui-input">
  217. </div>
  218. </div>
  219. <div class="layui-form-item">
  220. <label class="layui-form-label sm">选择分类</label>
  221. <div class="layui-input-block">
  222. <div data-js="goods_class"><div data-select></div>
  223. <input type="hidden" name="goods_class_1_r" data-input value="{$config_info.goods_class_1_r|default='0'}" />
  224. <div data-type="template" data-name="gc_id_r" data-value="{if isset($config_info['gc_id_r'])}{:json_encode($config_info['gc_id_r'])}{/if}"></div>
  225. <table class="dssc-default-table mb15">
  226. <thead>
  227. <tr>
  228. <th class="tl">{$Think.lang.ds_goodsclass}</th>
  229. <th class="w90">{$Think.lang.ds_sort}</th>
  230. </tr>
  231. </thead>
  232. <tbody>
  233. </tbody>
  234. </table>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. <div class="model-item">
  240. <div class="layui-form-item">
  241. <label class="layui-form-label sm">右侧广告</label>
  242. <div class="layui-input-block">
  243. <div class="uploader-wrapper">
  244. <div class="uploader-image-wrapper" {if !isset($config_info['adv_right_r'][0]['image']) || !$config_info['adv_right_r'][0]['image']}style="display:none"{/if}>
  245. <img class='uploader-image' src='{$config_info['adv_right_r'][0]['image']|default=""}' />
  246. <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
  247. </div>
  248. <div class='uploader-content' {if isset($config_info['adv_right_r'][0]['image']) && $config_info['adv_right_r'][0]['image']}style="display:none"{/if}>
  249. <div class="uploader-icon iconfont">&#xe6bf;</div>
  250. <div class="uploader-text">点击上传</div>
  251. <div class="uploader-notice">395×300</div>
  252. <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
  253. <input type='hidden' name='adv_right_r[i_0][image]' value="{$config_info['adv_right_r'][0]['image']|default=""}">
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. <div class="layui-form-item">
  259. <label class="layui-form-label sm">跳转页面</label>
  260. <div class="layui-input-block">
  261. <input type="text" name="adv_right_r[i_0][link]" value="" placeholder="请输入跳转页面" class="layui-input">
  262. </div>
  263. </div>
  264. </div>
  265. <div class="model-item">
  266. <div class="layui-form-item">
  267. <label class="layui-form-label sm">固定商品</label>
  268. <div class="layui-input-block">
  269. <div class="onoff">
  270. <label for="if_fixed_goods_10_r_1" class="cb-enable{if !isset($config_info.if_fixed_goods_r) || $config_info.if_fixed_goods_r==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>
  271. <label for="if_fixed_goods_10_r_0" class="cb-disable{if isset($config_info.if_fixed_goods_r) && $config_info.if_fixed_goods_r==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>
  272. <input id="if_fixed_goods_10_r_1"{if !isset($config_info.if_fixed_goods_r) || $config_info.if_fixed_goods_r==1} checked="checked"{/if} name="if_fixed_goods_r" value="1" type="radio">
  273. <input id="if_fixed_goods_10_r_0"{if isset($config_info.if_fixed_goods_r) && $config_info.if_fixed_goods_r==0} checked="checked"{/if} name="if_fixed_goods_r" value="0" type="radio">
  274. </div>
  275. </div>
  276. </div>
  277. <div class="layui-form-item" data-fixed="1"{if isset($config_info.if_fixed_goods_r) && $config_info.if_fixed_goods_r==0} style="display:none"{/if}>
  278. <label class="layui-form-label sm">选择商品</label>
  279. <div class="layui-input-block">
  280. <div class="select-wrapper" data-select="goods">
  281. <span class="text" data-count>请选择</span>
  282. <span class="icon iconfont">&#xe687;</span>
  283. </div>
  284. <div data-content="goods_ids" style="display:none">
  285. {if isset($config_info['goods_id_r']) && !empty($config_info['goods_id_r'])}
  286. {foreach name='config_info.goods_id_r' item='item' key='key'}
  287. <input data-goods="{$key}" type="number" min="0" max="255" size="1" name="goods_id_r[{$key}][sort]" value="{$item.sort}" />
  288. {/foreach}
  289. {/if}
  290. </div>
  291. </div>
  292. </div>
  293. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_goods_r) || $config_info.if_fixed_goods_r==1} style="display:none"{/if}>
  294. <label class="layui-form-label sm">商品分类</label>
  295. <div class="layui-input-block">
  296. <div data-js="goods_class"><div data-select></div><input type="hidden" name="goods_class_2_r" data-input value="{$config_info.goods_class_2_r|default='0'}" /></div>
  297. </div>
  298. </div>
  299. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_goods_r) || $config_info.if_fixed_goods_r==1} style="display:none"{/if}>
  300. <label class="layui-form-label sm">商品排序</label>
  301. <div class="layui-input-block">
  302. <select name="goods_sort_r">
  303. <option value="1"{if !isset($config_info.goods_sort_r) || $config_info.goods_sort_r==1} selected="selected"{/if}>按新品</option>
  304. <option value="2"{if isset($config_info.goods_sort_r) && $config_info.goods_sort_r==2} selected="selected"{/if}>按热销</option>
  305. <option value="3"{if isset($config_info.goods_sort_r) && $config_info.goods_sort_r==3} selected="selected"{/if}>按好评</option>
  306. </select>
  307. </div>
  308. </div>
  309. </div>
  310. <div class="model-item">
  311. <div class="layui-form-item">
  312. <label class="layui-form-label sm">固定品牌</label>
  313. <div class="layui-input-block">
  314. <div class="onoff">
  315. <label for="if_fixed_brand_10_r_1" class="cb-enable{if !isset($config_info.if_fixed_brand_r) || $config_info.if_fixed_brand_r==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>
  316. <label for="if_fixed_brand_10_r_0" class="cb-disable{if isset($config_info.if_fixed_brand_r) && $config_info.if_fixed_brand_r==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>
  317. <input id="if_fixed_brand_10_r_1"{if !isset($config_info.if_fixed_brand_r) || $config_info.if_fixed_brand_r==1} checked="checked"{/if} name="if_fixed_brand_r" value="1" type="radio">
  318. <input id="if_fixed_brand_10_r_0"{if isset($config_info.if_fixed_brand_r) && $config_info.if_fixed_brand_r==0} checked="checked"{/if} name="if_fixed_brand_r" value="0" type="radio">
  319. </div>
  320. </div>
  321. </div>
  322. <div class="layui-form-item" data-fixed="1"{if isset($config_info.if_fixed_brand_r) && $config_info.if_fixed_brand_r==0} style="display:none"{/if}>
  323. <label class="layui-form-label sm">选择品牌</label>
  324. <div class="layui-input-block">
  325. <div class="select-wrapper" data-select="brand">
  326. <span class="text" data-count>请选择</span>
  327. <span class="icon iconfont">&#xe687;</span>
  328. </div>
  329. <div data-content="brand_ids" style="display:none">
  330. {if isset($config_info['brand_id_r']) && !empty($config_info['brand_id_r'])}
  331. {foreach name='config_info.brand_id_r' item='item' key='key'}
  332. <input data-brand="{$key}" type="number" min="0" max="255" size="1" name="brand_id_r[{$key}][sort]" value="{$item.sort}" />
  333. {/foreach}
  334. {/if}
  335. </div>
  336. </div>
  337. </div>
  338. <div class="layui-form-item" data-fixed="0"{if !isset($config_info.if_fixed_brand_r) || $config_info.if_fixed_brand_r==1} style="display:none"{/if}>
  339. <label class="layui-form-label sm">商品分类</label>
  340. <div class="layui-input-block">
  341. <div data-js="goods_class"><div data-select></div><input type="hidden" name="goods_class_3_r" data-input value="{$config_info.goods_class_3_r|default='0'}" /></div>
  342. </div>
  343. </div>
  344. </div>
  345. </form>
  346. <script>
  347. if(typeof(loadConfig10)=='undefined'){
  348. function loadConfig10(obj){
  349. obj.find('[data-js="color"]').colorpicker({showOn: 'both'});
  350. var id=obj.attr('data-id')
  351. var i=0
  352. obj.find('[data-js="goods_class"]').each(function(){
  353. $(this).attr('id','goods_class_'+i+'_'+id)
  354. var gc_id=parseInt($('#goods_class_'+i+'_'+id).find('*[data-input]').val())
  355. if(gc_id){
  356. getGoodsClass(gc_id,'goods_class_'+i+'_'+id)
  357. }else{
  358. loadGoodsClass(1,0,'goods_class_'+i+'_'+id)
  359. }
  360. i++
  361. })
  362. var i=0
  363. obj.find('[data-select="goods"]').each(function(){
  364. $(this).attr('id','select_goods_'+i+'_'+id)
  365. i++
  366. })
  367. obj.find('*[data-select="goods"]').click(function(){
  368. var goods_id=''
  369. $(this).parent().find('*[data-content="goods_ids"] input').each(function(){
  370. goods_id+='&goods_id['+$(this).attr('data-goods')+'][sort]='+$(this).val()
  371. })
  372. dsLayerOpen('{:url(request()->controller()."/search_goods")}?id='+$(this).attr('id')+goods_id,'选择商品')
  373. })
  374. var i=0
  375. obj.find('[data-select="brand"]').each(function(){
  376. $(this).attr('id','select_brand_'+i+'_'+id)
  377. i++
  378. })
  379. obj.find('*[data-select="brand"]').click(function(){
  380. var brand_id=''
  381. $(this).parent().find('*[data-content="brand_ids"] input').each(function(){
  382. brand_id+='&brand_id['+$(this).attr('data-brand')+'][sort]='+$(this).val()
  383. })
  384. dsLayerOpen('{:url(request()->controller()."/search_brand")}?id='+$(this).attr('id')+brand_id,'选择品牌')
  385. })
  386. obj.find('.onoff').each(function(){
  387. $(this).find(".cb-enable").click(function() {
  388. var parent = $(this).parents('.onoff');
  389. $('.cb-disable', parent).removeClass('selected');
  390. $(this).addClass('selected');
  391. $('.checkbox', parent).prop('checked', true);
  392. });
  393. $(this).find(".cb-disable").click(function() {
  394. var parent = $(this).parents('.onoff');
  395. $('.cb-enable', parent).removeClass('selected');
  396. $(this).addClass('selected');
  397. $('.checkbox', parent).prop('checked', false);
  398. });
  399. })
  400. }
  401. }
  402. if(typeof(saveGoods)=='undefined'){
  403. function saveGoods(html,id,count){
  404. $('#'+id).parent().find('[data-content="goods_ids"]').html(html)
  405. $('#'+id).parent().find('[data-count]').text(count?('已选择'+count+'个'):'请选择')
  406. $('#'+id).parents('form').change()
  407. }
  408. }
  409. if(typeof(saveBrand)=='undefined'){
  410. function saveBrand(html,id,count){
  411. $('#'+id).parent().find('[data-content="brand_ids"]').html(html)
  412. $('#'+id).parent().find('[data-count]').text(count?('已选择'+count+'个'):'请选择')
  413. $('#'+id).parents('form').change()
  414. }
  415. }
  416. </script>