Floor.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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 h3 {
  28. width: 100%;
  29. height: 70px;
  30. font-size: 24px;
  31. padding-top: 0;
  32. margin: 0;
  33. line-height: 100px;
  34. color: #333;
  35. }
  36. .floor {
  37. ul {
  38. border-bottom: 1px solid #d8d8d8;
  39. }
  40. .floor-item {
  41. float: left;
  42. position: relative;
  43. overflow: hidden;
  44. a {
  45. display: block;
  46. text-align: center;
  47. }
  48. .floor-item-img:hover {
  49. transform: scale(1.1);
  50. }
  51. .floor-content {
  52. position: absolute;
  53. text-align: center;
  54. }
  55. &.medium,&.small {
  56. border-top: 1px solid #d8d8d8;
  57. border-right: 1px solid #d8d8d8;
  58. }
  59. &.large {
  60. width: 360px;
  61. height: 400px;
  62. img {
  63. width: 226px;
  64. height: 226px;
  65. margin-top: 40px;
  66. }
  67. }
  68. &.medium {
  69. width: 390px;
  70. height: 200px;
  71. img {
  72. position: absolute;
  73. bottom: 50px;
  74. right: 52px;
  75. width: 100px;
  76. height: 100px;
  77. }
  78. .floor-content {
  79. top: 0;
  80. left: 0;
  81. right: 0;
  82. padding: 30px;
  83. }
  84. .floor-item-name {
  85. color: #575757;
  86. font-size: 24px;
  87. margin-bottom: 30px;
  88. text-align: left;
  89. font-weight: 600;
  90. overflow: hidden;
  91. text-overflow: ellipsis;
  92. display: -webkit-box;
  93. -webkit-box-orient: vertical;
  94. -webkit-line-clamp: 2;
  95. width: 300px;
  96. word-wrap: break-word;
  97. }
  98. .floor-item-body {
  99. margin-right: 150px;
  100. color: #575757;
  101. font-size: 14px;
  102. line-height: 20px;
  103. text-align: left;
  104. }
  105. }
  106. &.small {
  107. width: 220px;
  108. height: 200px;
  109. img {
  110. margin-top: 15px;
  111. width: 70px;
  112. height: 70px;
  113. }
  114. .floor-content {
  115. top: 100px;
  116. bottom: 0;
  117. left: 0;
  118. right: 0;
  119. padding: 15px;
  120. }
  121. .floor-item-name {
  122. color: #575757;
  123. font-size: 16px;
  124. font-weight: 600;
  125. text-overflow: ellipsis;
  126. overflow: hidden;
  127. display: -webkit-box;
  128. -webkit-box-orient: vertical;
  129. -webkit-line-clamp: 2;
  130. word-break: break-all;
  131. display: inherit;
  132. }
  133. .floor-item-body {
  134. color: #575757;
  135. font-size: 14px;
  136. line-height: 18px;
  137. }
  138. }
  139. &.tiny {
  140. display: none;
  141. }
  142. }
  143. }
  144. </style>