home-class.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="tab-class">
  3. <view class="class" @click="onTap(classStatusEnum.RUNNING)">
  4. <u--image src="/static/ic_current_class.png" width="296rpx" height="168rpx" />
  5. <view class="current-text">
  6. <text class="current-tip">正在开班</text>
  7. <text class="current-txt">开班中:{{current}}</text>
  8. </view>
  9. </view>
  10. <view class="other-class">
  11. <view class="class" @click="onTap(classStatusEnum.NO_START)">
  12. <u--image src="/static/ic_future_class.png" width="367rpx" height="80rpx" />
  13. <text class="class-text">即将开班:{{future}}</text>
  14. </view>
  15. <view class="class" @click="onTap(classStatusEnum.HISTORY)">
  16. <u--image src="/static/ic_history_class.png" width="367rpx" height="80rpx" />
  17. <text class="class-text">历史开班:{{history}}</text>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. classStatus
  25. } from '@/utils/enum.js'
  26. export default {
  27. name: "home-class",
  28. props: {
  29. current: Number,
  30. future: Number,
  31. history: Number
  32. },
  33. data() {
  34. return {
  35. classStatusEnum: classStatus,
  36. };
  37. },
  38. methods: {
  39. onTap(type) {},
  40. }
  41. }
  42. </script>
  43. <style scoped>
  44. /* 正在开班 历史,即将 */
  45. .tab-class {
  46. padding-left: 30rpx;
  47. padding-right: 30rpx;
  48. display: flex;
  49. flex-direction: row;
  50. height: 170rpx;
  51. }
  52. .class {
  53. flex: 1;
  54. width: 100%;
  55. position: relative;
  56. }
  57. .other-class {
  58. flex: 1;
  59. height: 100%;
  60. display: flex;
  61. flex-direction: column;
  62. align-items: flex-end;
  63. }
  64. .current-text {
  65. position: absolute;
  66. right: 70rpx;
  67. top: 40rpx;
  68. display: flex;
  69. flex-direction: column;
  70. }
  71. .current-tip {
  72. font-size: 30rpx;
  73. font-weight: 500;
  74. color: #FFFFFF;
  75. }
  76. .current-txt {
  77. margin-top: 10rpx;
  78. font-size: 22rpx;
  79. font-weight: 500;
  80. color: #FFE1DD;
  81. }
  82. .class-text {
  83. width: 100%;
  84. height: 100%;
  85. text-align: center;
  86. font-size: 26rpx;
  87. font-weight: 500;
  88. color: #FFFFFF;
  89. position: absolute;
  90. right: 0;
  91. top: 20rpx;
  92. }
  93. </style>