<template>
  <van-overlay :show="value" :duration="0.1" :lock-scroll="false">
    <div class="ruleModalNew ruleModal2" @click.stop>
      <img src="../assets/img/close.png" class="close" @click="closeClick" />
      <div>
        <div class="titles">
          <div class="title active">产品说明</div>
        </div>
        <div class="main" v-html="richText"></div>
      </div>

    </div>
  </van-overlay>
</template>
<script>

import addR from "../common/addRecord";
export default {
  model: { prop: "value", event: "change" },
  props: { pageData: Object, value: Boolean },

  computed: {
    richText () {
      return this.pageData.mainProduct.orderingInfo;
    },
  },
  methods: {
    closeClick () {
      this.$emit("ruleShow");
      let ruleTime = new Date().getTime() - localStorage.getItem("startTime");
      localStorage.setItem("ruleTime", ruleTime);
      addR.explainBrowseTime();
      this.$emit("change", false);
      localStorage.removeItem("startTime");
      localStorage.removeItem("ruleTime");
    },
    // ruleClose() {},
  },
};
</script>
<style lang="scss">
.ruleModal2 {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  top: 210px;
  transform: translateX(-50%);
  width: 620px;
  height: 830px;
  background-color: #fff;
  border-radius: 20px;

  .close {
    width: 72px;
    height: 72px;
    position: absolute;
    bottom: -110px;
    left: 50%;
    transform: translateX(-50%);
  }
}
.ruleModalNew {
  box-sizing: border-box;
  padding: 40px 48px 58px 40px;
  background-color: #fff;
  .titles {
    display: flex;
    justify-content: space-around;
    .title {
      font-size: 40px;
      line-height: 40px;
      font-weight: 700;
      color: #222222;
      position: relative;
      margin-bottom: 20px;
    }
  }
  .main {
    height: 662px;
    overflow-y: scroll;
    font-size: 32px;
    line-height: 48px;
    color: #222222;
    font-family: PingFang SC, PingFang SC-Regular;
    font-weight: 400;
    word-wrap: break-word;
    word-break: break-all;
    box-sizing: border-box;
    p {
      margin: 10px !important;
    }
    h2 {
      margin: 0;
    }
  }
}
</style>
