ZZJ
2022-04-02 45faaf27722588e92050e2e3eace9b3704377048
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
<template>
  <div class="productCard">
    <div class="image">
      <img
        v-if="data.pics[0]"
        :src="'/httpImage/' + data.pics[0].url"
        class="cursor-pointer"
      />
    </div>
 
    <div class="info">
      <img :src="'/httpImage/' + data.logoUrl" alt />
      <div class="right">
        <div class="name">{{ data.productName }}</div>
        <div class="tagList">
          <span class="tag" v-for="(name, index) in labels" :key="index">{{
            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,
        },
      });
    },
  },
};
</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: 0 10px;
      width: 60px;
      height: 60px;
    }
 
    .right {
      .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;
        }
      }
    }
  }
 
  .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>