SearchTitle.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="search-store-title">
  3. <span class="search-result">
  4. 搜索 "
  5. <span style="color: #ff0101">{{keyword}}</span>
  6. ",为您找到
  7. <span v-text="goodsCount">1000</span>
  8. 家店铺:
  9. </span>
  10. <div class="tab-filter" >
  11. <div class="fr">
  12. <div :class="activeType == 0?'active':''" @click="defaultSearch"><a >综合排序</a></div>
  13. <!--<div :class="activeType == 1?'active':''"><a >库存</a></div>-->
  14. <!--<div :class="activeType == 2?'active':''"><a >销量</a></div>-->
  15. <!--<div :class="activeType == 3?'active':''"><a >信用</a></div>-->
  16. <div :class="activeType == 4?'active':''">
  17. <select @change="onSelectTypeChange" class="form-control select-type select-adder">
  18. <option value="">店铺类型</option>
  19. <option value="">原厂</option>
  20. <option value="">代理</option>
  21. <option value="">经销</option>
  22. <!--<option value="">寄售</option>-->
  23. </select>
  24. </div>
  25. <!--<div class=""><a >所在地</a></div>-->
  26. </div>
  27. <!--<div class="off">-->
  28. <!--<a @click="showClick">-->
  29. <!--<span v-text="show?'收起':'展开'" style="margin-right: 10px;"></span>-->
  30. <!--<i v-show="!show" class="fa fa-angle-down"></i>-->
  31. <!--<i v-show="show" class="fa fa-angle-up"></i>-->
  32. <!--</a>-->
  33. <!--</div>-->
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. props: ['keyword'],
  40. data () {
  41. return {
  42. activeType: 0,
  43. paramType: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT',
  44. show: true
  45. }
  46. },
  47. computed: {
  48. goodsCount () {
  49. if (this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores) {
  50. return this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores.totalElements || 0
  51. } else {
  52. return 0
  53. }
  54. }
  55. },
  56. methods: {
  57. defaultSearch: function () {
  58. this.activeType = 0
  59. this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
  60. this.$store.dispatch('searchStore/searchStoreDetail',
  61. {
  62. page: 1,
  63. count: 4,
  64. keyword: this.$route.query.w,
  65. types: this.paramType,
  66. op: 'pageByType'})
  67. },
  68. onSelectTypeChange: function (e) {
  69. let type = e.target[e.target.selectedIndex].innerHTML
  70. if (type === '原厂') {
  71. this.paramType = 'ORIGINAL_FACTORY'
  72. } else if (type === '代理') {
  73. this.paramType = 'AGENCY'
  74. } else if (type === '经销') {
  75. this.paramType = 'DISTRIBUTION'
  76. } else if (type === '店铺类型') {
  77. this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
  78. }
  79. this.$emit('typeAction', this.paramType)
  80. this.$store.dispatch('searchStore/searchStoreDetail',
  81. {
  82. page: 1,
  83. count: 4,
  84. keyword: this.$route.query.w,
  85. types: this.paramType,
  86. op: 'pageByType'})
  87. this.activeType = 4
  88. },
  89. showClick: function () {
  90. this.show = !this.show
  91. this.$emit('showAction', this.show)
  92. }
  93. }
  94. }
  95. </script>
  96. <style>
  97. .search-store-title {
  98. margin-top: 22px;
  99. }
  100. .search-store-title .select-type {
  101. min-width: 87px;
  102. }
  103. .tab-filter{
  104. width: 1190px;
  105. height: 40px;
  106. margin-top: 14px;
  107. line-height: 40px;
  108. background: #f4f8ff;
  109. border: 1px solid rgb( 231, 231, 231 );
  110. border-bottom: none;
  111. }
  112. .tab-filter .fl,.tab-filter .fr{
  113. float: left;
  114. }
  115. .tab-filter .fl{
  116. font-size: 14px;
  117. }
  118. .tab-filter .fr{
  119. max-width: 1050px;
  120. margin-left: 10px;
  121. }
  122. .tab-filter .fl span{
  123. font-size: 14px;
  124. }
  125. .tab-filter .fr div{
  126. float: left;
  127. margin-right: 10px;
  128. }
  129. .tab-filter .fr div.active a, .tab-filter .fr div.active select{
  130. border: #5078cb 1px solid;
  131. color: #5078cb;
  132. }
  133. .tab-filter .fr div.active select option {
  134. color: #000;
  135. }
  136. .tab-filter .fr a{
  137. display: inline-block;
  138. padding: 0 10px;
  139. border: #ccc 1px solid;
  140. line-height: 30px;
  141. font-size: 14px;
  142. text-align: center;
  143. color: #333;
  144. height: 30px;
  145. background: #fff;
  146. }
  147. .tab-filter .fr a i{
  148. /*margin-left: 5px;*/
  149. }
  150. .tab-filter .fr a:hover{
  151. border: #5078cb 1px solid;
  152. color: #5078cb;
  153. }
  154. .tab-filter .off{
  155. float: right;
  156. margin-right: 20px;
  157. color: black;
  158. }
  159. .tab-filter .off a:hover{
  160. border: none;
  161. color: #5078cb;
  162. }
  163. .tab-filter .off a{
  164. border: none;
  165. text-align: right;
  166. background: none;
  167. color: #333;
  168. }
  169. .tab-filter .off a i{
  170. font-size: 16px;
  171. }
  172. .tab-filter .fr .form-control{
  173. width: 85px;
  174. height: 30px;
  175. line-height: 30px;
  176. border-radius: 0;
  177. padding: 0 5px;
  178. }
  179. </style>