<template>
  <div class="inform-container">
    <div class="inform-notice">
      <cr-tag type="danger">重要</cr-tag>
      <div class="inform-notice-content">
        为保证被保险人的保险权益在理赔时不受影响，请确认被保险人健康状况是否符合以下投保条件：
      </div>
    </div>
    <card title="true" class="inform-content">
      <span slot="title" class="inform-content-title">
        请如实告知
        <strong>被保人</strong> 是否有以下情形之一
      </span>
      <iframe class="inform-frame" :src="url" frameborder="0" height="100%"></iframe>
    </card>
    <div class="inform-btns">
      <cr-button @click="$router.back()">不符合</cr-button>
      <cr-button type="warning" @click="conform">符合，立即投保</cr-button>
    </div>
  </div>
</template>

<script>
import card from "@/components/Card";
import detailPayMixin from "../Detail/modules/detailPay.mixin";
export default {
  name: "GoodsInform",
  mixins: [detailPayMixin],
  components: {
    card
  },
  data() {
    return {
      formData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
      orderInfo: {},
      tradeType: "JSAPI",
      url: "http://mangguo-contract.qthbx.com/huatai-jian-kang-gao-zhi-v1/"
    };
  },
  methods: {
    conform() {
      this.$router.push(`/policy/detail/123`);
      // this.generateFormData();
      // this.generateOrder();
    },
    generateFormData() {
      const {
        productNo,
        userInfoSecId,
        name,
        idNo,
        relation,
        // socialSecurity,
        // selfSocialSecurity,
        selfName,
        selfIdNo,
        selfPhone,
        selfSecId,
        payType,
        autoRenewPolicy
      } = this.formData;
      this.subFromData = {
        insuredUserInfo: {
          userInfoSecId: userInfoSecId ?? null,
          name,
          idNo,
          relation
          // socialSecurity: socialSecurity ? !!Number(socialSecurity) : null
        },
        productNo,
        holderUserInfo: {
          phoneNo: selfPhone,
          userInfoSecId: selfSecId,
          name: selfName,
          idNo: selfIdNo
          // socialSecurity: selfSocialSecurity ? !!Number(selfSocialSecurity) : null
        },
        productItem: {
          payType: payType ? payType : null
        },
        autoRenewPolicy: autoRenewPolicy
      };
    }
  }
};
</script>
<style lang="less" src="./index.less" scoped></style>
