ZZJ
2022-07-14 2b99047683332624832c1dfcae596e957a710b7d
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
<template>
  <div class="productDetail">
    <IndexHeader :opacity="false"></IndexHeader>
    <!-- 面包屑 -->
    <div class="heart" v-if="showData">
      <el-breadcrumb separator=">">
        <el-breadcrumb-item :to="{ path: '/product' }"
          >全部产品</el-breadcrumb-item
        >
        <el-breadcrumb-item>产品详情</el-breadcrumb-item>
      </el-breadcrumb>
 
      <!-- 购买配置 -->
      <PayCard :dataInfo="data"></PayCard>
 
      <!-- 功能区域 -->
      <Function :dataInfo="data"></Function>
    </div>
 
    <!-- 页尾 -->
    <Footer :isBlack="true"></Footer>
  </div>
</template>
 
<script>
import IndexHeader from "@/components/IndexHeader";
import PayCard from "@/views/productDetail/components/PayCard";
import Footer from "@/components/Footer";
import Function from "@/views/productDetail/components/Function";
import { getProductById } from "@/api/product";
export default {
  created() {
    this.getProduct();
  },
  data() {
    return {
      data: {
        data: {},
      },
      showData: false,
    };
  },
  components: {
    IndexHeader,
    PayCard,
    Footer,
    Function,
  },
  methods: {
    getProduct() {
      let param = {
        id: this.$route.query.id,
      };
      getProductById(param).then((res) => {
        this.data.data = res.data;
        this.showData = true;
      });
    },
  },
};
</script>
 
<style scoped lang="scss">
.productDetail {
  background-color: rgb(243, 245, 248);
 
  .el-breadcrumb {
    margin-top: 48px;
    margin-bottom: 24px;
 
    ::v-deep span {
      color: #666;
    }
  }
 
  .heart {
    min-height: calc(100vh - 210px);
  }
}
</style>