<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>
      <div class="inform-frame" v-html="article"></div>
      <!-- <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>
    <pay-wait-layer :value="isPayWait" />
  </div>
</template>

<script>
import card from "@/components/Card";
import detailPayMixin from "../Detail/modules/detailPay.mixin";
import htDetail from "@/api/detail.huatai.zhongjixian";
import hgDetail from "@/api/detail.huagui.shouxian";
const { healthNotice: hgNotice } = hgDetail;
const { healthNotice: htNotice } = htDetail;
export default {
  name: "GoodsInform",
  mixins: [detailPayMixin],
  components: {
    card
  },
  data() {
    return {
      subFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
      orderInfo: {},
      refreshIframe: true,
      tradeType: "JSAPI",
      contentType: "huatai" // huatai / huagui
    };
  },
  computed: {
    article() {
      return this.contentType === "huatai" ? htNotice : hgNotice;
    }
  },
  mounted() {
    this.contentType = this.$route.query.contentType || this.contentType;
    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>
