Collection.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="collection">
  3. <div class="d-body" v-if="paging.total>0">
  4. <ul>
  5. <li class="collectionHover" @click="clickItem(item)" v-for="(item,i) in tableData" :key="i">
  6. <div>
  7. <img :src="item.thumb" :alt="item.title">
  8. </div>
  9. <div>
  10. <span :title="item.name">{{item.name||'-'}}</span>
  11. <img :src="require('@/assets/images/xinjiang/enter.png')" alt="">
  12. </div>
  13. </li>
  14. </ul>
  15. <Paging class="paging" @changeCurrent="data=>{this.$emit('changeCurrent',data)}" v-if="paging.total>0" :paging="paging" />
  16. </div>
  17. <div class="norecord" v-else>暂无数据</div>
  18. </div>
  19. </template>
  20. <script>
  21. import Paging from '@/components/Paging'
  22. export default {
  23. props:{
  24. tableData:Array,
  25. paging:Object
  26. },
  27. components:{
  28. Paging
  29. },
  30. data(){
  31. return {
  32. }
  33. },
  34. mounted(){
  35. },
  36. watch:{
  37. },
  38. methods:{
  39. clickItem(item){
  40. this.$showBroadcast({
  41. item,
  42. zhuti:this.theme
  43. })
  44. },
  45. }
  46. }
  47. </script>
  48. <style lang="less" scoped>
  49. .collection{
  50. position: relative;
  51. margin: 0 auto;
  52. width: 100%;
  53. display: flex;
  54. justify-content: space-between;
  55. align-items: flex-start;
  56. min-height: 30vh;
  57. .d-body{
  58. width: 100%;
  59. text-align: center;
  60. position: relative;
  61. padding-bottom: 104px;
  62. >ul{
  63. width: 100%;
  64. min-height: 70vh;
  65. text-align: left;
  66. >li{
  67. font-size: 0;
  68. display: inline-block;
  69. width: 310px;
  70. margin-right: 18px;
  71. text-align: center;
  72. margin-bottom: 37px;
  73. cursor: pointer;
  74. &:nth-child(3n){
  75. margin-right: 0;
  76. }
  77. >div{
  78. background: linear-gradient(180deg, #A2A2A2 0%, #606060 100%);
  79. &:first-child{
  80. height: 200px;
  81. position: relative;
  82. overflow: hidden;
  83. >img{
  84. position: absolute;
  85. top: 50%;
  86. left: 50%;
  87. transform: translate(-50%,-50%);
  88. width: 100%;
  89. }
  90. }
  91. &:last-child{
  92. height: 50px;
  93. padding: 0 12px;
  94. display: flex;
  95. justify-content: space-between;
  96. align-items: center;
  97. background: #fff;
  98. color: #333;
  99. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  100. >span{
  101. width: calc(100% - 40px);
  102. white-space: nowrap;
  103. text-overflow: ellipsis;
  104. overflow: hidden;
  105. word-break: break-all;
  106. font-weight: bold;
  107. text-align: left;
  108. }
  109. >img{
  110. width: 30px;
  111. height: 30px;
  112. }
  113. }
  114. }
  115. &:hover{
  116. >div{
  117. &:last-child{
  118. >span{
  119. color: #fff;
  120. }
  121. }
  122. }
  123. }
  124. }
  125. }
  126. .paging{
  127. margin-top: 27px;
  128. font-weight: normal;
  129. }
  130. }
  131. .norecord{
  132. position: absolute;
  133. top: 50%;
  134. left: 50%;
  135. transform: translate(-50%,-50%);
  136. font-size: 16px;
  137. color: #000;
  138. }
  139. }
  140. </style>