Floor.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="floor">
  3. <h3>F{{ floor.floorNumber }}&nbsp;{{ floor.name }}</h3>
  4. <ul class="list-unstyled clearfix" :style="{borderColor: floor.items[1].backGroundColor || '#d8d8d8'}">
  5. <li v-for="(item, index) in floor.items" :key="index" class="floor-item" :class="item.size"
  6. :style="{backgroundColor: item.backGroundColor || '#fff', borderColor: item.borderColor || floor.items[1].backGroundColor || '#d8d8d8'}">
  7. <a :href="item.hrefUrl" target="_blank">
  8. <img :src="item.pictureUrl" class="floor-item-img"/>
  9. <div class="floor-content">
  10. <p v-if="item.name" class="floor-item-name">{{ item.name }}</p>
  11. <p v-if="item.body" v-html="item.body" class="floor-item-body"></p>
  12. </div>
  13. </a>
  14. </li>
  15. </ul>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'floor',
  21. props: {
  22. floor: Object
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .floor {
  28. ul {
  29. border-bottom: 1px solid #d8d8d8;
  30. }
  31. .floor-item {
  32. float: left;
  33. position: relative;
  34. overflow: hidden;
  35. a {
  36. display: block;
  37. text-align: center;
  38. }
  39. .floor-item-img:hover {
  40. transform: scale(1.1);
  41. }
  42. .floor-content {
  43. position: absolute;
  44. text-align: center;
  45. }
  46. &.medium,&.small {
  47. border-top: 1px solid #d8d8d8;
  48. border-right: 1px solid #d8d8d8;
  49. }
  50. &.large {
  51. width: 360px;
  52. height: 400px;
  53. img {
  54. width: 226px;
  55. height: 226px;
  56. margin-top: 40px;
  57. }
  58. }
  59. &.medium {
  60. width: 389px;
  61. height: 199px;
  62. img {
  63. position: absolute;
  64. bottom: 50px;
  65. right: 52px;
  66. width: 100px;
  67. height: 100px;
  68. }
  69. .floor-content {
  70. top: 0;
  71. left: 0;
  72. right: 0;
  73. padding: 30px;
  74. }
  75. .floor-item-name {
  76. color: #575757;
  77. font-size: 24px;
  78. margin-bottom: 30px;
  79. text-align: left;
  80. font-weight: 600;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. display: -webkit-box;
  84. -webkit-box-orient: vertical;
  85. -webkit-line-clamp: 2;
  86. width: 300px;
  87. word-wrap: break-word;
  88. }
  89. .floor-item-body {
  90. margin-right: 150px;
  91. color: #575757;
  92. font-size: 14px;
  93. line-height: 20px;
  94. text-align: left;
  95. }
  96. }
  97. &.small {
  98. width: 219px;
  99. height: 199px;
  100. img {
  101. margin-top: 15px;
  102. width: 70px;
  103. height: 70px;
  104. }
  105. .floor-content {
  106. top: 100px;
  107. bottom: 0;
  108. left: 0;
  109. right: 0;
  110. padding: 15px;
  111. }
  112. .floor-item-name {
  113. color: #575757;
  114. font-size: 16px;
  115. font-weight: 600;
  116. text-overflow: ellipsis;
  117. overflow: hidden;
  118. display: -webkit-box;
  119. -webkit-box-orient: vertical;
  120. -webkit-line-clamp: 2;
  121. word-break: break-all;
  122. }
  123. .floor-item-body {
  124. color: #575757;
  125. font-size: 14px;
  126. line-height: 18px;
  127. }
  128. }
  129. &.tiny {
  130. display: none;
  131. }
  132. }
  133. }
  134. </style>