|
|
@@ -1,45 +1,195 @@
|
|
|
<template>
|
|
|
-<div class='son6'>son6</div>
|
|
|
+ <div class="son6">
|
|
|
+ <!-- 点击视频播放的盒子 -->
|
|
|
+ <div class="videoPlayBox" v-if="videoId">
|
|
|
+ <video controls autoplay :src="`/data/${videoId}.mp4`"></video>
|
|
|
+ <!-- 关闭按钮 -->
|
|
|
+ <div class="close" @click="videoId = null"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 点击场景播放的盒子 -->
|
|
|
+ <div class="videoPlayBox" v-if="modelId">
|
|
|
+ <iframe :src="modelId" frameborder="0"></iframe>
|
|
|
+ <!-- 关闭按钮 -->
|
|
|
+ <div class="close" @click="modelId = null"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 场景 -->
|
|
|
+ <div class="modelBox">
|
|
|
+ <div
|
|
|
+ class="modelPlay"
|
|
|
+ @click="
|
|
|
+ modelId =
|
|
|
+ 'https://www.4dkankan.com/panorama/show.html?id=WK1526492643662524416&vr=fd720_JUXrSixwc'
|
|
|
+ "
|
|
|
+ ></div>
|
|
|
+ <img src="../assets/img/mod1.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="shuming">场景:围馆封仓</div>
|
|
|
+
|
|
|
+ <div class="sonBj1"></div>
|
|
|
+ <div
|
|
|
+ class="rowBox"
|
|
|
+ v-for="item in data"
|
|
|
+ :key="item.id"
|
|
|
+ :class="{ noPad: item.pad }"
|
|
|
+ >
|
|
|
+ <div class="row" @click="toInfo(item.id)" :style="`width: ${item.ww};`">
|
|
|
+ <img
|
|
|
+ :style="`height: ${item.hh};`"
|
|
|
+ :src="require(`@/assets/img/zhanpin/${item.id}.png`)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <p>{{ item.name }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="sonBj2"></div>
|
|
|
+ <!-- 视频 -->
|
|
|
+ <div class="videoBox">
|
|
|
+ <div class="vidPlay" @click="videoId = '3'"></div>
|
|
|
+ <img src="../assets/img/vid4.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="shuming">《传讯行商》</div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
-name:'son6',
|
|
|
-components: {},
|
|
|
-data() {
|
|
|
-//这里存放数据
|
|
|
-return {
|
|
|
-
|
|
|
+ name: "son6",
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ //这里存放数据
|
|
|
+ return {
|
|
|
+ videoId: null,
|
|
|
+ modelId: null,
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ id: 38,
|
|
|
+ name: "林则徐画像",
|
|
|
+ ww: "155px",
|
|
|
+ hh: "183px",
|
|
|
+ pad: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 39,
|
|
|
+ name: "(油画)销烟壮举",
|
|
|
+ ww: "257px",
|
|
|
+ hh: "190px",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ //监控data中的数据变化
|
|
|
+ watch: {},
|
|
|
+ //方法集合
|
|
|
+ methods: {
|
|
|
+ toInfo(id) {
|
|
|
+ this.$router.push(`/info/${id}`);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {},
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {},
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
-},
|
|
|
-//监听属性 类似于data概念
|
|
|
-computed: {},
|
|
|
-//监控data中的数据变化
|
|
|
-watch: {},
|
|
|
-//方法集合
|
|
|
-methods: {
|
|
|
-
|
|
|
-},
|
|
|
-//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
-created() {
|
|
|
-
|
|
|
-},
|
|
|
-//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
-mounted() {
|
|
|
-
|
|
|
-},
|
|
|
-beforeCreate() {}, //生命周期 - 创建之前
|
|
|
-beforeMount() {}, //生命周期 - 挂载之前
|
|
|
-beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
-updated() {}, //生命周期 - 更新之后
|
|
|
-beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
-destroyed() {}, //生命周期 - 销毁完成
|
|
|
-activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
-}
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
-.son6{
|
|
|
- color: red;
|
|
|
-}
|
|
|
+.son6 {
|
|
|
+ .videoPlayBox {
|
|
|
+ position: fixed;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ z-index: 999;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ background-color: rgba(0, 0, 0, 0.9);
|
|
|
+ video {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ max-height: 60vh;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ }
|
|
|
+ .close {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 20px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ background: url("../assets/img/close.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ iframe {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .videoBox {
|
|
|
+ position: relative;
|
|
|
+ & > img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .vidPlay {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ width: 77px;
|
|
|
+ height: 77px;
|
|
|
+ background: url("../assets/img/videoPlay.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .modelBox {
|
|
|
+ position: relative;
|
|
|
+ & > img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .modelPlay {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ width: 77px;
|
|
|
+ height: 77px;
|
|
|
+ background: url("../assets/img/modelPlay.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ .rowBox {
|
|
|
+ padding: 0;
|
|
|
+ margin-bottom: 50px;
|
|
|
+ display: flex;
|
|
|
+ .row {
|
|
|
+ & > img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ & > p {
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 16px;
|
|
|
+ text-align: center;
|
|
|
+ width: 100%;
|
|
|
+ padding: 10px;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:nth-of-type(2n) {
|
|
|
+ justify-content: end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .noPad {
|
|
|
+ padding: 0 24px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|