<template>
  <div class="Pdb-insurance">
    <p class="Pdb-insurance-name">{{ product.title }}</p>
    <p class="Pdb-insurance-no">NO.{{ policyNo }}<br />由{{ product.compony }}承保</p>
    <div class="Pdb-insurance-operation">
      <cr-button class="Pdbi-operation-button" @click="goNext">{{ buttonText }}</cr-button>
      <cr-button class="Pdbi-operation-button">申请理赔</cr-button>
    </div>
  </div>
</template>
<script>
import GOODS_LIST from "@/api/goodsList.mock";

export default {
  name: "InsuranceCard",
  props: {
    productNo: {
      type: [Number, String],
      default: 1
    },
    autoRenewPremium: {
      type: Boolean,
      default: false
    },
    policyNo: {
      type: String,
      default: ""
    }
  },
  data() {
    return {};
  },
  computed: {
    product() {
      return GOODS_LIST.find(v => v.id === +this.productNo);
    },
    buttonText() {
      return this.autoRenewPremium ? "已开通次年续保" : "已关闭次年续保";
    }
  },
  methods: {
    goNext() {}
  }
};
</script>
<style lang="less" src="../index.less" scoped></style>
