ZZJ
2022-07-15 b35ae89a354d29643af99cc150812241b940352d
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<template>
  <div class="productCard">
    <div class="image">
      <ImageShow v-if="data.pics[0]" :src="data.pics[0].url"></ImageShow>
    </div>
 
    <div class="info">
      <ImageShow v-if="data.pics[0]" :src="data.logoUrl"></ImageShow>
      <div class="right">
        <div class="name">{{ data.productName }}</div>
        <div class="tagList">
          <span
            class="tag"
            v-for="(name, index) in labels"
            :key="index"
            :class="{
              red: name === '软件',
              orange: name === '应用',
              lightBlue: name === 'SDK',
              blue: name === '产品密钥',
            }"
            >{{ name }}</span
          >
        </div>
      </div>
    </div>
    <div class="des">{{ data.description }}</div>
    <Price :priceNew="data.priceBase"></Price>
    <div class="button" @click="buyProduct">立即购买</div>
  </div>
</template>
 
<script>
import Price from "@/components/Price";
export default {
  props: {
    data: {},
    labels: {},
  },
  components: {
    Price,
  },
  methods: {
    buyProduct() {
      this.$router.push({
        path: "/productDetail",
        query: {
          id: this.data.id,
        },
      });
    },
    getColor(name) {
      switch (name) {
        case "算法":
          return "red";
        case "应用":
          return "orange";
        case "云服务":
          return "lightBlue";
        case "边缘计算设备":
          return "blue";
      }
    },
  },
};
</script>
 
<style lang="scss" scoped>
.productCard {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  width: 302px;
  height: 413px;
  background-color: #fff;
 
  &:hover {
    filter: drop-shadow(0px 2px 16px rgba(0, 43, 106, 0.25));
  }
 
  .image {
    margin: 10px;
    height: 157px;
 
    img {
      width: 100%;
      height: 100%;
    }
  }
 
  .info {
    display: flex;
 
    img {
      margin-left: 10px;
      width: 60px;
      height: 60px;
    }
 
    .right {
      margin-left: 10px;
      .name {
        margin-bottom: 10px;
        font-size: 16px;
        font-weight: 700;
      }
 
      .tagList {
        display: flex;
 
        .tag {
          margin-right: 10px;
          padding: 2px 5px;
          border: 1px solid #ff5033;
          color: #ff5033;
 
          &.red {
            color: #ff4f32;
            border-color: #ff4f32;
          }
 
          &.orange {
            color: #ff9500;
            border-color: #ff9500;
          }
 
          &.lightBlue {
            color: #00bee7;
            border-color: #00bee7;
          }
 
          &.blue {
            color: #0064ff;
            border-color: #0064ff;
          }
        }
      }
    }
  }
 
  .des {
    margin: 20px;
    color: #666666;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
 
  .Price {
    margin-right: 20px;
  }
 
  .button {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 302px;
    height: 40px;
    background: #ff6a00;
    text-align: center;
    line-height: 40px;
    color: #fff;
    font-weight: 700;
 
    &:hover {
      cursor: pointer;
      background: linear-gradient(
        90.78deg,
        #ffba4a 0%,
        #ff6a00 20.33%,
        #ff6a00 79.66%,
        #ffba4a 100%
      );
    }
  }
}
</style>