File

src/app/mail/detail/detail.component.ts

Implements

OnInit

Metadata

selector app-mail-detail
styleUrls ./detail.component.scss
templateUrl ./detail.component.html

Index

Properties
Methods
Inputs

Constructor

constructor()

Inputs

mail

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

shownMailDetail
import { Component, Input, OnInit } from '@angular/core';

@Component({
  selector: 'app-mail-detail',
  templateUrl: './detail.component.html',
  styleUrls: ['./detail.component.scss']
})
export class DetailComponent implements OnInit {
  @Input() mail;
  shownMailDetail;

  constructor() {}

  ngOnInit() {}
}
<div class="mail-detail" *ngIf="mail">
  <div class="mail-subject">{{ mail.subject }}</div>

  <div class="mail-header" fxLayout="row">
    <img class="avatar" src="assets/images/avatars/noavatar.png" />
    <div class="mail-info" fxLayout="column">
      <span class="from">{{ mail.from.name }}</span>
      <span class="to">发送至 我<mat-icon>arrow_drop_down</mat-icon></span>
    </div>
    <span fxFlex></span>
    <div class="mail-extra">
      <span class="when">{{ mail.when }}</span>
      <button mat-icon-button><mat-icon>start</mat-icon></button>
      <button mat-icon-button><mat-icon>reply</mat-icon></button>
      <button mat-icon-button [matMenuTriggerFor]="mailOptions">
        <mat-icon>more_vert</mat-icon>
      </button>
    </div>
  </div>

  <div class="mail-content">
    <div class="mail-content-text">
      <p>{{ mail.content }}</p>
    </div>

    <div class="attachments-container" *ngIf="mail.attach">
      <div
        class="attachments-header"
        fxLayout="row"
        fxLayoutAlign="start center"
      >
        <span class="title">附件</span>
        <mat-divider fxFlex></mat-divider>
        <button class="download" mat-icon-button>
          <mat-icon>file_download</mat-icon>
        </button>
      </div>

      <div class="attachments" fxLayout="row wrap">
        <div class="attachment"><img class="pointer" /></div>
      </div>
    </div>
  </div>

  <div class="respond" fxLayout="row" fxLayoutAlign="start center">
    <button mat-raised-button class="respond-button">
      <mat-icon>reply</mat-icon> 回复
    </button>
    <button mat-raised-button><mat-icon>forward</mat-icon> 转发</button>
  </div>

  <div style="display: none" class="respond respond-active">
    <quill-editor></quill-editor>
    <div class="respond-buttons" fxLayout="row" fxLayoutAlign="end stretch">
      <button mat-button>Cancel</button>
      <button mat-raised-button color="primary">
        Send <mat-icon>send</mat-icon>
      </button>
    </div>
  </div>
</div>

<mat-menu #mailOptions="matMenu">
  <button mat-menu-item><mat-icon>reply</mat-icon>回复</button>
  <button mat-menu-item><mat-icon>forward</mat-icon>转发</button>
  <button mat-menu-item><mat-icon>filter_list</mat-icon>过滤此类邮件</button>
  <button mat-menu-item><mat-icon>delete</mat-icon>删除此邮件</button>
  <button mat-menu-item><mat-icon>error</mat-icon>列为垃圾邮件</button>
  <button mat-menu-item>
    <mat-icon>markunread_mailbox</mat-icon>标记为未读
  </button>
</mat-menu>

./detail.component.scss

.mail-detail {
  position: relative;
  padding: 24px 32px;

  .mail-header {
    .avatar {
      height: 45px;
      width: 45px;
      margin-right: 20px;
      border-radius: 50%;
    }

    .from {
      font-weight: 500;
      font-size: 15px;
    }

    .to {
      color: #999;
      font-size: 15px;
      margin-top: 2px;
      font-weight: 500;

      mat-icon {
        height: 16px;
        width: 16px;
        font-size: 16px;
        vertical-align: middle;
      }
    }

    .mail-extra {
      color: #999;
      font-size: 15px;
      font-weight: 500;

      .when {
        vertical-align: middle;
      }
    }
  }

  .mail-subject {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
  }

  .mail-content {
    margin-top: 32px;
    margin-bottom: 240px;
  }

  .attachments-container {
    .attachments-header {
      color: #999;

      .title {
        font-size: 13px;
        font-weight: 500;
        margin-right: 24px;
      }

      .download {
        margin-left: 24px;
      }
    }

    .attachments {
      margin-top: 12px;
      margin-bottom: 12px;

      .attachment {
        margin-right: 12px;

        img {
          max-height: 140px;
          max-width: 80px;
        }
      }
    }
  }

  .respond {
    padding: 24px 0;
    border-top: 1px solid #eee;

    &-button {
      margin-right: 16px;
    }

    .reply {
      color: #2b303b;
      margin-right: 24px;
    }

    .respond-buttons {
      margin-top: 12px;

      mat-icon {
        font-size: 18px;
        height: 18px;
        width: 18px;
        margin-left: 6px;
      }

      button {
        margin-left: 12px;
      }
    }
  }
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""