floor.wpy 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <style lang="less">
  2. .component-floor {
  3. border-radius: 16rpx;
  4. background: rgba(255, 255, 255, 0.9);
  5. .component-wrapper {
  6. display: flex;
  7. justify-content: space-between;
  8. .building-wrapper {
  9. padding: 16rpx;
  10. border-right: 1px solid #c4c9cf4d;
  11. .building-item {
  12. max-width: 240rpx;
  13. height: 72rpx;
  14. line-height: 72rpx;
  15. font-size: 32rpx;
  16. font-weight: 400;
  17. color: #626c78;
  18. text-align: center;
  19. }
  20. }
  21. }
  22. .floor-wrapper {
  23. display: flex;
  24. padding: 16rpx;
  25. flex-direction: column-reverse;
  26. }
  27. }
  28. .component-floor.fold .floor-item {
  29. background: none;
  30. }
  31. .component-floor.fold .building-item {
  32. background: none;
  33. }
  34. .component-floor.expand {
  35. .component-wrapper {
  36. max-height: 800rpx;
  37. }
  38. }
  39. .component-floor .floor-item {
  40. width: 112rpx;
  41. height: 72rpx;
  42. line-height: 72rpx;
  43. font-size: 32rpx;
  44. font-weight: 400;
  45. color: #626c78;
  46. text-align: center;
  47. }
  48. .component-floor.building .floor-item {
  49. width: 224rpx;
  50. }
  51. .floor-item:first-child {
  52. border-radius: 16rpx 16rpx 0 0;
  53. }
  54. .floor-item.selected,
  55. .building-item.selected {
  56. background: #d4faf4;
  57. }
  58. .floor-item:last-child {
  59. border-radius: 0 0 8px 8px;
  60. }
  61. .icon-arrow {
  62. text-align: right;
  63. .icon-arrow-box {
  64. box-sizing: border-box;
  65. padding: 16rpx;
  66. display: inline-block;
  67. // width: 152rpx;
  68. height: 88rpx;
  69. label {
  70. display: inline-block;
  71. vertical-align: middle;
  72. font-family: PingFang SC;
  73. font-size: 32rpx;
  74. font-weight: 500;
  75. letter-spacing: 0px;
  76. }
  77. image {
  78. display: inline-block;
  79. vertical-align: middle;
  80. margin-left: 20rpx;
  81. width: 24rpx;
  82. height: 24rpx;
  83. }
  84. }
  85. }
  86. .icon-arrow .icon {
  87. width: 24rpx;
  88. height: 24rpx;
  89. }
  90. </style>
  91. <template>
  92. <!-- && selectedFloor == item.id -->
  93. <!-- :class="{'selected' :selectedBuilding == item.id}" -->
  94. <div class="{{'component-floor '+status}}">
  95. <div class="component-wrapper">
  96. <div class="building-wrapper">
  97. <div class="building-item"
  98. :key="index+'building-map'"
  99. v-for="(item,index) in buildings">
  100. {{item.localName}}
  101. </div>
  102. </div>
  103. <!-- :class="{'selected' :selectedFloor == item.id}" -->
  104. <div class="floor-wrapper">
  105. <div
  106. class="floor-item"
  107. :key="index+'map'"
  108. v-for="(item,index) in floors"
  109. v-on:click.stop="changeFloor(item.id)"
  110. v-if="status=='expand' || (status=='fold' && selectedFloor == item.id)"
  111. >
  112. {{item.localName}}
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </template>
  118. <script>
  119. import wepy from '@wepy/core';
  120. import config from '@/config';
  121. let h5StaticPath = config.h5StaticPath + '/page-intelligent-control/';
  122. wepy.component({
  123. data: {
  124. h5StaticPath
  125. },
  126. props: {
  127. floors: Array,
  128. buildings: Array,
  129. status: 'fold',
  130. selectedBuilding: String, //选中的building id
  131. selectedFloor: String //选中的floor id
  132. },
  133. created() {},
  134. ready() {},
  135. didUpdate() {},
  136. didUnmount() {},
  137. methods: {
  138. changeFloor(id) {
  139. if (id !== this.selectedFloor) {
  140. this.$emit('component-floor-change', id);
  141. }
  142. this.$emit('component-floor-click');
  143. },
  144. flodFloor() {
  145. this.$emit('component-floor-fold');
  146. }
  147. }
  148. });
  149. </script>