SearchTitle.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="search-store-title">
  3. <span class="search-result">
  4. 搜索"
  5. <span>{{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?'收起':'展开'"></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: 10px;
  99. }
  100. .search-store-title .select-type {
  101. min-width: 87px;
  102. }
  103. .tab-filter{
  104. width: 1190px;
  105. height: 40px;
  106. margin: 10px auto;
  107. line-height: 40px;
  108. margin-bottom: 10px;
  109. background: #f1efef;
  110. }
  111. .tab-filter .fl,.tab-filter .fr{
  112. float: left;
  113. }
  114. .tab-filter .fl{
  115. font-size: 14px;
  116. }
  117. .tab-filter .fr{
  118. max-width: 1050px;
  119. }
  120. .tab-filter .fl span{
  121. font-size: 14px;
  122. }
  123. .tab-filter .fr div{
  124. float: left;
  125. margin: 0 5px;
  126. }
  127. .tab-filter .fr div.active a, .tab-filter .fr div.active select{
  128. border: #5078cb 1px solid;
  129. color: #5078cb;
  130. }
  131. .tab-filter .fr div.active select option {
  132. color: #000;
  133. }
  134. .tab-filter .fr a{
  135. display: inline-block;
  136. padding: 1px 10px;
  137. border: #ccc 1px solid;
  138. line-height: 26px;
  139. font-size: 14px;
  140. text-align: center;
  141. color: #333;
  142. max-height: 30px;
  143. background: #fff;
  144. }
  145. .tab-filter .fr a i{
  146. /*margin-left: 5px;*/
  147. }
  148. .tab-filter .fr a:hover{
  149. border: #5078cb 1px solid;
  150. color: #5078cb;
  151. }
  152. .tab-filter .off{
  153. float: right;
  154. margin-right: 20px;
  155. color: black;
  156. }
  157. .tab-filter .off a:hover{
  158. border: none;
  159. color: #5078cb;
  160. }
  161. .tab-filter .off a{
  162. border: none;
  163. text-align: right;
  164. padding-left: 360px;
  165. background: none;
  166. color: #333;
  167. }
  168. .tab-filter .off a i{
  169. font-size: 16px;
  170. }
  171. .tab-filter .fr .form-control{
  172. width: 70px;
  173. height: 30px;
  174. border-radius: 0;
  175. padding-left: 5px;
  176. }
  177. </style>