PopularProject.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="popular-card">
  3. <el-card>
  4. <div slot="header" class="popular-header">
  5. <img src="../../assets/img/popular-project.png" alt="popular-project" class="popular-header-img"/>
  6. <span class="popular-header-title">热门项目</span>
  7. <el-button style="float: right; padding: 3px 0;line-height: 25px" type="text" @click="goToMore()">more>></el-button>
  8. </div>
  9. <div class="popular-list">
  10. <el-row class="popular-list-item" v-for="item in hotCrowdTestProjectVOs" :key="item.id">
  11. <el-col :span="19">
  12. <img src="../../assets/img/logo-project.png" alt="logo-project" class="pull-left project-logo-img">
  13. <div style="margin-left: 55px; cursor: pointer;" @click="goToProjectDetail(item.code)">
  14. <div class="list-item-title">
  15. {{item.name}}
  16. </div>
  17. <div class="list-item-info">
  18. {{item.description}}
  19. </div>
  20. </div>
  21. </el-col>
  22. <el-col :span="5">
  23. <div class="project-people-number">
  24. <span v-if="item.joinCount > 10000">{{item.joinCount > 10000 ? Math.floor(item.joinCount/10000) + 'w+' : item.joinCount}}人</span>
  25. <span v-else>{{item.joinCount > 1000 ? Math.floor(item.joinCount/1000) + 'k+' : item.joinCount}}人</span>
  26. </div>
  27. </el-col>
  28. </el-row>
  29. </div>
  30. </el-card>
  31. </div>
  32. </template>
  33. <script>
  34. import Http from '@/js/http.js';
  35. import Apis from '@/js/api.js';
  36. import {notify} from "../../constants";
  37. export default {
  38. name: 'PopularProject',
  39. props:['hotCrowdTestProjectVOs'],
  40. methods:{
  41. goToMore(){
  42. console.log("goToMoreProject");
  43. this.$router.push({
  44. name: 'PopularProjectAndTaskList',
  45. params: {type: "project"}
  46. })
  47. },
  48. goToProjectDetail (id) {
  49. this.$router.push({name: 'Project', params: {projectId: id}})
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="less">
  55. .popular-card {
  56. margin-bottom: 15px;
  57. }
  58. .popular-header .el-card__header{
  59. border-bottom: 2px solid rgba(0,117,203,1) !important;
  60. }
  61. .popular-card .el-card__body{
  62. padding: 0 !important;
  63. }
  64. .popular-header {
  65. height: 25px;
  66. vertical-align:middle;
  67. }
  68. .popular-header-title {
  69. display: inline-block;
  70. line-height: 25px;
  71. vertical-align:middle;
  72. }
  73. .popular-header-img {
  74. height: 25px;
  75. width: 25px;
  76. vertical-align:middle;
  77. }
  78. .popular-list {
  79. .popular-list-item {
  80. padding: 5px 10px;
  81. border-bottom: 1px solid #ccc !important;
  82. .list-item-title{
  83. font-size:14px;
  84. font-family:Source Han Sans CN;
  85. font-weight:400;
  86. color:rgba(0,0,0,1);
  87. overflow: hidden;
  88. text-overflow:ellipsis; //溢出用省略号显示
  89. white-space:nowrap; //溢出不换行
  90. }
  91. .list-item-info{
  92. font-size:14px;
  93. font-family:Adobe Heiti Std;
  94. font-weight:normal;
  95. color:rgba(153,153,153,1);
  96. overflow:hidden; //超出的文本隐藏
  97. text-overflow:ellipsis; //溢出用省略号显示
  98. white-space:nowrap; //溢出不换行
  99. }
  100. .project-logo-img {
  101. width: 44px;
  102. height: 44px;
  103. display: inline-block;
  104. margin: 2px 0;
  105. }
  106. .project-people-number {
  107. font-size:16px;
  108. font-family:Roboto;
  109. font-weight:400;
  110. color:rgba(0,117,203,1);
  111. line-height: 48px;
  112. }
  113. }
  114. }
  115. </style>