index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div
  3. class="birdview"
  4. :class="{ birdview_ipad: isiPad, birdview_pad_notlandscape: isiPad && !g_isLandscape }"
  5. :style="{ backgroundImage: `url(${require(`@/assets/images/proj2022/birdviewbg.jpg`)})` }"
  6. >
  7. <!-- <img v-if="!hideClose" class="close" @click="close" :src="require('@/assets/images/proj2022/pc/cancel.png')" alt="" /> -->
  8. <div class="modelcon">
  9. <img :src="require(`@/assets/images/proj2022/model.png`)" alt="" />
  10. <div class="tag" v-for="(item, i) in tags" :key="i" :style="{ top: item.top, left: item.left, width: item.width, height: item.height }">
  11. <img @click="onClick(item)" :src="require(`@/assets/images/proj2022/bird_view/${item.eng}${currentId == item.id ? '_acitve' : ''}.svg`)" alt="" />
  12. </div>
  13. </div>
  14. <!-- <roundMenu :noMode="true" /> -->
  15. </div>
  16. </template>
  17. <script>
  18. import { region } from "@/data/raw.js";
  19. import { Booth } from "@/data/booth.js";
  20. // import roundMenu from "../menu/index.vue";
  21. let bb = [];
  22. Booth.forEach((item) => {
  23. bb = bb.concat(item.company);
  24. });
  25. export default {
  26. data() {
  27. return {
  28. show: true,
  29. hideClose: false,
  30. themescene: "",
  31. tags: bb,
  32. currentId: "",
  33. };
  34. },
  35. watch: {
  36. show: {
  37. deep: true,
  38. immediate: true,
  39. handler: function(newVal) {
  40. this.$bus.$emit("noMode", newVal);
  41. },
  42. },
  43. },
  44. // components:{roundMenu},
  45. methods: {
  46. close() {
  47. this.$hideBirdView();
  48. },
  49. onClick(data) {
  50. this.currentId = data.id;
  51. let player = window.player;
  52. if (!player) {
  53. this.$bus.$emit("resetCurrentTheme");
  54. this.$bus.$emit("ifrMessage", {
  55. events: "flyToPano",
  56. data: data,
  57. });
  58. setTimeout(() => {
  59. this.close();
  60. }, 400);
  61. return;
  62. }
  63. let fn = () => {
  64. let currentRegion = region.find((item) => item.id == data.id);
  65. let { x, y, z, w } = currentRegion.firstView.panoQuaternion;
  66. let fnname = "flyToPano";
  67. if (player.mode == "panorama") {
  68. fnname = "blackToPano";
  69. }
  70. player[fnname]({
  71. pano: player.model.panos.index[currentRegion.firstView.panoId],
  72. quaternion: new window.THREE.Quaternion(x, y, z, w),
  73. });
  74. };
  75. setTimeout(() => {
  76. fn();
  77. this.close();
  78. this.currentId = "";
  79. }, 300);
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang="less" scoped>
  85. .birdview {
  86. position: fixed;
  87. left: 0;
  88. top: 0;
  89. width: 100%;
  90. height: 100%;
  91. z-index: 4001;
  92. background-size: cover;
  93. background-position: left top;
  94. background-repeat: no-repeat;
  95. .close {
  96. position: absolute;
  97. right: 30px;
  98. top: 30px;
  99. cursor: pointer;
  100. z-index: 99;
  101. }
  102. .modelcon {
  103. width: 100%;
  104. margin: 0 auto;
  105. text-align: center;
  106. position: relative;
  107. > img {
  108. width: 90%;
  109. }
  110. .tag {
  111. position: absolute;
  112. cursor: pointer;
  113. display: inline-block;
  114. text-align: center;
  115. top: 50%;
  116. left: 50%;
  117. // background: rgba(0, 0, 0, 0.5);
  118. // width: 10%;
  119. height: 15%;
  120. &:hover {
  121. > img {
  122. display: inline-block;
  123. width: 9vw;
  124. position: absolute;
  125. left: 50%;
  126. transform: translate(-50%, -50%);
  127. top: 10%;
  128. }
  129. }
  130. &:first-of-type {
  131. top: 17%;
  132. left: 6%;
  133. width: 45%;
  134. height: 49%;
  135. clip-path: polygon(0 40%, 70% 0%, 100% 50%, 25% 100%);
  136. &:hover {
  137. > img {
  138. top: 40%;
  139. }
  140. }
  141. }
  142. > img {
  143. width: 100%;
  144. display: none;
  145. }
  146. }
  147. }
  148. .birdview_ipad {
  149. }
  150. .birdview_pad_notlandscape {
  151. }
  152. }
  153. </style>