<template>
  <div class="my-message">
    <div class="my-message__header">
      <el-tabs v-model="activeName">
        <el-tab-pane label="系统消息" name="1"></el-tab-pane>
        <el-tab-pane label="教务消息" name="2"></el-tab-pane>
      </el-tabs>
    </div>

    <div class="my-message__body">
      <div class="content">
        <div class="content__header">
          <div class="text">
            未读共
            <span class="note">1</span>
            条
          </div>

          <div class="btn btn--red">清空</div>
          <div class="btn">全部标为已读</div>
        </div>
        <div class="content__body">
          <div class="message-list">
            <div
              class="message-list__item"
              v-for="(item, index) in 5"
              :key="index"
            >
              <div class="icon"></div>
              <div class="text">
                <div class="desc">2022-02-23 12:30</div>
                <div class="title">学时机构审核通过提醒</div>
              </div>
              <div class="btn" @click="showDetailModal = true">查看详情</div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <el-dialog
      width="600px"
      class="my-message-modal"
      :visible.sync="showDetailModal"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :show-close="false"
    >
      <div class="my-message-modal__content">
        <div class="my-message-modal__close" @click="showDetailModal = false">
          X
        </div>
        <div class="my-message-modal__header">通知详情</div>
        <div class="my-message-modal__body">
          <div class="content">
            <div class="content__body">
              <div class="title">通知标题</div>
              <div class="desc">202-02-11 12:30:30</div>
              <div class="list">
                <div class="item">
                  课程商品名称/科目/类目标题/章标题/节标题 16:52
                </div>
                <div class="item">
                  课程商品名称/科目/类目标题/章标题/节标题 16:52
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="my-message-modal__footer">
          <div class="confirm" @click="showDetailModal = false">我知道了</div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "MyMessage",
  data() {
    return {
      showDetailModal: false,
      activeName: "1",
    };
  },
  mounted() {},
  methods: {},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.my-message {
  &__header {
    /deep/ .el-tabs__header {
      margin-bottom: 0;
    }
  }
  &__body {
    .content {
      &__header {
        height: 64px;
        display: flex;
        align-items: center;

        .text {
          flex: 1;
          padding-left: 28px;
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: #999999;
          .note {
            font-size: 14px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #3f8dfd;
          }
        }

        .btn {
          cursor: pointer;
          margin: 0 14px;
          width: 122px;
          height: 32px;
          background: #ffffff;
          border: 1px solid #3f8dfd;
          border-radius: 16px;
          color: #3f8dfd;
          text-align: center;
          line-height: 30px;
          font-size: 16px;
          &--red {
            border-color: #ff3b30;
            color: #ff3b30;
          }
        }
      }

      &__body {
        .message-list {
          &__item {
            margin-bottom: 24px;
            display: flex;
            border: 1px solid #eee;
            padding: 30px 24px;
            align-items: center;
            border-radius: 8px;

            .icon {
              width: 40px;
              height: 40px;
              background: rgba(255, 209, 0, 1);
              border-radius: 50%;
            }

            .text {
              flex: 1;
              padding-left: 16px;
              .title {
                font-size: 16px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                color: #333333;
                margin-top: 10px;
              }

              .desc {
                font-size: 12px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                color: #999999;
              }
            }

            .btn {
              cursor: pointer;
              width: 122px;
              height: 32px;
              background: #3f8dfd;
              border-radius: 16px;
              text-align: center;
              line-height: 32px;
              color: #fff;
              font-size: 16px;
            }
          }
        }
      }
    }
  }

  .my-message-modal {
    /deep/ .el-dialog__header {
      display: none;
    }
    /deep/ .el-dialog__body {
      padding: 0;
      overflow: unset;
    }

    &__close {
      cursor: pointer;
      position: absolute;
      right: 0;
      top: -24px;
      width: 24px;
      height: 24px;
      line-height: 24px;
      text-align: center;
      color: #fff;
      border: 1px solid #eee;
      border-radius: 50%;
    }

    &__header {
      height: 40px;
      line-height: 40px;
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      color: #333333;
      padding-left: 24px;
      border-bottom: 1px solid #eee;
    }

    &__body {
      height: 200px;
      padding: 0 24px;

      .content {
        &__body {
          .title {
            margin-top: 10px;
            font-size: 16px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #333333;
            line-height: 24px;
          }

          .desc {
            margin-top: 8px;
            font-size: 12px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #999999;
            line-height: 24px;
          }

          .list {
            .item {
              cursor: pointer;
              margin-top: 18px;
              font-size: 14px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #3f8dfd;
              line-height: 28px;
            }
          }
        }
      }
    }

    &__footer {
      height: 90px;
      overflow: hidden;
      border-top: 1px solid #eee;
      .confirm {
        margin: 25px auto 0;
        cursor: pointer;
        width: 200px;
        height: 40px;
        background: #3f8dfd;
        border-radius: 20px;
        text-align: center;
        line-height: 40px;
        color: #fff;
      }
    }
  }
}
</style>
