<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%"
        v-if="refreshIframe"
      ></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 {
      subFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
      orderInfo: {},
      refreshIframe: true,
      tradeType: "JSAPI",
      url: "https://mangguo-contract.qthbx.com/huatai-jian-kang-gao-zhi-v1/"
    };
  },
  mounted() {
    this.url = this.$route.query.url || this.url;
    this.refreshIframe = false;
    setTimeout(() => {
      this.refreshIframe = true;
    }, 1000);
  },
  methods: {
    conform() {
      if (this.$route.query.noOrder) {
        const { userInfoSecId } = this.$route.query;
        this.$router.push({ path: "/policy/add", query: { userInfoSecId } });
      } else {
        // this.generateFormData();
        // TODO 目前只有一种在当前页支付的险种，先写死
        this.generateOrder("cii");
      }
    }
  }
};
</script>
<style lang="less" src="./index.less" scoped></style>
