courseMessage.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="cTypeBox" v-if="cType.length">
  24. <div v-for="(item, index) in cType" :key="index" class="cType">
  25. <span style="min-width: 50px">{{ item + ':' }}</span>
  26. <span v-for="(item2, index2) in cJson[item]" :key="index2">{{ item2 }}</span>
  27. </div>
  28. </div>
  29. <div>
  30. <span style="min-width: 50px">创建者:</span> <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>参与人数:</div>
  41. <div class="man">
  42. <img src="../../../assets/images/home/people.png" alt />
  43. </div>
  44. <div class="person">{{ cDetail.vcount != null ? cDetail.vcount : 0 }}人</div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. props: {
  53. cDetail: {
  54. type: Object
  55. },
  56. cInfo: {
  57. type: Array
  58. },
  59. rwLength: {
  60. type: Number,
  61. default: 0
  62. },
  63. cType: {
  64. type: Array
  65. },
  66. cJson: {
  67. type: Object
  68. },
  69. tName: {
  70. type: Array
  71. }
  72. },
  73. data() {
  74. return {
  75. TnameCheck: false,
  76. mr: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/noBanner1656409780264.jpg'
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. @mixin display() {
  83. display: flex;
  84. flex-direction: row;
  85. flex-wrap: nowrap;
  86. align-items: center;
  87. }
  88. $pad: 0 10px 10px 0;
  89. $font: 15px;
  90. .courseBox {
  91. margin-top: 50px;
  92. min-height: 350px;
  93. .courseTop {
  94. .courseImg {
  95. width: 100%;
  96. height: 200px;
  97. > img {
  98. width: 100%;
  99. height: 100%;
  100. object-fit: cover;
  101. }
  102. }
  103. .courseMes {
  104. padding: 10px 0 0 15px;
  105. .cFirst {
  106. @include display();
  107. padding: $pad;
  108. .cTitle {
  109. font-size: 18px;
  110. font-weight: bold;
  111. max-width: 200px;
  112. white-space: nowrap;
  113. overflow: hidden;
  114. text-overflow: ellipsis;
  115. word-break: break-word;
  116. margin-right: 10px;
  117. }
  118. .jd {
  119. background: #4a9eed;
  120. color: #fff;
  121. height: 20px;
  122. line-height: 20px;
  123. text-align: center;
  124. border-radius: 10px;
  125. padding: 0 10px;
  126. margin: 0 10px 0 0;
  127. }
  128. }
  129. .cSecond {
  130. @include display();
  131. padding: $pad;
  132. font-size: $font;
  133. .cTypeBox {
  134. margin-right: 10px;
  135. .cType {
  136. display: flex;
  137. flex-direction: row;
  138. flex-wrap: nowrap;
  139. align-items: center;
  140. > span:nth-child(2) {
  141. max-width: 180px;
  142. white-space: nowrap;
  143. overflow: hidden;
  144. text-overflow: ellipsis;
  145. word-break: break-word;
  146. }
  147. }
  148. }
  149. }
  150. .Tname {
  151. padding: $pad;
  152. font-size: $font;
  153. > span {
  154. margin: 0px 5px;
  155. }
  156. }
  157. .people {
  158. padding: $pad;
  159. @include display();
  160. > div:nth-child(1) {
  161. font-size: 15px;
  162. }
  163. .man {
  164. width: 20px;
  165. height: 20px;
  166. > img {
  167. width: 100%;
  168. height: 100%;
  169. }
  170. }
  171. .person {
  172. font-size: $font;
  173. margin-left: 10px;
  174. }
  175. }
  176. }
  177. }
  178. }
  179. </style>