_keycode.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="search-list">
  3. <div class="search-item">
  4. <span :class="activeType=='store'?'active':''" @click="activeType='store'">仅看有货</span>
  5. <span :class="activeType=='support'?'active':''" @click="activeType='support'">店铺自营</span>
  6. </div>
  7. <brand-list v-if="activeType=='support'"></brand-list>
  8. <detail-brand v-if="activeType=='store'"></detail-brand>
  9. <good-list></good-list>
  10. </div>
  11. </template>
  12. <script>
  13. import { BrandList, DetailBrand, GoodList } from '~components/mobile/search'
  14. export default {
  15. layout: 'main',
  16. data () {
  17. return {
  18. activeType: 'store',
  19. count: '',
  20. filter: {},
  21. page: '',
  22. sorting: {}
  23. }
  24. },
  25. fetch ({store, route}) {
  26. return Promise.all([
  27. store.dispatch('searchData/searchForList', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}})
  28. ])
  29. },
  30. components: {
  31. BrandList,
  32. DetailBrand,
  33. GoodList
  34. }
  35. }
  36. </script>
  37. <style scoped lang="scss">
  38. .search-list{
  39. width:100%;
  40. margin-bottom: .98rem;
  41. margin-top: .88rem;
  42. .search-item{
  43. justify-content: space-around;
  44. text-align: center;
  45. display:flex;
  46. span{
  47. display:inline-block;
  48. width:1.41rem;
  49. line-height: .76rem;
  50. font-size:.32rem;
  51. color:#666;
  52. }
  53. span.active{
  54. color:#3976f4;
  55. border-bottom:2px solid #3976f4;
  56. }
  57. }
  58. }
  59. </style>