Home.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <template>
  2. <div class="Home" @click.once="topBox2Show = true">
  3. <!-- 全景页面 -->
  4. <div class="iframeBox" v-if="iframeSrc" :key="iframeSrc">
  5. <iframe :src="iframeSrc" frameborder="0"></iframe>
  6. </div>
  7. <!-- 在第一展厅和第二展厅出来的背景模板 -->
  8. <div class="tedingBac" v-show="oneSid > 2 && zhanShow"></div>
  9. <!-- 音乐 -->
  10. <audio id="myAduio" loop src="../assets/bg.mp3"></audio>
  11. <!-- 右上角logo -->
  12. <div class="rightLogo">
  13. <img src="../assets/img/logo.png" alt="" />
  14. </div>
  15. <!-- 左上角 -->
  16. <div class="topLeft">
  17. <div class="back el-icon-s-home" @click="backSta"></div>
  18. <div class="topTit">
  19. <img
  20. title="简介"
  21. @click="
  22. topBox1Show = !topBox1Show;
  23. topBox3Show = false;
  24. "
  25. :src="require(`@/assets/img/left1${topBox1Show ? 'Ac' : ''}.png`)"
  26. alt=""
  27. />
  28. <img
  29. title="音乐"
  30. @click="topBox2Show = !topBox2Show"
  31. :src="require(`@/assets/img/left2${topBox2Show ? 'Ac' : ''}.png`)"
  32. alt=""
  33. />
  34. <img
  35. @click="
  36. topBox3Show = !topBox3Show;
  37. topBox1Show = false;
  38. "
  39. title="分享"
  40. :src="require(`@/assets/img/left3${topBox3Show ? 'Ac' : ''}.png`)"
  41. alt=""
  42. />
  43. </div>
  44. </div>
  45. <!-- 点击简介出来的盒子 -->
  46. <div class="topBox1" :class="{ topBox1Show: topBox1Show }">
  47. <!-- 关闭按钮 -->
  48. <div class="topClose" @click="topBox1Show = false">
  49. <img src="../assets/img/topClose.png" alt="" />
  50. </div>
  51. <h3>
  52. 第九届“博博会”<br /><br />
  53. —— 新时代的博物馆:创新·发展·传承
  54. </h3>
  55. <p>
  56. &emsp;&emsp;“博博会”创办于2004年,已成功召开八届,是我国文博界最具影响力的盛会,是展示博物馆领域发展成果、增强中华文化自信、促进文博科技融合发展、相关技术应用创新服务升级、扩展博物馆服务社会功能、推动国内外博物馆务实合作、开拓博物馆文化产业发展新领域的重要平台,在服务我国文博事业健康可持续发展和相关行业创造性转化、创新性发展方面发挥着独特的作用。
  57. </p>
  58. </div>
  59. <!-- 点击分享出来的盒子 -->
  60. <div class="topBox3" :class="{ topBox3Show: topBox3Show }">
  61. <!-- 关闭按钮 -->
  62. <div class="topClose" @click="topBox3Show = false">
  63. <img src="../assets/img/topClose.png" alt="" />
  64. </div>
  65. <h3>分享页面</h3>
  66. <div class="url">{{ myUrl }}</div>
  67. <div class="btnn" @click="copyPcTxt"><div>一键复制</div></div>
  68. </div>
  69. <!-- 底部组件 -->
  70. <div
  71. class="bttomBox"
  72. :style="`height:${oneSid > 2 ? '256' : '213'}px;bottom:${
  73. bttomIsShow ? '0' : oneSid > 2 ? '-256' : '-213'
  74. }px`"
  75. >
  76. <div
  77. class="bttomIsShow"
  78. @click="bttomIsShow = !bttomIsShow"
  79. :class="bttomIsShow ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
  80. ></div>
  81. <Bottom2
  82. @zhanShowFu="zhanShowFu"
  83. @zhanChange="zhanChange"
  84. @gaoduChange="gaoduChange"
  85. ref="Bottom2"
  86. />
  87. <div class="shadow"></div>
  88. <div class="shadow right"></div>
  89. </div>
  90. <!-- 点击展厅出来的组件 -->
  91. <Onezhan @toZhan="toZhan" v-if="oneSid === 3" v-show="zhanShow" />
  92. <Towzhan @toZhan="toZhan" v-else-if="oneSid === 4" v-show="zhanShow" />
  93. </div>
  94. </template>
  95. <script>
  96. import Bottom from "./Bottom.vue";
  97. import Bottom2 from "./Bottom2.vue";
  98. import Onezhan from "./Onezhan.vue";
  99. import Towzhan from "./Towzhan.vue";
  100. export default {
  101. name: "Home",
  102. components: { Bottom, Bottom2, Onezhan, Towzhan },
  103. data() {
  104. return {
  105. iframeSrc: "",
  106. // 选择了航拍还是展厅
  107. oneSid: 1,
  108. zhanShow: true,
  109. bttomIsShow: true,
  110. topBox1Show: false,
  111. topBox2Show: false,
  112. topBox3Show: false,
  113. myUrl: "",
  114. };
  115. },
  116. computed: {},
  117. watch: {
  118. // bttomIsShow() {
  119. // this.zhanShow = true;
  120. // },
  121. // 控制背景音乐播放暂停
  122. topBox2Show(val) {
  123. if (val) document.querySelector("#myAduio").play();
  124. else document.querySelector("#myAduio").pause();
  125. },
  126. },
  127. methods: {
  128. // 点击左上角的返回
  129. backSta() {
  130. //回到博博会之前的开发页面
  131. window.location.href = "https://zzbbh.4dage.com/web/index.html";
  132. },
  133. zhanShowFu() {
  134. this.zhanShow = true;
  135. },
  136. toZhan(bs, id1, id2, code) {
  137. this.$refs.Bottom2.baseList(bs);
  138. this.$refs.Bottom2.getSwFu(id1, id2);
  139. // if (bs > 2) {
  140. // this.zhanShow = false;
  141. // }
  142. this.zhanChange(code);
  143. },
  144. gaoduChange(oneSid) {
  145. if (oneSid > 2) this.zhanShow = true;
  146. this.oneSid = oneSid;
  147. },
  148. zhanChange(code) {
  149. this.zhanShow = false;
  150. // this.bttomIsShow = false;
  151. this.iframeSrc = `swkk.html?m=${code}`;
  152. console.log("VR改变了", code);
  153. },
  154. //点击复制链接
  155. copyPcTxt() {
  156. // 存储传递过来的数据
  157. let OrderNumber = window.location.href;
  158. // 创建一个input 元素
  159. // createElement() 方法通过指定名称创建一个元素
  160. let newInput = document.createElement("input");
  161. // 讲存储的数据赋值给input的value值
  162. newInput.value = OrderNumber;
  163. // appendChild() 方法向节点添加最后一个子节点。
  164. document.body.appendChild(newInput);
  165. // 选中input元素中的文本
  166. // select() 方法用于选择该元素中的文本。
  167. newInput.select();
  168. // 执行浏览器复制命令
  169. // execCommand方法是执行一个对当前文档,当前选择或者给出范围的命令
  170. document.execCommand("Copy");
  171. // 清空输入框
  172. newInput.remove();
  173. // 下面是element的弹窗 不需要的自行删除就好
  174. this.$message({
  175. message: "复制成功",
  176. type: "success",
  177. });
  178. },
  179. },
  180. //生命周期 - 创建完成(可以访问当前this实例)
  181. created() {
  182. this.myUrl = window.location.href;
  183. },
  184. //生命周期 - 挂载完成(可以访问DOM元素)
  185. mounted() {},
  186. beforeCreate() {}, //生命周期 - 创建之前
  187. beforeMount() {}, //生命周期 - 挂载之前
  188. beforeUpdate() {}, //生命周期 - 更新之前
  189. updated() {}, //生命周期 - 更新之后
  190. beforeDestroy() {}, //生命周期 - 销毁之前
  191. destroyed() {}, //生命周期 - 销毁完成
  192. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  193. };
  194. </script>
  195. <style lang='less' scoped>
  196. .Home {
  197. width: 100%;
  198. height: 100%;
  199. position: relative;
  200. background-image: url("../assets/img/homeBg.jpg");
  201. background-size: 100% 100%;
  202. .iframeBox {
  203. position: absolute;
  204. top: 0;
  205. left: 0;
  206. width: 100%;
  207. height: 100%;
  208. iframe{
  209. width: 100%;
  210. height: 100%;
  211. }
  212. }
  213. .tedingBac {
  214. position: absolute;
  215. top: 0;
  216. left: 0;
  217. width: 100%;
  218. height: 100%;
  219. z-index: 3;
  220. backdrop-filter: blur(10px);
  221. }
  222. .rightLogo {
  223. width: 572px;
  224. height: 46px;
  225. position: absolute;
  226. z-index: 10;
  227. top: 20px;
  228. right: 40px;
  229. & > img {
  230. width: 100%;
  231. height: 100%;
  232. }
  233. }
  234. .topClose {
  235. position: absolute;
  236. right: 32px;
  237. top: 32px;
  238. width: 30px;
  239. height: 30px;
  240. display: flex;
  241. justify-content: center;
  242. align-items: center;
  243. cursor: pointer;
  244. & > img {
  245. width: 18px;
  246. height: 18px;
  247. }
  248. }
  249. .topLeft {
  250. position: absolute;
  251. z-index: 10;
  252. top: 18px;
  253. left: 30px;
  254. display: flex;
  255. .back {
  256. cursor: pointer;
  257. width: 36px;
  258. height: 36px;
  259. background-image: url("../assets/img/back.png");
  260. background-size: 100% 100%;
  261. font-size: 18px;
  262. color: #fff;
  263. text-align: center;
  264. line-height: 36px;
  265. margin-right: 17px;
  266. transition: all 0.5s;
  267. border-radius: 50%;
  268. &:hover {
  269. box-shadow: 0px 0px 15px 3px black;
  270. }
  271. }
  272. .topTit {
  273. height: 36px;
  274. display: flex;
  275. align-items: center;
  276. border-radius: 18px;
  277. background-color: rgba(0, 0, 0, 0.6);
  278. padding: 0 8px;
  279. & > img {
  280. display: block;
  281. margin: 0 5px;
  282. cursor: pointer;
  283. width: 28px;
  284. height: 28px;
  285. }
  286. }
  287. }
  288. .topBox1 {
  289. opacity: 0;
  290. pointer-events: none;
  291. transition: opacity 0.5s;
  292. color: #fff;
  293. padding: 80px 65px 0px;
  294. position: absolute;
  295. z-index: 10;
  296. top: 70px;
  297. left: 64px;
  298. width: 457px;
  299. height: 600px;
  300. background-image: url("../assets/img/top1Bac.png");
  301. background-size: 100% 100%;
  302. & > h3 {
  303. font-size: 18px;
  304. text-align: center;
  305. }
  306. & > p {
  307. margin-top: 50px;
  308. font-size: 14px;
  309. line-height: 34px;
  310. }
  311. }
  312. .topBox1Show {
  313. opacity: 1;
  314. pointer-events: auto;
  315. }
  316. .topBox3 {
  317. opacity: 0;
  318. pointer-events: none;
  319. transition: opacity 0.5s;
  320. color: #fff;
  321. position: absolute;
  322. z-index: 10;
  323. padding: 60px 60px 0;
  324. top: 70px;
  325. left: 64px;
  326. width: 457px;
  327. height: 295px;
  328. background-image: url("../assets/img/top3Bac.png");
  329. background-size: 100% 100%;
  330. & > h3 {
  331. font-size: 18px;
  332. text-align: center;
  333. margin-bottom: 20px;
  334. }
  335. .url {
  336. width: 100%;
  337. height: 60px;
  338. background-color: rgba(0, 0, 0, 0.5);
  339. margin: 10px 0;
  340. padding: 0 10px;
  341. line-height: 60px;
  342. text-align: center;
  343. overflow: hidden;
  344. text-overflow: ellipsis;
  345. white-space: nowrap;
  346. }
  347. .btnn {
  348. width: 100%;
  349. height: 60px;
  350. background-color: rgba(0, 0, 0, 0.5);
  351. display: flex;
  352. justify-content: center;
  353. align-items: center;
  354. & > div {
  355. cursor: pointer;
  356. width: 110px;
  357. height: 30px;
  358. text-align: center;
  359. line-height: 28px;
  360. border: 1px solid #fff;
  361. }
  362. }
  363. }
  364. .topBox3Show {
  365. opacity: 1;
  366. pointer-events: auto;
  367. }
  368. .bttomBox {
  369. z-index: 10;
  370. transition: bottom 0.5s;
  371. position: absolute;
  372. bottom: 5px;
  373. left: 50%;
  374. transform: translateX(-50%);
  375. width: 1339px;
  376. height: 256px;
  377. .bttomIsShow {
  378. cursor: pointer;
  379. text-align: center;
  380. color: #edb8a4;
  381. position: absolute;
  382. z-index: 10;
  383. top: -15px;
  384. left: 50%;
  385. transform: translateX(-50%);
  386. width: 91px;
  387. height: 17px;
  388. background-image: url("../assets/img/bttomIsShow.png");
  389. background-size: 100% 100%;
  390. }
  391. .shadow {
  392. border-radius: 60px 0 0 0;
  393. position: absolute;
  394. z-index: 11;
  395. left: 0;
  396. top: 0;
  397. width: 200px;
  398. height: 152px;
  399. background-image: linear-gradient(
  400. to right,
  401. rgba(0, 0, 0, 0.7),
  402. rgba(0, 0, 0, 0)
  403. );
  404. pointer-events: none;
  405. }
  406. .right {
  407. border-radius: 0 60px 0 0;
  408. left: auto;
  409. right: 0;
  410. background-image: linear-gradient(
  411. to left,
  412. rgba(0, 0, 0, 0.7),
  413. rgba(0, 0, 0, 0)
  414. );
  415. }
  416. }
  417. }
  418. </style>