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