index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <div class="info-box" id="info-left" v-if="title != '' && disc != ''">
  3. <div class="top">
  4. <div class="title-box" @click="() => {
  5. isShow = !isShow;
  6. isOpenHot = false;
  7. }
  8. ">
  9. <div class="detail">
  10. <div class="scroll-wrap">
  11. <div class="scroll-item">
  12. {{ title }}
  13. </div>
  14. </div>
  15. </div>
  16. <div class="line"></div>
  17. <img src="../../assets/img/infoIcon.png" alt="" />
  18. </div>
  19. <!-- <img v-show="isShowHotIcon" @click="() => { isOpenHot = !isOpenHot; isShow = false }"
  20. src="@/assets/images/icon/hot-icon.png" alt=""> -->
  21. <el-dropdown v-if="curGroup" trigger="click" placement="bottom"
  22. @command="handleLocation"
  23. >
  24. <img src="@/assets/img/list.png" />
  25. <template #dropdown>
  26. <el-dropdown-menu class="info-box-dropdown">
  27. <el-dropdown-item v-for="item in curGroup" :key="item.m" :command="item.m">
  28. {{ item.label }}
  29. </el-dropdown-item>
  30. </el-dropdown-menu>
  31. </template>
  32. </el-dropdown>
  33. </div>
  34. <transition name="fade">
  35. <div class="disc-box" v-if="isShow" v-html="disc"></div>
  36. </transition>
  37. <!-- <div class="disc-box" v-if="isShow" v-html="disc"></div> -->
  38. <!-- <div class="disc-box2" v-show="isOpenHot">
  39. <img class="close-icon" @click="() => { isOpenHot = false }" src="@/assets/images/icon/icon-close.png" alt="">
  40. <div class="back-box" @click="back()"><img src="@/assets/images/icon/back.png" alt="">返回上一级场景</div>
  41. <div class="hot-list">
  42. <div class="list-title">关联场景</div>
  43. <div class="list-content">
  44. <div class="list-item" @mouseover="() => { hotInd = index }" @click="openHot(item, index)"
  45. @mouseout="() => { hotInd = null }" :class="{ 'active': hotInd === index }" v-for="(item, index) in data"
  46. :key="index">
  47. {{ item.info.title ? item.info.title : '热点' }}
  48. </div>
  49. </div>
  50. </div>
  51. </div> -->
  52. </div>
  53. </template>
  54. <script>
  55. const GROUP = [
  56. [
  57. {
  58. label: '乾务糖厂码头桁架',
  59. m: 'KJ-0r8j5EQjXCH'
  60. },
  61. {
  62. label: '乾务糖厂除尘塔',
  63. m: 'KJ-sF36qa2CucM'
  64. },
  65. ]
  66. ]
  67. export default {
  68. components: {},
  69. data() {
  70. return {
  71. title: "",
  72. disc: "",
  73. isShow: true,
  74. isShowHotIcon: false,
  75. isOpenHot: false,
  76. data: [],
  77. hotInd: null,
  78. curGroup: null
  79. };
  80. },
  81. computed: {},
  82. watch: {},
  83. methods: {
  84. openHot(e, index) {
  85. // 停止自动导览
  86. window.player.director.stopTour();
  87. setTimeout(() => {
  88. e && e.examine(window.player, true);
  89. this.hotInd = index;
  90. }, 200);
  91. },
  92. back() {
  93. if (window.parent) {
  94. window.parent.window.backFu()
  95. }
  96. },
  97. handleLocation(m) {
  98. window.location.href = `${location.origin}${location.pathname}?m=${m}`
  99. }
  100. },
  101. created() { },
  102. mounted() {
  103. let timeA = -1;
  104. timeA = window.setInterval(() => {
  105. if (window.DATA) {
  106. clearInterval(timeA);
  107. }
  108. this.title = window.DATA.name;
  109. this.disc = window.DATA.summary;
  110. document.title = window.DATA.name;
  111. }, 100);
  112. let timeB = -1;
  113. timeB = window.setInterval(() => {
  114. if (window.isHot) {
  115. clearInterval(timeB);
  116. }
  117. if (window.isHot && window.myHotList && window.myHotList.length) {
  118. if (window.myHotList.length > 0) {
  119. this.isShowHotIcon = true;
  120. this.data = window.myHotList.filter((item) => {
  121. return item.info.linkType != "common"
  122. });
  123. setTimeout(() => {
  124. this.isShow = true
  125. },1000)
  126. }
  127. }
  128. }, 500)
  129. setTimeout(() => {
  130. if (this.isShow) {
  131. this.isShow = false
  132. }
  133. }, 3000)
  134. const i = GROUP.findIndex(item => {
  135. return item.findIndex(subItem => subItem.m === window.number) > -1
  136. })
  137. if (i > -1) {
  138. this.curGroup = GROUP[i]
  139. }
  140. },
  141. beforeCreate() { }, //生命周期 - 创建之前
  142. beforeMount() { }, //生命周期 - 挂载之前
  143. beforeUpdate() { }, //生命周期 - 更新之前
  144. updated() { }, //生命周期 - 更新之后
  145. beforeDestroy() { }, //生命周期 - 销毁之前
  146. destroyed() { }, //生命周期 - 销毁完成
  147. activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  148. };
  149. </script>
  150. <style lang="less" scoped>
  151. .info-box {
  152. position: absolute;
  153. z-index: 9997;
  154. height: 42px;
  155. min-width: 100px;
  156. top: 10px;
  157. left: 10px;
  158. /* transform: translateX(-50%); */
  159. color: #fff;
  160. &-dropdown {
  161. border: none;
  162. background-color: rgba(94, 26, 19, 0.60);
  163. /deep/ .popper__arrow {
  164. display: none;
  165. }
  166. .el-dropdown-menu__item {
  167. color: white;
  168. &:hover {
  169. color: #ECC439;
  170. background: none;
  171. }
  172. }
  173. }
  174. .top {
  175. height: 100%;
  176. display: flex;
  177. align-items: center;
  178. transition: all 1s ease;
  179. img {
  180. margin-left: 20px;
  181. cursor: pointer;
  182. }
  183. }
  184. .title-box {
  185. width: 100%;
  186. height: 100%;
  187. display: flex;
  188. justify-content: center;
  189. align-items: center;
  190. background: url("../../assets/img/infoBg.png");
  191. background-size: 100% 100%;
  192. font-size: 1.2em;
  193. font-family: "AdobeHeitiStd";
  194. cursor: pointer;
  195. padding: 0 20px;
  196. .line {
  197. width: 1px;
  198. height: 50%;
  199. background: #fff;
  200. margin-left: 20px;
  201. }
  202. img {
  203. // width: 25px;
  204. // height: 25px;
  205. margin-left: 15px;
  206. // margin-top: 10px;
  207. }
  208. }
  209. .fade-enter-active,
  210. .fade-leave-active {
  211. transition: all 1s ease;
  212. }
  213. .fade-enter,
  214. .fade-leave-to
  215. /* .fade-leave-active below version 2.1.8 */
  216. {
  217. opacity: 0;
  218. // height: 0;
  219. // display: none;
  220. }
  221. .disc-box {
  222. width: 300px;
  223. background: #5e1b13a4;
  224. backdrop-filter: blur(10px);
  225. padding: 30px;
  226. text-indent: 2em;
  227. line-height: 25px;
  228. font-size: 1.2em;
  229. letter-spacing: 2px;
  230. margin-top: 10px;
  231. border-radius: 10px 10px;
  232. position: relative;
  233. transition: all 1s ease;
  234. }
  235. .disc-box2 {
  236. width: 300px;
  237. background: #5e1b13a4;
  238. backdrop-filter: blur(10px);
  239. padding: 10px 10px;
  240. line-height: 25px;
  241. margin-top: 10px;
  242. border-radius: 10px 10px;
  243. font-size: 1.2em;
  244. position: relative;
  245. .close-icon {
  246. position: absolute;
  247. top: 15px;
  248. right: 10px;
  249. cursor: pointer;
  250. }
  251. .back-box {
  252. font-size: 0.9em;
  253. line-height: 40px;
  254. color: rgba(255, 255, 255, 0.6);
  255. font-weight: 400;
  256. cursor: pointer;
  257. img {
  258. transform: calc(0.9);
  259. margin-right: 10px;
  260. }
  261. }
  262. .hot-list {
  263. width: 100%;
  264. .list-title {
  265. color: #E7C395;
  266. padding: 0 10px;
  267. }
  268. .list-content {
  269. max-height: 400px;
  270. overflow: auto;
  271. .list-item {
  272. width: 100%;
  273. height: 30px;
  274. line-height: 30px;
  275. color: white;
  276. text-align: left;
  277. white-space: nowrap;
  278. cursor: pointer;
  279. padding: 0 10px;
  280. }
  281. }
  282. .active {
  283. color: #E7C395;
  284. background: #911212;
  285. }
  286. }
  287. }
  288. }
  289. @media screen and (max-width: 1000px) {
  290. .info-box {
  291. height: 58px;
  292. width: 300px;
  293. min-width: 0px;
  294. transform: scale(0.7);
  295. left: 10%;
  296. .title-box {
  297. font-size: 18px;
  298. .detail {
  299. max-width: 70%;
  300. .scroll-wrap {
  301. max-width: 100%;
  302. display: inline-block;
  303. vertical-align: top;
  304. overflow: hidden;
  305. white-space: nowrap;
  306. .scroll-item {
  307. animation: scroll linear 7s alternate infinite;
  308. float: left;
  309. }
  310. @keyframes scroll {
  311. 0% {
  312. margin-left: 0;
  313. transform: translateX(0);
  314. }
  315. 10% {
  316. margin-left: 0;
  317. transform: translateX(0);
  318. }
  319. 90% {
  320. margin-left: 100%;
  321. transform: translateX(-100%);
  322. }
  323. 100% {
  324. margin-left: 100%;
  325. transform: translateX(-100%);
  326. }
  327. }
  328. }
  329. }
  330. }
  331. .disc-box {
  332. width: 100%;
  333. }
  334. }
  335. }
  336. </style>