_keycode.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. .search-item{
  42. justify-content: space-around;
  43. text-align: center;
  44. display:flex;
  45. span{
  46. display:inline-block;
  47. width:1.41rem;
  48. line-height: .76rem;
  49. font-size:.32rem;
  50. color:#666;
  51. }
  52. span.active{
  53. color:#3976f4;
  54. border-bottom:2px solid #3976f4;
  55. }
  56. }
  57. }
  58. </style>