ZZJ
2022-04-22 fc17d4b6114ac373b28570837865998f5189e3a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
  <div class="banner">
    <el-carousel
      trigger="click"
      height="546px"
      :autoplay="false"
      arrow="never"
      ref="banner"
    >
      <el-carousel-item v-for="(item, index) in bannerList" :key="index">
        <div
          class="banner_content"
          :style="{
            // backgroundImage: 'url(' + baseImg + ')',
            backgroundImage: 'url(' + getUrl(item.pic) + ')',
            backgroundSize: '100% 100%',
            backgroundRepeat: 'no-repeat',
          }"
        >
          <div class="banner_text" v-html="item.name"></div>
        </div>
        <div class="link"></div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
 
<script>
export default {
  name: "Banner",
  props: {
    bannerList: {},
  },
  data() {
    return {
      baseImg: "/images/index/banner.png",
    };
  },
  methods: {
    toggleBanner(i) {
      this.$refs["banner"].setActiveItem(i);
    },
    getUrl(url) {
      if (!url) {
        return this.baseImg;
      } else if (
        url.indexOf("http://apps.smartai.com/httpImage/") === -1 &&
        url.indexOf("/images") !== 0
      ) {
        return "/httpImage/" + url;
      }
      return url;
    },
  },
};
</script>
 
<style lang="scss" scoped>
.banner {
  position: relative;
  height: 546px;
  width: 100%;
  min-width: 1280px;
  z-index: -1;
  top: -62px;
  .banner_content {
    height: 100%;
    padding: 183px 0 0 0;
 
    .banner_text {
      margin: 0 auto;
      width: 1280px;
      color: #fff;
    }
  }
 
  ::v-deep .el-carousel__indicators {
    display: none;
  }
}
</style>