feat: 优化UI

This commit is contained in:
GukSang.Jin
2026-02-26 17:10:29 +08:00
parent 779162d064
commit 1e37d8056e
7 changed files with 123 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -20,6 +20,7 @@
<Resource Include="Images\dog.png" />
<Resource Include="Images\dog1.png" />
<Resource Include="Images\dog2.png" />
<Resource Include="Images\kef.png" />
<Resource Include="Images\liuc.png" />
<Resource Include="Images\qrcode.png" />
</ItemGroup>

View File

@@ -88,6 +88,9 @@ public partial class MainViewModel : ObservableObject
[ObservableProperty]
private bool _isInstructionDialogOpen;
[ObservableProperty]
private bool _isCustomerServiceDialogOpen;
private readonly System.Timers.Timer _carouselTimer;
private readonly System.Timers.Timer _clockTimer;
private readonly string[] _carouselImages = { "/Images/dog.png", "/Images/dog1.png", "/Images/dog2.png" };
@@ -220,6 +223,20 @@ public partial class MainViewModel : ObservableObject
_logger.LogInfo("关闭使用说明");
}
[RelayCommand]
private void ShowCustomerService()
{
IsCustomerServiceDialogOpen = true;
_logger.LogInfo("显示联系客服");
}
[RelayCommand]
private void CloseCustomerService()
{
IsCustomerServiceDialogOpen = false;
_logger.LogInfo("关闭联系客服");
}
[RelayCommand]
private void BackToIdle()
{

View File

@@ -561,7 +561,8 @@
<Button Content="📞 联系客服"
Height="70"
Margin="5"
Style="{StaticResource RoundButton}"/>
Style="{StaticResource RoundButton}"
Command="{Binding ShowCustomerServiceCommand}"/>
<Button Content="⚙ 设置"
Height="70"
Margin="5"
@@ -1635,7 +1636,7 @@
<Border Background="White"
CornerRadius="20"
MaxWidth="1000"
MaxHeight="800"
MaxHeight="700"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center">
@@ -1730,5 +1731,107 @@
</Grid>
</Border>
</Grid>
<!-- 联系客服弹窗 -->
<Grid Visibility="{Binding IsCustomerServiceDialogOpen, Converter={StaticResource BoolToVisibilityConverter}}"
Background="#80000000">
<Border Background="White"
CornerRadius="20"
MaxWidth="800"
MaxHeight="600"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect Color="#000000" BlurRadius="30" ShadowDepth="10" Opacity="0.5"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 标题栏 -->
<Border Grid.Row="0"
Background="#FF6F00"
CornerRadius="20,20,0,0"
Padding="30,20">
<Grid>
<TextBlock Text="联系客服"
FontSize="28"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<Button Content="✕"
FontSize="24"
Width="40"
Height="40"
Background="Transparent"
Foreground="White"
BorderThickness="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Cursor="Hand"
Command="{Binding CloseCustomerServiceCommand}">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="20">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Border>
<!-- 图片内容区 -->
<Border Grid.Row="1"
Padding="20"
Background="White"
MinHeight="400">
<Grid>
<!-- 图片 -->
<Image x:Name="CustomerServiceImage"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center"
RenderOptions.BitmapScalingMode="HighQuality">
<Image.Source>
<BitmapImage UriSource="/Images/kef.png"
CacheOption="OnLoad"
CreateOptions="IgnoreColorProfile"/>
</Image.Source>
</Image>
<!-- 加载失败时的提示 -->
<TextBlock Text="客服联系方式"
FontSize="24"
Foreground="#999"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Visibility="Collapsed"/>
</Grid>
</Border>
<!-- 底部按钮 -->
<Border Grid.Row="2"
Padding="30,20"
Background="White"
CornerRadius="0,0,20,20">
<Button Content="关闭"
Height="50"
Width="200"
FontSize="20"
FontWeight="Bold"
Style="{StaticResource RoundButton}"
Command="{Binding CloseCustomerServiceCommand}"/>
</Border>
</Grid>
</Border>
</Grid>
</Grid>
</Window>