Refactor UI: Enhance layout and styling for various pages, implement back navigation, and improve search functionality
This commit is contained in:
parent
a05bdc77f7
commit
e50b799992
@ -2,73 +2,83 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:CORP_MAUI.Pages"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.ChatPage"
|
||||
Title="Чат">
|
||||
Title="Чат"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
|
||||
<!-- Шапка с информацией о собеседнике -->
|
||||
<Border
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Padding="15"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.3, Offset='0,2', Radius=4}">
|
||||
ColumnDefinitions="50,Auto,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="White">
|
||||
|
||||
<Grid ColumnDefinitions="Auto,Auto,*">
|
||||
<!-- Кнопка "Назад" -->
|
||||
<Button
|
||||
Grid.Column="0"
|
||||
Text="←"
|
||||
FontSize="24"
|
||||
TextColor="White"
|
||||
BackgroundColor="Transparent"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
Padding="0"
|
||||
VerticalOptions="Center"
|
||||
Clicked="OnBackButtonClicked"/>
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
WidthRequest="50"
|
||||
HeightRequest="50"
|
||||
StrokeShape="RoundRectangle 25"
|
||||
Padding="0"
|
||||
Margin="10,0,0,0"
|
||||
BackgroundColor="White">
|
||||
<Image
|
||||
x:Name="RecipientAvatar"
|
||||
Source="dotnet_bot.png"
|
||||
Aspect="AspectFill"/>
|
||||
</Border>
|
||||
<!-- Кнопка назад -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
BackgroundColor="Transparent"
|
||||
Stroke="Transparent"
|
||||
HorizontalOptions="Start">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnBackButtonClicked"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="arrow_back.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource AvatarSmall}"
|
||||
Margin="5,0,10,0">
|
||||
<Image
|
||||
x:Name="RecipientAvatar"
|
||||
Source="dotnet_bot.png"
|
||||
Aspect="AspectFill"/>
|
||||
</Border>
|
||||
|
||||
<!-- Информация о собеседнике -->
|
||||
<VerticalStackLayout
|
||||
Grid.Column="2"
|
||||
VerticalOptions="Center"
|
||||
Margin="10,0,0,0">
|
||||
<Label
|
||||
x:Name="RecipientName"
|
||||
Text="Выберите собеседника"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="White"/>
|
||||
<Label
|
||||
x:Name="RecipientStatus"
|
||||
Text="Offline"
|
||||
FontSize="12"
|
||||
TextColor="White"
|
||||
Opacity="0.8"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- Информация о собеседнике -->
|
||||
<VerticalStackLayout
|
||||
Grid.Column="2"
|
||||
VerticalOptions="Center"
|
||||
Spacing="2">
|
||||
<Label
|
||||
x:Name="RecipientName"
|
||||
Text="Выберите собеседника"
|
||||
FontSize="16"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
<Label
|
||||
x:Name="RecipientStatus"
|
||||
Text="Offline"
|
||||
FontSize="12"
|
||||
TextColor="{StaticResource Gray500}"/>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="3" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Список сообщений -->
|
||||
<CollectionView
|
||||
Grid.Row="1"
|
||||
x:Name="MessagesCollectionView"
|
||||
SelectionMode="None"
|
||||
BackgroundColor="Transparent"
|
||||
Margin="10">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type local:MessageViewModel}">
|
||||
@ -79,13 +89,14 @@
|
||||
MaximumWidthRequest="300"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
StrokeShape="RoundRectangle 15"
|
||||
Padding="10"
|
||||
Stroke="Transparent"
|
||||
Padding="12"
|
||||
Margin="50,0,0,0"
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.2, Offset='0,1', Radius=3}">
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.1, Offset='0,1', Radius=3}">
|
||||
<Border.Triggers>
|
||||
<DataTrigger TargetType="Border" Binding="{Binding IsMyMessage}" Value="False">
|
||||
<Setter Property="HorizontalOptions" Value="Start"/>
|
||||
<Setter Property="BackgroundColor" Value="{StaticResource Gray200}"/>
|
||||
<Setter Property="BackgroundColor" Value="White"/>
|
||||
<Setter Property="Margin" Value="0,0,50,0"/>
|
||||
</DataTrigger>
|
||||
</Border.Triggers>
|
||||
@ -119,10 +130,10 @@
|
||||
FontSize="10"
|
||||
HorizontalOptions="End"
|
||||
TextColor="White"
|
||||
Opacity="0.7">
|
||||
Opacity="0.8">
|
||||
<Label.Triggers>
|
||||
<DataTrigger TargetType="Label" Binding="{Binding IsMyMessage}" Value="False">
|
||||
<Setter Property="TextColor" Value="{StaticResource Gray600}"/>
|
||||
<Setter Property="TextColor" Value="{StaticResource Gray500}"/>
|
||||
</DataTrigger>
|
||||
</Label.Triggers>
|
||||
</Label>
|
||||
@ -136,35 +147,56 @@
|
||||
<!-- Панель ввода сообщения -->
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource Gray100}"
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.3, Offset='0,-2', Radius=4}">
|
||||
Padding="15,10"
|
||||
BackgroundColor="White"
|
||||
Stroke="Transparent"
|
||||
StrokeShape="RoundRectangle 0">
|
||||
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<Entry
|
||||
x:Name="MessageEntry"
|
||||
|
||||
<!-- Поле ввода -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Placeholder="Введите сообщение..."
|
||||
PlaceholderColor="{StaticResource Gray400}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="White"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
Stroke="Transparent"
|
||||
HeightRequest="45"
|
||||
VerticalOptions="Center"
|
||||
TextChanged="OnMessageTextChanged"
|
||||
Completed="OnSendMessageClicked"/>
|
||||
Padding="15,0">
|
||||
<Entry
|
||||
x:Name="MessageEntry"
|
||||
Placeholder="Введите сообщение..."
|
||||
PlaceholderColor="{StaticResource Gray500}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="Transparent"
|
||||
VerticalOptions="Center"
|
||||
TextChanged="OnMessageTextChanged"
|
||||
Completed="OnSendMessageClicked"/>
|
||||
</Border>
|
||||
|
||||
<Button
|
||||
<!-- Кнопка отправки -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
x:Name="SendButton"
|
||||
Text="➤"
|
||||
FontSize="24"
|
||||
WidthRequest="50"
|
||||
WidthRequest="45"
|
||||
HeightRequest="45"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
TextColor="White"
|
||||
CornerRadius="10"
|
||||
Margin="10,0,0,0"
|
||||
Clicked="OnSendMessageClicked"/>
|
||||
Stroke="Transparent"
|
||||
Margin="10,0,0,0">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnSendMessageClicked"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="send.png"
|
||||
WidthRequest="22"
|
||||
HeightRequest="22"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@ -173,13 +205,14 @@
|
||||
Grid.Row="1"
|
||||
x:Name="ConnectionIndicator"
|
||||
IsVisible="False"
|
||||
BackgroundColor="{StaticResource Secondary}"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
Padding="12,8"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
Stroke="Transparent"
|
||||
VerticalOptions="Start"
|
||||
HorizontalOptions="Center"
|
||||
Margin="0,10,0,0"
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.3, Offset='0,2', Radius=4}">
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.2, Offset='0,2', Radius=4}">
|
||||
<Label
|
||||
Text="Подключение..."
|
||||
TextColor="White"
|
||||
|
||||
@ -4,210 +4,268 @@
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.DepartmentDetailsPage"
|
||||
Title="Информация об отделе">
|
||||
Title="Информация об отделе"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Shell.BackButtonBehavior>
|
||||
<BackButtonBehavior IsVisible="True" TextOverride="Назад" />
|
||||
</Shell.BackButtonBehavior>
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="15" Spacing="20">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Информация об отделе -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<!-- Название отдела -->
|
||||
<Label
|
||||
x:Name="DepartmentNameLabel"
|
||||
Style="{StaticResource PageTitle}"/>
|
||||
|
||||
<!-- Описание -->
|
||||
<Label
|
||||
x:Name="DepartmentDescriptionLabel"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="16"
|
||||
HorizontalOptions="Center"
|
||||
HorizontalTextAlignment="Center"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<!-- Количество сотрудников -->
|
||||
<HorizontalStackLayout
|
||||
HorizontalOptions="Center"
|
||||
Spacing="5">
|
||||
<Image Source="employees.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center"/>
|
||||
<Label
|
||||
x:Name="EmployeesCountLabel"
|
||||
Style="{StaticResource MetaText}"
|
||||
FontSize="16"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
<!-- Кнопка назад -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
BackgroundColor="Transparent"
|
||||
Stroke="Transparent"
|
||||
HorizontalOptions="Start">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnBackTapped"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="arrow_back.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Информация об отделе"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Руководитель отдела -->
|
||||
<VerticalStackLayout
|
||||
x:Name="HeadSection"
|
||||
Spacing="10"
|
||||
IsVisible="False">
|
||||
<!-- Контент -->
|
||||
<ScrollView Grid.Row="1">
|
||||
<VerticalStackLayout Padding="15" Spacing="15">
|
||||
|
||||
<Label Text="Руководитель" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<Border Style="{StaticResource SectionBorder}">
|
||||
|
||||
<Grid ColumnDefinitions="60,*">
|
||||
<!-- Информация об отделе -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<!-- Аватар руководителя -->
|
||||
<Border Grid.Column="0" Style="{StaticResource AvatarMedium}">
|
||||
<Image x:Name="HeadAvatarImage" Aspect="AspectFill"/>
|
||||
</Border>
|
||||
|
||||
<!-- Информация о руководителе -->
|
||||
<VerticalStackLayout
|
||||
Grid.Column="1"
|
||||
VerticalOptions="Center"
|
||||
Spacing="3"
|
||||
Margin="10,0">
|
||||
|
||||
<!-- Название отдела -->
|
||||
<Label
|
||||
x:Name="DepartmentNameLabel"
|
||||
Style="{StaticResource PageTitle}"/>
|
||||
|
||||
<!-- Описание -->
|
||||
<Label
|
||||
x:Name="DepartmentDescriptionLabel"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="16"
|
||||
HorizontalOptions="Center"
|
||||
HorizontalTextAlignment="Center"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<!-- Количество сотрудников -->
|
||||
<HorizontalStackLayout
|
||||
HorizontalOptions="Center"
|
||||
Spacing="5">
|
||||
<Image Source="employees.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label
|
||||
x:Name="HeadNameLabel"
|
||||
Style="{StaticResource CardSubtitle}"/>
|
||||
|
||||
<Label
|
||||
x:Name="HeadPositionLabel"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="13"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
</Grid>
|
||||
x:Name="EmployeesCountLabel"
|
||||
Style="{StaticResource CardMeta}"
|
||||
FontSize="16"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Команда отдела -->
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<Label Text="Команда отдела" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<CollectionView
|
||||
x:Name="TeamCollectionView"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnTeamMemberSelected">
|
||||
<!-- Руководитель отдела -->
|
||||
<VerticalStackLayout
|
||||
x:Name="HeadSection"
|
||||
Spacing="10"
|
||||
IsVisible="False">
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
|
||||
<Label
|
||||
Text="Нет сотрудников в отделе"
|
||||
Style="{StaticResource EmptyStateTitle}"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.EmptyView>
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:User">
|
||||
<Border Style="{StaticResource CardBorder}" Margin="0,5">
|
||||
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnTeamMemberCardTapped" CommandParameter="{Binding .}"/>
|
||||
</Border.GestureRecognizers>
|
||||
|
||||
<Grid ColumnDefinitions="60,*,50">
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border Grid.Column="0" Style="{StaticResource AvatarMedium}">
|
||||
<Grid>
|
||||
<Image
|
||||
Source="{Binding DisplayAvatarSource}"
|
||||
Aspect="AspectFill"/>
|
||||
<!-- Индикатор онлайн статуса -->
|
||||
<Border
|
||||
Style="{StaticResource OnlineIndicatorMedium}"
|
||||
IsVisible="{Binding IsOnline}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Информация о сотруднике -->
|
||||
<VerticalStackLayout
|
||||
Grid.Column="1"
|
||||
VerticalOptions="Center"
|
||||
Spacing="5"
|
||||
Margin="10,0">
|
||||
|
||||
<Label
|
||||
Text="{Binding FullName}"
|
||||
Style="{StaticResource CardSubtitle}"/>
|
||||
|
||||
<Label
|
||||
Text="{Binding PositionName}"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="13"/>
|
||||
|
||||
<!-- Навыки -->
|
||||
<FlexLayout
|
||||
BindableLayout.ItemsSource="{Binding Skills}"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Start"
|
||||
Margin="0,3,0,0">
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Skill">
|
||||
<Border
|
||||
Padding="6,3"
|
||||
Margin="2"
|
||||
StrokeShape="RoundRectangle 10"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
Stroke="Transparent">
|
||||
<Label
|
||||
Text="{Binding Name}"
|
||||
FontSize="11"
|
||||
TextColor="{StaticResource Gray700}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
</FlexLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Кнопка чата -->
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource IconButton}"
|
||||
VerticalOptions="Center">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnChatIconTapped" CommandParameter="{Binding .}"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="chats.png"
|
||||
WidthRequest="22"
|
||||
HeightRequest="22"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
<Label Text="Руководитель" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||||
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
|
||||
<Grid ColumnDefinitions="60,*">
|
||||
|
||||
<!-- Аватар руководителя -->
|
||||
<Border Grid.Column="0" Style="{StaticResource AvatarMedium}">
|
||||
<Image x:Name="HeadAvatarImage" Aspect="AspectFill"/>
|
||||
</Border>
|
||||
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
<!-- Информация о руководителе -->
|
||||
<VerticalStackLayout
|
||||
Grid.Column="1"
|
||||
VerticalOptions="Center"
|
||||
Spacing="3"
|
||||
Margin="10,0">
|
||||
|
||||
<Label
|
||||
x:Name="HeadNameLabel"
|
||||
Style="{StaticResource CardSubtitle}"/>
|
||||
|
||||
<Label
|
||||
x:Name="HeadPositionLabel"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="13"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Команда отдела -->
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<Label Text="Команда отдела" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||||
|
||||
<CollectionView
|
||||
x:Name="TeamCollectionView"
|
||||
SelectionMode="None"
|
||||
BackgroundColor="Transparent">
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
|
||||
<Label Text="👥" Style="{StaticResource EmptyStateIcon}"/>
|
||||
<Label
|
||||
Text="Нет сотрудников в отделе"
|
||||
Style="{StaticResource EmptyStateTitle}"
|
||||
Margin="0,10,0,0"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.EmptyView>
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:User">
|
||||
<Border
|
||||
Style="{StaticResource CardBorder}"
|
||||
Margin="0,5">
|
||||
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnTeamMemberCardTapped" CommandParameter="{Binding .}"/>
|
||||
</Border.GestureRecognizers>
|
||||
|
||||
<Grid ColumnDefinitions="60,*,50">
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border Grid.Column="0" Style="{StaticResource AvatarMedium}">
|
||||
<Grid>
|
||||
<Image
|
||||
Source="{Binding DisplayAvatarSource}"
|
||||
Aspect="AspectFill"/>
|
||||
<!-- Индикатор онлайн статуса -->
|
||||
<Border
|
||||
Style="{StaticResource OnlineIndicatorMedium}"
|
||||
IsVisible="{Binding IsOnline}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Информация о сотруднике -->
|
||||
<VerticalStackLayout
|
||||
Grid.Column="1"
|
||||
VerticalOptions="Center"
|
||||
Spacing="5"
|
||||
Margin="10,0">
|
||||
|
||||
<Label
|
||||
Text="{Binding FullName}"
|
||||
Style="{StaticResource CardSubtitle}"/>
|
||||
|
||||
<Label
|
||||
Text="{Binding PositionName}"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="13"/>
|
||||
|
||||
<!-- Навыки -->
|
||||
<FlexLayout
|
||||
BindableLayout.ItemsSource="{Binding Skills}"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Start"
|
||||
Margin="0,3,0,0">
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Skill">
|
||||
<Border
|
||||
Padding="6,3"
|
||||
Margin="2"
|
||||
StrokeShape="RoundRectangle 10"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
Stroke="Transparent">
|
||||
<Label
|
||||
Text="{Binding Name}"
|
||||
FontSize="11"
|
||||
TextColor="{StaticResource Gray700}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
</FlexLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Кнопка чата -->
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource IconButton}"
|
||||
VerticalOptions="Center">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnChatIconTapped" CommandParameter="{Binding .}"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="chats.png"
|
||||
WidthRequest="22"
|
||||
HeightRequest="22"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
Color="{StaticResource Primary}"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center"
|
||||
Margin="0,50,0,0"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
Color="{StaticResource Primary}"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center"
|
||||
Margin="0,50,0,0"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using CORP_MAUI.Models;
|
||||
namespace CORP_MAUI.Pages;
|
||||
@ -41,6 +41,12 @@ public partial class DepartmentDetailsPage : ContentPage
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnBackTapped(object sender, TappedEventArgs e)
|
||||
{
|
||||
await Navigation.PopAsync();
|
||||
}
|
||||
|
||||
private async Task LoadDepartmentDataAsync()
|
||||
{
|
||||
try
|
||||
@ -105,16 +111,6 @@ public partial class DepartmentDetailsPage : ContentPage
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnTeamMemberSelected(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.CurrentSelection.FirstOrDefault() is User selectedUser)
|
||||
{
|
||||
TeamCollectionView.SelectedItem = null;
|
||||
|
||||
// Открываем профиль сотрудника
|
||||
await Navigation.PushAsync(new EmployeeProfilePage(selectedUser));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Обработчик клика по карточке сотрудника (открытие профиля)
|
||||
|
||||
@ -2,25 +2,87 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.DepartmentsPage"
|
||||
Title="Отделы">
|
||||
Title="Отделы"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Grid RowDefinitions="Auto,Auto,*">
|
||||
|
||||
<!-- Поиск -->
|
||||
<Border
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource SearchContainerBorder}">
|
||||
<SearchBar
|
||||
x:Name="SearchBar"
|
||||
Placeholder="Поиск отделов..."
|
||||
Style="{StaticResource AppSearchBar}"
|
||||
TextChanged="OnSearchTextChanged"/>
|
||||
</Border>
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Пустое место слева -->
|
||||
<BoxView Grid.Column="0" Color="Transparent"/>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Отделы"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Поиск с серым фоном -->
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
Padding="15,5,15,15"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Круглая кнопка поиска -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="45"
|
||||
HeightRequest="45"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
Stroke="Transparent"
|
||||
Margin="0,0,10,0">
|
||||
<Image
|
||||
Source="search.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Поле поиска с серым фоном -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Gray300}"
|
||||
Stroke="Transparent"
|
||||
HeightRequest="45"
|
||||
Padding="15,0">
|
||||
<Entry
|
||||
x:Name="SearchEntry"
|
||||
Placeholder="Поиск отделов..."
|
||||
PlaceholderColor="{StaticResource Gray500}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="Transparent"
|
||||
VerticalOptions="Center"
|
||||
TextChanged="OnSearchTextChanged"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- Список отделов -->
|
||||
<RefreshView
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
x:Name="RefreshView"
|
||||
IsRefreshing="False"
|
||||
Refreshing="OnRefreshing">
|
||||
@ -28,19 +90,27 @@
|
||||
<CollectionView
|
||||
x:Name="DepartmentsCollectionView"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnDepartmentSelected">
|
||||
SelectionChanged="OnDepartmentSelected"
|
||||
BackgroundColor="Transparent">
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
|
||||
<Label Text="🏢" Style="{StaticResource EmptyStateIcon}"/>
|
||||
<Label
|
||||
Text="Нет доступных отделов"
|
||||
Style="{StaticResource EmptyStateTitle}"/>
|
||||
Text="Нет отделов"
|
||||
Style="{StaticResource EmptyStateTitle}"
|
||||
Margin="0,10,0,0"/>
|
||||
<Label
|
||||
Text="Попробуйте изменить параметры поиска"
|
||||
Style="{StaticResource EmptyStateText}"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.EmptyView>
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Department">
|
||||
<Border Style="{StaticResource CardBorder}">
|
||||
<Border
|
||||
Style="{StaticResource CardBorder}"
|
||||
Margin="10,5">
|
||||
|
||||
<Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto,Auto">
|
||||
|
||||
@ -70,16 +140,24 @@
|
||||
|
||||
<!-- Количество сотрудников -->
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Image Source="employees.png" WidthRequest="16" HeightRequest="16" VerticalOptions="Center"/>
|
||||
<Label Text="{Binding EmployeesCount}" Style="{StaticResource MetaText}"/>
|
||||
<Image Source="employees.png" WidthRequest="16" HeightRequest="16" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label Text="{Binding EmployeesCount}" Style="{StaticResource CardMeta}"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<!-- Руководитель -->
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Image Source="profile.png" WidthRequest="16" HeightRequest="16" VerticalOptions="Center"/>
|
||||
<Image Source="profile.png" WidthRequest="16" HeightRequest="16" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label
|
||||
Text="{Binding Head.FullName}"
|
||||
Style="{StaticResource MetaText}"
|
||||
Style="{StaticResource CardMeta}"
|
||||
LineBreakMode="TailTruncation"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
@ -105,7 +183,7 @@
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
|
||||
@ -4,164 +4,195 @@
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.EmployeeProfilePage"
|
||||
Title="Профиль сотрудника">
|
||||
Title="Профиль сотрудника"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Shell.BackButtonBehavior>
|
||||
<BackButtonBehavior IsVisible="True" TextOverride="Назад" />
|
||||
</Shell.BackButtonBehavior>
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="15" Spacing="20">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Аватар и основная информация -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="15" HorizontalOptions="Center">
|
||||
<!-- Кнопка назад -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
BackgroundColor="Transparent"
|
||||
Stroke="Transparent"
|
||||
HorizontalOptions="Start">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnBackTapped"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="arrow_back.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Профиль сотрудника"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Контент -->
|
||||
<ScrollView Grid.Row="1">
|
||||
<VerticalStackLayout Padding="15" Spacing="15">
|
||||
|
||||
<!-- Аватар и основная информация -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="15" HorizontalOptions="Center">
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border Style="{StaticResource AvatarXLarge}">
|
||||
<Grid>
|
||||
<Image
|
||||
x:Name="AvatarImage"
|
||||
Aspect="AspectFill"/>
|
||||
<!-- Индикатор онлайн статуса -->
|
||||
<Border
|
||||
Style="{StaticResource OnlineIndicatorLarge}"
|
||||
x:Name="OnlineIndicator"
|
||||
IsVisible="False"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ФИО -->
|
||||
<Label
|
||||
x:Name="FullNameLabel"
|
||||
Style="{StaticResource PageTitle}"/>
|
||||
|
||||
<!-- Должность -->
|
||||
<Label
|
||||
x:Name="PositionLabel"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="16"
|
||||
HorizontalOptions="Center"
|
||||
HorizontalTextAlignment="Center"/>
|
||||
|
||||
<!-- Кнопка "Написать сообщение" -->
|
||||
<Button
|
||||
x:Name="ChatButton"
|
||||
Text="💬 Написать сообщение"
|
||||
Style="{StaticResource PrimaryButton}"
|
||||
Clicked="OnChatButtonClicked"
|
||||
Margin="0,10,0,0"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Контактная информация -->
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border Style="{StaticResource AvatarXLarge}">
|
||||
<Grid>
|
||||
<Image
|
||||
x:Name="AvatarImage"
|
||||
Aspect="AspectFill"/>
|
||||
<!-- Индикатор онлайн статуса -->
|
||||
<Border
|
||||
Style="{StaticResource OnlineIndicatorLarge}"
|
||||
x:Name="OnlineIndicator"
|
||||
IsVisible="False"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Label Text="Контакты" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||||
|
||||
<!-- ФИО -->
|
||||
<Label
|
||||
x:Name="FullNameLabel"
|
||||
Style="{StaticResource PageTitle}"/>
|
||||
|
||||
<!-- Должность -->
|
||||
<Label
|
||||
x:Name="PositionLabel"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="16"
|
||||
HorizontalOptions="Center"
|
||||
HorizontalTextAlignment="Center"/>
|
||||
|
||||
<!-- Кнопка "Написать сообщение" -->
|
||||
<!-- Email -->
|
||||
<Border
|
||||
x:Name="ChatButton"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
StrokeShape="RoundRectangle 10"
|
||||
Stroke="Transparent"
|
||||
HeightRequest="50"
|
||||
Margin="0,10,0,0"
|
||||
Padding="15,0">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnChatButtonClicked"/>
|
||||
</Border.GestureRecognizers>
|
||||
<HorizontalStackLayout
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
Spacing="10">
|
||||
<Image
|
||||
Source="chats.png"
|
||||
WidthRequest="22"
|
||||
HeightRequest="22"
|
||||
VerticalOptions="Center">
|
||||
Style="{StaticResource CardBorderLarge}"
|
||||
x:Name="EmailSection"
|
||||
IsVisible="False">
|
||||
<HorizontalStackLayout Spacing="12">
|
||||
<Image Source="email.png" WidthRequest="24" HeightRequest="24" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label
|
||||
Text="Написать сообщение"
|
||||
TextColor="White"
|
||||
FontSize="16"
|
||||
FontAttributes="Bold"
|
||||
VerticalOptions="Center"/>
|
||||
<VerticalStackLayout Spacing="3">
|
||||
<Label Text="Email" Style="{StaticResource CardMeta}"/>
|
||||
<Label x:Name="EmailLabel" Style="{StaticResource CardText}" TextColor="{StaticResource Gray900}"/>
|
||||
</VerticalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Телефон -->
|
||||
<Border
|
||||
Style="{StaticResource CardBorderLarge}"
|
||||
x:Name="PhoneSection"
|
||||
IsVisible="False">
|
||||
<HorizontalStackLayout Spacing="12">
|
||||
<Image Source="phone.png" WidthRequest="24" HeightRequest="24" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<VerticalStackLayout Spacing="3">
|
||||
<Label Text="Телефон" Style="{StaticResource CardMeta}"/>
|
||||
<Label x:Name="PhoneLabel" Style="{StaticResource CardText}" TextColor="{StaticResource Gray900}"/>
|
||||
</VerticalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Контактная информация -->
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<Label Text="Контакты" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<!-- Email -->
|
||||
<Border
|
||||
Style="{StaticResource SectionBorder}"
|
||||
x:Name="EmailSection"
|
||||
<!-- Отделы -->
|
||||
<VerticalStackLayout
|
||||
Spacing="10"
|
||||
x:Name="DepartmentsSection"
|
||||
IsVisible="False">
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Label Text="📧" FontSize="20" VerticalOptions="Center"/>
|
||||
<VerticalStackLayout Spacing="3">
|
||||
<Label Text="Email" Style="{StaticResource CardMeta}"/>
|
||||
<Label x:Name="EmailLabel" Style="{StaticResource CardText}" TextColor="{StaticResource Gray900}"/>
|
||||
</VerticalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Телефон -->
|
||||
<Border
|
||||
Style="{StaticResource SectionBorder}"
|
||||
x:Name="PhoneSection"
|
||||
|
||||
<Label Text="Отделы" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||||
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout
|
||||
x:Name="DepartmentsContainer"
|
||||
Spacing="5"/>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Навыки -->
|
||||
<VerticalStackLayout
|
||||
Spacing="10"
|
||||
x:Name="SkillsSection"
|
||||
IsVisible="False">
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Label Text="📱" FontSize="20" VerticalOptions="Center"/>
|
||||
<VerticalStackLayout Spacing="3">
|
||||
<Label Text="Телефон" Style="{StaticResource CardMeta}"/>
|
||||
<Label x:Name="PhoneLabel" Style="{StaticResource CardText}" TextColor="{StaticResource Gray900}"/>
|
||||
</VerticalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
|
||||
<Label Text="Навыки" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||||
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<FlexLayout
|
||||
x:Name="SkillsContainer"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Start"/>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
Color="{StaticResource Primary}"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center"
|
||||
Margin="0,50,0,0"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Отделы -->
|
||||
<VerticalStackLayout
|
||||
Spacing="10"
|
||||
x:Name="DepartmentsSection"
|
||||
IsVisible="False">
|
||||
|
||||
<Label Text="Отделы" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<Border Style="{StaticResource SectionBorder}">
|
||||
<VerticalStackLayout
|
||||
x:Name="DepartmentsContainer"
|
||||
Spacing="5"/>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Навыки -->
|
||||
<VerticalStackLayout
|
||||
Spacing="10"
|
||||
x:Name="SkillsSection"
|
||||
IsVisible="False">
|
||||
|
||||
<Label Text="Навыки" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<Border Style="{StaticResource SectionBorder}">
|
||||
<FlexLayout
|
||||
x:Name="SkillsContainer"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Start"/>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
Color="{StaticResource Primary}"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center"
|
||||
Margin="0,50,0,0"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
||||
|
||||
|
||||
@ -176,5 +176,10 @@ public partial class EmployeeProfilePage : ContentPage
|
||||
await DisplayAlert("Ошибка", "Не удалось открыть чат", "OK");
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnBackTapped(object sender, TappedEventArgs e)
|
||||
{
|
||||
await Navigation.PopAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,44 +4,112 @@
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.EmployeesPage"
|
||||
Title="Сотрудники">
|
||||
Title="Сотрудники"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Grid RowDefinitions="Auto,Auto,*">
|
||||
|
||||
<!-- Поиск -->
|
||||
<Border
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource SearchContainerBorder}">
|
||||
<SearchBar
|
||||
x:Name="SearchBar"
|
||||
Placeholder="Поиск сотрудников..."
|
||||
Style="{StaticResource AppSearchBar}"
|
||||
TextChanged="OnSearchTextChanged"/>
|
||||
</Border>
|
||||
|
||||
<!-- Список пользователей -->
|
||||
<RefreshView
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Пустое место слева -->
|
||||
<BoxView Grid.Column="0" Color="Transparent"/>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Сотрудники"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Поиск с серым фоном -->
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
Padding="15,5,15,15"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Круглая кнопка поиска -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="45"
|
||||
HeightRequest="45"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
Stroke="Transparent"
|
||||
Margin="0,0,10,0">
|
||||
<Image
|
||||
Source="search.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Поле поиска с серым фоном -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Gray300}"
|
||||
Stroke="Transparent"
|
||||
HeightRequest="45"
|
||||
Padding="15,0">
|
||||
<Entry
|
||||
x:Name="SearchEntry"
|
||||
Placeholder="Поиск сотрудников..."
|
||||
PlaceholderColor="{StaticResource Gray500}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="Transparent"
|
||||
VerticalOptions="Center"
|
||||
TextChanged="OnSearchTextChanged"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- Список сотрудников -->
|
||||
<RefreshView
|
||||
Grid.Row="2"
|
||||
x:Name="RefreshView"
|
||||
IsRefreshing="False"
|
||||
Refreshing="OnRefreshing">
|
||||
|
||||
<CollectionView
|
||||
x:Name="EmployeesCollectionView"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnEmployeeSelected">
|
||||
SelectionMode="None"
|
||||
BackgroundColor="Transparent">
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
|
||||
<Label Text="👥" Style="{StaticResource EmptyStateIcon}"/>
|
||||
<Label
|
||||
Text="Нет доступных сотрудников"
|
||||
Style="{StaticResource EmptyStateTitle}"/>
|
||||
Text="Нет сотрудников"
|
||||
Style="{StaticResource EmptyStateTitle}"
|
||||
Margin="0,10,0,0"/>
|
||||
<Label
|
||||
Text="Попробуйте изменить параметры поиска"
|
||||
Style="{StaticResource EmptyStateText}"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.EmptyView>
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:User">
|
||||
<Border Style="{StaticResource CardBorder}">
|
||||
<Border
|
||||
Style="{StaticResource CardBorder}"
|
||||
Margin="10,5">
|
||||
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnEmployeeCardTapped" CommandParameter="{Binding .}"/>
|
||||
@ -115,7 +183,7 @@
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
|
||||
@ -99,17 +99,6 @@ public partial class EmployeesPage : ContentPage
|
||||
await LoadEmployeesAsync();
|
||||
}
|
||||
|
||||
private async void OnEmployeeSelected(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.CurrentSelection.FirstOrDefault() is User selectedEmployee)
|
||||
{
|
||||
// Сбрасываем выбор
|
||||
EmployeesCollectionView.SelectedItem = null;
|
||||
|
||||
// Открываем профиль сотрудника
|
||||
await Navigation.PushAsync(new EmployeeProfilePage(selectedEmployee));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Обработчик клика по карточке сотрудника (открытие профиля)
|
||||
|
||||
@ -36,11 +36,12 @@
|
||||
Margin="0,0,0,20"/>
|
||||
|
||||
<!-- Форма входа -->
|
||||
<Frame
|
||||
Padding="20"
|
||||
CornerRadius="15"
|
||||
<Border
|
||||
Padding="25"
|
||||
StrokeShape="RoundRectangle 15"
|
||||
BackgroundColor="White"
|
||||
HasShadow="True">
|
||||
Stroke="Transparent"
|
||||
Shadow="{Shadow Brush=Black, Opacity=0.2, Offset='0,4', Radius=8}">
|
||||
|
||||
<VerticalStackLayout Spacing="15">
|
||||
|
||||
@ -48,51 +49,62 @@
|
||||
<Label
|
||||
Text="Имя пользователя"
|
||||
FontSize="14"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray700}"/>
|
||||
|
||||
<Entry
|
||||
x:Name="UsernameEntry"
|
||||
Placeholder="Введите имя пользователя"
|
||||
PlaceholderColor="{StaticResource Gray400}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
<Border
|
||||
StrokeShape="RoundRectangle 10"
|
||||
BackgroundColor="{StaticResource Gray100}"
|
||||
HeightRequest="50"/>
|
||||
Stroke="{StaticResource Gray200}"
|
||||
Padding="12,0"
|
||||
HeightRequest="50">
|
||||
<Entry
|
||||
x:Name="UsernameEntry"
|
||||
Placeholder="Введите имя пользователя"
|
||||
PlaceholderColor="{StaticResource Gray400}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="Transparent"
|
||||
VerticalOptions="Center"/>
|
||||
</Border>
|
||||
|
||||
<!-- Пароль -->
|
||||
<Label
|
||||
Text="Пароль"
|
||||
FontSize="14"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray700}"
|
||||
Margin="0,10,0,0"/>
|
||||
|
||||
<Entry
|
||||
x:Name="PasswordEntry"
|
||||
Placeholder="Введите пароль"
|
||||
IsPassword="True"
|
||||
PlaceholderColor="{StaticResource Gray400}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
<Border
|
||||
StrokeShape="RoundRectangle 10"
|
||||
BackgroundColor="{StaticResource Gray100}"
|
||||
HeightRequest="50"/>
|
||||
Stroke="{StaticResource Gray200}"
|
||||
Padding="12,0"
|
||||
HeightRequest="50">
|
||||
<Entry
|
||||
x:Name="PasswordEntry"
|
||||
Placeholder="Введите пароль"
|
||||
IsPassword="True"
|
||||
PlaceholderColor="{StaticResource Gray400}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="Transparent"
|
||||
VerticalOptions="Center"/>
|
||||
</Border>
|
||||
|
||||
<!-- Сообщение об ошибке -->
|
||||
<Label
|
||||
x:Name="ErrorLabel"
|
||||
IsVisible="False"
|
||||
TextColor="Red"
|
||||
FontSize="12"
|
||||
TextColor="{StaticResource Error}"
|
||||
FontSize="13"
|
||||
HorizontalOptions="Center"/>
|
||||
|
||||
<!-- Кнопка входа -->
|
||||
<Button
|
||||
x:Name="LoginButton"
|
||||
Text="Войти"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
TextColor="White"
|
||||
FontSize="16"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="50"
|
||||
CornerRadius="10"
|
||||
Margin="0,20,0,0"
|
||||
Style="{StaticResource PrimaryButton}"
|
||||
Margin="0,15,0,0"
|
||||
Clicked="OnLoginClicked"/>
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
@ -104,7 +116,7 @@
|
||||
HorizontalOptions="Center"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
</Border>
|
||||
|
||||
<!-- Дополнительная информация -->
|
||||
<Label
|
||||
|
||||
@ -3,129 +3,167 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:viewModels="clr-namespace:CORP_MAUI.ViewModels"
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.PostDetailsPage"
|
||||
x:DataType="viewModels:PostDetailsViewModel"
|
||||
Title="Публикация"
|
||||
BackgroundColor="{StaticResource Gray100}">
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Grid>
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Кнопка назад -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
BackgroundColor="Transparent"
|
||||
Stroke="Transparent"
|
||||
HorizontalOptions="Start">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="OnCloseClicked"/>
|
||||
</Border.GestureRecognizers>
|
||||
<Image
|
||||
Source="arrow_back.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Публикация"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Контент -->
|
||||
<CollectionView
|
||||
Grid.Row="1"
|
||||
x:Name="CommentsCollectionView"
|
||||
ItemsSource="{Binding Comments}"
|
||||
SelectionMode="None"
|
||||
Margin="0,0,0,20">
|
||||
BackgroundColor="Transparent">
|
||||
|
||||
<CollectionView.Header>
|
||||
<VerticalStackLayout Spacing="15" Padding="15" BackgroundColor="White">
|
||||
<!-- Заголовок -->
|
||||
<Label Text="{Binding PostViewModel.Post.Title}"
|
||||
FontSize="22"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
Margin="0,20,0,0"/>
|
||||
<VerticalStackLayout>
|
||||
<Border Style="{StaticResource CardBorderLarge}" Margin="10,10,10,5">
|
||||
<VerticalStackLayout Spacing="15">
|
||||
|
||||
<!-- Автор и дата -->
|
||||
<Grid ColumnDefinitions="50,*">
|
||||
<Border Grid.Column="0" Style="{StaticResource AvatarSmall}">
|
||||
<Image Source="{Binding PostViewModel.Post.Author.DisplayAvatarSource}" Aspect="AspectFill"/>
|
||||
</Border>
|
||||
<VerticalStackLayout Grid.Column="1" VerticalOptions="Center" Spacing="2" Margin="10,0,0,0">
|
||||
<Label Text="{Binding PostViewModel.Post.Author.FullName}" Style="{StaticResource CardSubtitle}"/>
|
||||
<Label Text="{Binding PostViewModel.Post.DisplayDate, StringFormat='{0:dd.MM.yyyy HH:mm}'}" Style="{StaticResource CardMeta}"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label Text="{Binding PostViewModel.Post.Title}"
|
||||
Style="{StaticResource CardTitle}"
|
||||
FontSize="20"/>
|
||||
|
||||
<!-- Автор и дата -->
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Label Text="{Binding PostViewModel.Post.Author.FullName}"
|
||||
FontSize="14"
|
||||
TextColor="{StaticResource Primary}"/>
|
||||
<Label Text="{Binding PostViewModel.Post.DisplayDate, StringFormat='{0:dd.MM.yyyy HH:mm}'}"
|
||||
FontSize="14"
|
||||
TextColor="{StaticResource Gray500}"/>
|
||||
</HorizontalStackLayout>
|
||||
<!-- Изображение -->
|
||||
<Image Aspect="AspectFit"
|
||||
MinimumHeightRequest="200"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
Source="{Binding PostViewModel.DisplayImageSource}"
|
||||
IsVisible="{Binding PostViewModel.IsImageVisible}"/>
|
||||
|
||||
<!-- Изображение -->
|
||||
<Image Aspect="AspectFill"
|
||||
HeightRequest="250"
|
||||
BackgroundColor="#F5F5F5"
|
||||
Source="{Binding PostViewModel.DisplayImageSource}"
|
||||
IsVisible="{Binding PostViewModel.IsImageVisible}"/>
|
||||
|
||||
<!-- Полный текст (Content) -->
|
||||
<!-- Используем Post.Content напрямую, так как ViewModel.PreviewContent обрезан -->
|
||||
<Label Text="{Binding PostViewModel.Post.Content}"
|
||||
FontSize="16"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
LineHeight="1.2"/>
|
||||
|
||||
<!-- Статистика -->
|
||||
<HorizontalStackLayout Spacing="20" Margin="0,10,0,0">
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Label Text="❤️" />
|
||||
<Label Text="{Binding PostViewModel.Post.LikesCount}"
|
||||
TextColor="{StaticResource Gray600}"/>
|
||||
</HorizontalStackLayout>
|
||||
<!-- Полный текст -->
|
||||
<Label Text="{Binding PostViewModel.Post.Content}"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="15"
|
||||
LineHeight="1.3"/>
|
||||
|
||||
<!-- Статистика -->
|
||||
<HorizontalStackLayout Spacing="20" Margin="0,5,0,0">
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Image Source="like.png" WidthRequest="18" HeightRequest="18" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label Text="{Binding PostViewModel.Post.LikesCount}" Style="{StaticResource CardMeta}" VerticalOptions="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Image Source="messages.png" WidthRequest="18" HeightRequest="18" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label Text="{Binding PostViewModel.Post.CommentsCount}" Style="{StaticResource CardMeta}" VerticalOptions="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Label Text="💬" />
|
||||
<Label Text="{Binding PostViewModel.Post.CommentsCount}"
|
||||
TextColor="{StaticResource Gray600}"/>
|
||||
</HorizontalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<BoxView HeightRequest="1" Color="{StaticResource Gray200}" Margin="0,10" />
|
||||
|
||||
<Label Text="Комментарии" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource Gray900}"/>
|
||||
|
||||
<!-- Индикатор загрузки комментариев -->
|
||||
<ActivityIndicator IsRunning="{Binding IsLoadingComments}"
|
||||
IsVisible="{Binding IsLoadingComments}"
|
||||
Color="{StaticResource Primary}"
|
||||
HorizontalOptions="Center"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.Header>
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Padding="20" Spacing="10" IsVisible="{Binding IsNotLoadingComments}">
|
||||
<Label Text="Нет комментариев"
|
||||
HorizontalOptions="Center"
|
||||
TextColor="{StaticResource Gray500}"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.EmptyView>
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Comment">
|
||||
<Border
|
||||
Padding="10"
|
||||
Margin="15,5"
|
||||
StrokeShape="RoundRectangle 8"
|
||||
BackgroundColor="White"
|
||||
StrokeThickness="0">
|
||||
<!-- Заголовок комментариев -->
|
||||
<Label Text="Комментарии" Style="{StaticResource SectionTitle}" Margin="15,15,15,5"/>
|
||||
|
||||
<VerticalStackLayout Spacing="5">
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Label Text="{Binding Author.FullName}"
|
||||
FontSize="13"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
<Label Text="{Binding DisplayDate, StringFormat='{0:dd.MM.yyyy HH:mm}'}"
|
||||
FontSize="11"
|
||||
TextColor="{StaticResource Gray500}"
|
||||
VerticalOptions="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
<!-- Индикатор загрузки комментариев -->
|
||||
<ActivityIndicator IsRunning="{Binding IsLoadingComments}"
|
||||
IsVisible="{Binding IsLoadingComments}"
|
||||
Color="{StaticResource Primary}"
|
||||
HorizontalOptions="Center"
|
||||
Margin="0,10"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.Header>
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Padding="20" Spacing="10" IsVisible="{Binding IsNotLoadingComments}">
|
||||
<Label Text="Нет комментариев"
|
||||
HorizontalOptions="Center"
|
||||
Style="{StaticResource EmptyStateTitle}"/>
|
||||
</VerticalStackLayout>
|
||||
</CollectionView.EmptyView>
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Comment">
|
||||
<Border
|
||||
Style="{StaticResource CardBorder}"
|
||||
Margin="10,5">
|
||||
|
||||
<Label Text="{Binding DisplayContent}"
|
||||
FontSize="14"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
<Button Text="✕"
|
||||
FontSize="20"
|
||||
FontAttributes="Bold"
|
||||
BackgroundColor="#80FFFFFF"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="End"
|
||||
VerticalOptions="Start"
|
||||
Margin="15"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
CornerRadius="20"
|
||||
Padding="0"
|
||||
Clicked="OnCloseClicked"/>
|
||||
<VerticalStackLayout Spacing="8">
|
||||
<Grid ColumnDefinitions="35,*">
|
||||
<Border Grid.Column="0" Style="{StaticResource AvatarSmall}" WidthRequest="35" HeightRequest="35">
|
||||
<Image Source="{Binding Author.DisplayAvatarSource}" Aspect="AspectFill"/>
|
||||
</Border>
|
||||
<VerticalStackLayout Grid.Column="1" VerticalOptions="Center" Spacing="2" Margin="8,0,0,0">
|
||||
<Label Text="{Binding Author.FullName}" Style="{StaticResource CardSubtitle}" FontSize="13"/>
|
||||
<Label Text="{Binding DisplayDate, StringFormat='{0:dd.MM.yyyy HH:mm}'}" Style="{StaticResource CardMeta}" FontSize="11"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
|
||||
<Label Text="{Binding DisplayContent}" Style="{StaticResource CardText}"/>
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
||||
|
||||
@ -182,7 +182,7 @@
|
||||
<!-- Изображение поста -->
|
||||
<Image
|
||||
Aspect="AspectFill"
|
||||
HeightRequest="180"
|
||||
MinimumHeightRequest="300"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
Source="{Binding DisplayImageSource}"
|
||||
IsVisible="{Binding IsImageVisible}"/>
|
||||
@ -219,7 +219,11 @@
|
||||
Source="like.png"
|
||||
WidthRequest="18"
|
||||
HeightRequest="18"
|
||||
VerticalOptions="Center"/>
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label
|
||||
Text="{Binding Post.LikesCount}"
|
||||
Style="{StaticResource CardMeta}"
|
||||
@ -232,7 +236,11 @@
|
||||
Source="messages.png"
|
||||
WidthRequest="18"
|
||||
HeightRequest="18"
|
||||
VerticalOptions="Center"/>
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label
|
||||
Text="{Binding Post.CommentsCount}"
|
||||
Style="{StaticResource CardMeta}"
|
||||
|
||||
@ -3,146 +3,180 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:viewModels="clr-namespace:CORP_MAUI.ViewModels"
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.ProfilePage"
|
||||
x:DataType="viewModels:ProfileViewModel"
|
||||
Title="Профиль">
|
||||
Title="Профиль"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="20" Spacing="20">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<ActivityIndicator IsRunning="{Binding IsLoading}"
|
||||
IsVisible="{Binding IsLoading}"
|
||||
Color="{StaticResource Primary}"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<!-- Аватар и имя -->
|
||||
<Frame
|
||||
Padding="20"
|
||||
CornerRadius="15"
|
||||
BackgroundColor="White"
|
||||
HasShadow="True">
|
||||
<!-- Пустое место слева -->
|
||||
<BoxView Grid.Column="0" Color="Transparent"/>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Мой профиль"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Иконка настроек -->
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
WidthRequest="40"
|
||||
HeightRequest="40"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
BackgroundColor="Transparent"
|
||||
Stroke="Transparent"
|
||||
HorizontalOptions="End">
|
||||
<Image
|
||||
Source="settings.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- Контент -->
|
||||
<ScrollView Grid.Row="1">
|
||||
<VerticalStackLayout Padding="15" Spacing="15">
|
||||
|
||||
<VerticalStackLayout Spacing="15">
|
||||
<Frame
|
||||
WidthRequest="100"
|
||||
HeightRequest="100"
|
||||
CornerRadius="25"
|
||||
Padding="0"
|
||||
IsClippedToBounds="True"
|
||||
HasShadow="False"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
HorizontalOptions="Center">
|
||||
<Image
|
||||
Source="{Binding DisplayImageSource}"
|
||||
Aspect="AspectFill"/>
|
||||
</Frame>
|
||||
<ActivityIndicator
|
||||
IsRunning="{Binding IsLoading}"
|
||||
IsVisible="{Binding IsLoading}"
|
||||
Color="{StaticResource Primary}"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<Label
|
||||
Text="{Binding FullName}"
|
||||
FontSize="24"
|
||||
FontAttributes="Bold"
|
||||
HorizontalOptions="Center"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
<!-- Аватар и имя -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="15" HorizontalOptions="Center">
|
||||
|
||||
<!-- Аватар -->
|
||||
<Border Style="{StaticResource AvatarXLarge}">
|
||||
<Image
|
||||
Source="{Binding DisplayImageSource}"
|
||||
Aspect="AspectFill"/>
|
||||
</Border>
|
||||
|
||||
<Label
|
||||
Text="{Binding Username}"
|
||||
FontSize="16"
|
||||
HorizontalOptions="Center"
|
||||
TextColor="{StaticResource Gray600}"/>
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
<!-- Имя -->
|
||||
<Label
|
||||
Text="{Binding FullName}"
|
||||
Style="{StaticResource PageTitle}"/>
|
||||
|
||||
<!-- Должность -->
|
||||
<Label
|
||||
Text="{Binding Position}"
|
||||
Style="{StaticResource CardText}"
|
||||
FontSize="16"
|
||||
HorizontalOptions="Center"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Информация о пользователе -->
|
||||
<Frame
|
||||
Padding="20"
|
||||
CornerRadius="15"
|
||||
BackgroundColor="White"
|
||||
HasShadow="True">
|
||||
|
||||
<VerticalStackLayout Spacing="15">
|
||||
<Label
|
||||
Text="Информация"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
<!-- Информация о пользователе -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="15">
|
||||
|
||||
<Label
|
||||
Text="Информация"
|
||||
Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto,Auto" RowSpacing="10">
|
||||
<Label Grid.Row="0" Grid.Column="0" Text="Email:" FontAttributes="Bold" TextColor="{StaticResource Gray700}"/>
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Email}" TextColor="{StaticResource Gray600}" Margin="10,0,0,0"/>
|
||||
<!-- Email -->
|
||||
<Grid ColumnDefinitions="Auto,*" RowSpacing="12">
|
||||
<HorizontalStackLayout Grid.Row="0" Grid.Column="0" Spacing="8">
|
||||
<Image Source="email.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label Text="Email" Style="{StaticResource CardText}" FontAttributes="Bold" VerticalOptions="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Email}" Style="{StaticResource CardText}" HorizontalOptions="End" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
|
||||
<BoxView HeightRequest="1" Color="{StaticResource Gray200}"/>
|
||||
|
||||
<!-- Отдел -->
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<HorizontalStackLayout Grid.Column="0" Spacing="8">
|
||||
<Image Source="departments.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label Text="Отдел" Style="{StaticResource CardText}" FontAttributes="Bold" VerticalOptions="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
<Label Grid.Column="1" Text="{Binding Department}" Style="{StaticResource CardText}" HorizontalOptions="End" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Text="Должность:" FontAttributes="Bold" TextColor="{StaticResource Gray700}"/>
|
||||
<Label Grid.Row="1" Grid.Column="1" Text="{Binding Position}" TextColor="{StaticResource Gray600}" Margin="10,0,0,0"/>
|
||||
<!-- Навыки -->
|
||||
<Border Style="{StaticResource CardBorderLarge}" IsVisible="{Binding HasSkills}">
|
||||
<VerticalStackLayout Spacing="12">
|
||||
|
||||
<Label Text="Навыки" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="0" Text="Отдел:" FontAttributes="Bold" TextColor="{StaticResource Gray700}"/>
|
||||
<Label Grid.Row="2" Grid.Column="1" Text="{Binding Department}" TextColor="{StaticResource Gray600}" Margin="10,0,0,0"/>
|
||||
<FlexLayout BindableLayout.ItemsSource="{Binding Skills}" Wrap="Wrap" AlignItems="Center" AlignContent="Start">
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Skill">
|
||||
<Border
|
||||
Padding="12,6"
|
||||
Margin="0,0,8,8"
|
||||
StrokeShape="RoundRectangle 15"
|
||||
BackgroundColor="{StaticResource Gray200}"
|
||||
Stroke="Transparent">
|
||||
<Label Text="{Binding Name}" TextColor="{StaticResource Gray700}" FontSize="14"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
</FlexLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0" Text="Статус:" FontAttributes="Bold" TextColor="{StaticResource Gray700}"/>
|
||||
<Label Grid.Row="3" Grid.Column="1" Text="{Binding StatusText}" TextColor="{Binding StatusColor}" Margin="10,0,0,0"/>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
<!-- Действия -->
|
||||
<Border Style="{StaticResource CardBorderLarge}">
|
||||
<VerticalStackLayout Spacing="12">
|
||||
|
||||
<Label Text="Настройки" Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<!-- Навыки -->
|
||||
<Frame
|
||||
Padding="20"
|
||||
CornerRadius="15"
|
||||
BackgroundColor="White"
|
||||
HasShadow="True"
|
||||
IsVisible="{Binding HasSkills}">
|
||||
|
||||
<VerticalStackLayout Spacing="10">
|
||||
<Label
|
||||
Text="Навыки"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"/>
|
||||
<Button
|
||||
Text="Обновить профиль"
|
||||
Style="{StaticResource PrimaryButton}"
|
||||
Command="{Binding LoadProfileCommand}"/>
|
||||
|
||||
<FlexLayout BindableLayout.ItemsSource="{Binding Skills}" Wrap="Wrap" AlignItems="Center" AlignContent="Start">
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Skill">
|
||||
<Frame Padding="10,5" CornerRadius="10" BackgroundColor="{StaticResource Gray100}" HasShadow="False" Margin="0,0,5,5">
|
||||
<Label Text="{Binding Name}" TextColor="{StaticResource Gray800}" FontSize="14"/>
|
||||
</Frame>
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
</FlexLayout>
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
<Button
|
||||
Text="Выйти"
|
||||
BackgroundColor="{StaticResource Error}"
|
||||
TextColor="White"
|
||||
FontSize="16"
|
||||
FontAttributes="Bold"
|
||||
CornerRadius="10"
|
||||
HeightRequest="50"
|
||||
Command="{Binding LogoutCommand}"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Действия -->
|
||||
<Frame
|
||||
Padding="20"
|
||||
CornerRadius="15"
|
||||
BackgroundColor="White"
|
||||
HasShadow="True">
|
||||
|
||||
<VerticalStackLayout Spacing="10">
|
||||
<Label
|
||||
Text="Настройки"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<Button
|
||||
Text="Обновить профиль"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
TextColor="White"
|
||||
CornerRadius="10"
|
||||
HeightRequest="45"
|
||||
Command="{Binding LoadProfileCommand}"/>
|
||||
|
||||
<Button
|
||||
Text="Выйти"
|
||||
BackgroundColor="{StaticResource Error}"
|
||||
TextColor="White"
|
||||
CornerRadius="10"
|
||||
HeightRequest="45"
|
||||
Command="{Binding LogoutCommand}"/>
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
|
||||
|
||||
@ -2,29 +2,92 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="CORP_MAUI.Pages.RequestsPage"
|
||||
Title="Заявления">
|
||||
Title="Заявления"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,*">
|
||||
|
||||
<!-- Поиск -->
|
||||
<Border
|
||||
<!-- Шапка -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource SearchContainerBorder}">
|
||||
<SearchBar
|
||||
x:Name="SearchBar"
|
||||
Placeholder="Поиск заявлений..."
|
||||
Style="{StaticResource AppSearchBar}"
|
||||
TextChanged="OnSearchTextChanged"/>
|
||||
</Border>
|
||||
ColumnDefinitions="50,*,50"
|
||||
Padding="15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Пустое место слева -->
|
||||
<BoxView Grid.Column="0" Color="Transparent"/>
|
||||
|
||||
<!-- Заголовок -->
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="Заявления"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
|
||||
<!-- Пустое место справа -->
|
||||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Поиск с серым фоном -->
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
Padding="15,5,15,10"
|
||||
BackgroundColor="#E5E5E5">
|
||||
|
||||
<!-- Круглая кнопка поиска -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
WidthRequest="45"
|
||||
HeightRequest="45"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Primary}"
|
||||
Stroke="Transparent"
|
||||
Margin="0,0,10,0">
|
||||
<Image
|
||||
Source="search.png"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
</Border>
|
||||
|
||||
<!-- Поле поиска с серым фоном -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
StrokeShape="RoundRectangle 22.5"
|
||||
BackgroundColor="{StaticResource Gray300}"
|
||||
Stroke="Transparent"
|
||||
HeightRequest="45"
|
||||
Padding="15,0">
|
||||
<Entry
|
||||
x:Name="SearchEntry"
|
||||
Placeholder="Поиск заявлений..."
|
||||
PlaceholderColor="{StaticResource Gray500}"
|
||||
TextColor="{StaticResource Gray900}"
|
||||
BackgroundColor="Transparent"
|
||||
VerticalOptions="Center"
|
||||
TextChanged="OnSearchTextChanged"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- Фильтры по статусу -->
|
||||
<ScrollView
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
HorizontalScrollBarVisibility="Never">
|
||||
HorizontalScrollBarVisibility="Never"
|
||||
BackgroundColor="#E5E5E5">
|
||||
<HorizontalStackLayout
|
||||
Padding="15,10"
|
||||
Padding="15,5,15,15"
|
||||
Spacing="10"
|
||||
x:Name="FilterButtons">
|
||||
|
||||
@ -69,7 +132,7 @@
|
||||
|
||||
<!-- Список заявлений -->
|
||||
<RefreshView
|
||||
Grid.Row="2"
|
||||
Grid.Row="3"
|
||||
x:Name="RefreshView"
|
||||
IsRefreshing="False"
|
||||
Refreshing="OnRefreshing">
|
||||
@ -77,7 +140,8 @@
|
||||
<CollectionView
|
||||
x:Name="RequestsCollectionView"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnRequestSelected">
|
||||
SelectionChanged="OnRequestSelected"
|
||||
BackgroundColor="Transparent">
|
||||
|
||||
<CollectionView.EmptyView>
|
||||
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
|
||||
@ -94,7 +158,10 @@
|
||||
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:Request">
|
||||
<Border Style="{StaticResource CardBorder}" StrokeShape="RoundRectangle 12">
|
||||
<Border
|
||||
Style="{StaticResource CardBorder}"
|
||||
Margin="10,5"
|
||||
StrokeShape="RoundRectangle 12">
|
||||
|
||||
<Grid ColumnDefinitions="50,*,Auto" RowDefinitions="Auto,Auto,Auto">
|
||||
|
||||
@ -178,7 +245,7 @@
|
||||
|
||||
<!-- Индикатор загрузки -->
|
||||
<ActivityIndicator
|
||||
Grid.Row="2"
|
||||
Grid.Row="3"
|
||||
x:Name="LoadingIndicator"
|
||||
IsRunning="False"
|
||||
IsVisible="False"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:usesCleartextTraffic="true"></application>
|
||||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:usesCleartextTraffic="true" android:networkSecurityConfig="@xml/network_security_config"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true">
|
||||
<trust-anchors>
|
||||
<certificates src="system"/>
|
||||
<certificates src="user"/>
|
||||
</trust-anchors>
|
||||
</base-config>
|
||||
<domain-config cleartextTrafficPermitted="false">
|
||||
<domain includeSubdomains="true">corp.robotail.pro</domain>
|
||||
<trust-anchors>
|
||||
<certificates src="system"/>
|
||||
</trust-anchors>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
|
||||
@ -47,6 +47,19 @@ public class ApiService : IDisposable
|
||||
|
||||
public bool IsAuthenticated => !string.IsNullOrEmpty(_accessToken);
|
||||
|
||||
/// <summary>
|
||||
/// Создаёт платформенно-специфичный HttpMessageHandler
|
||||
/// </summary>
|
||||
private static HttpMessageHandler CreatePlatformHandler()
|
||||
{
|
||||
// Используем стандартны<D0BD><D18B> HttpClientHandler с отключённой проверкой сертификатов для отладки
|
||||
// В продакшене следует убрать ServerCertificateCustomValidationCallback
|
||||
return new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Получить текущий access токен (для WebSocket и других сервисов)
|
||||
/// </summary>
|
||||
@ -64,7 +77,9 @@ public class ApiService : IDisposable
|
||||
Trace.WriteLine($"[ApiService] TokenObtainPath: {_config.TokenObtainPath}");
|
||||
Trace.WriteLine($"[ApiService] TokenRefreshPath: {_config.TokenRefreshPath}");
|
||||
|
||||
_httpClient = new HttpClient
|
||||
// Создаём HttpClient с платформенным хэндлером для корректной работы на Android
|
||||
HttpMessageHandler handler = CreatePlatformHandler();
|
||||
_httpClient = new HttpClient(handler)
|
||||
{
|
||||
BaseAddress = new Uri(_config.BaseUrl),
|
||||
Timeout = TimeSpan.FromSeconds(_config.Timeout)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user