fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
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
82
83
84
85
86
87
88
89
90
<template>
  <div class="findMgt-details">
    <div class="find-img">
      <el-carousel v-show="form.mediaType === '0'" @change="changeImg" :interval="5000" arrow="always">
          <el-carousel-item v-for="item in form.urlList" :key="item">
              <img @click="clickImg(item)" :src="item"/>
          </el-carousel-item>
      </el-carousel>
      <div class="imgIndex" v-show="form.mediaType === '0'">{{imgIndex}}/{{form.urlList.length}}</div>
      <video  v-show="form.mediaType === '1'" :src="form.urlList[0]" controls/>
    </div>
    <div class="find-content">
      {{form.content}}
    </div>
    <el-dialog title="图片详情" class="find-img-dialog" :visible.sync="dialogVisible" width="564px" v-if="dialogVisible" append-to-body>
       <img :src="imgUrl" width="100%"/>
    </el-dialog>
  </div>
</template>
 
<script>
export default {
  props: ['form'],
  data () {
    return {
      imgIndex: 1,
      imgUrl: null,
      dialogVisible: false
    }
  },
  methods: {
    // 点击图片 查看大图
    clickImg (url) {
      this.dialogVisible = true
      this.imgUrl = url
    },
    // 轮播图切换获取当前图片索引
    changeImg (newIndex, oldIndex) {
      this.imgIndex = newIndex + 1
    }
  }
}
</script>
 
<style lang="scss">
.findMgt-details{
  .find-img{
    min-height: 300px;
    max-height: 500px;
    position: relative;
    img{
      cursor: pointer;
    }
    .imgIndex{
      position:absolute;
      z-index: 999;
      bottom: 0;
      text-align: center;
      font-size: 18px;
      background-color: rgba(0,0,0,.4);
      width: 100%;
      color: #eeeeee;
    }
    img,video{
      width: 100%;
    }
    video{
      height: 300px;
    }
  }
  .find-content{
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .el-carousel {
    .el-carousel__indicators{
      display: none;
    }
  }
}
.find-img-dialog{
  .el-dialog__body{
    max-height: 600px;
    overflow-y: auto;
    width: 90%;
    margin: 0 auto;
    &::-webkit-scrollbar {display:none}
}
}
</style>