<template>
  <div class="shareMaskDiv" v-if="show">
    <basicPop :title="title" @closeClick="closeClick">
      <div class="context1">
        <div class="formtop"></div>

        <div class="formInfo" v-if="firendList.length > 0">
          <div
            class="formitem"
            v-for="(item, index) in firendList"
            :key="index"
          >
            <div class="infoLeft">
              <img :src="item.userImg" alt="" />
              <span>{{ item.nickName }}</span>
            </div>
            <div class="infoRight">
              <span>
                {{ item.createTime }}
              </span>
            </div>
          </div>
        </div>
        <div class="formInfo1" v-if="firendList.length == 0">
          暂无邀请记录~
        </div>
        <!-- <div class="context" v-html="ruleText"></div> -->
      </div>
    </basicPop>
  </div>
</template>

<script>
import basicPop from "./basicPopNew10070.vue";
import apis1 from "../../../util/apis1.js";
import dateUtil from "../../../util/dateUtil.js";
let { bargainFriends } = apis1;
export default {
  props: [],
  components: {
    basicPop,
  },
  data() {
    return {
      title: "邀请好友记录",
      firendList: [],
    };
  },
  created() {
    document
      .querySelector("body")
      .setAttribute(
        "style",
        "position:#fixed;top:0;height:100%;overflow:hidden"
      );

    this.initData();
  },
  methods: {
    initData() {
      bargainFriends((data) => {
        this.firendList = data.data.friends;
        for (var i = 0; i < this.firendList.length; i++) {
          this.firendList[i].createTime = dateUtil.dateChangeYYYY(
            this.firendList[i].createTime,
            1
          );
        }
      });
    },
    closeClick() {
      document.querySelector("body").removeAttribute("style");
      this.submit();
    },
  },
};
</script>

<style lang="scss">
.shareMaskDiv {
  .basicPopDiv {
    height: 9.13rem;
    background:#f1f1f1 !important;
    .context1 {
      margin-top: 0.2rem;
      height: 100%;
      display: flex;
      // align-items: center;
      justify-content: center;
      font-size: 0.24rem;
      color: #333333;
      flex-wrap: wrap;
    }
    .formtop {
      width: 6.9rem;
      height: 0.9rem;
      background-image: url(//img10.360buyimg.com/imgzone/jfs/t1/230601/14/133/3983/652f9a29F67d0239b/5631e69eb8f204c0.png);
      background-size: 100%;
      background-repeat:no-repeat;
    }
    .formInfo {
      width: 6.9rem;
      height: 7rem;
      overflow-y: scroll;
      .formitem {
        width: 6.9rem;
        height: 0.7rem;
        background-image: url(//img10.360buyimg.com/imgzone/jfs/t1/130525/30/39342/772/652f9b7eF6c1f104f/2cbc2293ae69102e.png);
        background-repeat:no-repeat;
        background-size: 100%;
        margin-top: 0.05rem;
        display: flex;

        .infoLeft {
          display: flex;
          align-items: center;
          height: 100%;
          width: 50%;
          img {
            width: 0.5rem;
            height: 0.5rem;
            border-radius: 50%;
            margin-left: 0.2rem;
            margin-right: 0.2rem;
          }
        }
        .infoRight {
          display: flex;
          align-items: center;
          height: 100%;
          width: 50%;
          padding-left: 0.9rem;
        }
      }
    }
    .formInfo1{
      width: 100%;
      text-align: center;
      margin-top: 3rem;
    }
    .context {
      height: 7.5rem;
      overflow-y: scroll;
      padding: 0 0.3rem;
      word-break: break-all;
      line-height: 0.4rem;
    }
  }
}
</style>
