<template>
  <div class="privat-chat">
    <div class="header">
      <div class="left">
        <el-button size="mini" type="primary" @click="closePrivateChat"
          >返回群聊</el-button
        >
        <h5>{{ userInfo.privateUserName }}（{{ userInfo.privateUserId }}）</h5>
      </div>
      <div>私聊中</div>
    </div>
    <newsList
      :type="5"
      :group-id="groupId"
      :user-id="userInfo.privateUserId"
      :private-new-msg="privateNewMsg"
      @setReplyMsg="setReplyMsg"
    />
  </div>
</template>
<script>
import newsList from "./newsList.vue";
export default {
  components: { newsList },
  props: {
    groupId: {
      type: Number
    },
    userInfo: {
      type: Object,
      default: () => {}
    },
    privateNewMsg: {
      type: Object
    }
  },
  methods: {
    closePrivateChat() {
      this.$emit("closePrivateChat");
    },
    setReplyMsg(item) {
      this.$emit("setReplyMsg", item);
    }
  }
};
</script>
<style lang="scss" scoped>
.privat-chat {
  flex: 1;
  background: #fff;
  margin-top: 10px;
  min-height: 500px;
  overflow-y: scroll;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #999;
  .left {
    display: flex;
    align-items: center;
    h5 {
      margin: 0 0 0 10px;
      font-size: 14px;
      color: #999;
      font-weight: normal;
    }
  }
  p {
    margin: 0;
  }
}
::v-deep .news-list-wrap {
  height: 587px;
}
</style>
