Floor.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div class="floor" :class="!isDefault ? 'normal-floor' : ''">
  3. <h3>{{ 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 + (isDefault ? ' default-floor' : '')"
  6. :style="{backgroundColor: item.backGroundColor || '#fff', borderColor: item.borderColor || floor.items[1].backGroundColor || '#d8d8d8'}">
  7. <img v-if="item.size != 'large' && isDefault" src="/images/floor/specificPrice-home.png" alt="">
  8. <a :href="item.hrefUrl" target="_blank">
  9. <img :src="item.pictureUrl" class="floor-item-img"/>
  10. <div class="floor-content">
  11. <p v-if="item.name" class="floor-item-name">{{ item.name }}</p>
  12. <p v-if="item.body" v-html="item.body" class="floor-item-body"></p>
  13. <p class="floor-item-price" v-if="item.size != 'large' && isDefault">{{item.currency == 'RMB' ? '¥' : '$'}}&nbsp;{{item.price}}</p>
  14. </div>
  15. </a>
  16. </li>
  17. </ul>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'floor',
  23. props: ['floor', 'isDefault']
  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. .floor-item-price {
  55. color: #ff4040;
  56. font-size: 16px;
  57. font-weight: bold;
  58. }
  59. }
  60. &.medium,&.small {
  61. border-top: 1px solid #d8d8d8;
  62. border-right: 1px solid #d8d8d8;
  63. }
  64. &.large {
  65. width: 360px;
  66. height: 400px;
  67. a {
  68. img {
  69. width: 226px;
  70. height: 226px;
  71. margin-top: 40px;
  72. }
  73. }
  74. &.default-floor {
  75. a {
  76. img {
  77. width: 360px;
  78. height: 400px;
  79. margin-top: 0;
  80. &:hover {
  81. transform: none;
  82. }
  83. }
  84. }
  85. }
  86. }
  87. &.medium {
  88. width: 390px;
  89. height: 200px;
  90. a {
  91. img {
  92. position: absolute;
  93. bottom: 50px;
  94. right: 52px;
  95. width: 100px;
  96. height: 90px;
  97. }
  98. }
  99. .floor-content {
  100. top: 0;
  101. left: 0;
  102. right: 0;
  103. padding: 30px;
  104. }
  105. .floor-item-name {
  106. color: #575757;
  107. font-size: 20px;
  108. margin-bottom: 30px;
  109. text-align: left;
  110. font-weight: 600;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. display: -webkit-box;
  114. -webkit-box-orient: vertical;
  115. -webkit-line-clamp: 2;
  116. width: 300px;
  117. word-wrap: break-word;
  118. }
  119. .floor-item-body {
  120. margin-right: 150px;
  121. color: #575757;
  122. font-size: 14px;
  123. line-height: 20px;
  124. text-align: left;
  125. }
  126. &.default-floor {
  127. .floor-content {
  128. .floor-item-body {
  129. color: #666;
  130. }
  131. .floor-item-price {
  132. text-align: left;
  133. }
  134. }
  135. > img {
  136. position: absolute;
  137. top: 0;
  138. left: 0;
  139. }
  140. }
  141. }
  142. &.small {
  143. width: 220px;
  144. height: 200px;
  145. a {
  146. img {
  147. margin-top: 15px;
  148. width: 70px;
  149. height: 70px;
  150. }
  151. }
  152. .floor-content {
  153. top: 100px;
  154. bottom: 0;
  155. left: 0;
  156. right: 0;
  157. padding: 15px;
  158. }
  159. .floor-item-name {
  160. color: #575757;
  161. font-size: 16px;
  162. font-weight: 600;
  163. text-overflow: ellipsis;
  164. overflow: hidden;
  165. display: -webkit-box;
  166. -webkit-box-orient: vertical;
  167. -webkit-line-clamp: 2;
  168. word-break: break-all;
  169. display: inherit;
  170. }
  171. .floor-item-body {
  172. color: #575757;
  173. font-size: 14px;
  174. line-height: 18px;
  175. }
  176. &.default-floor {
  177. > img {
  178. position: absolute;
  179. top: 0;
  180. left: 0;
  181. }
  182. .floor-content {
  183. top: 85px;
  184. .floor-item-body {
  185. color: #666;
  186. }
  187. }
  188. }
  189. }
  190. &.tiny {
  191. display: none;
  192. }
  193. }
  194. }
  195. </style>