HotContest.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <el-card class="popular-card">
  3. <div slot="header" class="popular-header">
  4. <img src="../../assets/img/crowd-contest.png" alt="hot-crowd" class="popular-header-img"/>
  5. <span class="popular-header-title">众测大赛</span>
  6. <el-button style="float: right; padding: 3px 0;line-height: 25px" type="text" @click="getMore()">>></el-button>
  7. </div>
  8. <div class="popular-list">
  9. <el-row class="popular-list-item" v-for="item in competitionList" :key="item.id">
  10. <el-col :span="23" @click.native="gotoDetail(item)">
  11. <img :src="logo_background" alt="logo-project" class="pull-left project-logo-img">
  12. <div style="margin-left: 55px">
  13. <div class="list-item-title">
  14. {{item.name}}
  15. </div>
  16. <div class="list-item-info">
  17. {{$moment(item.startTime).format("YYYY-MM-DD HH:mm:ss")}}
  18. </div>
  19. </div>
  20. </el-col>
  21. <el-col :span="1">
  22. <div class="project-people-number">
  23. >
  24. </div>
  25. </el-col>
  26. </el-row>
  27. </div>
  28. </el-card>
  29. </template>
  30. <script>
  31. import {CONFIG} from '../../config/index'
  32. export default {
  33. name: 'HotContest',
  34. props:['competitionList'],
  35. data(){
  36. return {
  37. logo_background:CONFIG.logo_background
  38. }
  39. },
  40. methods:{
  41. getMore(){
  42. this.$router.push({
  43. name: 'CompetitionList',
  44. });
  45. },
  46. gotoDetail(item){
  47. window.open(item.linkUrl)
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. @import "../../style/main";
  54. .popular-card {
  55. margin-bottom: 5px!important;
  56. }
  57. .popular-header .el-card__header{
  58. border-bottom: 2px solid rgba(0,117,203,1) !important;
  59. }
  60. .popular-card .el-card__body{
  61. padding: 0 !important;
  62. }
  63. .popular-header {
  64. height: 25px;
  65. vertical-align:middle;
  66. }
  67. .popular-header-title {
  68. display: inline-block;
  69. line-height: 25px;
  70. vertical-align:middle;
  71. }
  72. .popular-header-img {
  73. height: 25px;
  74. width: 25px;
  75. vertical-align:middle;
  76. }
  77. .popular-list {
  78. .popular-list-item {
  79. padding: 4px 10px !important;
  80. border-bottom: 1px solid #ccc !important;
  81. .list-item-title {
  82. font-size: 14px;
  83. font-family: Source Han Sans CN;
  84. font-weight: 400;
  85. color: rgba(0, 0, 0, 1);
  86. overflow: hidden;
  87. text-overflow: ellipsis; //溢出用省略号显示
  88. white-space: nowrap; //溢出不换行
  89. }
  90. .single-line-title{
  91. line-height: 48px;
  92. }
  93. .list-item-info {
  94. font-size: 14px;
  95. font-family: Adobe Heiti Std;
  96. font-weight: normal;
  97. color: rgba(153, 153, 153, 1);
  98. overflow: hidden; //超出的文本隐藏
  99. text-overflow: ellipsis; //溢出用省略号显示
  100. white-space: nowrap; //溢出不换行
  101. }
  102. .project-logo-img {
  103. width: 44px;
  104. height: 44px;
  105. display: inline-block;
  106. margin: 2px 0;
  107. }
  108. .project-people-number {
  109. font-size: 16px;
  110. font-family: Roboto;
  111. font-weight: 400;
  112. line-height: 48px;
  113. color: $--color-primary;
  114. }
  115. }
  116. }
  117. </style>