<template>
  <div class="main">
    <!-- 搜索 -->
    <search-bar readonly @click.native="$router.push({ name: 'search' })"></search-bar>
    <card title="组织排行榜">
      <group-list :show-index="true"></group-list>
    </card>
  </div>
</template>

<script>
// components
import SearchBar from '@/components/SearchBar'
import Card from '@/components/Card'
import GroupList from '@/components/GroupList'
export default {
  name: 'GroupIndex',
  components: { SearchBar, Card, GroupList },
  data() {
    return {
      typeMap: {
        1: '公益行',
        2: '去游学',
        3: '直播课',
        4: '找工作',
        5: '运动家'
      }
    }
  },
  computed: {
    title() {
      const { type = 1 } = this.$route.query
      return this.typeMap[type]
    }
  },
  methods: {
    onSearch() {
      this.$router.push({ name: 'search' })
    }
  }
}
</script>

<style lang="scss"></style>
