courseAll.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="courseBox" v-if="courseList.length > 0">
  3. <div v-for="(c, cIndex) in courseList" :key="cIndex" class="courseItem" @click="goTo(c.courseId)">
  4. <div class="cDetail">
  5. <div class="courseImg">
  6. <img :src="c.cover ? JSON.parse(c.cover)[0].url : require('../../../assets/images/home/wheel.png')" alt="" />
  7. </div>
  8. <div class="cRight">
  9. <div>{{ c.title }}</div>
  10. <div>创建者:{{ c.uname }}</div>
  11. <div class="jdBox">
  12. <div class="jdImg"><img src="../../../assets/images/home/jd.png" alt="" /></div>
  13. <div>{{ JSON.parse(c.chapters).length }}阶段</div>
  14. </div>
  15. <div>{{ c.typename ? c.typename : '暂无分类' }}</div>
  16. </div>
  17. </div>
  18. <div class="cButtonBox" v-show="false">
  19. <div class="cButton">
  20. <div class="bImg"><img src="../../../assets/images/home/courseEvaIcon.png" alt="" /></div>
  21. <div>评课</div>
  22. </div>
  23. <div class="cButton">
  24. <div class="bImg"><img src="../../../assets/images/home/evaIcon.png" alt="" /></div>
  25. <div>评价</div>
  26. </div>
  27. <div class="cButton">
  28. <div class="bImg"><img src="../../../assets/images/home/analysisIcon.png" alt="" /></div>
  29. <div>分析</div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. props: {
  38. courseList: {
  39. type: Array,
  40. default: []
  41. }
  42. },
  43. methods: {
  44. goTo(cid) {
  45. this.$router.push({ path: '/courseDetail', query: { courseid: cid } })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .courseBox {
  52. background: #e8ebf2;
  53. padding: 15px 0;
  54. .courseItem {
  55. background: #fff;
  56. width: 90%;
  57. margin: 0 auto 15px;
  58. border-radius: 10px;
  59. box-shadow: 0 0 10px 1px #dcdfe6;
  60. padding: 10px;
  61. .cDetail {
  62. display: flex;
  63. flex-direction: row;
  64. flex-wrap: nowrap;
  65. align-items: flex-start;
  66. .courseImg {
  67. width: 110px;
  68. height: 80px;
  69. > img {
  70. width: 100%;
  71. height: 100%;
  72. border-radius: 5px;
  73. }
  74. }
  75. .cRight {
  76. margin-left: 20px;
  77. > div {
  78. margin: 2px 0;
  79. }
  80. > div:nth-child(1) {
  81. font-size: 18px;
  82. font-weight: bold;
  83. max-width: 225px;
  84. white-space: nowrap;
  85. overflow: hidden;
  86. text-overflow: ellipsis;
  87. word-break: break-word;
  88. }
  89. .jdBox {
  90. display: flex;
  91. flex-direction: row;
  92. flex-wrap: nowrap;
  93. align-items: center;
  94. justify-content: flex-start;
  95. .jdImg {
  96. width: 15px;
  97. margin-top: 1px;
  98. height: 15px;
  99. > img {
  100. width: 100%;
  101. height: 100%;
  102. }
  103. }
  104. }
  105. }
  106. }
  107. .cButtonBox {
  108. width: 100%;
  109. display: flex;
  110. flex-direction: row;
  111. flex-wrap: nowrap;
  112. align-items: center;
  113. padding: 10px 0 0 0;
  114. .cButton {
  115. width: 100px;
  116. height: 30px;
  117. margin: 0 10px 0 0;
  118. display: flex;
  119. flex-direction: row;
  120. flex-wrap: nowrap;
  121. align-items: center;
  122. border: 1px solid #587ff3;
  123. color: #587ff3;
  124. border-radius: 5px;
  125. justify-content: center;
  126. .bImg {
  127. width: 20px;
  128. height: 20px;
  129. > img {
  130. width: 100%;
  131. height: 100%;
  132. }
  133. }
  134. }
  135. }
  136. }
  137. }
  138. </style>