mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'feature/chat' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/chat
This commit is contained in:
@@ -36,8 +36,8 @@
|
||||
<ion-label> {{message}} Esta conversa passou a grupo</ion-label><br />
|
||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||
</div>
|
||||
<div class="messages">
|
||||
<div class="container-width-100" *ngFor="let msg of messages">
|
||||
<div class="messages" #scrollMe>
|
||||
<div class="container-width-100" *ngFor="let msg of messages" #scrollMe>
|
||||
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
@@ -68,7 +68,7 @@
|
||||
<div class="width-80">
|
||||
<ion-item class="ion-no-padding type-message" lines="none">
|
||||
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
||||
<button class="btn-no-color" (click)="notImplemented()">
|
||||
<button hidden class="btn-no-color">
|
||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||
</button>
|
||||
</ion-item>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
//transform: translate3d(0, 1px, 0);
|
||||
|
||||
|
||||
.header-top{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
@@ -52,7 +52,7 @@
|
||||
margin: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ion-content{
|
||||
@@ -159,9 +159,9 @@
|
||||
.container{
|
||||
justify-content: center;
|
||||
justify-content: space-evenly;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.chat-icon-options{
|
||||
display:block !important;
|
||||
font-size: 25px;
|
||||
@@ -183,10 +183,15 @@
|
||||
align-items: center;
|
||||
overflow: auto;
|
||||
|
||||
|
||||
ion-textarea{
|
||||
width: fit-content;
|
||||
display: block;
|
||||
margin: 0 !important;
|
||||
align-self: center;
|
||||
//border: 1px solid red;
|
||||
//overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter} from '@angular/core';
|
||||
import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter, ViewChild, ElementRef, AfterViewChecked} from '@angular/core';
|
||||
import { ActionSheetController, AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -14,11 +14,11 @@ import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
templateUrl: './group-messages.page.html',
|
||||
styleUrls: ['./group-messages.page.scss'],
|
||||
})
|
||||
export class GroupMessagesPage implements OnInit, OnChanges {
|
||||
export class GroupMessagesPage implements OnInit, OnChanges, AfterViewChecked {
|
||||
showLoader: boolean;
|
||||
isGroupCreated:boolean;
|
||||
loggedUser: any;
|
||||
message:any;
|
||||
message:any="";
|
||||
leaveStatus:any;
|
||||
messages:any;
|
||||
|
||||
@@ -34,6 +34,8 @@ export class GroupMessagesPage implements OnInit, OnChanges {
|
||||
@Output() openGroupContacts:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openEditGroupPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
|
||||
constructor(
|
||||
private menu: MenuController,
|
||||
private modalController: ModalController,
|
||||
@@ -49,6 +51,7 @@ export class GroupMessagesPage implements OnInit, OnChanges {
|
||||
}
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.getRoomInfo();
|
||||
this.scrollToBottom();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -57,8 +60,16 @@ export class GroupMessagesPage implements OnInit, OnChanges {
|
||||
console.log(this.roomId);
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
ngAfterViewChecked() {
|
||||
this.scrollToBottom();
|
||||
}
|
||||
|
||||
scrollToBottom(): void {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
} catch(err) { }
|
||||
finally {
|
||||
}
|
||||
}
|
||||
|
||||
openGroupContactsPage(){
|
||||
@@ -73,6 +84,7 @@ export class GroupMessagesPage implements OnInit, OnChanges {
|
||||
this.getRoomInfo();
|
||||
ev.target.complete();
|
||||
}
|
||||
|
||||
get watch(){
|
||||
this.getRoomInfo();
|
||||
console.log('here watching');
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
|
||||
|
||||
<ion-footer>
|
||||
FOOter
|
||||
<div class="container width-100 d-flex">
|
||||
<div>
|
||||
<button class="btn-no-color" (click)="openSendMessageOptions()">
|
||||
@@ -58,7 +57,7 @@
|
||||
<div class="width-80">
|
||||
<ion-item class="ion-no-padding type-message" lines="none">
|
||||
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
||||
<button class="btn-no-color" (click)="notImplemented()">
|
||||
<button hidden class="btn-no-color" (click)="notImplemented()">
|
||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||
</button>
|
||||
</ion-item>
|
||||
|
||||
@@ -45,15 +45,14 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
|
||||
/* this.dm = this.navParams.get('dm'); */
|
||||
}
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
console.log(this.roomId);
|
||||
this.load();
|
||||
//this.load();
|
||||
|
||||
//throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
//this.scrollToBottom();
|
||||
this.scrollToBottom();
|
||||
|
||||
/* setInterval(()=>{ */
|
||||
this.load();
|
||||
@@ -80,20 +79,17 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
//this.scrollToBottom();
|
||||
console.log(this.roomId);
|
||||
this.scrollToBottom();
|
||||
}
|
||||
/* scrollToBottom(): void {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
scrollToBottom(): void {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
} catch(err) { }
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
|
||||
} */
|
||||
loadMoreMessages(ev:any){
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user