Browse Source

增加kpanor

zjs_project 1 year ago
parent
commit
bca8ade8fc

+ 1 - 0
package.json

@@ -43,6 +43,7 @@
     "cross-env": "^7.0.3",
     "eslint": "^7.32.0",
     "eslint-plugin-vue": "^8.0.3",
+    "file-loader": "^6.2.0",
     "node-sass": "^4.14.1",
     "px2rem-loader": "^0.1.9",
     "sass-loader": "^7.3.1",

+ 1 - 0
public/index.html

@@ -13,6 +13,7 @@
       <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
     <div id="app"></div>
+	<script type="text/javascript" src="https://dm.static.elab-plus.com/krpano-no-watermark.js"></script>
     <!-- built files will be auto injected -->
 	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
   </body>

BIN
src/components/panoramic/img/horn-img.png


BIN
src/components/panoramic/img/person-img.png


BIN
src/components/panoramic/img/play-horn-img.gif


BIN
src/components/panoramic/img/prompt-720-img.png


BIN
src/components/panoramic/img/voice-bg-img.png


+ 257 - 0
src/components/panoramic/index.scss

@@ -0,0 +1,257 @@
+.panoramic-components {
+    font-size: 12px;
+    .refresh-btn {
+        position: fixed;
+        right: 20px;
+        top: 20px;
+        z-index: 4;
+        width: 20px;
+        height: 17px;
+        > img {
+            width: 20px;
+            height: 17px;
+        }
+    }
+    .krpano-img-before {
+        position: fixed;
+        top: 0;
+        left: 0;
+        z-index: 1;
+        overflow: hidden;
+        width: 100%;
+        height: 100%;
+        transition: opacity 0.5s ease-in;
+        pointer-events: none;
+        > img {
+            width: 100%;
+        }
+    }
+    .krpano-img-after {
+        opacity: 0;
+    }
+    .play-img {
+        position: fixed;
+        width: 1.37rem;
+        height: 1.52rem;
+        margin: auto;
+        left: 0;
+        right: 0;
+        top: 0;
+        bottom: 0;
+        pointer-events: none;
+        transform: scale(2);
+        transition: transform 0.5s ease-in;
+        opacity: 0;
+        z-index: 10;
+        > img {
+            width: 100%;
+            height: 100%;
+        }
+    }
+    .play-img-show {
+        opacity: 1;
+        transform: scale(1);
+    }
+    .prompt-720-img {
+        position: fixed;
+        z-index: 10;
+        top: 0;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        background: rgba(0, 0, 0, 0.5);
+        z-index: 10;
+        margin: auto;
+        pointer-events: none;
+        transition: opacity 0.5s ease-out;
+        > img {
+            width: 2.8rem;
+            height: 4.06rem;
+            position: absolute;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            margin: auto;
+        }
+    }
+    .img-hide {
+        opacity: 0;
+    }
+    .img-hide-once {
+        display: none;
+    }
+    @keyframes promptImg {
+        0% {
+            transform: scale(1);
+        }
+        50% {
+            transform: scale(0.6);
+        }
+        100% {
+            transform: scale(1);
+        }
+    }
+    .disclaimer {
+        position: fixed;
+        display: inline-block;
+        z-index: 1;
+        word-wrap: break-word;
+        width: 12px;
+        line-height: 14px;
+        right: 0.26rem;
+        top: 135px;
+        > a {
+            font-size: 12px;
+            color: rgba(255, 255, 255, 0.5);
+            text-decoration: none;
+        }
+    }
+    #panoramic-krpano {
+        position: fixed;
+        left: 0;
+        right: 0;
+        top: 0;
+        bottom: 0;
+        width: 100%;
+        height: 100%;
+    }
+    .panoramic-tab-content {
+        position: fixed;
+        bottom: 2.44rem;
+        width: 100%;
+        .voice {
+            display: flex;
+            align-items: center;
+            margin-left: 0.3rem;
+            box-sizing: border-box;
+            .sales-head {
+                width: 0.94rem;
+                height: 0.98rem;
+                box-sizing: border-box;
+                overflow: hidden;
+                > img {
+                    display: block;
+                    width: 100%;
+                    height: 100%;
+                    margin-left: 0.03rem;
+                    // margin-top: 0.02rem;
+                }
+            }
+            .voice-content {
+                border-radius: 16px;
+                width: 1rem;
+                height: 0.6rem;
+                line-height: 0.6rem;
+                text-align: center;
+                position: relative;
+                .voice-bg-img {
+                    position: absolute;
+                    left: 0;
+                    top: 0;
+                    width: 1rem;
+                    height: 0.6rem;
+                }
+                .horn {
+                    position: absolute;
+                    right: 0;
+                    margin: auto;
+                    left: 0;
+                    display: inline-flex;
+                    align-items: center;
+                    top: 0;
+                    bottom: 0;
+                    > img {
+                        width: 0.28rem;
+                        right: 0;
+                        margin: auto;
+                        left: 0;
+                    }
+                    > span {
+                        font-size: 0.28rem;
+                        font-weight: 400;
+                        color: #533c12;
+                        padding-left: 0.08rem;
+                    }
+                }
+            }
+        }
+        .swiper-container-class {
+            padding-left: 0.3rem;
+            overflow: visible;
+            .content {
+                font-size: 12px;
+                display: flex;
+                align-items: center;
+                > div {
+                    border: 2px solid rgba(0, 0, 0, 0);
+                    padding: 0.04rem 0.18rem;
+                    width: auto;
+                    display: inline-block;
+                    background: rgba(205, 242, 163, 0.6);
+                    border-radius: 0.2rem 0.2rem 0.2rem 0rem;
+                    margin-right: 0.24rem;
+                    position: relative;
+                    display: inline-flex;
+                    align-items: baseline;
+                    .person-img {
+                        width: 0.2rem;
+                        margin-right: 0.18rem;
+                        display: none;
+                    }
+                    > span {
+                        color: rgba(70, 70, 70, 0.8);
+                    }
+                    .logo {
+                        position: absolute;
+                        left: -2px;
+                        width: 1px;
+                        height: 0.3rem;
+                        border-left: 2px solid rgba(205, 242, 163, 0.6);
+                        bottom: -0.34rem;
+                        > i {
+                            width: 6px;
+                            height: 6px;
+                            opacity: 1;
+                            background: rgba(205, 242, 163, 0.6);
+                            border-radius: 50%;
+                            display: inline-block;
+                            bottom: -0.1rem;
+                            left: -4px;
+                            position: absolute;
+                        }
+                    }
+                }
+                .select-style {
+                    border: 2px solid #ffffff;
+                    background: rgba(205, 242, 163, 1);
+                    .person-img {
+                        display: none; // 这里需要跟设计商量,修改小人的位置
+                    }
+                    > span {
+                        color: rgba(70, 70, 70, 1);
+                    }
+                    .logo {
+                        position: absolute;
+                        border-left: 2px solid #ffffff;
+                        > i {
+                            background: #ffffff;
+                            width: 8px;
+                            height: 8px;
+                            left: -5px;
+                        }
+                    }
+                }
+            }
+            .btn-line {
+                position: absolute;
+                left: -0.3rem;
+                right: 0;
+                height: 1px;
+                opacity: 0.2;
+                background: #ffffff;
+                bottom: -0.34rem;
+            }
+        }
+    }
+}

