index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="bg-F5">
  3. <div class="container">
  4. <el-row class="mt2rem" :gutter="20">
  5. <el-col :span="4">
  6. <mymenu></mymenu>
  7. </el-col>
  8. <el-col :span="20">
  9. <div class="infoTabDiv">
  10. <el-tabs v-model="activeName" @tab-click="handleClick">
  11. <el-tab-pane label="求购信息" name="first">
  12. <ul class="listUl">
  13. <li v-for="item in 10" :key="item">
  14. <router-link to="/info/buyDetail">
  15. <span class="name">信息信息信信息信息信息息11111</span
  16. ><span class="date">2010-01-01发布</span></router-link
  17. >
  18. </li>
  19. </ul>
  20. </el-tab-pane>
  21. <el-tab-pane label="供应信息" name="second">
  22. <ul class="listUl">
  23. <li v-for="item in 10" :key="item">
  24. <router-link to="/info/supplyDetail">
  25. <span class="name">信息信息信信息信息信息息11111</span
  26. ><span class="date">2010-01-01发布</span></router-link
  27. >
  28. </li>
  29. </ul>
  30. </el-tab-pane>
  31. </el-tabs>
  32. <div class="btnDiv">
  33. <router-link to="/info/buy">
  34. <el-button class="buyBtn" size="mini">我要买</el-button>
  35. </router-link>
  36. <el-button class="buyBtn" size="mini">我要卖</el-button>
  37. </div>
  38. </div>
  39. <el-pagination
  40. class="pageDiv"
  41. background
  42. @current-change="handleCurrentChange"
  43. :page-size="pageSize"
  44. :current-page="currentPage"
  45. layout="prev, pager, next,total, jumper"
  46. :total="total"
  47. ></el-pagination>
  48. </el-col>
  49. </el-row>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import { Component, Vue, Watch } from "vue-property-decorator";
  55. import mymenu from "@/components/menu.vue";
  56. export default {
  57. name: "app",
  58. components: {
  59. mymenu
  60. },
  61. data() {
  62. return {
  63. activeName: "first",
  64. currentPage: 1,
  65. pageSize: 10,
  66. total: 20
  67. };
  68. },
  69. methods: {
  70. handleClick(tab, event) {
  71. console.log(tab, event);
  72. },
  73. handleCurrentChange(val) {
  74. this.currentPage = val;
  75. this.requestData();
  76. }
  77. }
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. .infoTabDiv {
  82. position: relative;
  83. background: #fff;
  84. border-radius: 0.4rem;
  85. .btnDiv {
  86. height: 5rem;
  87. line-height: 5rem;
  88. position: absolute;
  89. right: 1.6rem;
  90. top: 0;
  91. .buyBtn {
  92. background: #fd5522;
  93. color: #fff;
  94. margin-left: 2rem;
  95. border: 0;
  96. border-radius: 0.4rem;
  97. }
  98. }
  99. .listUl {
  100. list-style: none;
  101. width: 100%;
  102. padding: 0 1.6rem 1.6rem;
  103. box-sizing: border-box;
  104. li {
  105. height: 3.6rem;
  106. line-height: 3.6rem;
  107. overflow: hidden;
  108. font-size: 1.4rem;
  109. .name {
  110. display: block;
  111. width: 80%;
  112. float: left;
  113. overflow: hidden;
  114. color: #333;
  115. }
  116. .date {
  117. display: block;
  118. width: 20%;
  119. float: left;
  120. text-align: right;
  121. color: #666;
  122. }
  123. }
  124. }
  125. }
  126. .pageDiv {
  127. text-align: right;
  128. margin-top: 0.5rem;
  129. padding: 2rem 0;
  130. }
  131. .mt2rem {
  132. margin-top: 2rem;
  133. }
  134. </style>
  135. <style lang="scss">
  136. .infoTabDiv {
  137. .el-tabs__nav-scroll {
  138. padding: 0 1.6rem;
  139. box-sizing: border-box;
  140. }
  141. .el-tabs__item {
  142. height: 5rem;
  143. line-height: 5rem;
  144. }
  145. .el-tabs__item:hover {
  146. color: #fd5522;
  147. }
  148. .el-tabs__item.is-active {
  149. color: #fd5522;
  150. }
  151. .el-tabs__active-bar {
  152. background-color: #fd5522;
  153. }
  154. }
  155. .pageDiv.el-pagination.is-background .el-pager li:not(.disabled).active {
  156. background: #fd5522;
  157. }
  158. .pageDiv.el-pagination.is-background .el-pager li:not(.disabled):hover {
  159. color: #fd5522;
  160. }
  161. </style>