emergencyEvacuationBigFullScreen.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view id="emergencyEvacuationBigFullScreen" >
  3. <!-- :style="'width:'+mapWidth+'px;height:'+mapHeight+'px;'" -->
  4. <view class="emergencyEvacuationBigFullScreen-page" :style="'width:'+mapWidth+'px;height:'+mapHeight+'px;transform: scale('+zoomData+');margin-top:-'+mapHeight/2+'px;margin-left:-'+mapWidth/2+'px;'">
  5. <view class="map-max-box" :style="'width:'+mapWidth+'px;height:'+mapHeight+'px;'">
  6. <!-- :style="'width:'+mapW+'px;height:'+mapH+'px;'" -->
  7. <view class="map-max-for-box"
  8. v-for="(item,index) in mapList" :key="index" :class="item.type == 2?'for-map-box-one':''"
  9. :style="'top:'+item.y+'px;left:'+item.x+'px;width:'+item.w+'px;height:'+item.h+'px;'">
  10. <view class="map-max-for-left-box"></view>
  11. <view class="map-max-for-center-box">
  12. <view class="map-max-for-center-min-left"></view>
  13. <view class="map-max-for-center-min-center"
  14. :class="item.type == 2?'for-map-box-one':(item.type == 1?'for-map-box':(item.type == 3?'for-map-box-two':''))">
  15. <view src="@/images/evacuation3_2/icon_sysbjt_m.png"
  16. :class="minItem.toward=='top'?'center-move-door-p-t':(minItem.toward=='bottom'?'center-move-door-p-b':(minItem.toward=='left'?'center-move-door-p-l':(minItem.toward=='right'?'center-move-door-p-r':'')))"
  17. v-for="(minItem,minIndex) in item.doorList" :key="minIndex"
  18. :style="'top:'+minItem.y+'px;left:'+minItem.x+'px;width:'+minItem.w+'px;height:'+minItem.h+'px;'"></view>
  19. <view src="@/images/evacuation3_2/icon_sjt.png"
  20. @click="lighButton(minItem)"
  21. :class="minItem.state=='1'?'lightTop':(minItem.state=='2'?'lightBottom':(minItem.state=='3'?'lightLeft':(minItem.state=='4'?'lightRight':'')))"
  22. v-for="(minItem,minIndex) in item.lightList" :key="minIndex"
  23. :style="'top:'+minItem.y+'px;left:'+minItem.x+'px;width:'+minItem.w+'px;height:'+minItem.h+'px;'"></view>
  24. </view>
  25. <view class="map-max-for-center-min-right"></view>
  26. </view>
  27. <view class="map-max-for-right-box"></view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="position-button">退出全屏</view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. zoomData: null,
  39. mapList:[{"x":1,"y":1,"w":162,"h":271,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":63.5,"y":244}]},{"x":1,"y":274,"w":800,"h":100,"type":"2","direction":"1","lightList":[{"type":"light","state":"3","w":20,"h":20,"x":243,"y":40},{"type":"light","state":"3","w":20,"h":20,"x":451,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":551,"y":40},{"type":"light","state":"3","w":20,"h":20,"x":652,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":737,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":110,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":335,"y":40}]},{"x":1,"y":374,"w":139,"h":204,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":55.5,"y":2}]},{"x":163,"y":101,"w":100,"h":173,"type":"2","direction":"1","lightList":[{"type":"light","state":"1","w":20,"h":20,"x":40,"y":126}]},{"x":263,"y":1,"w":100,"h":273,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":37.5,"y":246}]},{"x":363,"y":1,"w":100,"h":273,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":33.5,"y":246}]},{"x":463,"y":2,"w":100,"h":272,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":39.5,"y":245}]},{"x":563,"y":1,"w":100,"h":273,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":32.5,"y":246}]},{"x":663,"y":3,"w":140,"h":271,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":56.5,"y":244}]},{"x":698,"y":374,"w":104,"h":205,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":19.5,"y":2}]},{"x":240,"y":375,"w":107,"h":204,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":40.5,"y":2}]},{"x":347,"y":375,"w":100,"h":204,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":37.5,"y":2}]},{"x":447,"y":375,"w":123,"h":204,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":52.5,"y":2}]},{"x":570,"y":375,"w":128,"h":204,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":47.5,"y":2}]},{"x":801,"y":274,"w":100,"h":100,"type":"3","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":36.5}]},{"x":163,"y":1,"w":100,"h":100,"type":"3","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":38.5,"y":73}]},{"x":140,"y":374,"w":100,"h":203,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":40.5,"y":2}]}],
  40. mapWidth:903+40,//40边框距离
  41. mapHeight:581+40,//40边框距离
  42. }
  43. },
  44. onLoad(option) {
  45. },
  46. onShow() {
  47. this.zoomCalculate();
  48. },
  49. methods: {
  50. //灯点击事件
  51. lighButton(item){
  52. console.log(item);
  53. },
  54. //计算缩放率
  55. zoomCalculate() {
  56. let self = this;
  57. wx.getSystemInfo({
  58. success: function(res) {
  59. if (res.windowHeight > self.mapHeight) {
  60. self.$set(self, 'zoomData', self.mapHeight / (res.windowHeight / 1));
  61. } else {
  62. self.$set(self, 'zoomData', (res.windowHeight/ 1) / self.mapHeight);
  63. }
  64. }
  65. })
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="stylus" scoped>
  71. #emergencyEvacuationBigFullScreen {
  72. height:100%;
  73. width:100%;
  74. display: flex;
  75. overflow: hidden;
  76. .emergencyEvacuationBigFullScreen-page{
  77. // overflow: scroll;
  78. overflow: hidden;
  79. position: absolute;
  80. top:50%;
  81. left:50%;
  82. .map-max-box {
  83. border:20px solid rgba(255,255,255,0);
  84. position: relative;
  85. .map-max-for-box{
  86. position: absolute;
  87. display: flex;
  88. flex-direction: column;
  89. .map-max-for-left-box{
  90. height:2px;
  91. }
  92. .map-max-for-center-box{
  93. flex:1;
  94. display: flex;
  95. .map-max-for-center-min-left{
  96. width:2px;
  97. }
  98. .map-max-for-center-min-center{
  99. flex:1;
  100. position: relative
  101. view{
  102. position: absolute
  103. }
  104. .center-move-door-p-t{
  105. background: url("../images/evacuation3_2/icon_sysbjt_m.png")!important;
  106. background-size: 100%!important;
  107. transform: rotate(180deg);
  108. }
  109. .center-move-door-p-b{
  110. background: url("../images/evacuation3_2/icon_sysbjt_m.png")!important;
  111. background-size: 100%!important;
  112. }
  113. .center-move-door-p-l{
  114. background: url("../images/evacuation3_2/icon_sysbjt_m.png")!important;
  115. background-size: 100%!important;
  116. transform: rotate(90deg);
  117. }
  118. .center-move-door-p-r{
  119. background: url("../images/evacuation3_2/icon_sysbjt_m.png")!important;
  120. background-size: 100%!important;
  121. transform: rotateZ(270deg);
  122. }
  123. .lightTop{
  124. background: url("../images/evacuation3_2/icon_sjt.png");
  125. background-size: 100%;
  126. }
  127. .lightBottom{
  128. background: url("../images/evacuation3_2/icon_xjt.png");
  129. background-size: 100%;
  130. }
  131. .lightLeft{
  132. background: url("../images/evacuation3_2/icon_zuo.png");
  133. background-size: 100%;
  134. }
  135. .lightRight{
  136. background: url("../images/evacuation3_2/icon_yuo.png");
  137. background-size: 100%;
  138. }
  139. }
  140. .map-max-for-center-min-right{
  141. width:2px;
  142. }
  143. }
  144. .map-max-for-right-box{
  145. height:2px;
  146. }
  147. .map-max-for-min-box{
  148. position: relative
  149. view{
  150. position: absolute
  151. }
  152. }
  153. }
  154. .for-map-box{
  155. background: #CEF2FD;
  156. }
  157. .for-map-box-one{
  158. background: #CEFDD5;
  159. }
  160. .for-map-box-two{
  161. background:url("../images/evacuation3_2/icon_yjtd.png") center center no-repeat #39AE36;
  162. background-size: 60px 60px;
  163. }
  164. }
  165. }
  166. .position-button {
  167. position: fixed;
  168. top: 20px;
  169. right: 17px;
  170. width: 120px;
  171. line-height: 35px;
  172. font-size: 18px;
  173. background: rgba(0, 0, 0, 0.5);
  174. color: #fff;
  175. text-align: center;
  176. border-radius: 18px;
  177. border: none;
  178. }
  179. }
  180. </style>