chengguo.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div id="chengguo">
  3. <el-row>
  4. <el-col :span="24" class="news">
  5. <el-col :span="24" class="topTit">
  6. <el-col :span="18">
  7. <span :style="`border-color:${borderColor}`">{{title}}</span>
  8. </el-col>
  9. <el-col :span="6" style="text-align:right;">
  10. <el-link :underline="false" :style="`color:${Color}`"
  11. @click="$router.push({ path: `list/${chengguolist[0].id}` })">MORE<i
  12. class="el-icon-video-play"></i></el-link>
  13. </el-col>
  14. </el-col>
  15. <!-- chengguolist -->
  16. <!-- <el-col :span="24" class="newsMain">
  17. <el-col :span="24" v-for="(tag, index) in chengguolist" :key="index" :type="tag.type">
  18. <el-col class="chengguolist" :span="24" v-for="(item, index) in tag.children" :key="index">
  19. <el-col :span="16" @click.native="$router.push({ name: 'detail', params:{id:item.id} })">
  20. <p class="textOver">{{ item.title }}</p>
  21. </el-col>
  22. <el-col :span="8" style="text-align:right;">
  23. {{item.publish_time}}
  24. </el-col>
  25. </el-col>
  26. </el-col>
  27. </el-col> -->
  28. <el-col :span="24" class="newsMain">
  29. <el-col :span="24" v-for="(tag, index) in chengguolist" :key="index" :type="tag.type">
  30. <el-carousel indicator-position="outside" type="card" :interval="3000">
  31. <el-carousel-item v-for="(item, index) in tag.children" :key="index">
  32. <el-col :span="24" class="link" @click.native="$router.push({ name: 'detail', params:{id:item.id} })">
  33. <el-col :span="24">
  34. <el-image style="width:100%;height:345px;" :src="getPic(index + 1)"></el-image>
  35. </el-col>
  36. <el-col :span="24" class="title" :unerline="false">
  37. <p>{{item.title}}</p>
  38. </el-col>
  39. </el-col>
  40. </el-carousel-item>
  41. </el-carousel>
  42. </el-col>
  43. </el-col>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. </template>
  48. <script>
  49. export default {
  50. name: 'chengguo',
  51. props: {
  52. chengguolist: null,
  53. },
  54. components: {},
  55. data: () => ({
  56. borderColor: '#850000',
  57. Color: '#850000',
  58. title: '成果展示',
  59. img1:require('../../assets/cg1.png'),
  60. img2:require('../../assets/cg2.jpg'),
  61. img3:require('../../assets/cg3.jpg'),
  62. }),
  63. created() {
  64. },
  65. computed: {},
  66. methods: {
  67. getPic(index) {
  68. let res= index % 3;
  69. if(res === 1) return this.img1;
  70. else if(res === 2) return this.img2;
  71. else return this.img3
  72. }
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. p {
  78. margin: 0;
  79. padding: 0;
  80. }
  81. .textOver {
  82. overflow: hidden;
  83. text-overflow: ellipsis;
  84. white-space: nowrap;
  85. }
  86. .news {
  87. padding: 10px;
  88. height: 399px;
  89. }
  90. .topTit {
  91. border-bottom: 1px solid #ccc;
  92. }
  93. .topTit span {
  94. display: inline-block;
  95. height: 30px;
  96. border-bottom: 1px solid transparent;
  97. }
  98. .chengguolist {
  99. padding: 10px 0;
  100. border-bottom: 1px dashed #ccc;
  101. margin: 1px;
  102. }
  103. .newsMain {
  104. padding: 5px 0;
  105. height: 356px;
  106. }
  107. /deep/.el-carousel__container {
  108. height: 345px;
  109. }
  110. /deep/.el-carousel__indicators {
  111. display: none;
  112. }
  113. .newsMain .title {
  114. position: absolute;
  115. bottom: 0;
  116. background: rgba(119, 136, 153, 0.5);
  117. }
  118. .newsMain .title p {
  119. height: 59px;
  120. line-height: 60px;
  121. font-size: 25px;
  122. padding: 0 10px;
  123. color: #fff;
  124. overflow: hidden;
  125. text-overflow: ellipsis;
  126. white-space: nowrap;
  127. }
  128. .newsMain .link:hover {
  129. cursor: pointer;
  130. }
  131. .newsMain .link .title:hover p {
  132. color: #1e90ff;
  133. }
  134. </style>