index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div class="parimaryExhibtion" :class="{ daolanactive: isShow }">
  3. <div class="p-title">
  4. <span>当前位置:{{ current.name }}</span>
  5. </div>
  6. <div class="cad-con"></div>
  7. <ul class="exhi-list">
  8. <li :class="{ haveChild: item.id == 'jishechengjiu', showactive: shensuo }" @click="handleItem(item)" v-for="(item, i) in list" :key="i">
  9. <span :class="{ active: item.name == current.name }">{{ item.name }}</span>
  10. <ul v-if="item.id == 'jishechengjiu'">
  11. <li :class="{ active: sub.name == current.name }" @click="handleItem(sub)" v-for="(sub, ii) in subList" :key="ii">
  12. {{ sub.name }}
  13. </li>
  14. </ul>
  15. </li>
  16. </ul>
  17. <div class="daolan" @click="isShow = !isShow">
  18. <img :src="require('@/assets/images/icon/daolan.png')" />
  19. <span>{{ isShow ? "收起" : "展开" }}导览</span>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. export default {
  25. props: ["showExhi"],
  26. data() {
  27. return {
  28. isShow: true,
  29. shensuo: false,
  30. subList: [
  31. {
  32. id: "xinjiang02",
  33. name: "艰苦创业铸忠诚展区",
  34. },
  35. {
  36. id: "xinjiang03",
  37. name: "奠定基础谋发展展区",
  38. },
  39. {
  40. id: "xinjiang04",
  41. name: "全面发展强根基展区",
  42. },
  43. {
  44. id: "xinjiang05",
  45. name: "奋进强军创一流展区",
  46. },
  47. ],
  48. list: [
  49. {
  50. id: "xinjiangout",
  51. name: "胡杨卫士广场",
  52. },
  53. {
  54. id: "xinjiang01",
  55. active: "",
  56. name: "序厅",
  57. },
  58. {
  59. id: "xinjiang01",
  60. pano: 24,
  61. quat: {
  62. w: 0.0790464668350327,
  63. x: 0.003520409893528852,
  64. y: 0.9958775678424138,
  65. z: -0.04435235868632624,
  66. },
  67. name: "发展历程厅",
  68. },
  69. {
  70. id: "jishechengjiu",
  71. name: "建设成就厅",
  72. },
  73. {
  74. id: "xinjiang05",
  75. name: "强军劲旅厅",
  76. pano: 98,
  77. quat: {
  78. w: 0.6813749981741799,
  79. x: 0.00593363566311834,
  80. y: 0.7318827124363794,
  81. z: -0.0063734735088626015,
  82. },
  83. },
  84. {
  85. id: "xinjiang05",
  86. name: "英模荣誉厅",
  87. pano: 120,
  88. quat: {
  89. w: 0.7633693466573722,
  90. x: -0.004737236104839399,
  91. y: 0.6459324426637506,
  92. z: 0.0040084588217659855,
  93. },
  94. },
  95. {
  96. id: "xinjiang05",
  97. name: "辅助展陈厅",
  98. pano: 186,
  99. quat: {
  100. w: 0.09926812639548109,
  101. x: -0.0003896273924052499,
  102. y: 0.9950529757251679,
  103. z: 0.0039055830856510134,
  104. },
  105. },
  106. ],
  107. current: {
  108. id: "xinjiangout",
  109. name: "胡杨卫士广场",
  110. },
  111. };
  112. },
  113. methods: {
  114. handleItem(item) {
  115. if (item.id == "jishechengjiu") {
  116. this.shensuo = !this.shensuo;
  117. return;
  118. }
  119. if (item.name == this.current.name) {
  120. return
  121. }
  122. this.current = item;
  123. this.$bus.$emit("currentScene", item);
  124. },
  125. },
  126. mounted() {
  127. this.$nextTick(() => {
  128. let list = this.list;
  129. if (window.number != "xinjiang01"&&window.number != "xinjiangout") {
  130. if (!window.firstViewPosi) {
  131. list = this.subList;
  132. this.shensuo = true
  133. }
  134. } else {
  135. list = this.list;
  136. }
  137. this.current = list.find((item) => {
  138. if (window.firstViewPosi) {
  139. return player.currentPano.id == item.pano;
  140. } else {
  141. return item.id == window.number;
  142. }
  143. });
  144. });
  145. },
  146. watch: {
  147. isShow(newVal) {
  148. let css = newVal ? "10px" : "-310px";
  149. $(".cad").css({ right: css });
  150. },
  151. },
  152. };
  153. </script>
  154. <style lang="less" scoped>
  155. .daolanactive {
  156. transform: translateX(0);
  157. .daolan {
  158. > img {
  159. width: 16px;
  160. transform: rotate(0);
  161. margin-bottom: 4px;
  162. }
  163. }
  164. }
  165. </style>
  166. <style lang="less">
  167. .cad {
  168. .xinjiang02 {
  169. transform: translateX(-40px);
  170. }
  171. .xinjiang03 {
  172. > svg {
  173. > g {
  174. transform: scale(1) translate(50px, 198px);
  175. }
  176. }
  177. }
  178. .xinjiang04 {
  179. > svg {
  180. > g {
  181. transform: scale(1.3) translate(-50px, 208px);
  182. path {
  183. stroke-width: 4;
  184. }
  185. circle {
  186. r: 6;
  187. stroke-width: 1.69182;
  188. }
  189. }
  190. }
  191. }
  192. .xinjiang05 {
  193. > svg {
  194. > g {
  195. transform: scale(3) translate(-90px, 260px);
  196. path {
  197. stroke-width: 2;
  198. }
  199. .sign {
  200. > path {
  201. // d:path("M 201.7 -168.93 L 215.111 -175.821 L 219.111 -158.779 L 201.7 -160.67 Z");
  202. }
  203. circle {
  204. r: 4;
  205. stroke-width: 1.69182;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. }
  212. </style>