courseMessage.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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>{{ 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. $font: 14px;
  94. .courseBox {
  95. margin-top: 50px;
  96. height: 100%;
  97. .courseTop {
  98. .courseImg {
  99. width: 100%;
  100. height: 200px;
  101. > img {
  102. width: 100%;
  103. height: 100%;
  104. object-fit: cover;
  105. }
  106. }
  107. .courseMes {
  108. background: #fff;
  109. padding: 10px 0 0 15px;
  110. .cFirst {
  111. @include display();
  112. padding: $pad;
  113. .cTitle {
  114. font-size: 18px;
  115. font-weight: bold;
  116. max-width: 200px;
  117. white-space: nowrap;
  118. overflow: hidden;
  119. text-overflow: ellipsis;
  120. word-break: break-word;
  121. margin-right: 10px;
  122. }
  123. .jd {
  124. background: #4a9eed;
  125. color: #fff;
  126. height: 20px;
  127. line-height: 20px;
  128. text-align: center;
  129. border-radius: 10px;
  130. padding: 0 10px;
  131. margin: 0 10px 0 0;
  132. }
  133. }
  134. .cSecond {
  135. @include display();
  136. padding: $pad;
  137. font-size: $font;
  138. .cTypeBox {
  139. margin-right: 10px;
  140. .cType {
  141. display: flex;
  142. flex-direction: row;
  143. flex-wrap: nowrap;
  144. align-items: center;
  145. > span:nth-child(2) {
  146. max-width: 200px;
  147. white-space: nowrap;
  148. overflow: hidden;
  149. text-overflow: ellipsis;
  150. word-break: break-word;
  151. }
  152. }
  153. }
  154. }
  155. .Tname {
  156. padding: $pad;
  157. font-size: $font;
  158. > span {
  159. margin: 0px 5px;
  160. }
  161. }
  162. .people {
  163. padding: $pad;
  164. @include display();
  165. .man {
  166. width: 15px;
  167. height: 15px;
  168. > img {
  169. width: 100%;
  170. height: 100%;
  171. }
  172. }
  173. .person {
  174. font-size: $font;
  175. margin-left: 10px;
  176. }
  177. }
  178. }
  179. }
  180. }
  181. </style>