|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="carousel" :class="{width_670: providerType === 'original'}">
|
|
|
+ <div class="carousel">
|
|
|
<div v-swiper:mySwiper="swiperOption">
|
|
|
<div class="swiper-wrapper">
|
|
|
<div class="swiper-slide" v-for="banner in banners">
|
|
@@ -21,28 +21,13 @@
|
|
|
data () {
|
|
|
return {
|
|
|
activeSlide: 0
|
|
|
- // banners: {}
|
|
|
}
|
|
|
},
|
|
|
mixins: [carousel],
|
|
|
-// mounted () {
|
|
|
-// this.$http.get('/api/carousel/home%20page%20banner')
|
|
|
-// .then(response => {
|
|
|
-// this.banners = response.data
|
|
|
-// this.x++
|
|
|
-// })
|
|
|
-// }
|
|
|
computed: {
|
|
|
- providerType () {
|
|
|
- return this.$route.path === '/provider/home' ? 'agency' : 'original'
|
|
|
- },
|
|
|
banners () {
|
|
|
if (this.$store.state.carousel.banners) {
|
|
|
- let banner = this.$store.state.carousel.banners.data.data.slice()
|
|
|
- banner.sort(function (a, b) {
|
|
|
- return a.contentId - b.contentId
|
|
|
- })
|
|
|
- return banner
|
|
|
+ return this.$store.state.carousel.banners.data.data
|
|
|
} else {
|
|
|
return ''
|
|
|
}
|
|
@@ -70,13 +55,9 @@
|
|
|
@import '~assets/scss/variables';
|
|
|
|
|
|
$carousel_width: 955px;
|
|
|
- /*$carousel_width_670: 670px;*/
|
|
|
$carousel_height: 400px;
|
|
|
|
|
|
.carousel {
|
|
|
- /*&.width_670{*/
|
|
|
- /*width: $carousel_width_670;*/
|
|
|
- /*}*/
|
|
|
width: $carousel_width;
|
|
|
height: $carousel_height;
|
|
|
transition: background-color .3s;
|