nav_edit.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.goods_class_index_class}</h3>
  7. </div>
  8. </div>
  9. </div>
  10. <form id="goods_class_form" name="goodsClassForm" enctype="multipart/form-data" method="post">
  11. <input type="hidden" name="gc_id" value="{$class_info.gc_id}" />
  12. <div class="ncap-form-default">
  13. <dl class="row">
  14. <dt class="tit">
  15. <label class="cn_name" for="cn_name">{$Think.lang.goodscn_alias}</label>
  16. </dt>
  17. <dd class="opt">
  18. <input type="text" maxlength="20" value="{$nav_info.goodscn_alias|default=''}" name="goodscn_alias" id="goodscn_alias" class="input-txt">
  19. <span class="err"></span>
  20. <p class="notic">{$Think.lang.goodscn_alias_tips}</p>
  21. </dd>
  22. </dl>
  23. <dl class="row">
  24. <dt class="tit">
  25. <label><em>*</em>{$Think.lang.recommend_goodsclass}</label>
  26. </dt>
  27. <dd class="opt">
  28. <div> {$Think.lang.under_goodsclass} <a class="ncap-btn" dstype="class_hide" href="javascript:void(0);">{$Think.lang.type_common_checked_hide}</a></div>
  29. <div id="class_div" class="scrollbar-box">
  30. <div class="ncap-type-spec-list">
  31. {notempty name="third_class"}
  32. {foreach name="third_class" item="val" key="key" }
  33. <dl>
  34. <dt id="class_dt_{$key}">{$val.name}</dt>
  35. {notempty name="$val.class"}
  36. <dd>
  37. {foreach name="$val.class" item="v" key="k" }
  38. <label for="class_{$k}">
  39. <input type="checkbox" name="class_id[]" value="{$k}" <?php if(!empty($nav_info['goodscn_classids']) && in_array($k, $nav_info['goodscn_classids'])){ echo 'checked="checked"';}?>>
  40. {$v} </label>
  41. {/foreach}
  42. </dd>
  43. {/notempty}
  44. </dl>
  45. {/foreach}
  46. {/notempty}
  47. </div>
  48. </div>
  49. <p class="notic">{$Think.lang.recommend_goodsclass_tips}</p>
  50. </dd>
  51. </dl>
  52. <dl class="row">
  53. <dt class="tit">
  54. <label><em>*</em>{$Think.lang.recommend_brand}</label>
  55. </dt>
  56. <dd class="opt">
  57. <div id="brandcategory">{$Think.lang.ds_quickly_targeted}
  58. <select class="class-select">
  59. <option value="0">{$Think.lang.ds_please_choose}</option>
  60. {notempty name="gc_list"}
  61. {foreach name="gc_list" item="v" key="k" }
  62. {if $v.gc_parent_id == 0}
  63. <option value="{$v.gc_id}">{$v.gc_name}</option>
  64. {/if}
  65. {/foreach}
  66. {/notempty}
  67. </select>
  68. {$Think.lang.under_brand} <a class="ncap-btn" dstype="brand_hide" href="javascript:void(0);">{$Think.lang.type_common_checked_hide}</a></div>
  69. <div id="brand_div" class="scrollbar-box">
  70. <div class="ncap-type-spec-list">
  71. {notempty name="brand_list"}
  72. {foreach name="brand_list" item="val" key="k" }
  73. <dl>
  74. <dt id="brand_dt_{$k}">{$val.name}</dt>
  75. {if $val.brand}
  76. <dd>
  77. {foreach name="$val.brand" item="bval"}
  78. <label for="brand_{$bval.brand_id}">
  79. <input type="checkbox" name="brand_id[]" value="{$bval.brand_id}" <?php if(in_array($bval['brand_id'], $nav_info['goodscn_brandids'])){ echo 'checked="checked"';}?> id="brand_{$bval.brand_id}" />
  80. {$bval.brand_name}</label>
  81. {/foreach}
  82. </dd>
  83. {/if}
  84. </dl>
  85. {/foreach}
  86. {else /}
  87. <div>{$Think.lang.type_add_brand_null_one}<a href="JavaScript:void(0);" onclick="window.parent.openItem('index,Brand,goods')">{$Think.lang.ds_brand_manage}</a>{$Think.lang.type_add_brand_null_two}</div>
  88. {/notempty}
  89. </div>
  90. </div>
  91. <p class="notic">{$Think.lang.recommend_brand_tips}</p>
  92. </dd>
  93. </dl>
  94. <dl class="row">
  95. <dt class="tit">
  96. <label for="pic">{$Think.lang.recommend_ad}1</label>
  97. </dt>
  98. <dd class="opt">
  99. <div class="input-file-show-shop"><span class="show"><a data-lightbox="lightbox-image" href="{$nav_info.goodscn_adv1|default=''}"> <i class="iconfont">&#xe72a;</i> </a></span><span class="type-file-box-shop">
  100. <input class="type-file-file" id="adv1" name="adv1" type="file" size="30" ds_type="change_pic" hidefocus="true">
  101. <input type="text" name="textfield" id="textfield2" class="type-file-text" />
  102. <input type="button" name="button" id="button1" value="上传" class="type-file-button" />
  103. </span></div>
  104. <label for="goodscn_adv1_link" class="ml5"><i class="iconfont">&#xe67d;</i>
  105. <input type="text" value="{$nav_info.goodscn_adv1_link|default=''}" name="goodscn_adv1_link" id="goodscn_adv1_link" class="input-txt ml5">
  106. </label>
  107. <p class="notic">{$Think.lang.recommend_ad_tips}</p>
  108. </dd>
  109. </dl>
  110. <dl class="row">
  111. <dt class="tit">
  112. <label for="pic">{$Think.lang.recommend_ad}2</label>
  113. </dt>
  114. <dd class="opt">
  115. <div class="input-file-show-shop"><span class="show"><a data-lightbox="lightbox-image" href="{$nav_info.goodscn_adv2|default=''}"> <i class="iconfont">&#xe72a;</i> </a></span><span class="type-file-box-shop">
  116. <input class="type-file-file" id="adv2" name="adv2" type="file" size="30" ds_type="change_pic" hidefocus="true">
  117. <input type="text" name="textfield" id="textfield3" class="type-file-text" />
  118. <input type="button" name="button" id="button1" value="上传" class="type-file-button" />
  119. </span></div>
  120. <label for="goodscn_adv2_link" class="ml5"><i class="iconfont">&#xe67d;</i>
  121. <input type="text" value="{$nav_info.goodscn_adv2_link|default=''}" name="goodscn_adv2_link" id="goodscn_adv2_link" class="input-txt ml5">
  122. </label>
  123. <p class="notic">{$Think.lang.recommend_ad_tips}</p>
  124. </dd>
  125. </dl>
  126. <div class="bot"><input class="btn btn-big btn-green" type="submit" value="{$Think.lang.ds_submit}"/></div>
  127. </div>
  128. </form>
  129. </div>
  130. <link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/css/lightbox.min.css">
  131. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/js/lightbox.min.js"></script>
  132. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  133. <script>
  134. $(function(){
  135. //自动加载滚动条
  136. $('#class_div').perfectScrollbar();
  137. $('#brand_div').perfectScrollbar();
  138. $("#pic").change(function(){
  139. $("#textfield1").val($(this).val());
  140. });
  141. $("#adv1").change(function(){
  142. $("#textfield2").val($(this).val());
  143. });
  144. $("#adv2").change(function(){
  145. $("#textfield3").val($(this).val());
  146. });
  147. // 类型搜索
  148. $("#brandcategory > select").on('change',function(){
  149. brand_scroll($(this));
  150. });
  151. // 品牌隐藏未选项
  152. $(document).off('click','a[dstype="brand_hide"]').on('click','a[dstype="brand_hide"]', function() {
  153. checked_hide('brand');
  154. });
  155. // 品牌全部显示
  156. $(document).off('click','a[dstype="brand_show"]').on('click','a[dstype="brand_show"]', function() {
  157. checked_show('brand');
  158. });
  159. // 子级分类隐藏未选项
  160. $(document).off('click','a[dstype="class_hide"]').on('click','a[dstype="class_hide"]', function() {
  161. checked_hide('class');
  162. });
  163. // 子级分类全部显示
  164. $(document).off('click','a[dstype="class_show"]').on('click','a[dstype="class_show"]', function() {
  165. checked_show('class');
  166. });
  167. });
  168. var brandScroll = 0;
  169. function brand_scroll(o){
  170. var id = o.val();
  171. if(!$('#brand_dt_'+id).is('dt')){
  172. return false;
  173. }
  174. $('#brand_div').scrollTop(-brandScroll);
  175. var sp_top = $('#brand_dt_'+id).offset().top;
  176. var div_top = $('#brand_div').offset().top;
  177. $('#brand_div').scrollTop(sp_top-div_top);
  178. brandScroll = sp_top-div_top;
  179. }
  180. //隐藏未选项
  181. function checked_show(str) {
  182. $('#'+str+'_div').find('dt').show().end().find('label').show();
  183. $('#'+str+'_div').find('dl').show();
  184. $('a[dstype="'+str+'_show"]').attr('dstype',str+'_hide').html('{$Think.lang.type_common_checked_hide}');
  185. $('#'+str+'_div').perfectScrollbar('destroy').perfectScrollbar();
  186. }
  187. //显示全部选项
  188. function checked_hide(str) {
  189. $('#'+str+'_div').find('dt').hide();
  190. $('#'+str+'_div').find('input[type="checkbox"]').parents('label').hide();
  191. $('#'+str+'_div').find('input[type="checkbox"]:checked').parents('label').show();
  192. $('#'+str+'_div').find('dl').each(function(){
  193. if ($(this).find('input[type="checkbox"]:checked').length == 0 ) $(this).hide();
  194. });
  195. $('a[dstype="'+str+'_hide"]').attr('dstype',str+'_show').html('{$Think.lang.display_no_options}');
  196. $('#'+str+'_div').perfectScrollbar('destroy').perfectScrollbar();
  197. }
  198. gcategoryInit('brandcategory');
  199. </script>