Blame view

pc-master/src/components/canvasShow/basics/imageTextList.vue 3.13 KB
3f535f30   杨鑫   '初始'
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
  <template>
    <div class="hom-pro-list warp" :class="'terminal'+terminal">
      <div class="title">
        <h2 class="h2" :style="{textAlign:componentContent.textAlign}">{{componentContent.title}}</h2>
      </div>
      <ul class="clearfix" :class="{imgTextNum4: componentContent.imgTextData.length === 4, imgTextNum5: componentContent.imgTextData.length === 5, imgTextStyle: componentContent.imgTextData.length >= 6 || componentContent.imgTextData.length === 3}">
        <li v-for="(item,index) in componentContent.imgTextData" :key="index">
          <a class="item a-link" @click="jumpLink(item.linkObj)">
            <div class="itemImgBox" v-show="item.isShow">
              <div class="imgBox">
                <img ref="getHeight" :src="item.imgData" v-show="item.imgData" :alt="item.title">
              </div>
            </div>
            <div class="text">
              <h4 class="h4">{{item.title}}</h4>
              <p class="p">{{item.describe}}</p>
            </div>
          </a>
        </li>
      </ul>
    </div>
  </template>
  
  <script>
    import {funMixin} from '../config/mixin'
    export default {
      name: 'imageTextList',
      mixins: [funMixin],
      props: {
        terminal: {
          type: Number,
          default: 4
        },
        componentContent: {
          type: Object
        }
      }
    }
  </script>
  
  <style lang="scss" scoped>
    .hom-pro-list{
      min-height: 450px;
      padding: 20px 0;
      .title{
        margin-bottom: 23px;
        position: relative;
        .h2{
          font-size: 22px;
          color: #333;
          line-height: 1em;
          font-weight: bold;
        }
      }
      ul{
        margin: -15px 0 0 -15px;
        display: flex;
        flex-wrap: wrap;
        li{
          flex: 0 0 50%;
          padding: 15px 0 0 15px;
          .item{
            .itemImgBox {
              height: auto;
              display: flex;
              flex-direction: column;
              justify-content: center;
              .imgBox {
                padding-bottom: 80%;
                background-color: #cacaca;
                position: relative;
                img {
                  max-width: 100%;
                  height: 100%;
                  max-height: 100%;
                  position: absolute;
                  margin: auto;
                  top: 0;
                  right: 0;
                  bottom: 0;
                  left: 0;
                }
              }
            }
            .text{
              padding:16px 20px;
              text-align: center;
              .h4{
                line-height: 25px;
                overflow: hidden;
                color: #333333;
              }
              .p{
                color: #666666;
                padding: 5px 0 10px;
              }
            }
          }
        }
      }
      .imgTextNum4 {
        li {
          flex: 0 0 50%;
        }
      }
      .imgTextNum5 {
        li {
          flex: 0 0 33.33%;
        }
        li:nth-child(1) {
          flex: 0 0 50%;
        }
        li:nth-child(2) {
          flex: 0 0 50%;
        }
      }
      .imgTextStyle {
        li {
          flex: 0 0 33.33%;
        }
      }
    }
    @media screen and (max-width: 768px) {
      .hom-pro-list ul li{
        flex: 0 0 50%;
      }
    }
    .terminal1,.terminal2,.terminal3{
      &.hom-pro-list ul li{
        flex: 0 0 50%;
      }
    }
  </style>