<template>
  <div class="SigleUserWithContent">
    <div class="SigleUserWithContent-inner">
      <UserInfo
        class="left-part"
        :customerId="customerId"
        :customerPhone="customerPhone"
        :visible="visible"
      />
      <div class="right-part">
        <div class="el-dialog__header">
          <div class="connect-line"></div>
          <div class="el-dialog__title">
            <slot name="title"></slot>
          </div>
          <slot name="closeBtn"></slot>
        </div>
        <div class="el-dialog__body clearfix">
          <slot></slot>
        </div>
        <div
          class="el-dialog__footer"
          v-if="$slots.footer"
        >
          <slot name="footer"></slot>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'user-with-content',
  props: {
    customerId: Number,
    visible: {
      type: Boolean,
      default: true,
    },
    customerPhone: String,
  },
};
</script>

<style lang="scss">
@import '../../assets/styles/variables.scss';

.SigleUserWithContent {
  .SigleUserWithContent-inner {
    display: flex;
    background: transparent;
    box-shadow: none;
    .UserInfo-Box {
      border-radius: 8px;
      .UserInfo-Title {
        border-radius: 8px 8px 0 0;
      }
      .UserInfo-Content {
        border-radius: 0 0 8px 8px;
      }
    }
    .left-part {
      z-index: 2;
      border-radius: 8px;
      box-shadow: 2px 2px 10px #333;
    }
    .right-part {
      flex: 1;
      margin-left: 20px;
      background-color: #fff;
      border-radius: 0 8px 8px 8px;
      .el-dialog__header {
        border-radius: 0 8px 0 0;
      }
    }
  }
  .sigle-user__body {
    display: flex;
    padding: 0;
  }
  .el-dialog__header {
    position: relative;
    height: 38px;
    background-color: #4e82fb;
    padding: 10px;
    .el-dialog__headerbtn {
      position: absolute;
      top: -20px;
      right: -20px;
      width: 39px;
      height: 39px;
    }
    .connect-line {
      position: absolute;
      left: -50px;
      top: 0;
      border-top: 19px solid transparent;
      border-right: 50px solid #4e82fb;
      border-bottom: 19px solid transparent;
    }
    .el-dialog__title {
      margin: 0px auto 0;
      display: flex;
      justify-content: center;
      align-items: center;
      color: #fff;
      line-height: 18px;
      vertical-align: top;
      font-size: 14px;
      img {
        width: 14px;
        height: 14px;
        margin-right: 20px;
      }
    }
  }

  .el-dialog__footer {
    box-sizing: content-box;
    text-align: center;
  }
}
@media screen and (min-width: $bigScreenWidth) {
  .SigleUserWithContent {
    .SigleUserWithContent-inner {
      .right-part {
        margin-left: 25px;
      }
    }
    .el-dialog__header {
      height: 96px;
      .el-dialog__headerbtn {
        top: -30px;
        right: -30px;
        width: 65px;
        height: 65px;
      }
      .connect-line {
        left: -70px;
        border-top-width: 48px;
        border-right-width: 70px;
        border-bottom-width: 48px;
      }
      .el-dialog__title {
        margin: 14px auto 0;
        font-size: 22px;
        img {
          width: 28px;
          height: 28px;
          margin-right: 20px;
        }
      }
    }
    .el-dialog__footer {
      padding: 50px 20px 40px;
    }
  }
}
</style>

