| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <template>
- <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 {
- 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缓存功能,这个函数会触发
- };
- </script>
- <style lang='less' scoped>
- .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>
|