search.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. {extend name="default/base/base_home" /}
  2. {block name="mall_main"}
  3. <script src="{$Think.HOME_SITE_ROOT}/js/search_goods.js"></script>
  4. <div class="dsh-container wrapper" >
  5. <div class="left">
  6. {notempty name="goods_class_array"}
  7. <div class="dsh-module dsh-module-style02">
  8. <div class="title">
  9. <h3>{$Think.lang.category_filtering}</h3>
  10. </div>
  11. <div class="content">
  12. <ul id="files" class="tree">
  13. {foreach name="goods_class_array" item="value"}
  14. <li><i class="tree-parent tree-parent-collapsed"></i><a href="{:url('Search/index',['cate_id'=>$value.gc_id,'keyword'=>$Request.param.keyword])}" {if condition="$value.gc_id eq $Request.param.cate_id"}class="selected"{/if}>{$value.gc_name}</a>
  15. {notempty name="$value.class2"}
  16. <ul>
  17. {foreach name="$value.class2" item="val"}
  18. <li><i class="tree-parent tree-parent-collapsed"></i><a href="{:url('Search/index',['cate_id'=>$val.gc_id,'keyword'=>$Request.param.keyword])}" {if condition="$val.gc_id eq $Request.param.cate_id"}class="selected"{/if}>{$val.gc_name}</a>
  19. {notempty name="$val.class3"}
  20. <ul>
  21. {foreach name="$val.class3" item="v"}
  22. <li class="tree-parent tree-parent-collapsed"><i></i><a href="{:url('Search/index',['cate_id'=>$v.gc_id,'keyword'=>$Request.param.keyword])}" {if condition="$v.gc_id eq $Request.param.cate_id"}class="selected"{/if}>{$v.gc_name}</a></li>
  23. {/foreach}
  24. </ul>
  25. {/notempty}
  26. </li>
  27. {/foreach}
  28. </ul>
  29. {/notempty}
  30. </li>
  31. {/foreach}
  32. </ul>
  33. </div>
  34. </div>
  35. {/notempty}
  36. <!-- S 推荐展位 -->
  37. <div dstype="booth_goods" class="dsh-module" style="display:none;"> </div>
  38. <!-- F 同类排行 -->
  39. <div stype="listhot_goods" style="display:none;"></div>
  40. <!-- E 推荐展位 -->
  41. <!-- 最近浏览 -->
  42. <div class="dsh-module dsh-module-style03">
  43. <div class="title">
  44. <h3>{$Think.lang.goods_class_viewed_goods}</h3>
  45. </div>
  46. <div class="content">
  47. <div class="dsh-sidebar-viewed" id="dshSidebarViewed">
  48. <ul>
  49. {notempty name="viewed_goods"}
  50. {foreach name="viewed_goods" item="v" key="k" }
  51. <li class="dsh-sidebar-bowers">
  52. <div class="goods-pic"><a href="{:url('Goods/index',['goods_id'=>$v.goods_id])}" target="_blank"><img class="lazyload" data-original="{:goods_thumb($v, 240);}" title="{$v.goods_name}" alt="{$v.goods_name}" ></a></div>
  53. <dl>
  54. <dt><a href="{:url('Goods/index',['goods_id'=>$v.goods_id])}" target="_blank">{$v.goods_name}</a></dt>
  55. <dd>{$Think.lang.currency}{$v.goods_promotion_price}</dd>
  56. </dl>
  57. </li>
  58. {/foreach}
  59. {/notempty}
  60. </ul>
  61. </div>
  62. <a href="{:url('Membergoodsbrowse/listinfo')}" class="dsh-sidebar-all-viewed">{$Think.lang.full_browsing_history}</a></div>
  63. </div>
  64. </div>
  65. <div class="right">
  66. <div id="gc_goods_recommend_div" style="width:980px;"></div>
  67. <?php if(!isset($goods_class_array['child']) && empty($goods_class_array['child']) && !empty($goods_class_array)){?>
  68. <?php $dl=1; //dl标记?>
  69. <?php if((!empty($brand_array) && is_array($brand_array)) || (!empty($attr_array) && is_array($attr_array))){?>
  70. <div class="dsh-module dsh-module-style01">
  71. <div class="title">
  72. <h3>
  73. {notempty name="show_keyword"}
  74. <em>{$show_keyword}</em> -
  75. {/notempty}
  76. {$Think.lang.product_screening}</h3>
  77. </div>
  78. <div class="content">
  79. <div class="dsh-module-filter">
  80. {if (isset($checked_brand) && is_array($checked_brand)) || (isset($checked_attr) && is_array($checked_attr))}
  81. <dl ds_type="ul_filter">
  82. <dt>{$Think.lang.goods_class_index_selected}{$Think.lang.ds_colon}</dt>
  83. <dd class="list">
  84. {notempty name="checked_brand"}
  85. {foreach name="checked_brand" item="val" key="key" }
  86. <span class="selected" dstype="span_filter">{$Think.lang.goods_class_index_brand}:<em>{$val.brand_name}</em><i data-uri="{:removeParam(array('b_id' => $key))}">X</i></span>
  87. {/foreach}
  88. {/notempty}
  89. {notempty name="checked_attr"}
  90. {foreach name="checked_attr" item="val"}
  91. <span class="selected" dstype="span_filter">{$val.attr_name}:<em>{$val.attrvalue_name}</em><i data-uri="{:removeParam(array('a_id' => $val['attrvalue_id']))}">X</i></span>
  92. {/foreach}
  93. {/notempty}
  94. </dd>
  95. </dl>
  96. {/if}
  97. {notempty name="brand_array"}
  98. <dl>
  99. <dt>{$Think.lang.goods_class_index_brand}{$Think.lang.ds_colon}</dt>
  100. <dd class="list">
  101. <ul class="dsh-brand-tab" dstype="ul_initial" style="display:none;">
  102. <li data-initial="all"><a href="javascript:void(0);">{$Think.lang.all_brands}<i class="arrow"></i></a></li>
  103. {notempty name="initial_array"}
  104. {foreach name="initial_array" item="val" }
  105. <li data-initial="{$val}"><a href="javascript:void(0);">{$val}<i class="arrow"></i></a></li>
  106. {/foreach}
  107. {/notempty}
  108. </ul>
  109. <div id="dsBrandlist">
  110. <ul class="dsh-brand-con" dstype="ul_brand">
  111. {php}$i = 0;{/php}
  112. {foreach name="brand_array" item="v" key="k" }
  113. {php}$i++;{/php}
  114. <li data-initial="{$v.brand_initial}" {if $i > 14}style="display:none;"{/if}>
  115. <a href="{:replaceParam(array('b_id' => $k))}">
  116. {if $v.brand_showtype == 0}
  117. <img class="lazyload" data-original="{:brand_image($v['brand_pic'])}" alt="{$v.brand_name}" /> <span>{$v.brand_name}</span>
  118. {else/}
  119. {$v.brand_name}
  120. {/if}
  121. </a>
  122. </li>
  123. {/foreach}
  124. </ul>
  125. </div>
  126. </dd>
  127. {if count($brand_array) > 16}
  128. <dd class="all"><span dstype="brand_show"><i class="iconfont">&#xe689;</i>{$Think.lang.goods_class_index_more}</span></dd>
  129. {/if}
  130. </dl>
  131. {php}$dl++;{/php}
  132. {/notempty}
  133. {notempty name="attr_array"}
  134. {php}$j = 0;{/php}
  135. {foreach name="attr_array" item="val" key="key" }
  136. {php}$j++;{/php}
  137. {if !isset($checked_attr[$key]) && !empty($val['value']) && is_array($val['value'])}
  138. <dl>
  139. <dt>{$val.name}{$Think.lang.ds_colon}</dt>
  140. <dd class="list">
  141. <ul>
  142. {php}$i = 0;{/php}
  143. {foreach name="$val.value" item="v" key="k" }
  144. {php}$i++;{/php}
  145. <li {if $i>10}style="display:none" ds_type="none"{/if}><a href="<?php $a_id = ((input('param.a_id')!= '' && input('param.a_id')!= 0)?input('param.a_id').'_'.$k:$k); echo replaceParam(array('a_id' => $a_id));?>">{$v.attrvalue_name}</a></li>
  146. {/foreach}
  147. </ul>
  148. </dd>
  149. {if count($val['value']) > 10}
  150. <dd class="all"><span ds_type="show"><i class="iconfont">&#xe689;</i>{$Think.lang.goods_class_index_more}</span></dd>
  151. {/if}
  152. </dl>
  153. {/if}
  154. {php}$dl++;{/php}
  155. {/foreach}
  156. {/notempty}
  157. </div>
  158. </div>
  159. </div>
  160. <?php } ?>
  161. <div class="shop_con_list" id="main-nav-holder">
  162. <nav class="sort-bar" id="main-nav">
  163. <div class="pagination"></div>
  164. <div class="dsh-sortbar-array"> {$Think.lang.sort}:
  165. <ul>
  166. <li {if $Request.param.key eq '0'}class="selected"{/if}><a href="{:dropParam(array('order', 'key'))}" title="{$Think.lang.goods_class_index_default_sort}">{$Think.lang.goods_class_index_default}</a></li>
  167. <li {if $Request.param.key eq '1'}class="selected"{/if}><a href="{if $Request.param.order=='2' && $Request.param.key=='1'}{:replaceParam(array('key' => '1', 'order' => '1'))}{else/}{:replaceParam(array('key' => '1', 'order' => '2'))}{/if}" {if $Request.param.key=='1'}class="{if $Request.param.order==1}asc{else/}desc{/if}"{/if} >{$Think.lang.goods_class_index_sold}<i></i></a></li>
  168. <li {if $Request.param.key eq '2'}class="selected"{/if}><a href="{if $Request.param.order=='2' && $Request.param.key=='2'}{:replaceParam(array('key' => '2', 'order' => '1'))}{else/}{:replaceParam(array('key' => '2', 'order' => '2'))}{/if}" {if $Request.param.key=='2'}class="{if $Request.param.order==1}asc{else/}desc{/if}"{/if} >{$Think.lang.goods_class_index_click}<i></i></a></li>
  169. <li {if $Request.param.key eq '3'}class="selected"{/if}><a href="{if $Request.param.order=='2' && $Request.param.key=='3'}{:replaceParam(array('key' => '3', 'order' => '1'))}{else/}{:replaceParam(array('key' => '3', 'order' => '2'))}{/if}" {if $Request.param.key=='3'}class="{if $Request.param.order==1}asc{else/}desc{/if}"{/if} >{$Think.lang.goods_class_index_price}<i></i></a></li>
  170. <li><div><input id="priceMin" title={$Think.lang.lowest_price} value="{$Request.param.priceMin}" maxlength="6" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" class="input-txt"><em>-</em><input id="priceMax" title={$Think.lang.highest_price} value="{$Request.param.priceMax}" maxlength="6" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" class="input-txt"><a id="priceBtn" class="priceBtn">{$Think.lang.ds_ok}</a></div></li>
  171. </ul>
  172. </div>
  173. <div class="dsh-sortbar-owner"><span><a href="{if $Request.param.type == '1'}{:dropParam(array('type'))}{else/}{:replaceParam(array('type' => '1'))}{/if}" {if $Request.param.type == '1'}class="selected"{/if}><i></i>{$Think.lang.platform_proprietary}</a></span></div>
  174. <div class="dsh-sortbar-owner"><span><a href="{if $Request.param.gift == '1'}{:dropParam(array('gift'))}{else/}{:replaceParam(array('gift' => '1'))}{/if}" {if $Request.param.gift == '1'}class="selected"{/if}><i></i>{$Think.lang.complimentary}</a></span></div>
  175. <div class="dsh-sortbar-location">{$Think.lang.location_goods}:
  176. <span class="area-wrapper">
  177. <input type="hidden" id="goods_area" value="{$Request.param.area_id}" />
  178. <input type="hidden" id="_area" />
  179. <input onclick="change_area()" type="button" class="input-btn" value="{$Think.lang.ds_ok}" />
  180. </span>
  181. </div>
  182. </nav>
  183. <!-- 商品列表循环 -->
  184. <div>
  185. {include file="default/base/home/goods_squares" /}
  186. </div>
  187. <div class="tc mt20 mb20">
  188. <div class="pagination">{$show_page|raw}</div>
  189. </div>
  190. </div>
  191. <!-- 猜你喜欢 -->
  192. <div id="guesslike_div" style="width:980px;"></div>
  193. </div>
  194. <div class="clear"></div>
  195. </div>
  196. <script src="{$Think.HOME_SITE_ROOT}/js/waypoints.js"></script>
  197. <script src="{$Think.HOME_SITE_ROOT}/js/search_category_menu.js"></script>
  198. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.query.js" charset="utf-8"></script>
  199. <script type="text/javascript">
  200. var defaultSmallGoodsImage = '{:ds_get_pic(ATTACH_COMMON,$Think.config.ds_config.default_goods_image)}';
  201. var defaultTinyGoodsImage = '{:ds_get_pic(ATTACH_COMMON,$Think.config.ds_config.default_goods_image)}';
  202. function change_area(){
  203. if($.query.get('area_id')!=$('#_area').val()){
  204. location.assign($.query.set('area_id', $('#_area').val()));
  205. }
  206. }
  207. $(function(){
  208. $('#goods_area').ds_region();
  209. $('#files').tree({
  210. expanded: 'li:lt(2)'
  211. });
  212. //品牌索引过长滚条
  213. $('#dsBrandlist').perfectScrollbar({suppressScrollX:true});
  214. //浮动导航 waypoints.js
  215. $('#main-nav-holder').waypoint(function(event, direction) {
  216. $(this).parent().toggleClass('sticky', direction === "down");
  217. event.stopPropagation();
  218. });
  219. // 单行显示更多
  220. $('span[ds_type="show"]').click(function(){
  221. s = $(this).parents('dd').prev().find('li[ds_type="none"]');
  222. if(s.css('display') == 'none'){
  223. s.show();
  224. $(this).html('<i class="iconfont">&#xe688;</i>{$Think.lang.goods_class_index_retract}');
  225. }else{
  226. s.hide();
  227. $(this).html('<i class="iconfont">&#xe689;</i>{$Think.lang.goods_class_index_more}');
  228. }
  229. });
  230. {if $Request.param.cate_id > 0}
  231. $('div[dstype="booth_goods"]').load("{:url('Search/get_booth_goods',['cate_id'=>$Request.param.cate_id])}", function(){
  232. $(this).show();
  233. });
  234. {/if}
  235. {if $Request.param.cate_id > 0}
  236. $('div[id="gc_goods_recommend_div"]').load("{:url('Search/get_hot_goods',['cate_id'=>$Request.param.cate_id])}", function(){
  237. $(this).show();
  238. });
  239. {/if}
  240. //浏览历史处滚条
  241. $('#dshSidebarViewed').perfectScrollbar({suppressScrollX:true});
  242. //猜你喜欢
  243. $('#guesslike_div').load("{:url('Search/get_guesslike')}", function(){
  244. $(this).show();
  245. });
  246. $('#priceBtn').click(function(){
  247. var priceMin = $('#priceMin').val();
  248. var priceMax = $('#priceMax').val();
  249. location.assign($.query.set('priceMin', priceMin).set('priceMax', priceMax));
  250. });
  251. });
  252. </script>
  253. {/block}