|
@@ -0,0 +1,447 @@
|
|
|
+<template>
|
|
|
+ <div class="images brightnessBigW">
|
|
|
+ <audio
|
|
|
+ id="audioTag"
|
|
|
+ class="noshow"
|
|
|
+ autoplay
|
|
|
+ :src="g_dealUrl(hotspot.backgroundMusic)"
|
|
|
+ ></audio>
|
|
|
+ <div class="jiantou brightnessBigW"></div>
|
|
|
+ <div class="title">{{ hotspot.title }}</div>
|
|
|
+ <div class="qline">
|
|
|
+ <img :src="require(`@/assets/images/icon/star.png`)" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="audiotu">
|
|
|
+ <img class="cd" :class="{cdactive:isPlay}" :src="require(`@/assets/images/project/CD.png`)" alt="" />
|
|
|
+ <img
|
|
|
+ class="hk"
|
|
|
+ @click="bofang"
|
|
|
+ :class="{ hkactive: !isPlay }"
|
|
|
+ :src="require(`@/assets/images/project/huakuai.png`)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="img-con">
|
|
|
+ <template v-if="hotspot.title == '院歌'">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item,i) in geciList" :key="i">
|
|
|
+ <span :class="{acitve:singleidx>idx}" v-for="(ii,idx) in item.txt" :key="idx">
|
|
|
+ {{ii}}
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </template>
|
|
|
+ <p v-else>{{ hotspot.content }}</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="qline rline">
|
|
|
+ <img :src="require(`@/assets/images/icon/star.png`)" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="audiocon">
|
|
|
+ <div class="adcon">
|
|
|
+ <img
|
|
|
+ @click="bofang"
|
|
|
+ :src="
|
|
|
+ require(`@/assets/images/project/${
|
|
|
+ isPlay ? 'zanting' : 'bofang'
|
|
|
+ }.png`)
|
|
|
+ "
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div class="bar">
|
|
|
+ <div class="activeLine" @click="seekTime"></div>
|
|
|
+ <div :style="{ width: currentPosi + '%' }" class="dot"></div>
|
|
|
+ </div>
|
|
|
+ <div class="time">
|
|
|
+ <span>{{ time }}</span
|
|
|
+ ><span> / {{ allTime }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { data } from "./yuange";
|
|
|
+export default {
|
|
|
+ props: ["hotspot"],
|
|
|
+ data() {
|
|
|
+ let tmp = Object.keys(data).map(item=>{
|
|
|
+ return {
|
|
|
+ miao:item,
|
|
|
+ txt:data[item]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ active: 0,
|
|
|
+ time: 0,
|
|
|
+ i_audio: "",
|
|
|
+ isPlay: false,
|
|
|
+ currentPosi: 0,
|
|
|
+ allTime: 0,
|
|
|
+ geci: tmp,
|
|
|
+ activeGeci:0,
|
|
|
+ singleidx: 0,
|
|
|
+ timer:null
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ geciList(){
|
|
|
+ let tmp = Object.keys(data).map(item=>{
|
|
|
+ return {
|
|
|
+ miao:item,
|
|
|
+ txt:data[item]
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ let active = tmp.splice(Math.max(this.activeGeci-1,0), 3)
|
|
|
+ return active
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ bofang() {
|
|
|
+ if (this.i_audio.paused) {
|
|
|
+ this.i_audio.play();
|
|
|
+ this.isPlay = true;
|
|
|
+ this.timer&&clearInterval(this.timer)
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.singleidx += 1
|
|
|
+ }, 350);
|
|
|
+ } else {
|
|
|
+ this.i_audio.pause();
|
|
|
+ this.isPlay = false;
|
|
|
+ this.timer&&clearInterval(this.timer)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ transTime(time) {
|
|
|
+ var duration = parseInt(time);
|
|
|
+ var minute = parseInt(duration / 60);
|
|
|
+ var sec = (duration % 60) + "";
|
|
|
+ var isM0 = ":";
|
|
|
+ if (minute == 0) {
|
|
|
+ minute = "00";
|
|
|
+ } else if (minute < 10) {
|
|
|
+ minute = "0" + minute;
|
|
|
+ }
|
|
|
+ if (sec.length == 1) {
|
|
|
+ sec = "0" + sec;
|
|
|
+ }
|
|
|
+ return minute + isM0 + sec;
|
|
|
+ },
|
|
|
+ updateProgress() {
|
|
|
+
|
|
|
+ this.geci.forEach((item,i)=>{
|
|
|
+ if (item.miao <= Math.floor(this.i_audio.currentTime)) {
|
|
|
+ this.activeGeci = i
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.currentPosi =
|
|
|
+ (this.i_audio.currentTime / this.i_audio.duration) * 100;
|
|
|
+ this.time = this.transTime(this.i_audio.currentTime);
|
|
|
+ },
|
|
|
+
|
|
|
+ audioEnded() {
|
|
|
+ this.i_audio.currentTime = 0;
|
|
|
+ this.i_audio.pause();
|
|
|
+ this.isPlay = false;
|
|
|
+ this.activeGeci=0
|
|
|
+ this.singleidx=0
|
|
|
+ this.timer&&clearInterval(this.timer)
|
|
|
+ },
|
|
|
+
|
|
|
+ seekTime(e) {
|
|
|
+ var rate = e.offsetX / e.target.clientWidth;
|
|
|
+ this.i_audio.currentTime = this.i_audio.duration * rate;
|
|
|
+ this.updateProgress();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ activeGeci(newVal,oldVal){
|
|
|
+ if (newVal) {
|
|
|
+ this.singleidx = 0
|
|
|
+ this.timer&&clearInterval(this.timer)
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.singleidx += 1
|
|
|
+ }, 350);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeDestroy(){
|
|
|
+ this.i_audio = null
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.i_audio = $("#audioTag")[0];
|
|
|
+ $("#audioTag").on("loadedmetadata", (e) => {
|
|
|
+ this.time = this.transTime(e.currentTarget.duration);
|
|
|
+ this.allTime = this.transTime(e.currentTarget.duration);
|
|
|
+ this.i_audio.play();
|
|
|
+ this.isPlay = true;
|
|
|
+ });
|
|
|
+
|
|
|
+ document.addEventListener(
|
|
|
+ "WeixinJSBridgeReady",
|
|
|
+ function() {
|
|
|
+ this.i_audio.play();
|
|
|
+ },
|
|
|
+ false
|
|
|
+ );
|
|
|
+
|
|
|
+ $("#audioTag").on("timeupdate", () => {
|
|
|
+ this.updateProgress();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#audioTag").on("timeupdate", () => {
|
|
|
+ this.updateProgress();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#audioTag").on("ended", () => {
|
|
|
+ this.audioEnded();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.images {
|
|
|
+ width: 320px;
|
|
|
+ height: 480px;
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 auto;
|
|
|
+ position: fixed;
|
|
|
+ top: 60%;
|
|
|
+ left: 32%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ border-radius: 5px;
|
|
|
+ border-top: 5px solid #ccaf8f;
|
|
|
+ border-bottom: 5px solid #ccaf8f;
|
|
|
+ background-color: rgba(3, 51, 48, .7);
|
|
|
+ color: #ffe0a6;
|
|
|
+ padding: 20px 24px;
|
|
|
+ text-align: left;
|
|
|
+ &::before{
|
|
|
+ content: '';
|
|
|
+ backdrop-filter: blur(2px) brightness(90%)!important;
|
|
|
+ background-color: rgba(255,255,255, 0.14)!important;
|
|
|
+ }
|
|
|
+ .jiantou{
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ left: 100%;
|
|
|
+ width: 130px;
|
|
|
+ height: 100px;
|
|
|
+ background-color: rgba(3, 51, 48, .7);
|
|
|
+ clip-path: polygon(0 58%, 0% 100%, 100% 0%);
|
|
|
+ &::before{
|
|
|
+ content: '';
|
|
|
+ backdrop-filter: blur(2px) brightness(90%)!important;
|
|
|
+ background-color: rgba(255,255,255, 0.14)!important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .title {
|
|
|
+ display: inline-block;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 20px;
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .qline {
|
|
|
+ width: 100%;
|
|
|
+ height: 1px;
|
|
|
+ margin: 22px 0 10px;
|
|
|
+ position: relative;
|
|
|
+ background: linear-gradient(
|
|
|
+ 90deg,
|
|
|
+ #fcf5d3 0%,
|
|
|
+ #fcf5d3 48%,
|
|
|
+ rgba(255, 255, 255, 0) 100%
|
|
|
+ );
|
|
|
+ > img {
|
|
|
+ position: absolute;
|
|
|
+ left: -10px;
|
|
|
+ width: 32px;
|
|
|
+ top: -12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .rline {
|
|
|
+ margin: 0 0 16px;
|
|
|
+ background: linear-gradient(
|
|
|
+ -90deg,
|
|
|
+ #fcf5d3 0%,
|
|
|
+ #fcf5d3 48%,
|
|
|
+ rgba(255, 255, 255, 0) 100%
|
|
|
+ );
|
|
|
+ > img {
|
|
|
+ position: absolute;
|
|
|
+ right: -10px;
|
|
|
+ left: unset;
|
|
|
+ width: 32px;
|
|
|
+ top: -12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .audiotu {
|
|
|
+ text-align: center;
|
|
|
+ position: relative;
|
|
|
+ .cd {
|
|
|
+ width: 70%;
|
|
|
+ transition: 0.3s ease all;
|
|
|
+ animation: stoprotate 1s linear forwards;
|
|
|
+ }
|
|
|
+ .hk {
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ left: 10px;
|
|
|
+ z-index: 99;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: 0.3s ease transform;
|
|
|
+ transform-origin: left;
|
|
|
+ width: 120px;
|
|
|
+ }
|
|
|
+ .hkactive {
|
|
|
+ transform: rotate(-30deg);
|
|
|
+ }
|
|
|
+
|
|
|
+ .cdactive{
|
|
|
+ animation: rotate360 5s linear infinite;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .img-con {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+ position: relative;
|
|
|
+ > p {
|
|
|
+ line-height: 2;
|
|
|
+ max-width: 1000px;
|
|
|
+ max-height: 100px;
|
|
|
+ margin: 10px 0;
|
|
|
+ text-align: justify;
|
|
|
+ overflow-y: auto;
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ width: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ >ul{
|
|
|
+ width:100%;
|
|
|
+ >li{
|
|
|
+ line-height: 1.5;
|
|
|
+ margin: 10px 0;
|
|
|
+ text-align: left;
|
|
|
+ transition: .3s ease all;
|
|
|
+ &:first-of-type,&:last-of-type{
|
|
|
+ >span{
|
|
|
+ color: rgba(255, 224, 166, 0.4)!important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ >span{
|
|
|
+ font-size: 14px;
|
|
|
+ display: inline-block;
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
+ transition: .4s ease all;
|
|
|
+ &.acitve{
|
|
|
+ color: rgba(255, 224, 166, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @color: rgba(20, 62, 58, 0.5);
|
|
|
+ .audiocon {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 40px;
|
|
|
+ .adcon {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .bar {
|
|
|
+ position: relative;
|
|
|
+ background: none;
|
|
|
+ display: flex;
|
|
|
+ overflow: visible;
|
|
|
+ height: 4px;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin: 0 10px 0 16px;
|
|
|
+ flex: auto;
|
|
|
+ .activeLine {
|
|
|
+ cursor: pointer;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ position: absolute;
|
|
|
+ background-color: rgba(252, 245, 211, .25);
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ border-radius: 12px;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dot {
|
|
|
+ display: inline-block;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 999;
|
|
|
+ background-color: rgba(226, 197, 154, .7);
|
|
|
+ transform: translateY(-50%);
|
|
|
+ top: 50%;
|
|
|
+ left: 0;
|
|
|
+ height: 100%;
|
|
|
+ cursor: pointer;
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ > img {
|
|
|
+ margin: 0 0px;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .time {
|
|
|
+ width: 100px;
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 auto;
|
|
|
+ > span {
|
|
|
+ font-size: 14px;
|
|
|
+ &:first-of-type {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ &:last-of-type {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.close {
|
|
|
+ position: absolute;
|
|
|
+ top: 40px;
|
|
|
+ right: 50px;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 9999999;
|
|
|
+}
|
|
|
+.noshow {
|
|
|
+ position: fixed;
|
|
|
+ top: -100%;
|
|
|
+ left: -100%;
|
|
|
+ opacity: 0 !important;
|
|
|
+ pointer-events: none !important;
|
|
|
+}
|
|
|
+</style>
|