detailPage.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <script setup lang='ts'>
  2. import { useStore } from '@/stores';
  3. import { baseURl } from '@/utils/https';
  4. const store = useStore();
  5. // stereoscopic-立体图 plane-平面图
  6. const mode = ref(store.dataAll.modeList[0])
  7. const curInfoPart = ref({} as any)
  8. const router = useRouter()
  9. const goScenefu = () => {
  10. if (curInfoPart.value.name != '救生艇') {
  11. store.mode = mode.value;
  12. store.currentInfoPart = curInfoPart.value;
  13. }
  14. router.push({
  15. path: '/scene',
  16. query: {
  17. code: curInfoPart.value.sceneCode
  18. }
  19. })
  20. }
  21. const onSelectfu = (item: any) => {
  22. mode.value = store.dataAll.modeList[1]
  23. curInfoPart.value = item
  24. item.name === '救生艇' ? goScenefu() : ''
  25. }
  26. onMounted(() => {
  27. if (Object.keys(store.mode).length != 0) {
  28. mode.value = store.mode
  29. }
  30. if (Object.keys(store.currentInfoPart).length != 0) {
  31. curInfoPart.value = store.currentInfoPart
  32. }
  33. })
  34. </script>
  35. <template>
  36. <div class='detail'>
  37. <img class="logo-icon" src="@/assets/images/logoS.png" alt="">
  38. <div class="menu-box">
  39. <img src="@/assets/images/menu.png" alt="">
  40. <div class="title" v-for="item in store.dataAll.modeList" :key="item.name"
  41. :class="{ 'stereoscopic': item.name == 'stereoscopic', 'activeTitle': mode.name == item.name }"
  42. @click="() => { mode = item, curInfoPart = {} as any }">{{ item.title }}</div>
  43. <div class="plane-list" :class="{ 'activePlane': mode.name == 'plane' }">
  44. <div class="plane-left">
  45. <div :class="{ 'active': curInfoPart.name == item.name }" v-for="item in store.dataAll.modeList[1].content"
  46. :key="item.name" @click="onSelectfu(item)">{{
  47. item.number }}</div>
  48. </div>
  49. <div class="plane-right">
  50. <div :class="{ 'active': curInfoPart.name == item.name }" v-for="item in store.dataAll.modeList[1].content"
  51. :key="item.name" @click="onSelectfu(item)">
  52. {{
  53. item.name }}</div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="main">
  58. <img class="img3d" v-show="Object.keys(curInfoPart).length == 0" :src="`${baseURl}/${mode.name}/${mode.mainBody}`"
  59. alt="">
  60. <div class="main-box" v-show="Object.keys(curInfoPart).length > 0"
  61. :style="{ backgroundImage: `url(${baseURl}/${mode.name}/${curInfoPart.mainBody})`, backgroundSize: '100% 100%' }">
  62. <img :style="{ position: 'absolute' }" v-show="Object.keys(curInfoPart).length > 0 && curInfoPart.name != '救生艇'"
  63. :src="`${baseURl}/${mode.name}/${curInfoPart.heilight}`" alt="">
  64. <!-- 介绍框 -->
  65. <div class="info-box" v-if="Object.keys(curInfoPart).length > 0 && curInfoPart.name != '救生艇'">
  66. <div class="title">
  67. {{ curInfoPart.number + curInfoPart.name }}
  68. </div>
  69. <div class="bottom-part">
  70. <img style="cursor: pointer;" @click="goScenefu()" :src="`${baseURl}/${mode.name}/pic${curInfoPart.id}.png`"
  71. alt="">
  72. <div class="disc">{{ curInfoPart.info }}</div>
  73. </div>
  74. </div>
  75. </div>
  76. <!-- <img v-show="Object.keys(curInfoPart).length > 0" :src="`${baseURl}/${mode.name}/${curInfoPart.mainBody}`" alt=""> -->
  77. <!-- 指引 -->
  78. <div class="guide" :style="{ top: curInfoPart.guideP.top, left: curInfoPart.guideP.left }"
  79. v-if="Object.keys(curInfoPart).length > 0 && curInfoPart.name != '救生艇'">
  80. <img class="hot" :style="{ top: curInfoPart.hotP.top, left: curInfoPart.hotP.left }" @click="goScenefu()"
  81. src="@/assets/images/hot.png" alt="">
  82. <img class="line"
  83. :style="{ width: curInfoPart.lineP.width, height: curInfoPart.lineP.height, left: curInfoPart.lineP.left }"
  84. :src="`${baseURl}/${mode.name}/line${curInfoPart.id}.png`" alt="">
  85. </div>
  86. </div>
  87. </div>
  88. </template>
  89. <style lang='less' scoped>
  90. .detail {
  91. width: 100vw;
  92. height: 100vh;
  93. background: url(@/assets/images/bg.png);
  94. background-size: 100% 100%;
  95. .logo-icon {
  96. position: absolute;
  97. left: 4%;
  98. top: 12%;
  99. width: 22vw;
  100. }
  101. .menu-box {
  102. position: fixed;
  103. right: 2vw;
  104. z-index: 2;
  105. width: 15vw;
  106. height: 70vh;
  107. @media screen and (max-width: 1560px) {
  108. width: 20vw;
  109. }
  110. img {
  111. position: absolute;
  112. width: 100%;
  113. height: 100%;
  114. }
  115. .stereoscopic {
  116. top: 8.5vh !important;
  117. }
  118. .activeTitle {
  119. color: #FFEFDA !important;
  120. text-shadow: 0px 0px 10px rgba(255, 255, 255, 0.5);
  121. div {
  122. color: white;
  123. }
  124. }
  125. .title {
  126. width: 100%;
  127. text-align: center;
  128. padding-left: 8%;
  129. color: #351301;
  130. font-family: 'REEJI-DuoguanGB-free-Flash';
  131. font-size: 1.6em;
  132. position: absolute;
  133. white-space: nowrap;
  134. // left: 50%;
  135. // transform: translateX(120%);
  136. top: 20vh;
  137. cursor: pointer;
  138. }
  139. .plane-list {
  140. width: 100%;
  141. position: absolute;
  142. top: 26vh;
  143. color: #CECECE;
  144. font-size: 1em;
  145. letter-spacing: 2px;
  146. transform: translateX(7%);
  147. white-space: nowrap;
  148. line-height: 40px;
  149. display: flex;
  150. justify-content: center;
  151. .plane-left {
  152. text-align: right;
  153. .active {
  154. color: #E7C395;
  155. background: #911212;
  156. }
  157. div {
  158. cursor: pointer;
  159. padding-right: 5px;
  160. }
  161. }
  162. .plane-right {
  163. text-align: left;
  164. .active {
  165. color: #E7C395;
  166. background: #911212;
  167. }
  168. div {
  169. cursor: pointer;
  170. }
  171. }
  172. }
  173. .activePlane {
  174. color: white;
  175. }
  176. }
  177. .main {
  178. width: 100%;
  179. height: 100%;
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. .img3d {
  184. margin-left: -10%;
  185. width: 80%;
  186. @media screen and (max-width: 1560px) {
  187. width: 75%;
  188. }
  189. }
  190. .main-box {
  191. width: 70%;
  192. height: 75%;
  193. position: relative;
  194. top: 50px;
  195. margin-left: -10%;
  196. img {
  197. width: 100%;
  198. height: 100%;
  199. object-fit: fill;
  200. }
  201. }
  202. .info-box {
  203. width: 20vw;
  204. height: 15vh;
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. justify-content: center;
  209. background: url(@/assets/images/infobg.png);
  210. background-size: 100% 100%;
  211. position: absolute;
  212. top: -2vh;
  213. right: 10%;
  214. z-index: 2;
  215. .title {
  216. width: 70%;
  217. height: 8%;
  218. background: url(@/assets/images/title-bg.png);
  219. background-size: 100% 100%;
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. color: #E8B478;
  224. font-family: 'SourceHanSansCN-Bold';
  225. font-size: 1em;
  226. margin-bottom: 10px;
  227. }
  228. .bottom-part {
  229. width: 90%;
  230. height: 70%;
  231. display: flex;
  232. align-items: center;
  233. img {
  234. width: 45%;
  235. object-fit: contain;
  236. // height: 100%;
  237. }
  238. .disc {
  239. color: rgba(255, 255, 255, 0.842);
  240. letter-spacing: 2px;
  241. font-size: 0.9em;
  242. // line-height: 28px;
  243. max-height: 90%;
  244. overflow: auto;
  245. margin-left: 10px;
  246. margin-top: 10px;
  247. }
  248. ::-webkit-scrollbar {
  249. width: 5px;
  250. /* 设置滚动条宽度 */
  251. height: 5px;
  252. /* 对于垂直滚动条的高度,也可以使用此属性 */
  253. background-color: #f5f5f531;
  254. /* 背景颜色 */
  255. border-radius: 5px;
  256. /* 边角圆角 */
  257. }
  258. /* 定义滚动条拖动柄(滑块)样式 */
  259. ::-webkit-scrollbar-thumb {
  260. background-color: #E8B478;
  261. /* 滑块的颜色 */
  262. border-radius: 5px;
  263. /* 可选,给滑块添加边框 */
  264. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  265. /* 可选,给滑块添加阴影效果 */
  266. }
  267. }
  268. }
  269. .guide {
  270. position: absolute;
  271. // top: 20%;
  272. // left: 40%;
  273. .hot {
  274. width: 100px;
  275. position: absolute;
  276. z-index: 2;
  277. cursor: pointer;
  278. }
  279. .line {
  280. position: absolute;
  281. // width: 20vw;
  282. // margin-left: -20%;
  283. }
  284. }
  285. }
  286. }
  287. </style>