PopularProject.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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">
  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. }
  49. }
  50. </script>
  51. <style lang="less">
  52. .popular-card {
  53. margin-bottom: 15px;
  54. }
  55. .popular-header .el-card__header{
  56. border-bottom: 2px solid rgba(0,117,203,1) !important;
  57. }
  58. .popular-card .el-card__body{
  59. padding: 0 !important;
  60. }
  61. .popular-header {
  62. height: 25px;
  63. vertical-align:middle;
  64. }
  65. .popular-header-title {
  66. display: inline-block;
  67. line-height: 25px;
  68. vertical-align:middle;
  69. }
  70. .popular-header-img {
  71. height: 25px;
  72. width: 25px;
  73. vertical-align:middle;
  74. }
  75. .popular-list {
  76. .popular-list-item {
  77. padding: 5px 10px;
  78. border-bottom: 1px solid #ccc !important;
  79. .list-item-title{
  80. font-size:14px;
  81. font-family:Source Han Sans CN;
  82. font-weight:400;
  83. color:rgba(0,0,0,1);
  84. overflow: hidden;
  85. text-overflow:ellipsis; //溢出用省略号显示
  86. white-space:nowrap; //溢出不换行
  87. }
  88. .list-item-info{
  89. font-size:14px;
  90. font-family:Adobe Heiti Std;
  91. font-weight:normal;
  92. color:rgba(153,153,153,1);
  93. overflow:hidden; //超出的文本隐藏
  94. text-overflow:ellipsis; //溢出用省略号显示
  95. white-space:nowrap; //溢出不换行
  96. }
  97. .project-logo-img {
  98. width: 44px;
  99. height: 44px;
  100. display: inline-block;
  101. margin: 2px 0;
  102. }
  103. .project-people-number {
  104. font-size:16px;
  105. font-family:Roboto;
  106. font-weight:400;
  107. color:rgba(0,117,203,1);
  108. line-height: 48px;
  109. }
  110. }
  111. }
  112. </style>