courseMessage.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <div class="courseBox">
  3. <div class="courseTop">
  4. <div class="courseImg">
  5. <img
  6. :src="
  7. cDetail.cover != null && cDetail.cover != ''
  8. ? JSON.parse(cDetail.cover).length > 0
  9. ? JSON.parse(cDetail.cover)[0].url
  10. : mr
  11. : mr
  12. "
  13. alt=""
  14. />
  15. </div>
  16. <div class="courseMes">
  17. <div class="cFirst">
  18. <div class="cTitle">{{ cDetail.title }}</div>
  19. <div class="jd">{{ cInfo.length }}阶段</div>
  20. <div class="jd">{{ rwLength }}任务</div>
  21. </div>
  22. <div class="cSecond">
  23. <div class="cType" v-if="cType.length">
  24. <div v-for="(item, index) in cType" :key="index">
  25. <span>{{ item + ':' }}</span>
  26. <span v-for="(item2, index2) in cJson[item]" :key="index2">{{ item2 }}</span>
  27. </div>
  28. </div>
  29. <div>
  30. 创建者:<span>{{ cDetail.username }}</span>
  31. </div>
  32. </div>
  33. <div class="Tname" v-if="tName.length > 0" @click="TnameCheck = !TnameCheck">
  34. 协同人员:<span v-for="(tname, tIndex) in TnameCheck ? tName : tName.slice(0, 6)" :key="tIndex">{{
  35. tname
  36. }}</span
  37. ><span v-if="!TnameCheck && tName.length > 6">更多....</span>
  38. </div>
  39. <div class="people">
  40. <div class="man">
  41. <img src="../../../assets/images/home/people.png" alt />
  42. </div>
  43. <div class="person">{{ cDetail.vcount != null ? cDetail.vcount : 0 }}人</div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. export default {
  51. props: {
  52. cDetail: {
  53. type: Object,
  54. default: {}
  55. },
  56. cInfo: {
  57. type: Array,
  58. default: []
  59. },
  60. rwLength: {
  61. type: Number,
  62. default: 0
  63. },
  64. cType: {
  65. type: Array,
  66. default: []
  67. },
  68. cJson: {
  69. type: Object,
  70. default: {}
  71. },
  72. tName: {
  73. type: Array,
  74. default: []
  75. }
  76. },
  77. data() {
  78. return {
  79. TnameCheck: false,
  80. mr: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/noBanner1656409780264.jpg'
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. @mixin display() {
  87. display: flex;
  88. flex-direction: row;
  89. flex-wrap: nowrap;
  90. align-items: center;
  91. }
  92. $pad: 0 0 10px 0;
  93. .courseBox {
  94. margin-top: 50px;
  95. height: 100%;
  96. .courseTop {
  97. .courseImg {
  98. width: 100%;
  99. height: 200px;
  100. > img {
  101. width: 100%;
  102. height: 100%;
  103. object-fit: cover;
  104. }
  105. }
  106. .courseMes {
  107. background: #fff;
  108. padding: 10px 0 0 15px;
  109. .cFirst {
  110. @include display();
  111. padding: $pad;
  112. .cTitle {
  113. font-size: 18px;
  114. font-weight: bold;
  115. max-width: 200px;
  116. white-space: nowrap;
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. word-break: break-word;
  120. margin-right: 10px;
  121. }
  122. .jd {
  123. background: #4a9eed;
  124. color: #fff;
  125. height: 20px;
  126. line-height: 20px;
  127. text-align: center;
  128. border-radius: 10px;
  129. padding: 0 10px;
  130. margin: 0 10px 0 0;
  131. }
  132. }
  133. .cSecond {
  134. @include display();
  135. padding: $pad;
  136. .cType {
  137. margin-right: 10px;
  138. }
  139. }
  140. .Tname {
  141. padding: $pad;
  142. > span {
  143. margin: 0px 5px;
  144. }
  145. }
  146. .people {
  147. padding: $pad;
  148. @include display();
  149. .man {
  150. width: 15px;
  151. height: 15px;
  152. > img {
  153. width: 100%;
  154. height: 100%;
  155. }
  156. }
  157. .person {
  158. font-size: 14px;
  159. margin-left: 10px;
  160. }
  161. }
  162. }
  163. }
  164. }
  165. </style>