Floor.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div class="floor" :class="!isDefault ? 'normal-floor' : 'price-floor'">
  3. <h3><span v-if="!isDefault">F{{ floor.floorNumber }}&nbsp;{{ floor.name }}</span></h3>
  4. <ul class="list-unstyled clearfix" :style="{borderColor: floor.items[0] && floor.items[0].backGroundColor ? floor.items[0].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[0] && floor.items[0].backGroundColor ? floor.items[0].backGroundColor : '#d8d8d8'}">
  7. <img v-if="!item.isNull && item.size != 'large' && isDefault" src="/images/floor/specificPrice-home.png" alt="">
  8. <a v-if="!item.isNull" :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" :title="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.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. &.price-floor {
  38. margin-top: -35px;
  39. }
  40. ul {
  41. border-bottom: 1px solid #d8d8d8;
  42. }
  43. .floor-item {
  44. float: left;
  45. position: relative;
  46. overflow: hidden;
  47. a {
  48. display: block;
  49. text-align: center;
  50. }
  51. .floor-item-img:hover {
  52. transform: scale(1.1);
  53. }
  54. .floor-content {
  55. position: absolute;
  56. text-align: center;
  57. .floor-item-price {
  58. color: #ff4040;
  59. font-size: 16px;
  60. font-weight: bold;
  61. }
  62. }
  63. &.medium,&.small {
  64. border-top: 1px solid #d8d8d8;
  65. border-right: 1px solid #d8d8d8;
  66. }
  67. &.large {
  68. width: 360px;
  69. height: 400px;
  70. a {
  71. img {
  72. width: 226px;
  73. height: 226px;
  74. margin-top: 40px;
  75. }
  76. }
  77. &.default-floor {
  78. a {
  79. img {
  80. width: 360px;
  81. height: 400px;
  82. margin-top: 0;
  83. &:hover {
  84. transform: none;
  85. }
  86. }
  87. }
  88. }
  89. }
  90. &.medium {
  91. width: 390px;
  92. height: 200px;
  93. a {
  94. img {
  95. position: absolute;
  96. bottom: 50px;
  97. right: 52px;
  98. width: 100px;
  99. height: 90px;
  100. }
  101. }
  102. .floor-content {
  103. top: 0;
  104. left: 0;
  105. right: 0;
  106. padding: 30px;
  107. }
  108. .floor-item-name {
  109. color: #575757;
  110. font-size: 20px;
  111. margin-bottom: 30px;
  112. text-align: left;
  113. font-weight: 600;
  114. overflow: hidden;
  115. text-overflow: ellipsis;
  116. /*display: -webkit-box;*/
  117. /*-webkit-box-orient: vertical;*/
  118. /*-webkit-line-clamp: 2;*/
  119. width: 300px;
  120. word-wrap: break-word;
  121. white-space: nowrap;
  122. }
  123. .floor-item-body {
  124. margin-right: 150px;
  125. color: #575757;
  126. font-size: 14px;
  127. line-height: 20px;
  128. text-align: left;
  129. }
  130. &.default-floor {
  131. .floor-content {
  132. .floor-item-body {
  133. color: #666;
  134. }
  135. .floor-item-price {
  136. text-align: left;
  137. }
  138. }
  139. > img {
  140. position: absolute;
  141. top: 0;
  142. left: 0;
  143. }
  144. }
  145. }
  146. &.small {
  147. width: 220px;
  148. height: 200px;
  149. a {
  150. img {
  151. margin-top: 15px;
  152. width: 70px;
  153. height: 70px;
  154. }
  155. }
  156. .floor-content {
  157. top: 100px;
  158. bottom: 0;
  159. left: 0;
  160. right: 0;
  161. padding: 15px;
  162. }
  163. .floor-item-name {
  164. color: #575757;
  165. font-size: 16px;
  166. font-weight: 600;
  167. text-overflow: ellipsis;
  168. overflow: hidden;
  169. /* display: -webkit-box;
  170. -webkit-box-orient: vertical;
  171. -webkit-line-clamp: 2;*/
  172. word-break: break-all;
  173. display: inherit;
  174. white-space: nowrap;
  175. }
  176. .floor-item-body {
  177. color: #575757;
  178. font-size: 14px;
  179. line-height: 18px;
  180. }
  181. &.default-floor {
  182. > img {
  183. position: absolute;
  184. top: 0;
  185. left: 0;
  186. }
  187. .floor-content {
  188. top: 85px;
  189. .floor-item-body {
  190. color: #666;
  191. }
  192. }
  193. }
  194. }
  195. &.tiny {
  196. display: none;
  197. }
  198. }
  199. }
  200. </style>