...
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
@using Common.Dtos.Conversation
|
@using Common.Dtos.Conversation
|
||||||
|
@using HushianWebApp.Service
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
|
@inject ConversationService conversationService;
|
||||||
|
|
||||||
<div class="chat-container p-3">
|
<div class="chat-container p-3">
|
||||||
|
|
||||||
@@ -12,8 +14,8 @@
|
|||||||
@if (!msg.IsRead && msg.Type == Common.Enums.ConversationType.UE)
|
@if (!msg.IsRead && msg.Type == Common.Enums.ConversationType.UE)
|
||||||
{
|
{
|
||||||
<p>ـــــــــــــــــــــــــ</p>
|
<p>ـــــــــــــــــــــــــ</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,29 +48,29 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.chat-bubble {
|
.chat-bubble {
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
max-width: 75%;
|
max-width: 75%;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-mine {
|
.chat-mine {
|
||||||
background: linear-gradient(to right, #005eff, #267fff);
|
background: linear-gradient(to right, #005eff, #267fff);
|
||||||
color: white;
|
color: white;
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-other {
|
.chat-other {
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
color: #333;
|
color: #333;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-ai {
|
.chat-ai {
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
color: #353;
|
color: #353;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -91,10 +93,12 @@
|
|||||||
public async Task MarkAsRead(int id)
|
public async Task MarkAsRead(int id)
|
||||||
{
|
{
|
||||||
var msg = Messages.FirstOrDefault(m => m.ID == id);
|
var msg = Messages.FirstOrDefault(m => m.ID == id);
|
||||||
if (msg != null && !msg.IsRead && msg.Type==Common.Enums.ConversationType.UE)
|
if (msg != null && !msg.IsRead && msg.Type == Common.Enums.ConversationType.UE)
|
||||||
{
|
{
|
||||||
msg.IsRead = true;
|
msg.IsRead = true;
|
||||||
await EventCallIsRead.InvokeAsync(id);
|
await conversationService.MarkAsReadConversationItemAsync(id);
|
||||||
|
|
||||||
|
// await EventCallIsRead.InvokeAsync(id);
|
||||||
}
|
}
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
@@ -174,12 +174,18 @@
|
|||||||
public int UserID = 0;
|
public int UserID = 0;
|
||||||
async Task OnclickInbox(int ID)
|
async Task OnclickInbox(int ID)
|
||||||
{
|
{
|
||||||
|
Inbox1Items = await conversationService.ConversationAwaitingOurResponse();
|
||||||
|
Inbox2Items = await conversationService.MyConversationIsInProgress();
|
||||||
|
Inbox3Items = await conversationService.MyConversationIsFinished();
|
||||||
|
|
||||||
switch (ID)
|
switch (ID)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
isSelectedInbox1 = true;
|
isSelectedInbox1 = true;
|
||||||
isSelectedInbox2 = false;
|
isSelectedInbox2 = false;
|
||||||
isSelectedInbox3 = false;
|
isSelectedInbox3 = false;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@@ -219,8 +225,15 @@
|
|||||||
}
|
}
|
||||||
async Task onClickSelectedCon(int InboxID,Read_ConversationDto conversationDto)
|
async Task onClickSelectedCon(int InboxID,Read_ConversationDto conversationDto)
|
||||||
{
|
{
|
||||||
// پر کردن SelectedCon
|
if (InboxID == 1 )
|
||||||
// مقدار دادن به SelectedChatUserName
|
Inbox1Items = await conversationService.ConversationAwaitingOurResponse();
|
||||||
|
if (InboxID == 2 )
|
||||||
|
Inbox2Items = await conversationService.MyConversationIsInProgress();
|
||||||
|
if ( InboxID == 3)
|
||||||
|
Inbox3Items = await conversationService.MyConversationIsFinished();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
chatloading = true;
|
chatloading = true;
|
||||||
SelectedChatUserName = "در حال گفتگو با "+ conversationDto.UserFullName;
|
SelectedChatUserName = "در حال گفتگو با "+ conversationDto.UserFullName;
|
||||||
SelectedConversation = conversationDto;
|
SelectedConversation = conversationDto;
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
if (item.Type == Common.Enums.ConversationType.UE)
|
if (item.Type == Common.Enums.ConversationType.UE)
|
||||||
{
|
{
|
||||||
<div style="display: flex; "
|
<div style="display: flex; "
|
||||||
dir="rtl" class="p-1 rounded w-100">
|
dir="rtl" class="p-1 rounded w-100">
|
||||||
<div class="bg-green-100 border p-2 rounded text-end" dir="rtl">
|
<div class="bg-green-100 border p-2 rounded text-end" dir="rtl">
|
||||||
@item.text
|
@item.text
|
||||||
</div>
|
</div>
|
||||||
@@ -17,8 +17,16 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
<div id="target" style="text-align: center;">
|
||||||
|
@if (!target&& !item.IsRead)
|
||||||
|
{
|
||||||
|
target = true;
|
||||||
|
<p>ـــــــــــــــــــــــــ</p>
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
<div style="display: flex; "
|
<div style="display: flex; "
|
||||||
dir="ltr" class="p-1 rounded w-100">
|
dir="ltr" class="p-1 rounded w-100">
|
||||||
<div class="bg-white border p-3 rounded text-end" dir="rtl">
|
<div class="bg-white border p-3 rounded text-end" dir="rtl">
|
||||||
@item.text
|
@item.text
|
||||||
</div>
|
</div>
|
||||||
@@ -35,6 +43,12 @@
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
// [Parameter] public List<Read_ConversationDto> Conversations { get; set; }
|
bool target = false;
|
||||||
|
// [Parameter] public List<Read_ConversationDto> Conversations { get; set; }
|
||||||
[Parameter] public List<Read_ConversationResponseDto> SelectedConversationItems { get; set; }
|
[Parameter] public List<Read_ConversationResponseDto> SelectedConversationItems { get; set; }
|
||||||
|
protected override Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
target = false;
|
||||||
|
return base.OnParametersSetAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user