serve.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <div id="serve">
  3. <el-row>
  4. <el-col :span="24" class="info">
  5. <el-col :span="24" class="top">
  6. 研发服务
  7. </el-col>
  8. <el-col :span="24" class="list">
  9. <ul>
  10. <li class="schoolList" v-for="(item, index) in list" :key="index">
  11. <el-col :span="24" class="image">
  12. <el-image style="width:219px;height:170px;" :src="url"></el-image>
  13. </el-col>
  14. <el-col :span="24" class="title textOver">
  15. {{ item.name }}
  16. </el-col>
  17. <el-col :span="12" class="yen textOver"> {{ item.messattribute }}</el-col>
  18. <el-col :span="12" class="type"> {{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}</el-col>
  19. </li>
  20. </ul>
  21. <el-col :span="24" class="page">
  22. <el-pagination
  23. @current-change="handleCurrentChange"
  24. :current-page="currentPage"
  25. layout="total, prev, pager, next, jumper"
  26. :total="serveTotal"
  27. :page-size="pageSize"
  28. >
  29. </el-pagination>
  30. </el-col>
  31. </el-col>
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </template>
  36. <script>
  37. import _ from 'lodash';
  38. export default {
  39. name: 'company',
  40. props: {
  41. serveList: null,
  42. serveTotal: null,
  43. },
  44. components: {},
  45. data: () => ({
  46. currentPage: 1,
  47. pageSize: 10,
  48. origin: [],
  49. list: [],
  50. url: require('@a/fabu.jpg'),
  51. }),
  52. created() {},
  53. computed: {},
  54. methods: {
  55. search(page = 1) {
  56. this.$set(this, `list`, this.origin[page - 1]);
  57. },
  58. handleCurrentChange(currentPage) {
  59. this.search(currentPage);
  60. },
  61. },
  62. watch: {
  63. serveList: {
  64. immediate: true,
  65. deep: true,
  66. handler(val) {
  67. if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
  68. this.search();
  69. },
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="less" scoped>
  75. ul {
  76. padding: 0;
  77. margin: 0;
  78. }
  79. li {
  80. padding: 0;
  81. margin: 0;
  82. list-style: none;
  83. }
  84. p {
  85. padding: 0;
  86. margin: 0;
  87. }
  88. .info {
  89. padding: 0 20px 20px 20px;
  90. }
  91. .top {
  92. height: 50px;
  93. line-height: 50px;
  94. border-bottom: 1px dashed #ccc;
  95. color: #215299;
  96. font-size: 18px;
  97. }
  98. .list {
  99. margin: 20px 0 0 0;
  100. }
  101. .schoolList {
  102. float: left;
  103. width: 219px;
  104. height: 219px;
  105. margin: 0 10px 10px 0;
  106. border: 1px solid #ccc;
  107. background-color: #f3f3f3;
  108. overflow: hidden;
  109. }
  110. .schoolList:nth-child(4n) {
  111. width: 215px;
  112. margin: 0 0 10px 0;
  113. }
  114. .schoolList .image {
  115. height: 170px;
  116. }
  117. .schoolList .title {
  118. padding: 3px 10px;
  119. font-size: 14px;
  120. color: #63636d;
  121. }
  122. .schoolList .yen {
  123. font-size: 14px;
  124. padding: 0 0 0 10px;
  125. color: red;
  126. }
  127. .schoolList .type {
  128. font-size: 14px;
  129. text-align: right;
  130. padding: 0 10px 0 0;
  131. color: #63636d;
  132. }
  133. .page {
  134. padding: 34px 0;
  135. text-align: center;
  136. }
  137. </style>