family chat
This commit is contained in:
@@ -20,7 +20,11 @@
|
||||
<ion-label>Chat</ion-label>
|
||||
</ion-list-header>
|
||||
<ion-item style="padding: 5px;">
|
||||
<ion-textarea style="width: 100%; border-radius: 10px; padding: 5px; background-color: white;" placeholder="Enter message"></ion-textarea>
|
||||
<ion-textarea
|
||||
[(ngModel)]="chat_message"
|
||||
(ionChange)="testEntry()"
|
||||
style="width: 100%; border-radius: 10px; padding: 5px; background-color: white;"
|
||||
placeholder="Enter message"></ion-textarea>
|
||||
</ion-item>
|
||||
<!-- <ion-item style="text-align: right; padding: 1px 1px 1px 0px; background-color: transparent;">-->
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {NavController} from "@ionic/angular";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {Router} from "@angular/router";
|
||||
import {SocketToolsService} from "../../services/socket-tools.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-familyconnectaction',
|
||||
@@ -11,14 +12,20 @@ import {Router} from "@angular/router";
|
||||
})
|
||||
export class FamilyconnectactionPage implements OnInit {
|
||||
connnectionData:any;
|
||||
@ViewChild('chat_message') chat_message;
|
||||
constructor(
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private router: Router,
|
||||
private navctr: NavController
|
||||
private navctr: NavController,
|
||||
public socketToolsService:SocketToolsService,
|
||||
) {
|
||||
this.connnectionData = this.router.getCurrentNavigation().extras.state;
|
||||
console.log("CONNECTION DATA RECIEVED", this.connnectionData);
|
||||
addEventListener('app-family-invite-message', (data:any) => {
|
||||
console.log("ACCEPT CALL DATA MESSAGE ", data); //connectData
|
||||
debugger;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -27,6 +34,11 @@ export class FamilyconnectactionPage implements OnInit {
|
||||
this.navctr.back();
|
||||
}
|
||||
sendMessage(){
|
||||
if (this.chat_message !=''){
|
||||
this.socketToolsService.familyConnectMessage(this.connnectionData, this.chat_message );
|
||||
}
|
||||
}
|
||||
testEntry(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,18 +24,24 @@ export class SocketToolsService {
|
||||
this.socket.connect();
|
||||
}
|
||||
|
||||
public familyConnectMessage(item, chatMessage){
|
||||
console.log(item);
|
||||
const msgPart = {
|
||||
type: 'FAMILY_INVITE_CONNECT_MESSAGE',
|
||||
chat_message : chatMessage,
|
||||
connectData: item
|
||||
};
|
||||
this.emmitSocketEvent("send_message",msgPart, item.target_room);
|
||||
}
|
||||
public familyInviteConnect(item){
|
||||
console.log(item);
|
||||
debugger;
|
||||
const msgPart = {
|
||||
type: 'FAMILY_INVITE_CONNECT',
|
||||
connectData: item
|
||||
};
|
||||
let Vv = this.sessionDataProviderService.getFamilyRoom()+"-"+item.uid;
|
||||
// let Vv = this.sessionDataProviderService.getFamilyRoom()+"-"+item.uid;
|
||||
this.emmitSocketEvent("send_message",msgPart, item.target_room);
|
||||
}
|
||||
|
||||
|
||||
public familyInvite(item, activitySelect:string){
|
||||
// console.log(item);
|
||||
const msgPart = {
|
||||
@@ -84,6 +90,14 @@ export class SocketToolsService {
|
||||
}});
|
||||
dispatchEvent(event_accept);
|
||||
break;
|
||||
case 'FAMILY_INVITE_CONNECT_MESSAGE':
|
||||
console.log("app-family-invite accepted****");
|
||||
const event_msg = new CustomEvent("app-family-invite-message", {detail: {
|
||||
title: 'Invite Call Message',
|
||||
data
|
||||
}});
|
||||
dispatchEvent(event_msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user