SearchTitle.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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="{'active': activeType == '0'}" @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="{'active': activeType > '0'}">
  17. <select v-model="activeType" @change="onSelectTypeChange" class="form-control select-type select-adder">
  18. <option value="0">店铺类型</option>
  19. <option value="1">原厂</option>
  20. <option value="2">代理</option>
  21. <option value="3">经销</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. watch: {
  48. '$route.query.w': {
  49. handler: function (val) {
  50. this.activeType = '0'
  51. this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT'
  52. },
  53. immediate: false
  54. }
  55. },
  56. computed: {
  57. goodsCount () {
  58. if (this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores) {
  59. return this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores.totalElements || 0
  60. } else {
  61. return 0
  62. }
  63. }
  64. },
  65. methods: {
  66. defaultSearch: function () {
  67. this.activeType = '0'
  68. this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
  69. this.$store.dispatch('searchStore/searchStoreDetail',
  70. {
  71. page: 1,
  72. count: 4,
  73. keyword: this.$route.query.w,
  74. types: this.paramType,
  75. op: 'pageByType'})
  76. },
  77. onSelectTypeChange: function () {
  78. let type = this.activeType
  79. if (type === '1') {
  80. this.paramType = 'ORIGINAL_FACTORY'
  81. } else if (type === '2') {
  82. this.paramType = 'AGENCY'
  83. } else if (type === '3') {
  84. this.paramType = 'DISTRIBUTION'
  85. } else if (type === '0') {
  86. this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
  87. }
  88. this.$emit('typeAction', this.paramType)
  89. this.$store.dispatch('searchStore/searchStoreDetail',
  90. {
  91. page: 1,
  92. count: 4,
  93. keyword: this.$route.query.w,
  94. types: this.paramType,
  95. op: 'pageByType'})
  96. },
  97. showClick: function () {
  98. this.show = !this.show
  99. this.$emit('showAction', this.show)
  100. }
  101. }
  102. }
  103. </script>
  104. <style>
  105. .search-store-title {
  106. margin-top: 22px;
  107. }
  108. .search-store-title .select-type {
  109. min-width: 87px;
  110. }
  111. .tab-filter{
  112. width: 1190px;
  113. height: 40px;
  114. margin-top: 14px;
  115. line-height: 40px;
  116. background: #f4f8ff;
  117. border: 1px solid rgb( 231, 231, 231 );
  118. border-bottom: none;
  119. }
  120. .tab-filter .fl,.tab-filter .fr{
  121. float: left;
  122. }
  123. .tab-filter .fl{
  124. font-size: 14px;
  125. }
  126. .tab-filter .fr{
  127. max-width: 1050px;
  128. margin-left: 10px;
  129. }
  130. .tab-filter .fl span{
  131. font-size: 14px;
  132. }
  133. .tab-filter .fr div{
  134. float: left;
  135. margin-right: 10px;
  136. }
  137. .tab-filter .fr div.active a, .tab-filter .fr div.active select{
  138. border: #5078cb 1px solid;
  139. color: #5078cb;
  140. }
  141. .tab-filter .fr div.active select option {
  142. color: #000;
  143. }
  144. .tab-filter .fr a{
  145. display: inline-block;
  146. padding: 0 10px;
  147. border: #ccc 1px solid;
  148. line-height: 30px;
  149. font-size: 14px;
  150. text-align: center;
  151. color: #333;
  152. height: 30px;
  153. background: #fff;
  154. }
  155. .tab-filter .fr a i{
  156. /*margin-left: 5px;*/
  157. }
  158. .tab-filter .fr a:hover{
  159. border: #5078cb 1px solid;
  160. color: #5078cb;
  161. }
  162. .tab-filter .off{
  163. float: right;
  164. margin-right: 20px;
  165. color: black;
  166. }
  167. .tab-filter .off a:hover{
  168. border: none;
  169. color: #5078cb;
  170. }
  171. .tab-filter .off a{
  172. border: none;
  173. text-align: right;
  174. background: none;
  175. color: #333;
  176. }
  177. .tab-filter .off a i{
  178. font-size: 16px;
  179. }
  180. .tab-filter .fr .form-control{
  181. width: 85px;
  182. height: 30px;
  183. line-height: 30px;
  184. border-radius: 0;
  185. padding: 0 5px;
  186. }
  187. </style>