+ 422 - 0
src/components/panoramic/index.vue

@@ -0,0 +1,422 @@
+<template>
+    <!-- @touchstart="touchstartFunc" -->
+    <div class="panoramic-components">
+        <!-- 刷新按钮 -->
+        <div class="refresh-btn" @click="refreshPage">
+            <img src="https://dm.static.elab-plus.com/refresh-btn.png">
+        </div>
+        <!-- 引导用户  触屏图片 -->
+        <div class="prompt-720-img" :class="isTouchstart ? '' : 'img-hide'">
+            <img src="https://dm.static.elab-plus.com/guide-mask.png" />
+        </div>
+        <!-- 封面引导 蒙城图 -->
+        <div class="krpano-img-before" :class="!videoBefore ? 'krpano-img-after' : ''">
+            <img src="https://dm.static.elab-plus.com/hqc-loading.png" />
+        </div>
+        <div class="play-img" :class="isPlayImg ? 'play-img-show': ''">
+            <img src="https://dm.static.elab-plus.com/hqc-img/play-img.png" />
+        </div>
+        <!-- 免责声明 -->
+        <div class="disclaimer">
+            <a
+                href="https://dm-mng.elab-plus.cn/touFangBao/index.html#/pages/preview?id=3176&templateCode=0&brandId=52&foot=no">本资料仅供宣传参考示意</a>
+        </div>
+        <!-- krpano -->
+        <div id="panoramic-krpano"></div>
+
+        <div class="panoramic-tab-content">
+            <div class="voice">
+                <div class="sales-head">
+                    <img src="https://dm.static.elab-plus.com/image/hqc/img_girl_head.png">
+                </div>
+                <div class="voice-content">
+                    <img class="voice-bg-img" src="./img/voice-bg-img.png">
+                    <div class="horn" @click="controlVoice()">
+                        <img :src="!isPayVoice ? require('./img/horn-img.png') : require('./img/play-horn-img.gif')" />
+                    </div>
+                </div>
+            </div>
+            <div class="swiper-container swiper-container-class">
+                <div class="swiper-wrapper content">
+                    <div v-for="(tab, index) in tabList" :key="index" :name="index"
+                        :class="selectTabIndex == index ? 'select-style swiper-slide' : 'swiper-slide'">
+                        <img class="person-img" src="./img/person-img.png" />
+                        <span :name="index">{{tab.name}}</span>
+                        <div class="logo">
+                            <i></i>
+                        </div>
+                    </div>
+                </div>
+                <div class="btn-line"></div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    // import BScroll from 'better-scroll';
+    const panoramicXML = require("./panoramic.xml");
+    export default {
+        data() {
+            return {
+                tabList: [],
+                selectTabIndex: 0,
+                isPayVoice: false,
+                isPromptShow: true,
+                sceneObj: { id: '', name: '' },
+                isTouchstart: false, // 是否触屏一次
+                isShowOneGuideMask: false, //是否显示过一次引导用户出的操作
+                videoBefore: true,
+                isPlayImg: false, // 暂停按钮出现
+                bgMusicList: {
+                    '1': 'https://dm.static.elab-plus.com/djp-bg-2.mp3',
+                    '2': 'https://dm.static.elab-plus.com/typ-bg-2.mp3',
+                    '3': 'https://dm.static.elab-plus.com/zyp-bg-2.mp3'
+                },
+                maxTabList: {
+                    '1': [
+                        {
+                            id: 'YZ', name: '私家庭院',
+                            music: 'https://dm.static.elab-plus.com/djp-yz-3.mp3',  //语音没有给
+                            videourl: "https://dm.static.elab-plus.com/sjty-A-floor.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/sjty-A-floor.jpg',
+                            isShowHotspot: false,
+                        },
+                        {
+                            id: 'XJEGC', name: '夏加尔广场',
+                            music: 'https://dm.static.elab-plus.com/djp-xjegc-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/djp-xjegc-1.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/djp-xjegc-2.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/djp-xjegc-bg.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        },
+                        {
+                            id: 'FLXZ', name: '芙乐小镇',
+                            music: 'https://dm.static.elab-plus.com/djp-flxz-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/djp-flxz-1.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/djp-flxz-2.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/djp-flxz-bg.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        }
+                    ],
+                    '2': [
+                        {
+                            id: 'YZ', name: '私家庭院',
+                            music: 'https://dm.static.elab-plus.com/sjty-D-music.mp3',  //语音没有给
+                            videourl: "https://dm.static.elab-plus.com/sjty-D-floor.mp4", // 有狗的
+                            bgImg: 'https://dm.static.elab-plus.com/sjty-D-floor.jpg', // 有狗的
+                            isShowHotspot: false,
+                        },
+                        {
+                            id: 'XRKHY', name: '向日葵花园',
+                            music: 'https://dm.static.elab-plus.com/typ-xrkhy-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/typ-xrkhy-1.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/typ-xrkhy-2.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/typ-xrkhy-bg.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        },
+                        {
+                            id: 'XYCHY', name: '无影教堂',
+                            music: 'https://dm.static.elab-plus.com/typ-wyjt-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/typ-wyjt-1.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/typ-wyjt-3.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/typ-wyjt-bg.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        },
+                        {
+                            id: 'MNHY', name: '莫奈花园',
+                            music: 'https://dm.static.elab-plus.com/typ-mnhy-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/hqc-file/zyp-mnhy-10-12-one.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/hqc-file/zyp-mnhy-10-12-two.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/hqc-file/typ-mnhy-bg-10-12.jpeg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        }
+                    ],
+                    '3': [
+                        {
+                            id: 'YZ', name: '私家庭院',
+                            music: 'https://dm.static.elab-plus.com/sjty-G-music.mp3',  //语音没有给
+                            videourl: "https://dm.static.elab-plus.com/sjty-G-floor.mp4", // 有狗的
+                            bgImg: 'https://dm.static.elab-plus.com/sjty-G-floor.jpg', // 有狗的
+                            isShowHotspot: false,
+                        },
+                        {
+                            id: 'ZJGJD', name: '最佳观景点',
+                            music: 'https://dm.static.elab-plus.com/zyp-zjgjd-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/zyp-zjgjd-1.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/zyp-zjgjd-2.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/zyp-zjgjd-bg.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        },
+                        {
+                            id: 'BSZY', name: '半山庄园',
+                            music: 'https://dm.static.elab-plus.com/zyp-bszy-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/zyp-bszy-1.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/zyp-bszy-2.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/zyp-bszy-bg.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        },
+                        {
+                            id: 'PTTY', name: '葡萄田园',
+                            music: 'https://dm.static.elab-plus.com/zyp-ptty-3.mp3',
+                            videourl: "https://dm.static.elab-plus.com/hqc-file/zyp-ptty-10-12-one.mp4",
+                            videourlTwo: "https://dm.static.elab-plus.com/hqc-file/zyp-ptty-10-12-two.mp4",
+                            bgImg: 'https://dm.static.elab-plus.com/hqc-file/zyp-ptty-bg-10-12.jpg',
+                            currentUrlName: '',  //当前播放的地址
+                            isShowHotspot: true,
+                        }
+                    ]
+                },
+            }
+        },
+        methods: {
+            // 更新title
+            updateTitle(name) {
+                document.title = name;
+            },
+            // 刷新页面
+            refreshPage() {
+                let href = window.location.href;
+                let route = this.$route;
+                let query = route.query;
+                let type = this.type;
+                let tabObj = this.maxTabList[type][this.selectTabIndex];
+                let newLocation = tabObj.id;
+                let newHref;
+                // 判断是否有 location
+                if (query.location) {
+                    newHref = href.replace(`location=${query.location}`, `location=${newLocation}`);
+                } else {
+                    if (JSON.stringify(query).length > 2) {
+                        // 当有参数,但是没有location
+                        newHref = `${href}&location=${newLocation}`;
+                    } else {
+                        // 当没有参数的时候
+                        newHref = `${href}?location=${newLocation}`;
+                    }
+                }
+                window.location.replace(newHref);
+                window.location.reload();
+            },
+            panoramic() {
+				console.warn("***panoramicKrpano***")
+                this.panoramicKrpano = document.getElementById('panoramic');
+                // 设置播放的场景
+                this.switchScene(this.selectTabIndex);
+                // 视频加载完
+                window.videoready = () => {
+                    this.videoBefore = false;
+                    // 兼容苹果手机, 当视频加载完也算触屏了, 显示引导用户触屏
+                    if (!this.isShowOneGuideMask) {
+                        // 视频加载完
+                        this.isTouchstart = true;
+                    }
+                    if (this.tipSwiper) {
+                        this.controlVoice(this.selectTabIndex, true, true);
+                    }
+                };
+                // 视频暂停了,自动刷新页面, 并且保存,当前的参数
+                window.videopausedFunc = () => {
+                    // this.refreshPage();
+                    // this.switchScene();
+                    // 关闭播放的的图片
+                    // this.isPayVoice = false;
+                    this.refreshPage();
+                }
+                // 当在视频里面切换不同的场景
+                window.switchScenesType = () => {
+                    this.tipSwiper = false;
+                    this.switchScene();
+                }
+                // 声音播放完
+                window.musicPlayComplete = () => {
+                    this.isPayVoice = false;
+                };
+                // 播放声音状态
+                window.payVoiceStatus = (isPlayStatus) => {
+                    this.isPayVoice = isPlayStatus == 'true' ? true : false;
+                }
+                // 暂停视频,显示图片
+                window.switchPlayImg = (isPlayStatus) => {
+                    this.isPlayImg = !this.isPlayImg;
+                }
+            },
+            manualUpdateSlide(index) {
+                // swiper  loop: true模式下 双向数据绑定无效,手动更新class
+                if (!this.slideList) {
+                    let slideListDom = document.querySelectorAll('.swiper-slide');
+                    this.slideList = Array.prototype.slice.call(slideListDom, 0);
+                }
+                this.slideList.map((dom) => {
+                    var indexName = dom.getAttribute('name');
+                    if (indexName == index) {
+                        dom.classList.add('select-style');
+                    } else {
+                        dom.classList.remove('select-style');
+                    }
+                });
+            },
+            // 点击播放音乐,点击暂停音乐
+            // isStartPay 重新播放
+            controlVoice(index = this.selectTabIndex, isPayVoice, isStartPay) {
+                if (isPayVoice === false) {
+                    this.isPayVoice = false;
+                } else {
+                    this.isPayVoice = isPayVoice ? true : this.isPayVoice = !this.isPayVoice;
+                }
+                // 获取声音的名称
+                let voiceObj = this.tabList[index];
+                // // 播放声音
+                // if (this.isPayVoice) {
+                // 是不是
+
+                this.panoramicKrpano.call(`playsoundMusic(${voiceObj.id},${voiceObj.music},${isStartPay})`);
+                // } else {
+                //     // 暂停声音
+                //     this.panoramicKrpano.call(`pausesoundMusic(${voiceObj.id})`);
+                // }
+
+            },
+            slideToIndex(index) {
+                // this.mySwiper.slideTo(index, 300, false);
+                // 手动更新class
+                this.manualUpdateSlide(index)
+            },
+            // 切换场景
+            switchScene(index = this.selectTabIndex, isStartPlay) {
+                // 视频加载之前, 加载遮住层
+                this.videoBefore = true;
+                // 解决黑屏的问题
+                // 获取对应的场景名称
+                let sceneName = this.tabList[index].id;
+                let videourl = this.tabList[index].videourl;
+                let bgImg = this.tabList[index].bgImg;
+                let isShowHotspot = this.tabList[index].isShowHotspot;
+                // 当前播放的url名称
+                let currentUrlName = this.tabList[index].currentUrlName;
+                // 当有下一个场景切换的时候
+                if (isShowHotspot) {
+                    if (currentUrlName == 'videourl' && !!currentUrlName && !isStartPlay) {
+                        videourl = this.tabList[index].videourlTwo;
+                        this.tabList[index].currentUrlName = 'videourlTwo';
+                    } else {
+                        this.tabList[index].currentUrlName = 'videourl';
+                    }
+                }
+                // 切换场景, 播放音乐
+                // 如果上次延时,没执行,则清理
+                if (this.timeId) {
+                    clearTimeout(this.timeId);
+                }
+                this.timeId = setTimeout(() => {
+                    let bgMusicPath = this.bgMusicList[this.type];
+                    this.panoramicKrpano.call(`playSceneName(${videourl}, ${bgImg},${bgMusicPath},${isShowHotspot})`);
+                }, (!this.tipSwiper ? 500 : 0));
+            },
+        },
+        watch: {
+            isTouchstart(val, oldVal) {
+                if (val == true) {
+                    this.isShowOneGuideMask = true;
+                    setTimeout(() => {
+                        this.isTouchstart = false;
+                        // 当引导图都隐藏后,才能触屏
+                        this.panoramicKrpano.call(`suspendedPlay()`);
+                    }, 3000);
+                }
+            }
+        },
+        mounted() {
+            embedpano({
+                swf: "https://dm.static.elab-plus.com/krpano.swf",
+                xml: panoramicXML,
+                bgcolor: "#000",
+                target: "panoramic-krpano",
+                passQueryParameters: false,
+                consolelog: true,
+                id: "panoramic",
+                mobilescale: 0.5, //移动设备缩放,1表示不缩放,默认0.5
+                onready: this.panoramic
+            });
+            let _that_ = this;
+            // this.mySwiper = new Swiper('.swiper-container', {
+            //     loop: false,
+            //     loopAdditionalSlides: 2,
+            //     slidesPerView: 'auto',
+            //     preventClicksPropagation: false,
+            //     on: {
+            //         click: function (e) {
+            //             let index = e.target.getAttribute("name");
+            //             // 重复点击一个无效
+            //             if (!index || _that_.selectTabIndex == index) {
+            //                 return false;
+            //             }
+            //             // 播放按钮隐藏
+            //             _that_.isPlayImg = false;
+            //             // 暂停现在播放的语音
+            //             _that_.controlVoice(_that_.selectTabIndex, false, false);
+            //             // 然后赋值
+            //             _that_.selectTabIndex = index;
+            //             // 滚动到对应的值
+            //             _that_.slideToIndex(index);
+            //             let name = _that_.tabList[index].name;
+            //             // 暂停全部声音
+            //             // _that_.panoramicKrpano.call(`closeVoice()`);
+            //             // 更新title名称
+            //             _that_.updateTitle(name);
+            //             // 切换场景
+            //             _that_.switchScene(index, true);
+            //             // 当切换过场景后,才能播放声音
+            //             _that_.tipSwiper = true;
+            //             _that_.$emit("setTab", _that_.tabList[index]);
+            //         },
+            //     },
+            // });
+            if (this.selectTabIndex != 0) {
+                this.slideToIndex(this.selectTabIndex);
+            }
+            let name = this.tabList[this.selectTabIndex].name;
+            // 更新title名称
+            this.updateTitle(name);
+            this.$emit("setTab", this.tabList[this.selectTabIndex]);
+        },
+        created() {
+			console.warn("***this.type***")
+            // type 1,2,3  表示 度假派、田园派、庄园派
+            this.type = this.$route.query.type || 1;
+            this.locationName = this.$route.query.location;
+            this.tabList = this.maxTabList[this.type];
+            // 寻找对应的场景
+            if (this.locationName) {
+                this.tabList.map((item, index) => {
+                    if (item.id == this.locationName) {
+                        // 取对应的值
+                        this.sceneObj = item;
+                        // 然后滚动到对应的区域
+                        this.selectTabIndex = index;
+                    }
+                });
+            } else {
+                // 如果没有默认第一个
+                this.sceneObj = this.tabList[0];
+            }
+			console.warn("***this.type***",this.sceneObj)
+            // // 监听屏幕大小变化
+            // window.addEventListener('resize', ()=>{
+            // });
+        },
+        beforeDestroy() {
+            // this.panoramicKrpano.call(`closeVoice()`);
+        }
+    }
+</script>
+<style scoped lang="scss">
+    @import "index.scss";
+</style>

+ 231 - 0
src/components/panoramic/panoramic.xml

@@ -0,0 +1,231 @@
+<krpano name="globalObject">
+    <plugin name="video"
+            url.html5="https://dm.static.elab-plus.com/videoplayer.js" 
+            videourl=""
+            muted="true"
+            preload="true"
+            pausedonstart="false"
+            onvideoready="videoreadyFunc"
+            onvideopaused="videopausedFunc"
+            url.flash="https://dm.static.elab-plus.com/videoplayer.swf"
+            loop="true"
+            isPlayBg="false"
+            voicesList=""
+            playName = ""
+            isPay = "false"
+            isVideoreadyType="false"
+            isTip = "false"
+            />
+    <image>
+        <sphere url="plugin:video" />
+    </image>
+    <!-- 热点地址 -->
+    <hotspot 
+        name="hotspot-yard"
+        type="image"
+        edge="lefttop"
+        url="https://dm.static.elab-plus.com/hqc-img/forward.png"
+        alturl="https://dm.static.elab-plus.com/hqc-img/forward.png"
+        distorted="true"
+		ath="0"
+        atv="0"
+        width="74"
+        height="91"
+        visible="false"
+        onclick="switchScenesType"
+        />
+    <settings width="100" height="50" />
+    <view hlookat="0" vlookat="0" fov="120" fovmin="90.0" fovmax="130.0" fovtype="DFOV"/>
+    <action name="switchScenesType">
+        jscall('window.switchScenesType()');
+    </action>
+    <action name="mobilescale" autorun="preinit" devices="mobile">
+        mul(stagescale,0.5);
+    </action>
+    <action name="playSceneName">
+        <!-- 打印日志 -->
+        <!-- showlog(true, top); -->
+        mobilescale();
+        <!-- 播放视频 -->
+        plugin[video].playvideo(%1, %2, false);
+        def(b, string, get(plugin[video].isPlayBg));
+        if(b == false, playBgMusic(%3));
+        if(b == suspend, delayedcall(0.5 , playBgMusic(%3, true)););
+        <!-- 是否显示热点 -->
+        if(
+            %4 == true,
+                set(hotspot[hotspot-yard].visible, true);
+                ,
+                set(hotspot[hotspot-yard].visible, false);
+            )
+    </action>
+    <action name="playBgMusic">
+        <!-- 播放背景音乐 -->
+        ifnot(%2 == true, playsound(bgsnd, %1, 0););
+        if(%2 == true, pausesoundtoggle(bgsnd););
+        set(plugin[video].isPlayBg, true);
+    </action>
+    <!-- 播放音乐设置,引入插件 -->
+    <plugin name="soundinterface" 
+        url="https://dm.static.elab-plus.com/soundinterface.swf"
+        alturl="https://dm.static.elab-plus.com/soundinterface.js" 
+        preload="true"
+        keep="true"
+        loop="false"
+        ></plugin>
+    <!-- 音乐播放完 -->
+    <action name="musicPlayComplete">
+        <!-- 删掉保存的状态 -->
+        <!-- 播放的数组 -->
+        def(voicesList, string, get(plugin[video].voicesList));
+        <!-- 刚播放完的名称 -->
+        def(voicesName, string, get(plugin[video].playName));
+        txtreplace(voicesList, get(voicesName), '');
+        set(plugin[video].playName, '');
+        set(plugin[video].isPay, false);
+        set(plugin[video].voicesList, voicesList);
+
+        jscall('window.musicPlayComplete()');
+    </action>
+    <!-- 播放声音 -->
+    <action name="playsoundMusic">
+        def(voicesList, string, get(plugin[video].voicesList));
+        def(voicesName, string, %1);
+        def(voicesUrl, string, %2);
+        def(isStartPay, string, %3);
+        <!-- 当前播放的名称 -->
+        set(plugin[video].playName, get(voicesName));
+        <!-- 当之前没有播放过,则播放声音 -1就是没有播放过-->
+        indexoftxt(index, get(voicesList), get(voicesName));
+        <!-- isStartPay true 播放音乐 false 暂停音乐  index == -1 播放音乐  其他的则切换音乐状态 -->
+        if(
+            isStartPay == true,
+                startPayMusic(get(voicesName), get(voicesUrl), get(voicesList));
+            ,
+                if(
+                    isStartPay == false,
+                        pausesoundMusic(get(voicesName));
+                    ,
+                        if(
+                            index == -1,
+                                startPayMusic(get(voicesName), get(voicesUrl), get(voicesList));
+                            ,
+                                toggleMusic(get(voicesName));
+                        )
+                )
+        );
+    </action>
+    <!-- 重新开始播放 -->
+    <action name="startPayMusic" args="voicesName, voicesUrl, voicesList">
+        <!-- 将播放的字符 添加到总字符中 -->
+        txtadd(voicesConcat, get(voicesList), get(voicesName));
+        <!-- 设置播放的字符集合 -->
+        set(plugin[video].voicesList, get(voicesConcat));
+        <!-- 是否在播放 -->
+        set(plugin[video].isPay, true);
+        <!-- 播放声音 -->
+        def(b, string, get(plugin[video].isPlayBg));
+        if(
+            b == suspend,
+                delayedcall(0.5,playsound(get(voicesName), get(voicesUrl), 1, musicPlayComplete););
+            ,
+                playsound(get(voicesName), get(voicesUrl), 1, musicPlayComplete);
+        );
+    </action>
+    <!-- 切换状态播放,暂停 -->
+    <action name="toggleMusic" args="voicesName">
+        def(isPay, string, get(plugin[video].isPay));
+        if(
+            isPay == false,
+                set(plugin[video].isPay, true);
+                resumesoundMusic(get(voicesName))
+            ,
+                set(plugin[video].isPay, false);
+                pausesoundMusic(get(voicesName));
+        );
+    </action>
+    <!-- 暂停声音 -->
+    <action name="pausesoundMusic">
+        pausesound(%1);
+    </action>
+    <!-- 恢复声音 -->
+    <action name="resumesoundMusic">
+        resumesound(%1);
+    </action>
+    <!-- 关闭所有的声音 -->
+    <action name="closeVoice">
+        pausesoundtoggle(bgsnd);
+    </action>
+    <!-- 视频初始化完成 -->
+    <action name="videoreadyFunc">
+        jscall('window.videoready()');
+    </action>
+    <!-- 引导图加载完成后 -->
+    <action name="suspendedPlay">
+        set(plugin[video].isVideoreadyType, true);
+    </action>
+    <!-- 视频暂停 -->
+    <!-- 解决ios手机 切换页面返回不自动播放的原因 devices="ios"-->
+    <action name="videopausedFunc" devices="ios">
+        def(isTip, string, get(plugin[video].isTip));
+        trace(plugin[video].isTip);
+        
+        pausesound(bgsnd);
+        set(plugin[video].isPay, false);
+        def(voicesName, string, get(plugin[video].playName));
+        ifnot(voicesName == '' ,pausesoundMusic(get(voicesName)););
+     
+
+        if(isTip == true, 
+            set(plugin[video].isTip, false);
+        ,
+            jscall('window.videopausedFunc()');
+        );
+    </action>
+    <!-- 滚动到中心位置 -->
+    <events onclick="clickFunc"></events>
+    <action name="clickFunc">
+        <!-- screentosphere(mouse.x, mouse.y, h, v);
+        trace(h,',',v); -->
+        def(isVideoreadyType, string, get(plugin[video].isVideoreadyType));
+        if(isVideoreadyType == true,
+            <!-- 获取当前播放的声音名称 -->
+            def(voicesName, string, get(plugin[video].playName));
+            <!-- 切换播放的状态 -->
+            <!-- plugin[video].togglepause(); -->
+
+            def(isPlayBg, string, get(plugin[video].isPlayBg));
+            if(isPlayBg == true,
+            <!-- 暂停声音 -->
+                    <!-- 暂停视频 -->
+                    plugin[video].pause();
+                       <!-- 是因为点击导致视频暂停 -->
+                    set(plugin[video].isTip, true);
+                    pausesound(bgsnd);
+                    set(plugin[video].isPlayBg, false);
+                    jscall(calc("window.switchPlayImg('"+ false +"')") );
+                    <!-- 当有播放声音的名称,则切换播放的状态 -->
+                    ifnot(voicesName == '' ,
+                        <!-- 暂停声音 -->
+                        set(plugin[video].isPay, false);
+                        pausesoundMusic(get(voicesName));
+                        jscall(calc("window.payVoiceStatus('"+ false +"')") );); 
+                ,
+            <!-- 播放声音 -->
+                    <!-- 播放视频 -->
+                    plugin[video].play();
+                    resumesound(bgsnd);
+                    set(plugin[video].isPlayBg, true);
+                    jscall(calc("window.switchPlayImg('"+ true +"')") );
+                    <!-- 当有播放声音的名称,则切换播放的状态 -->
+                    ifnot(voicesName == '' ,
+                        <!-- 播放声音 -->
+                        set(plugin[video].isPay, true);
+                        resumesoundMusic(get(voicesName));
+                        jscall(calc("window.payVoiceStatus('"+ true +"')") );); 
+            );
+        );
+        
+        
+    </action>
+</krpano>

+ 2 - 2
src/pages/webgl_rxdz_720/webgl_rxdz_720.vue

@@ -109,8 +109,8 @@
 			var that = this;
 			console.warn("***webgl_rxdz_roam-options***", this.$route.query)
 			this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
-			// this.videoUrl = this.$route.query.videoUrl || '';
-			this.videoUrl = this.$route.query.videoUrl || 'https://dm.static.elab-plus.com/miniProgram/002.mp4';
+			this.videoUrl = this.$route.query.videoUrl || '';
+			// this.videoUrl = this.$route.query.videoUrl || 'https://dm.static.elab-plus.com/miniProgram/002.mp4';
 			this.bgUrl = this.$route.query.bgUrl ||
 				'https://dm.static.elab-plus.com/miniProgram/tears_of_steel_bridge_2k.jpg';
 			this.coordinate = this.$route.query.coordinate || '';

+ 11 - 0
src/pages/webgl_rxdz_panor/webgl_rxdz_panor.html

@@ -0,0 +1,11 @@
+<!--
+ * @Author: caodongdong caodongdoong@gmail.com
+ * @Date: 2023-05-17 15:46:34
+ * @LastEditors: caodongdong caodongdoong@gmail.com
+ * @LastEditTime: 2023-06-30 16:20:04
+ * @FilePath: \h5-uniApp-miniprogrgm\webgl\pages\webgl_rxdz\webgl_rxdz.html
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<div class="main-view">
+	<Panoramic></Panoramic>
+</div>

+ 21 - 0
src/pages/webgl_rxdz_panor/webgl_rxdz_panor.scss

@@ -0,0 +1,21 @@
+.main-view{
+	width:100vw;
+	height:100vh;
+	overflow: hidden;
+	position: relative;
+}
+canvas { z-index: 10;}
+.mapDiv{
+	position: relative;
+	background-color: #fff;
+	font-size: 0px;
+}
+page {
+    -webkit-user-select: none;
+    user-select: none;
+    width: 100%;
+	height:100vh;
+    overflow-x: hidden;
+    overflow-y: hidden;
+}
+

+ 72 - 0
src/pages/webgl_rxdz_panor/webgl_rxdz_panor.vue

@@ -0,0 +1,72 @@
+<template src="./webgl_rxdz_panor.html">
+
+</template>
+<script>
+	import Panoramic from "../../components/panoramic/index.vue";
+	import commonPageMethod from '@/mixins/commonPageMethod.js';
+	// import commonPageMethod from '@/common/commonPageMethod.js';
+	export default {
+		components: {
+			Panoramic
+		},
+		mixins: [commonPageMethod],
+		/**
+		 * 页面的初始数据
+		 */
+		data() {
+			return {
+				pvCurPageName: "panor",
+				locusBehaviorName: "panor",
+				pvCurPageParams: null,
+				houseId: "",
+				pvId: 'p_2cmina_23080402',
+				canvas: null,
+				navbar: {
+					showCapsule: 1,
+					title: 'panor',
+					titleColor: '#000',
+					navPadding: 0,
+					navPaddingBg: 'transparent',
+					navBarColor: 'transparent',
+					navBackColor: 'transparent',
+					haveCallback: true, // 如果是 true 会接手 navbarBackClk
+					fromShare: false,
+					fromProject: 0,
+					shareToken: "",
+					pageName: this.pvCurPageName,
+				},
+				isIOS: false,
+				videoUrl:'',
+				bgUrl:'',
+			}
+		},
+		beforeDestroy() {
+			console.warn("***beforeDestroy-webgl_rxdz_panor***");
+		},
+		mounted(options) {
+			var that = this;
+			console.warn("***webgl_rxdz_panor-options***", this.$route.query)
+			this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
+			this.videoUrl = this.$route.query.videoUrl || '';
+			this.bgUrl = this.$route.query.bgUrl || 'https://elab-marketing-web.oss-accelerate.aliyuncs.com/replicate_images/1702457671501.png';
+			
+		},
+		methods: {
+			clearHandle() {
+				this.clearEvent();
+			},
+			updateMuted(){
+				this.muted = !this.muted;
+			},
+			iosPlay(){
+				this.videoHandle();
+				this.hasOneTouch = true;
+			},
+			
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	@import "./webgl_rxdz_panor.scss";
+	/* @import "@/common/css/common.css"; */
+</style>

+ 9 - 0
src/router/index.js

@@ -12,6 +12,7 @@ import webgl_rxdz_customize from '@/pages/webgl_rxdz_customize/webgl_rxdz_custom
 import webgl_rxdz_vr from '@/pages/webgl_rxdz_vr/webgl_rxdz_vr.vue'
 import webgl_rxdz_720 from '@/pages/webgl_rxdz_720/webgl_rxdz_720.vue'
 import webgl_rxdz_clipImg from '@/pages/webgl_rxdz_clipImg/webgl_rxdz_clipImg';//webgl 截图功能
+import webgl_rxdz_panor from '@/pages/webgl_rxdz_panor/webgl_rxdz_panor';//panor
 
 Vue.use(Router)
 const router = new Router({
@@ -86,6 +87,14 @@ const router = new Router({
 			meta:{
 				keepAlive:false
 			}
+		},
+		{
+			path: '/pages/webgl_rxdz_panor',
+			name: 'webgl_rxdz_panor',
+			component: webgl_rxdz_panor,
+			meta:{
+				keepAlive:false
+			}
 		}
 		
     ],

+ 18 - 0
vue.config.js

@@ -34,5 +34,23 @@ module.exports = {
 				remUnit: 75, //根据视觉稿,rem为px的⼗分之⼀,750px  75rem
 				remPrecision: 4 //保留8位⼩数
 			}).end();
+		config.module
+		    .rule('xml')
+		    .test(/\.xml$/)
+		    .use('file-loader')
+		    .loader('file-loader')
+			.options({
+				esModule: false
+			})
+		    .end()
+		config.module
+		    .rule('swf')
+		    .test(/\.swf/)
+		    .use('file-loader')
+		    .loader('file-loader')
+			.options({
+				esModule: false
+			})
+		    .end()
 	}
 }