...
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
@inject ToastService toastService
|
||||
@inject ILocalStorageService localStorageService;
|
||||
@inject HttpClient _Http;
|
||||
@inject NavigationManager nav
|
||||
<ConfirmDialog @ref="dialog" />
|
||||
<Modal @ref="modal" IsVerticallyCentered="true" IsScrollable="true" />
|
||||
<PageTitle>گفتمان</PageTitle>
|
||||
@@ -33,7 +34,7 @@
|
||||
<div class="sidebar-tabs" id="A2">
|
||||
<!-- Inbox1 -->
|
||||
<Button Outline="@isSelectedInbox1" Type="ButtonType.Link" @onclick="async()=>{await OnclickInbox(1);}" Size=ButtonSize.Small Color="ButtonColor.Warning"
|
||||
class=@($"tab-button inbox1-button {(isSelectedInbox1 ? "active-tab inbox1-active" : "")}")>
|
||||
class=@($"tab-button inbox1-button {(isSelectedInbox1 ? "active-tab inbox1-active" : "")}")>
|
||||
<Icon Name="IconName.Inbox" Class="tab-icon" />
|
||||
<span class="tab-text">پیام های آمده</span>
|
||||
<Badge Color="BadgeColor.Warning" Class="tab-badge">@Inbox1Items.Count()</Badge>
|
||||
@@ -41,7 +42,7 @@
|
||||
|
||||
<!-- Inbox2 -->
|
||||
<Button Outline="@isSelectedInbox2" Type="ButtonType.Link" @onclick="async()=>{await OnclickInbox(2);}" Size=ButtonSize.Small Color="ButtonColor.Primary"
|
||||
class=@($"tab-button inbox2-button {(isSelectedInbox2 ? "active-tab inbox2-active" : "")}")>
|
||||
class=@($"tab-button inbox2-button {(isSelectedInbox2 ? "active-tab inbox2-active" : "")}")>
|
||||
<Icon Name="IconName.Send" Class="tab-icon" />
|
||||
<span class="tab-text">پیام های من</span>
|
||||
<Badge Color="BadgeColor.Warning" Class="tab-badge">@Inbox2Items.Count()</Badge>
|
||||
@@ -49,7 +50,7 @@
|
||||
|
||||
<!-- Inbox3 -->
|
||||
<Button Outline="@isSelectedInbox3" Type="ButtonType.Link" @onclick="async()=>{await OnclickInbox(3);}" Size=ButtonSize.Small Color="ButtonColor.Danger"
|
||||
class=@($"tab-button inbox3-button {(isSelectedInbox3 ? "active-tab inbox3-active" : "")}")>
|
||||
class=@($"tab-button inbox3-button {(isSelectedInbox3 ? "active-tab inbox3-active" : "")}")>
|
||||
<Icon Name="IconName.Archive" Class="tab-icon" />
|
||||
<span class="tab-text">پیام های بسته</span>
|
||||
</Button>
|
||||
@@ -161,7 +162,7 @@
|
||||
@if (ChatCurrent.status == Common.Enums.ConversationStatus.InProgress)
|
||||
{
|
||||
<Button Color="ButtonColor.Danger" Size=ButtonSize.ExtraSmall Outline="true" Class="finish-conversation-btn"
|
||||
@onclick="CloseChat">
|
||||
@onclick="CloseChat">
|
||||
<Icon Name="IconName.Escape" /> اتمام گفتگو
|
||||
</Button>
|
||||
|
||||
@@ -173,7 +174,7 @@
|
||||
&& (CurrentUser.Role == "Company" || ChatCurrent.ExperID == CurrentUser.ExperID))
|
||||
{
|
||||
<Button Color="ButtonColor.Success" Size=ButtonSize.ExtraSmall Outline="true" Class="open-conversation-btn"
|
||||
@onclick="OpenChat">
|
||||
@onclick="OpenChat">
|
||||
|
||||
<Icon Name="IconName.Escape" /> باز کردن گفتگو
|
||||
</Button>
|
||||
@@ -377,13 +378,13 @@
|
||||
if (!string.IsNullOrEmpty(MsgInput) && ChatCurrent != null)
|
||||
{
|
||||
Common.Enums.ConversationType type = CurrentUser.Role == "Company" ? Common.Enums.ConversationType.CU : Common.Enums.ConversationType.EU;
|
||||
var geter= await chatService.ADDChatResponse(ChatCurrent.ID, MsgInput, type);
|
||||
if(geter!=null)
|
||||
var geter= await chatService.ADDChatResponse(ChatCurrent.ID, MsgInput, type);
|
||||
if(geter!=null)
|
||||
{ChatCurrent?.Responses.Add(geter);
|
||||
ChatCurrent.LastText = MsgInput;
|
||||
await Task.Yield();
|
||||
await JS.InvokeVoidAsync("scrollToBottom", "B1");
|
||||
MsgInput = string.Empty;}
|
||||
ChatCurrent.LastText = MsgInput;
|
||||
await Task.Yield();
|
||||
await JS.InvokeVoidAsync("scrollToBottom", "B1");
|
||||
MsgInput = string.Empty;}
|
||||
}
|
||||
}
|
||||
async Task onClickSelectedChat(int InboxID, ChatItemDto chatItem)
|
||||
@@ -402,14 +403,19 @@
|
||||
[JSInvokable]
|
||||
public async Task MarkAsRead(int id)
|
||||
{
|
||||
var msg = ChatCurrent.Responses.FirstOrDefault(m => m.ID == id);
|
||||
if (msg != null && !msg.IsRead && msg.Type == Common.Enums.ConversationType.UE)
|
||||
var allowcjange = nav.Uri.Split('/');
|
||||
if (allowcjange.Length == 4 && (allowcjange[3].ToLower() == "chat" || string.IsNullOrEmpty(allowcjange[3]) ))
|
||||
{
|
||||
msg.IsRead = true;
|
||||
await chatService.MarkAsReadChatItemAsync(id);
|
||||
var msg = ChatCurrent.Responses.FirstOrDefault(m => m.ID == id);
|
||||
if (msg != null && !msg.IsRead && msg.Type == Common.Enums.ConversationType.UE)
|
||||
{
|
||||
msg.IsRead = true;
|
||||
await chatService.MarkAsReadChatItemAsync(id);
|
||||
}
|
||||
// StateHasChanged();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
// StateHasChanged();
|
||||
await Task.CompletedTask;
|
||||
|
||||
}
|
||||
async Task onclickAttachedto()
|
||||
{
|
||||
|
Reference in New Issue
Block a user