人人商城

search.html 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. {template '_header'}
  2. <div class="page-header">当前位置:<span class="text-primary">搜索</span></div>
  3. <style>
  4. .search-top {
  5. padding: 20px 0 30px;
  6. border-bottom: 1px solid #efefef;
  7. }
  8. .search-top .search-inner {
  9. width: 680px;
  10. margin: auto;
  11. }
  12. .search-top .search-inner .search-input {
  13. height: 36px;
  14. width: inherit;
  15. display: -webkit-box;
  16. display: -webkit-flex;
  17. display: -ms-flexbox;
  18. display: flex;
  19. }
  20. .search-top .search-inner .search-input .input {
  21. display: block;
  22. -webkit-box-flex: 1;
  23. -webkit-flex: 1;
  24. -ms-flex: 1;
  25. flex: 1;
  26. border: 1px solid #efefef;
  27. border-right: 0;
  28. padding: 0 10px;
  29. font-size: 14px;
  30. }
  31. .search-top .search-inner .search-input .input:focus {
  32. border-color: #44abf7;
  33. }
  34. .search-top .search-inner .search-input .btn {
  35. width: 65px;
  36. font-size: 16px;
  37. padding: 0;
  38. height: 36px;
  39. line-height: 34px;
  40. display: block;
  41. border-bottom-left-radius: 0;
  42. border-top-left-radius: 0;
  43. border: 0;
  44. }
  45. .search-panel {
  46. padding: 30px 0;
  47. display: -webkit-box;
  48. display: -webkit-flex;
  49. display: -ms-flexbox;
  50. display: flex;
  51. }
  52. .search-panel-l {
  53. -webkit-box-flex: 1;
  54. -webkit-flex: 1;
  55. -ms-flex: 1;
  56. flex: 1;
  57. }
  58. .search-panel-r {
  59. min-height: 500px;
  60. width: 330px;
  61. padding: 0 15px;
  62. border-left: 1px solid #efefef;
  63. }
  64. .search-panel .title {
  65. font-size: 15px;
  66. }
  67. .search-panel .inner {
  68. padding-top: 20px;
  69. }
  70. .search-panel .inner .line {
  71. display: -webkit-box;
  72. display: -webkit-flex;
  73. display: -ms-flexbox;
  74. display: flex;
  75. }
  76. .search-panel .inner .line-title {
  77. width: 110px;
  78. font-size: 15px;
  79. line-height: 30px;
  80. color: #666;
  81. }
  82. .search-panel .inner .line-navs {
  83. -webkit-box-flex: 1;
  84. -webkit-flex: 1;
  85. -ms-flex: 1;
  86. flex: 1;
  87. }
  88. .search-panel .search-panel-l .inner a {
  89. background: #eff8fd;
  90. padding: 8px 12px;
  91. font-size: 14px;
  92. display: inline-block;
  93. margin: 0 8px 12px 0;
  94. }
  95. .search-panel .search-panel-l .inner a span {
  96. color: #999;
  97. font-size: 12px;
  98. padding-left: 5px;
  99. }
  100. .search-panel .search-panel-l .inner a:hover,
  101. .search-panel .search-panel-l .inner a:hover span {
  102. background: #44abf7;
  103. color: #fff;
  104. }
  105. .search-panel .search-panel-l .inner b {
  106. font-weight: 100;
  107. color: red;
  108. }
  109. .search-panel .search-panel-r .inner a {
  110. background: #eff8fd;
  111. padding: 6px 8px;
  112. width: auto;
  113. display: inline-block;
  114. margin: 2px 2px 2px 0;
  115. font-size: 14px;
  116. }
  117. .search-panel .search-panel-r .inner a:hover {
  118. background: #44abf7;
  119. color: #fff;
  120. }
  121. .search-panel .search-panel-r .inner .empty-data {
  122. text-align: center;
  123. color: #999;
  124. display: inline-block;
  125. width: 100%;
  126. }
  127. .search-panel .search-panel-l .empty-data {
  128. padding-top: 135px;
  129. width: 200px;
  130. margin: 100px auto;
  131. background: url('../addons/ewei_shopv2/static/images/nodata.jpg') no-repeat center top;
  132. font-size: 15px;
  133. color: #999;
  134. text-align: center;
  135. }
  136. </style>
  137. <div class="page-content">
  138. <form action="">
  139. <input type="hidden" name="c" value="site" />
  140. <input type="hidden" name="a" value="entry" />
  141. <input type="hidden" name="m" value="ewei_shopv2" />
  142. <input type="hidden" name="do" value="web" />
  143. <input type="hidden" name="r" value="search" />
  144. <div class="search-top">
  145. <div class="search-inner">
  146. <div class="search-input">
  147. <input class="input" name="keyword" placeholder="请输入关键字进行搜索..." value="{$keyword}" maxlength="10" />
  148. <input type="submit" class="btn btn-primary btn-lg" value="搜索" />
  149. </div>
  150. </div>
  151. </div>
  152. </form>
  153. <div class="search-panel">
  154. <div class="search-panel-l">
  155. <div class="title">搜索结果:</div>
  156. {if empty($list)}
  157. <div class="empty-data">抱歉,没有找到相关内容</div>
  158. {else}
  159. <div class="inner">
  160. {loop $list $item}
  161. <div class="line">
  162. <div class="line-title">{$item['title']}</div>
  163. <div class="line-navs">
  164. {loop $item['items'] $child}
  165. <a href="{$child['url']}">{$child['title']} {if !empty($child['desc'])}<span>{$child['desc']}</span>{/if}</a>
  166. {/loop}
  167. </div>
  168. </div>
  169. {/loop}
  170. </div>
  171. {/if}
  172. </div>
  173. <div class="search-panel-r">
  174. <div class="title">历史搜索:</div>
  175. <div class="inner">
  176. {if !empty($history)}
  177. {loop $history $history_item}
  178. <a href="{php echo webUrl('search', array('keyword'=>$history_item))}">{$history_item}</a>
  179. {/loop}
  180. <a href="javascript:;" id="btn-clear-search">清除历史搜索</a>
  181. {/if}
  182. <span class="empty-data" {if !empty($history)}style="display: none"{/if}>暂时没有历史搜索哦~</span>
  183. </div>
  184. </div>
  185. </div>
  186. <script type="text/javascript">
  187. $("#btn-clear-search").click(function () {
  188. tip.confirm("确定清空历史搜索吗?", function () {
  189. $.post(biz.url('clearhistory'), {type:1}, function (ret) {
  190. location.href = biz.url('search');
  191. });
  192. });
  193. });
  194. </script>
  195. </div>
  196. {template '_footer'}