123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- <template>
- <div class="home">
- <div class="main">
- <div class="mainCon" v-show="!oneTxt">
- <audio
- id="myAudio"
- v-if="audio"
- v-show="isOneAduio"
- :src="urlToFitFu(audio)"
- controls
- ></audio>
- <!-- 音频图标 v-if="audio && !isOneAduio"-->
- <div class="iconList">
- <div
- class="audioIcon"
- @click="audioSta = !audioSta"
- :title="audioSta ? '关闭音频' : '打开音频'"
- >
- <img
- :src="
- require(`@/assets/images/pc/audio${audioSta ? 'Ac' : ''}.png`)
- "
- alt=""
- />
- </div>
- <div
- class="audioIcon"
- @click="audioSta = !audioSta"
- :title="audioSta ? '关闭音频' : '打开音频'"
- >
- <img
- :src="
- require(`@/assets/images/pc/yuyan.png`)
- "
- alt=""
- />
- </div>
- </div>
- <!-- 如果只有一个模块 -->
- <!-- <div
- class="oneTabNum"
- v-if="
- flooTab.length === 1 &&
- data[myType] &&
- data[myType].length &&
- data[myType].length > 1
- "
- >
- {{ myInd + 1 }} / {{ data[myType].length }}
- </div> -->
- <!-- 底部的tab -->
- <!-- <div class="flooTabBox" v-if="flooTab.length > 1">
- <div
- @click="myType = item.type"
- class="tabRow"
- :class="{ tabRowAc: myType === item.type }"
- v-for="item in flooTab"
- :key="item.id"
- >
- <img
- :src="
- require(`@/assets/images/pc/icon${item.id}${
- myType === item.type ? 'Ac' : ''
- }.png`)
- "
- alt=""
- />
- {{ item.name }}
- <span
- v-if="
- data[item.type] &&
- data[item.type].length &&
- data[item.type].length > 1
- "
- >{{ item.type === myType ? myInd + 1 + "/" : null
- }}{{ data[item.type].length }}</span
- >
- </div>
- </div> -->
- <!-- 主要内容 -->
- <div class="contenBoxMain">
- <img class="logo" src="../assets/logo.png" alt="" />
- <div
- class="contenBox"
- :class="{ contenBoxAc: index === myInd }"
- v-for="(item, index) in activeObj.images"
- :key="index"
- >
- <!-- 模型页面 -->
- <!-- <div class="modelBox" v-if="myType === 'model'">
- <iframe
- :src="urlToFitFu(item)"
- frameborder="0"
- v-if="index === myInd"
- ></iframe>
- </div> -->
- <!-- 视频页面 -->
- <!-- <div class="videoBox" v-else-if="myType === 'video'">
- <video
- controls
- :src="urlToFitFu(item.url)"
- v-if="index === myInd"
- ></video>
- </div> -->
- <!-- 图片页面 v-if="myType === 'img'"-->
- <div class="imgBox">
- <div class="smImgBox" @click="lookImg(urlToFitFu(item))">
- <img v-lazy="urlToFitFu(item)" alt="" />
- </div>
- </div>
- </div>
- <!-- 左右箭头 -->
- <div
- @click="cutMyInd(-1, myInd === 0)"
- class="leftJJ awccJJ"
- :class="{ noClick: myInd === 0 }"
- v-if="activeObj.images && activeObj.images.length > 1"
- ></div>
- <div
- @click="cutMyInd(1, myInd === activeObj.images.length - 1)"
- class="rightJJ awccJJ"
- :class="{ noClick: myInd === activeObj.images.length - 1 }"
- v-if="activeObj.images && activeObj.images.length > 1"
- ></div>
- </div>
- </div>
- <div class="changeList">
- <div class="list">
- <div class="item" @click="activeObj = element;myInd = 0" v-for="element in list" :key="element.title" :class="{active: element.id == activeObj.id}">
- {{ element.title }}
- </div>
- </div>
- </div>
- <!-- 下面的文字介绍 -->
- <div class="flooTxt" v-if="activeObj.images[myInd]">
- <div class="flooTxtBox">
- <div class="myTitle">{{ activeObj.images[myInd].title_zh }}</div>
- <div class="myTxt">
- {{ activeObj.images[myInd].text_zh }}
- </div>
- </div>
- </div>
- </div>
- <!-- 查看图片 -->
- <viewer class="viewerCla" ref="viewer" :images="lookPics">
- <img :src="lookPics[0]" alt="" />
- </viewer>
- </div>
- </template>
- <script>
- import myData from "./data.json";
- export default {
- name: "Home",
- data() {
- return {
- m: this.$route.query.m,
- id: this.$route.query.id,
- // 音频地址
- audio: "",
- // 如果只有单独的音频
- isOneAduio: false,
- // 音频状态
- audioSta: false,
- myInd: 0,
- // 当前 type
- list: [],
- // 查看图片
- lookPics: [],
- activeObj: {
- id: 1,
- images: [],
- },
- };
- },
- watch: {
- myType() {
- this.myInd = 0;
- },
- // 音频的开启和关闭
- audioSta(val) {
- const dom = document.querySelector("#myAudio");
- if (val) {
- dom.play();
- dom.onended = () => {
- // console.log("----音频播放完毕");
- this.audioSta = false;
- };
- } else dom.pause();
- },
- },
- computed: {},
- components: {},
- methods: {
- // 本地化 url 适配
- urlToFitFu(url) {
- return url.url || url;
- // const resUrl = url;
- // if (url.includes("https://super.4dage.com")) {
- // return url.replace("https://super.4dage.com", "");
- // } else if (url.includes("http://super.4dage.com")) {
- // return url.replace("http://super.4dage.com", "");
- // } else return resUrl;
- },
- // 点击左右箭头
- cutMyInd(num, flag) {
- if (flag) return;
- this.myInd += num;
- this.activeObj = this.data[this.myType][this.myInd];
- console.log("----num", this.activeObj, "flag", flag, this.myInd);
- },
- // 点击查看大图
- lookImg(url) {
- let dom = this.$refs.viewer.$viewer;
- this.lookPics = [url.url || url];
- dom.show();
- },
- async getData() {
- console.log("----myData", myData);
- // https://www.4dmodel.com/
- // let url = `https://super.4dage.com/data/${ // 线上数据
- // let url = `/data/${
- // //本地化部署
- // this.id
- // }/hot/js/data.js?time=${Math.random()}`;
- // let url = `/hot/js/data.js?time=${Math.random()}`;
- // let result = (await this.$http.get(url)).data;
- const resData = myData;
- this.list = resData;
- let showData = resData && resData[0];
- this.activeObj = {
- ...showData,
- };
- },
- },
- mounted() {
- this.getData();
- },
- };
- </script>
- <style lang="less" scoped>
- .home {
- .viewerCla img {
- display: none;
- }
- width: 100%;
- height: 100%;
- background-color: rgba(255, 252, 247, 0.6);
- backdrop-filter: blur(10px);
- position: relative;
- #myAudio {
- z-index: 11;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: 500px;
- height: 60px;
- }
- .main {
- width: 1350px;
- margin: 0 auto;
- height: 825px;
- padding-top: 95px;
- .changeList {
- width: 630px;
- height: 32px;
- width: 630px;
- height: 32px;
- position: absolute;
- left: calc(50% - 315px);
- bottom: 286px;
- .list {
- display: flex;
- align-items: center;
- .active{
- opacity: 1;
- color: #02362C;
- }
- div {
- height: 100%;
- padding: 8px 7px 10px 7px;
- min-width: 70px;
- text-align: center;
- background: #dde5e2;
- border-radius: 7px;
- font-family: Source Han Serif CN;
- font-weight: 500;
- font-size: 14px;
- color: #02362c;
- line-height: 14px;
- opacity: 0.79;
- margin-right: 20px;
- }
- }
- }
- .mainCon {
- background-image: url("../assets/bg.png");
- background-size: 100% 100%;
- position: relative;
- border-radius: 6px;
- overflow: hidden;
- width: 100%;
- height: 100%;
-
- .iconList{
- position: absolute;
- bottom: 182px;
- right: 237px;
- display: flex;
- }
- .audioIcon {
- z-index: 10;
- cursor: pointer;
- position: relative;
- // right: 20px;
- // bottom: 278px;
- width: 62px;
- img {
- width: 100%;
- }
- }
- .oneTabNum {
- z-index: 10;
- position: absolute;
- bottom: 30px;
- left: 50%;
- transform: translateX(-50%);
- font-size: 14px;
- }
- .flooTabBox {
- z-index: 10;
- position: absolute;
- bottom: 30px;
- left: 50%;
- transform: translateX(-50%);
- display: flex;
- .tabRow {
- cursor: pointer;
- display: flex;
- align-items: center;
- margin: 0 12px;
- font-size: 12px;
- background-color: #dedede;
- padding: 0px 14px;
- height: 36px;
- border-radius: 18px;
- & > img {
- margin-right: 6px;
- }
- }
- .tabRowAc {
- background-color: #b90c0c;
- pointer-events: none;
- color: #d6b970;
- }
- }
- .contenBoxMain {
- position: relative;
- width: 100%;
- height: 100%;
- .logo {
- position: absolute;
- left: 52px;
- top: 37px;
- height: 60px;
- }
- }
- .contenBox {
- width: 630px;
- height: 355px;
- position: absolute;
- top: 123px;
- left: calc(50% - 315px);
- opacity: 0;
- pointer-events: none;
- transition: all 0.5s;
- .modelBox,
- .videoBox,
- .imgBox {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .modelBox {
- iframe {
- width: 100%;
- height: 100%;
- }
- }
- .videoBox {
- // padding: 100px 100px 120px;
- video {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- .imgBox {
- // padding: 100px 100px 120px;
- .smImgBox {
- width: 100%;
- height: 100%;
- cursor: zoom-in;
- & > img {
- pointer-events: none;
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- }
- }
- .contenBoxAc {
- opacity: 1;
- pointer-events: auto;
- }
- .awccJJ {
- cursor: pointer;
- position: absolute;
- top: 42%;
- transform: translateY(-50%);
- left: 266px;
- width: 48px;
- height: 60px;
- background-image: url("../assets/images/icon/left.png");
- background-size: 100% 100%;
- &:focus {
- outline: none;
- }
- }
- .rightJJ {
- left: auto;
- right: 266px;
- background-image: url("../assets/images/icon/right.png");
- }
- .noClick {
- cursor: default;
- opacity: 0.4;
- }
- }
- .flooTxt {
- margin-top: 20px;
- width: 80%;
- height: 135px;
- margin: 0 auto;
- position: relative;
- top: -137px;
- .flooTxtBox {
- width: 100%;
- height: 100%;
- overflow-y: auto;
- .myTitle {
- color: #DDE5E2;
- font-size: 22px;
- font-weight: 700;
- margin-bottom: 10px;
- }
- .myTxt {
- font-family: Adobe Heiti Std;
- font-weight: normal;
- font-size: 19px;
- color: #DDE5E2;
- line-height: 31px;
- }
- &::-webkit-scrollbar {
- /*滚动条整体样式*/
- width: 3px; /*高宽分别对应横竖滚动条的尺寸*/
- height: 1px;
- }
- &::-webkit-scrollbar-thumb {
- /*滚动条里面小方块*/
- border-radius: 10px;
- -webkit-box-shadow: inset 0 0 5px transparent;
- background: #b90c0c;
- }
- &::-webkit-scrollbar-track {
- /*滚动条里面轨道*/
- -webkit-box-shadow: inset 0 0 5px transparent;
- border-radius: 10px;
- background: transparent;
- }
- }
- }
- .flooTxtOne {
- height: 600px;
- }
- }
- }
- // 移动端
- @media screen and (max-width: 1000px) {
- .home {
- #myAudio {
- width: 90vw;
- max-width: 500px;
- }
- .main {
- width: 90%;
- height: 94%;
- padding: 0;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- .mainCon {
- border-radius: 8px 8px 0 0;
- .audioIcon {
- cursor: default;
- right: auto;
- bottom: auto;
- top: 6px;
- left: 6px;
- & > img {
- width: 30px;
- }
- }
- .flooTabBox {
- width: 100%;
- bottom: 20px;
- justify-content: center;
- .tabRow {
- cursor: default;
- margin: 0 6px;
- padding: 0 10px;
- height: 32px;
- & > img {
- width: 16px;
- }
- }
- }
- .contenBox {
- .videoBox {
- padding: 0px 0;
- position: relative;
- video {
- width: 96%;
- max-height: 100%;
- height: auto;
- position: absolute;
- top: 50%;
- left: 2%;
- transform: translateY(-50%);
- }
- }
- .imgBox {
- padding: 60px 50px 80px;
- .smImgBox {
- cursor: default;
- }
- }
- }
- .awccJJ {
- left: 0;
- width: 28px;
- height: 57px;
- cursor: default;
- background-image: url("../assets/images/pc/icon-left.png");
- }
- .rightJJ {
- left: auto;
- right: 0;
- background-image: url("../assets/images/pc/icon-right.png");
- }
- }
- .flooTxt {
- margin-top: 0;
- padding: 20px 15px 15px;
- height: 200px;
- background-color: #fff;
- border-radius: 0 0 8px 8px;
- .flooTxtBox {
- .myTitle {
- font-size: 18px;
- }
- .myTxt {
- font-size: 14px;
- line-height: 22px;
- }
- }
- }
- .flooTxtOne {
- height: 100%;
- }
- }
- }
- }
- </style>
|