Lessons.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="container">
  3. <!--<div class="search">
  4. <Input v-model="values" placeholder="请输入优课主题 (如:小学语文)" style="width: 200px" />
  5. <Button>搜索</Button>
  6. </div>-->
  7. <div class="activity-item" v-for="(item,index) in lessons" :key="index">
  8. <div class="activity-banner">
  9. <img :src="getThumb(index)" />
  10. </div>
  11. <div class="activity-brief">
  12. <div class="left">
  13. <div class="line">
  14. <span class="tips">优课主题:</span>
  15. <span class="items">{{item.name}}</span>
  16. <span class="status" style="background: #999;">已结束</span>
  17. </div>
  18. <div class="line"><span class="tips">起止时间:</span> <span class="items2">{{item.timeTip}}</span></div>
  19. <div class="line"><span class="tips">优课数:</span> <span class="items2">{{item.viewActivityCount}}</span></div>
  20. </div>
  21. <div class="right">
  22. <Button type="primary" size="large" @click="goDetails">查看详情</Button>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import lessons from '@/static/lessons.json'
  30. export default {
  31. components: {
  32. },
  33. data() {
  34. return {
  35. lessons: [],
  36. values:""
  37. }
  38. },
  39. created() {
  40. this.lessons = lessons.list;
  41. },
  42. methods: {
  43. getList(type) {
  44. let list = noticeList.list;
  45. var newArray = list.filter(function(item){
  46. return item.noticeTypeId == type;
  47. });
  48. this.noticeList = newArray;
  49. },
  50. getThumb(index) {
  51. let thumb = {
  52. 0: require("../../assets/image/bg_lessons.png"),
  53. 1: require("../../assets/image/bg_lessons_2.png"),
  54. 2: require("../../assets/image/bg_lessons_3.png")
  55. };
  56. return thumb[index];
  57. },
  58. handleMenuClick(index,typeId,name) {
  59. this.activeIndex = index;
  60. this.typeName = name;
  61. this.getList(typeId);
  62. },
  63. goDetails() {
  64. this.$router.push('lessonList')
  65. }
  66. },
  67. mounted() {
  68. }
  69. }
  70. </script>
  71. <style scoped>
  72. html, body, #app {
  73. height: 100% !important;
  74. user-select: none;
  75. }
  76. .main-content {
  77. background: rgb(248,248,248) !important;
  78. }
  79. .container {
  80. width: 1200px;
  81. margin: 100px auto;
  82. display: flex;
  83. flex-direction: column;
  84. }
  85. .container .activity-item {
  86. width:100%;
  87. padding-bottom:50px;
  88. background:#fff;
  89. margin-top:40px;
  90. }
  91. .container .activity-item .activity-banner img {
  92. width:100%;
  93. }
  94. .container .activity-brief {
  95. width:100%;
  96. padding:15px 40px;
  97. display:flex;
  98. flex-direction:row;
  99. justify-content:space-between;
  100. align-items:center;
  101. }
  102. .container .activity-brief .line {
  103. font-size:16px;
  104. margin-top:10px;
  105. }
  106. .container .activity-brief .status {
  107. font-size:14px;
  108. padding:2px 8px;
  109. margin-left:8px;
  110. border-radius:5px;
  111. color:#fff;
  112. }
  113. .container .activity-brief .line .tips{
  114. font-weight:bold;
  115. color:#999;
  116. }
  117. .container .time-count {
  118. font-size:16px;
  119. margin-bottom:20px;
  120. }
  121. .container .time-count .count-down {
  122. color:orange;
  123. }
  124. .container .right .ivu-btn {
  125. width:180px;
  126. height:48px;
  127. font-size:16px;
  128. }
  129. </style>