index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div class="page">
  3. <div class="page-top"></div>
  4. <div class="page-content">
  5. <div class="content"></div>
  6. <div class="entry">
  7. <div class="title">活动入口</div>
  8. <div class="list">
  9. <div class="cover" @click="toDetail">
  10. <span class="status" :class="activity.type">{{
  11. activity.text
  12. }}</span>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { mapGetters } from 'vuex'
  21. export default {
  22. layout: 'app-ross',
  23. data() {
  24. return {
  25. status: 1,
  26. }
  27. },
  28. computed: {
  29. ...mapGetters(['routePrefix']),
  30. activity() {
  31. const result = {
  32. 0: { type: 'end', text: '已结束' },
  33. 1: { type: 'start', text: '进行中' },
  34. 2: { type: 'wait', text: '未开始' },
  35. }
  36. return result[this.status]
  37. },
  38. },
  39. methods: {
  40. toDetail() {
  41. const url = `${this.routePrefix}/activity/challenge/list`
  42. this.$router.push(url)
  43. },
  44. },
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. @media screen and (min-width: 768px) {
  49. .page {
  50. padding-bottom: 269px;
  51. .page-top {
  52. width: 100%;
  53. height: 530px;
  54. background-position: center;
  55. background: #ddd;
  56. }
  57. .page-content {
  58. width: 1200px;
  59. margin: 0 auto;
  60. margin-top: 16px;
  61. .content {
  62. min-height: 1170px;
  63. background: #fff5e8;
  64. }
  65. .entry {
  66. .title {
  67. font-size: 24px;
  68. text-align: center;
  69. font-weight: bold;
  70. color: #282828;
  71. margin: 85px 0 48px;
  72. }
  73. .cover {
  74. position: relative;
  75. width: 856px;
  76. height: 340px;
  77. margin: 0 auto;
  78. background: pink;
  79. cursor: pointer;
  80. .status {
  81. position: absolute;
  82. left: 0;
  83. top: 0;
  84. width: 72px;
  85. height: 32px;
  86. line-height: 32px;
  87. border-radius: 8px 0 8px 0;
  88. color: #fff;
  89. text-align: center;
  90. &.wait {
  91. background: #f94b4b;
  92. }
  93. &.start {
  94. background: #f3920d;
  95. }
  96. &.end {
  97. background: rgba(0, 0, 0, 0.3);
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }
  105. </style>