index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="parimaryExhibtion" :class="{ daolanactive: isShow }">
  3. <div class="p-title">
  4. <div class="p-left">{{ Mylangue ? "当前位置" : "Current Position" }}</div>
  5. <div class="p-right">{{ Mylangue ? current.name : current.name2 }}</div>
  6. </div>
  7. <div class="exh-con">
  8. <!-- <img :src="require('@/assets/images/map.png')" /> -->
  9. </div>
  10. <ul class="exhi-list">
  11. <li
  12. @click="handleItem(item.Logo)"
  13. v-for="(item, i) in list"
  14. :key="i"
  15. :class="{ active: item.id === current.id }"
  16. >
  17. {{ Mylangue ? item.name : item.name2 }}
  18. </li>
  19. </ul>
  20. <div class="daolan" @click="isShow = !isShow">
  21. <img :src="require('@/assets/images/icon/daolan.png')" />
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. isShow: false,
  30. list: [
  31. {
  32. id: 1,
  33. name: "负一楼",
  34. name2: "-1F",
  35. pano: "56fa4a8ee09542e69e0e5e763cf3a4eb",
  36. Logo: "1173",
  37. },
  38. {
  39. id: 2,
  40. name: "一楼",
  41. name2: "1F",
  42. Logo: "1171",
  43. pano: "bd279aa2ee3445658d5949ccdc3d0dec",
  44. },
  45. {
  46. id: 3,
  47. name: "二楼",
  48. name2: "2F",
  49. Logo: "1172",
  50. pano: "b2431912b20d4df7b81f47821fca6d1a",
  51. },
  52. ],
  53. current: {},
  54. };
  55. },
  56. methods: {
  57. handleItem(val) {
  58. // 中文版
  59. if (this.Mylangue) {
  60. window.location.href = window.location.origin +window.location.pathname+ `#/?m=${val}`;
  61. } else window.location.href = window.location.origin +window.location.pathname+ `#/?m=${val}_1`;
  62. location.reload(true);
  63. },
  64. },
  65. watch: {
  66. isShow(newVal) {
  67. let css = newVal ? "0px" : "-310px";
  68. $(".cad").css({ right: css });
  69. },
  70. },
  71. mounted() {
  72. this.list.forEach((v) => {
  73. if (window.location.href.includes(v.Logo)) {
  74. this.current = v;
  75. }
  76. });
  77. },
  78. };
  79. </script>
  80. <style lang="less" scoped>
  81. .parimaryExhibtion {
  82. width: 300px;
  83. transform: translateX(300px);
  84. transition: all 0.3s ease;
  85. color: #fff;
  86. .daolan {
  87. cursor: pointer;
  88. position: absolute;
  89. right: 300px;
  90. background: rgba(0, 0, 0, 0.4);
  91. border-radius: 10px 0px 0px 10px;
  92. border-left: 5px solid #68a0c5;
  93. top: 24%;
  94. padding: 15px 5px;
  95. > img {
  96. width: 16px;
  97. transform: rotate(180deg);
  98. margin-bottom: 4px;
  99. }
  100. }
  101. .p-title {
  102. transform: translateX(-8px);
  103. position: relative;
  104. height: 60px;
  105. color: #fff;
  106. .p-left {
  107. opacity: 0;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. width: 150px;
  112. height: 60px;
  113. background: url("../../assets/img/mapt.png");
  114. background-size: 100% 100%;
  115. font-size: 16px;
  116. padding-top: 10px;
  117. }
  118. .p-right {
  119. border-radius: 8px 22px 0 0;
  120. position: absolute;
  121. bottom: 0;
  122. left: 142px;
  123. width: calc(100% - 134px);
  124. height: 45px;
  125. background-color: rgba(104, 160, 197, 0.5);
  126. flex: 1;
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. font-size: 16px;
  131. }
  132. }
  133. .exh-con {
  134. background: rgba(0, 0, 0, 0.4);
  135. width: 100%;
  136. height: 200px;
  137. border: 2px solid #68a0c5;
  138. }
  139. .exhi-list {
  140. width: 100%;
  141. display: flex;
  142. > li {
  143. // text-align: center;
  144. background: rgba(0, 0, 0, 0.4);
  145. border-radius: 0 0 5px 5px;
  146. flex: 1;
  147. height: 40px;
  148. line-height: 40px;
  149. text-align: center;
  150. cursor: pointer;
  151. &:hover {
  152. background: #165491;
  153. }
  154. }
  155. .active {
  156. background: #165491;
  157. pointer-events: none;
  158. }
  159. }
  160. }
  161. .exh-con {
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. > img {
  166. width: 80%;
  167. }
  168. }
  169. .daolanactive {
  170. transform: translateX(0);
  171. .p-left {
  172. opacity: 1 !important;
  173. }
  174. .daolan {
  175. > img {
  176. width: 16px;
  177. transform: rotate(0);
  178. margin-bottom: 4px;
  179. }
  180. }
  181. }
  182. @media screen and (max-width: 600px) {
  183. .parimaryExhibtion {
  184. transform: translateX(255px) scale(0.7);
  185. }
  186. .daolanactive {
  187. transform: translateX(45px) scale(0.7);
  188. }
  189. }
  190. </style>