Blame view

ceres-uniapp-master/components/canvasShow/basics/categoryList.vue 2.49 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
  <template>
    <div class="category-list warp" :class="'terminal' + terminal">
      <h2 class="hom-title" :style="{textAlign:componentContent.textAlign}">{{componentContent.title}}</h2>
      <div class="content-warp">
        <div class="ul clearfix" :class="{number5: componentContent.categoryData.length === 5}">
          <div class="li" v-for="(item) of componentContent.categoryData" :key="item.id">
            <a class="item a-link" @click="jumpCategory(item)">
              <div class="imgBox">
                <img ref="getHeight" :src="item.img" v-show="item.img" :alt="item.name">
              </div>
            </a>
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  import {funMixin} from '../config/mixin'
  export default {
    name: 'categoryList',
    mixins: [funMixin],
    props: {
      terminal: {
        type: Number,
        default: 4
      },
      componentContent: {
        type: Object
      }
    }
  }
  </script>
  <style lang="scss" scoped>
    .category-list{
      padding: 20upx 0;
      .hom-title{
        font-size: 22upx;
        color: #333;
        line-height: 1em;
        margin-bottom: 23upx;
        font-weight: bold;
        text-align: center;
      }
      .content-warp{
        display: flex;
        .ul{
          width: 100%;
          display: flex;
          flex-wrap: wrap;
          .li{
            flex: 1;
            padding: 10upx 0 0 10upx;
            box-sizing: border-box;
            .item{
              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;
              }
            }
          }
        }
        .number5 {
          display: block;
          .li {
            width: 25%;
            float: left;
          }
          .li:nth-child(1) {
            width: 50%;
          }
        }
      }
    }
    @media screen and (max-width: 768px) {
      .category-list .content-warp .ul .li{
        flex: 0 0 50%;
      }
    }
    .terminal1,.terminal2,.terminal3{
      &.category-list .content-warp{
        display: block;
        .ul{
          margin: -15upx 0 0 -15upx;
          width: auto;
          .li{
            flex: 0 0 50%;
            padding: 15upx 0 0 15upx;
          }
        }
      }
    }
  </style>