courseChap.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="chapBox">
  3. <div class="chapTop">
  4. <div :class="{ isStepCss: isStep == 0 }" @click="isStep = 0">任务阶段</div>
  5. <div :class="{ isStepCss: isStep == 1 }" @click="isStep = 1">项目详情</div>
  6. </div>
  7. <div v-if="isStep == 1" class="briefCss">
  8. {{ brief ? brief : '暂无详情' }}
  9. </div>
  10. <div v-if="isStep == 0" class="courseJdBox">
  11. <div class="blue_box_one" v-for="(item, index) in chInfo" :key="index" @click="goCourse">
  12. <div>第{{ index + 1 }}阶段</div>
  13. <div :title="item.dyName">{{ item.dyName }}</div>
  14. <div>{{ item.chapterInfo[0].taskJson.length }}个任务</div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. chInfo: {
  23. type: Array
  24. },
  25. brief: {
  26. type: String,
  27. default: ''
  28. }
  29. },
  30. data() {
  31. return {
  32. isStep: 0
  33. }
  34. },
  35. methods: {
  36. goCourse() {
  37. this.$emit('goCourse')
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .chapBox {
  44. margin-top: 15px;
  45. background: #fff;
  46. .chapTop {
  47. display: flex;
  48. flex-direction: row;
  49. flex-wrap: nowrap;
  50. align-items: center;
  51. font-size: 16px;
  52. padding: 10px 0 10px 15px;
  53. > div {
  54. color: #afafaf;
  55. padding: 0 0 5px 0;
  56. margin-right: 30px;
  57. }
  58. .isStepCss {
  59. color: #000;
  60. font-weight: bold;
  61. border-bottom: 3px solid #4f86d6;
  62. }
  63. }
  64. .briefCss {
  65. width: 90%;
  66. text-indent: 30px;
  67. font-size: 16px;
  68. margin: 10px auto;
  69. height: 300px;
  70. overflow: auto;
  71. line-height: 30px;
  72. }
  73. .courseJdBox {
  74. display: flex;
  75. flex-direction: row;
  76. flex-wrap: wrap;
  77. align-items: flex-start;
  78. justify-content: flex-start;
  79. padding: 0 0 0 30px;
  80. .blue_box_one {
  81. width: 150px;
  82. height: 150px;
  83. background-image: linear-gradient(90deg, #477cd7, #65b9fc);
  84. display: flex;
  85. flex-direction: column;
  86. flex-wrap: nowrap;
  87. align-items: center;
  88. justify-content: center;
  89. color: #fff;
  90. border-radius: 12px;
  91. margin: 0 15px 10px 0;
  92. >div{
  93. margin: 3px 0;
  94. font-size: 14px;
  95. }
  96. > div:nth-child(1) {
  97. font-size: 16px;
  98. font-weight: bold;
  99. }
  100. > div:nth-child(2) {
  101. max-width: 100px;
  102. white-space: nowrap;
  103. overflow: hidden;
  104. text-overflow: ellipsis;
  105. word-break: break-word;
  106. }
  107. }
  108. }
  109. }
  110. </style>