From 35a7aff698a73c4d68f73fd795bf92f1288f4b00 Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 26 Mar 2020 15:45:59 +0900 Subject: [PATCH] =?UTF-8?q?1:1=20=EB=8C=80=ED=99=94=EB=B0=A9=EC=9D=B4?= =?UTF-8?q?=EB=A9=B0=20=EB=8C=80=ED=99=94=EB=B0=A9=EB=AA=85=EC=9D=B4=20?= =?UTF-8?q?=EC=A7=80=EC=A0=95=EB=90=98=EC=A7=80=20=EC=95=8A=EC=95=98?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=EC=97=90=20=EB=8C=80=ED=99=94?= =?UTF-8?q?=EB=B0=A9=EB=AA=85=EC=97=90=20"=EC=9D=B4=EB=A6=84=20=EC=A7=81?= =?UTF-8?q?=EA=B8=89=20=EB=82=B4=EC=84=A0=20=EB=AA=A8=EB=B0=94=EC=9D=BC"?= =?UTF-8?q?=20=EB=A1=9C=20=ED=91=9C=ED=98=84=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/messages.component.html | 30 ++++++++++++ .../components/messages.component.scss | 8 ++++ .../components/messages.component.ts | 46 ++++++++++++++++++- .../components/main.page.component.html | 1 + 4 files changed, 84 insertions(+), 1 deletion(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html index 2774fbf6..20681eae 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html @@ -91,6 +91,36 @@ {{ getRoomNameByRoomUser(_roomUserInfos) }} + + + {{ getSingleRoomUserInfosGrade(_roomUserInfos) }} + + + / {{ getSingleRoomUserInfosLineNumber(_roomUserInfos) }} + + + / {{ getSingleRoomUserInfosHpNumber(_roomUserInfos) }} + + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss index 72bde422..61e48675 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss @@ -77,6 +77,14 @@ font-size: 0.94rem; line-height: normal; @include ellipsis(1); + + .more-info { + font-size: 0.9rem; + color: #656565; + .callable { + cursor: pointer; + } + } } .room-type { font-size: 0.9rem; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index 935fb921..edd74ac7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -27,7 +27,8 @@ import { AlertSnackbarComponent, AlertSnackbarData, TranslateService as UiTranslateService, - TranslatePipe as UiTranslatePipe + TranslatePipe as UiTranslatePipe, + StringFormatterPhonePipe } from '@ucap-webmessenger/ui'; import { Store, select } from '@ngrx/store'; import { NGXLogger } from 'ngx-logger'; @@ -143,6 +144,7 @@ import { EventDownloadRequest } from '@ucap-webmessenger/api-message'; import moment from 'moment'; +import { start } from 'repl'; @Component({ selector: 'app-layout-messenger-messages', @@ -158,6 +160,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { }>(); @Output() closeRightDrawer = new EventEmitter(); + @Output() + sendCall = new EventEmitter(); @ViewChild('chatSearch', { static: false }) private chatSearch: SearchComponent; @@ -534,6 +538,46 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { return roomName; } + getSingleRoomUserInfosGrade(roomUserInfos: any[]) { + if (roomUserInfos.length > 0) { + return new UiTranslatePipe( + this.uiTranslateService, + this.changeDetectorRef + ).transform(roomUserInfos, 'grade', ','); + } + return ''; + } + getSingleRoomUserInfosLineNumber(roomUserInfos: any[]) { + if ( + roomUserInfos.length > 0 && + !!roomUserInfos[0].lineNumber && + roomUserInfos[0].lineNumber.trim().length > 0 + ) { + return `${new StringFormatterPhonePipe().transform( + roomUserInfos[0].lineNumber + )}`; + } + } + getSingleRoomUserInfosHpNumber(roomUserInfos: any[]) { + if ( + roomUserInfos.length > 0 && + !!roomUserInfos[0].hpNumber && + roomUserInfos[0].hpNumber.trim().length > 0 + ) { + return `${new StringFormatterPhonePipe().transform( + roomUserInfos[0].hpNumber + )}`; + } + } + + onClickSendClickToCall(type: string) { + if(type === 'LINE') { + this.sendCall.emit(this._roomUserInfos[0].lineNumber); + } else if(type === 'MOBILE') { + this.sendCall.emit(this._roomUserInfos[0].hpNumber); + } + } + /** 대화전송 가능한 방인지 판단 */ getEnableSend() { if (!this.roomInfoSubject.value) { diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html index 7a85bfed..3c72fa64 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html @@ -32,6 +32,7 @@ *ngIf="!!(this.selectedChat$ | async)" (openProfile)="onClickOpenProfile($event)" (closeRightDrawer)="onCloseRightDrawer()" + (sendCall)="sendClickToCall($event)" >