<template>
  <div class="page">
    <div class="page-top"></div>
    <div class="page-content">
      <div class="content"></div>
      <div class="entry">
        <div class="title">活动入口</div>
        <div class="list">
          <div class="cover" @click="toDetail">
            <span class="status" :class="activity.type">{{
              activity.text
            }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  layout: 'app-ross',
  data() {
    return {
      status: 1,
    }
  },
  computed: {
    ...mapGetters(['routePrefix']),
    activity() {
      const result = {
        0: { type: 'end', text: '已结束' },
        1: { type: 'start', text: '进行中' },
        2: { type: 'wait', text: '未开始' },
      }
      return result[this.status]
    },
  },
  methods: {
    toDetail() {
      const url = `${this.routePrefix}/activity/challenge/list`
      this.$router.push(url)
    },
  },
}
</script>

<style lang="scss" scoped>
@media screen and (min-width: 768px) {
  .page {
    padding-bottom: 269px;
    .page-top {
      width: 100%;
      height: 530px;
      background-position: center;
      background: #ddd;
    }

    .page-content {
      width: 1200px;
      margin: 0 auto;
      margin-top: 16px;

      .content {
        min-height: 1170px;
        background: #fff5e8;
      }

      .entry {
        .title {
          font-size: 24px;
          text-align: center;
          font-weight: bold;
          color: #282828;
          margin: 85px 0 48px;
        }

        .cover {
          position: relative;
          width: 856px;
          height: 340px;
          margin: 0 auto;
          background: pink;
          cursor: pointer;

          .status {
            position: absolute;
            left: 0;
            top: 0;
            width: 72px;
            height: 32px;
            line-height: 32px;
            border-radius: 8px 0 8px 0;
            color: #fff;
            text-align: center;

            &.wait {
              background: #f94b4b;
            }
            &.start {
              background: #f3920d;
            }
            &.end {
              background: rgba(0, 0, 0, 0.3);
            }
          }
        }
      }
    }
  }
}
</style>
