123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <template>
- <div v-if="!isMobile" class="images" :style="{backgroundImage:`url(${require('@/assets/images/project/hotspot_bg.jpg')})`}">
- <div class="title">{{hotspot.title}}</div>
- <div class="img-con">
- <span @click="active-=1" :class="{noshow:active<=0}">上一张</span>
- <img v-viewer :src="hotspot.images[active]" alt="">
- <span @click="active+=1" :class="{noshow:active>=hotspot.images.length - 1}">下一张</span>
- <ul class="pagna">
- <li v-for="(item,i) in hotspot.images" :class="{active:i==active}" :key="i"></li>
- </ul>
- </div>
- <div class="desc" v-html="hotspot.content">
- </div>
- </div>
- <div v-else class="mbimages" :style="{backgroundImage:`url(${require('@/assets/images/project/mb_hostpot.jpg')})`}">
- <div class="title">{{hotspot.title}}</div>
- <swiper class="swiper-wrapper swiper-wrapper-n" :options="swiperOption">
- <swiper-slide class="swiper-slide" v-for="(item,index) in hotspot.images" :key="index">
- <div class="sl-item">
- <img v-viewer :src="item">
- </div>
- </swiper-slide>
- </swiper>
- <ul class="pagna">
- <li v-for="(item,i) in hotspot.images" :class="{active: i == mbactive}" :key="i"></li>
- </ul>
- <div v-if="hotspot.content" class="desc">
- <p>简介:</p>
- <div v-html="hotspot.content"></div>
- </div>
- </div>
- </template>
- <script>
- import { Swiper, SwiperSlide } from "vue-awesome-swiper";
- import 'swiper/swiper-bundle.css'
- export default {
- components: {
- Swiper,
- SwiperSlide,
- },
- props:['hotspot'],
- data(){
- return {
- active:0,
- mbactive:0
- }
- },
- computed:{
- swiperOption() {
- let that = this
- return {
- slidesPerView: 'auto',
- autoplay: false,
- centeredSlides: true,
- watchSlidesProgress: true,
- loop: false,
- on:{
- slideChangeTransitionEnd:function () {
- that.mbactive = this.realIndex
- console.log(that.mbactive);
- }
- }
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .noshow{
- opacity: 0!important;;
- pointer-events: none!important;;
- }
- .images{
- width: 100%;
- height: 100%;
- background-repeat: no-repeat;
- text-align: center;
- .title{
- padding: 0 80px;
- display: inline-block;
- color: #DBA761;
- font-weight: bold;
- font-size: 36px;
- height: 70px;
- line-height: 70px;
- background: #BC1515;
- border-radius: 60px;
- margin: 45px auto;
- }
- .img-con{
- display: flex;
- justify-content: space-around;
- align-items: center;
- position: relative;
- padding-bottom: 40px;
- >span{
- display: inline-block;
- padding: 0 30px;
- box-sizing: content-box;
- font-size: 20px;
- height: 50px;
- line-height: 50px;
- background: rgba(188, 21, 21, 0.9);
- border: 2px solid #DBA761;
- border-radius: 37px;
- cursor: pointer;
- &:hover,&.active{
- color: #DBA761;
- }
- }
- >img{
- max-width: 1000px;
- border: 10px solid #BC1515;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
- max-height: 600px;
- }
- .pagna{
- position: absolute;
- bottom: 0;
- text-align: center;
- z-index: 999;
- >li{
- width: 60px;
- height: 6px;
- background: #BC1515;
- display: inline-block;
- margin: 0 4px;
- &.active{
- background: #DBA761;
- }
- }
- }
- }
- .desc{
- max-width: 1000px;
- margin: 20px auto 0;
- color: #DBA761;
- text-align: left;
- line-height: 2;
- max-height: 200px;
- overflow-y: auto;
- }
- }
- @position:62px;
- .mbimages{
- width: 100%;
- height: 100%;
- background-repeat: no-repeat;
- background-size: 100% calc(100% + @position);
- background-position: 0 -@position;
- text-align: center;
- .title{
- width: 90%;
- padding: 10px;
- display: inline-block;
- color: #DBA761;
- font-weight: bold;
- font-size: 18px;
- background: #BC1515;
- border-radius: 60px;
- margin: 20px auto;
- }
- .swiper-wrapper {
- height: 250px;
- padding: 0;
- .swiper-slide {
- width: 85%;
- transform-style: preserve-3d;
- position: relative;
- height: 100%;
- margin: 0 10px;
- .sl-item{
- position: absolute;
- top: 0;
- left: 50%;
- height: 100%;
- transform: translateX(-50%);
- width: 100%;
- overflow: hidden;
- border: 4px solid #BC1515;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
- background-color: #757477;
- >img{
- height: 100%;
- transform: translateX(-50%);
- position: absolute;
- left: 50%;
- }
- }
- }
- }
- .pagna{
- text-align: center;
- z-index: 999;
- >li{
- width: 40px;
- height: 4px;
- background: #BC1515;
- display: inline-block;
- margin: 0 4px;
- &.active{
- background: #DBA761;
- }
- }
- }
- .desc{
- color: #DBA761;
- text-align: left;
- width: 85%;
- margin: 20px auto 0;
- p{
- font-size: 16px;
- font-weight: bold;
- }
- div{
- font-size: 14px;
- margin-top: 10px;
- line-height: 1.5;
- max-height: 50vh;
- overflow-y: auto;
- }
- }
- }
- </style>
|