<template>
  <div class="policy-detail">
    <div class="policy-detail-body">
      <status-desc :cardConfig="cardConfig"></status-desc>
      <pay-info :policy="policy"></pay-info>
      <ActBanner></ActBanner>
      <insurance-recommend class="Pdb-recommend" />
    </div>
  </div>
</template>
<script>
import ActBanner from "./modules/ActBanner";
import PayInfo from "./modules/PayInfo";
import StatusDesc from "../Detail/modules/StatusDesc";
import InsuranceRecommend from "../modules/InsuranceRecommend";
import { getGenPolicyDetail } from "@/api/policy";
import policyStatusMixin from "../mixin/policyStatus.mixin";

export default {
  name: "Sucess",
  mixins: [policyStatusMixin],
  components: {
    StatusDesc,
    PayInfo,
    ActBanner,
    InsuranceRecommend
  },
  data() {
    return {
      policy: {},
      cardConfig: {
        statusText: "购买成功"
      }
    };
  },
  async created() {
    const detail = await getGenPolicyDetail(this.$route.params.orderNo);
    this.policy = this.getGoodsInfo(detail);
  }
};
</script>
<style lang="less" src="../Detail/index.less" scoped></style>
