Files
Better-Seewo/Manager/Pages/ActivatePage.xaml

464 lines
26 KiB
Plaintext
Raw Normal View History

<Page x:Class="Better_Seewo.Manager.Pages.ActivatePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="900"
FontFamily="Microsoft YaHei UI"
Title="激活管理">
<!-- 页面资源字典 -->
<Page.Resources>
<CubicEase x:Key="CubicEase" EasingMode="EaseOut"/>
<QuadraticEase x:Key="QuadraticEase" EasingMode="EaseOut"/>
<!-- 激活按钮样式 -->
<Style x:Key="ActivateButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="40,12"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="btnBorder"
Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="{TemplateBinding Padding}"
RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<ScaleTransform ScaleX="1.0" ScaleY="1.0"/>
</Border.RenderTransform>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="btnBorder"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleX)"
To="1.04" Duration="0:0:0.150"
EasingFunction="{StaticResource CubicEase}"/>
<DoubleAnimation Storyboard.TargetName="btnBorder"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)"
To="1.04" Duration="0:0:0.150"
EasingFunction="{StaticResource CubicEase}"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="btnBorder"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleX)"
To="1.0" Duration="0:0:0.150"
EasingFunction="{StaticResource CubicEase}"/>
<DoubleAnimation Storyboard.TargetName="btnBorder"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)"
To="1.0" Duration="0:0:0.150"
EasingFunction="{StaticResource CubicEase}"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="btnBorder" Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 次要按钮样式 -->
<Style x:Key="SecondaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Padding" Value="24,10"/>
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="btnBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="6"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="btnBorder" Property="BorderBrush"
Value="{DynamicResource AccentBrush}"/>
<Setter TargetName="btnBorder" Property="Foreground"
Value="{DynamicResource AccentBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 输入框聚焦发光样式 -->
<Style x:Key="ActivationInputStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="14,12"/>
</Style>
</Page.Resources>
<!-- 主背景 -->
<Grid Background="{DynamicResource BackgroundBrush}">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="40,30,40,40">
<!-- ====== 顶部标题区域 ====== -->
<StackPanel Margin="0,0,0,25">
<TextBlock Text="激活管理"
FontSize="28"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"/>
<TextBlock Text="管理 Better-Seewo 许可证"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
Margin="0,4,0,0"/>
</StackPanel>
<!-- ====== 未激活状态:激活码输入界面 ====== -->
<StackPanel x:Name="PanelNotActivated">
<Border Background="{DynamicResource CardBackgroundBrush}"
CornerRadius="12"
Padding="30"
Margin="0,0,0,20"
HorizontalAlignment="Center"
MaxWidth="550">
<StackPanel>
<!-- 标题 -->
<TextBlock Text="输入激活码"
FontSize="20"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
HorizontalAlignment="Center"
Margin="0,0,0,6"/>
<TextBlock Text="请输入您的许可证激活码以激活 Better-Seewo"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Center"
Margin="0,0,0,24"/>
<!-- 激活码输入框(带聚焦发光效果) -->
<Border x:Name="ActivationInputBorder"
Style="{StaticResource ActivationInputStyle}"
Margin="0,0,0,16">
<TextBox x:Name="ActivationCodeInput"
BorderThickness="0"
Background="Transparent"
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"
CaretBrush="{DynamicResource AccentBrush}"
TextWrapping="Wrap"
AcceptsReturn="False"
MaxHeight="100"
VerticalScrollBarVisibility="Auto"
GotFocus="ActivationCodeInput_GotFocus"
LostFocus="ActivationCodeInput_LostFocus"/>
</Border>
<!-- 激活按钮 -->
<Button x:Name="BtnActivate"
Content="激活"
Style="{StaticResource ActivateButtonStyle}"
HorizontalAlignment="Center"
Click="BtnActivate_Click"/>
<!-- 分隔线 + 或 -->
<Grid Margin="0,24,0,24">
<Separator Background="{DynamicResource BorderBrush}" VerticalAlignment="Center"/>
<Border Background="{DynamicResource CardBackgroundBrush}"
Padding="16,0"
HorizontalAlignment="Center">
<TextBlock Text="或"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
FontWeight="Medium"/>
</Border>
</Grid>
<!-- 导入许可证文件按钮 -->
<Button x:Name="BtnImportLicense"
Content="导入许可证文件"
Style="{StaticResource SecondaryButtonStyle}"
HorizontalAlignment="Center"
Click="BtnImportLicense_Click"/>
<!-- 错误提示区域 -->
<Border x:Name="ErrorPanel"
Background="#FFFDEDED"
CornerRadius="8"
Padding="14"
Margin="0,16,0,0"
Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<TextBlock Text="!"
FontSize="14"
FontWeight="Bold"
Foreground="#FFD32F2F"
VerticalAlignment="Center"
Margin="0,0,8,0"/>
<TextBlock x:Name="ErrorText"
Text="激活码无效"
FontSize="13"
Foreground="#FFD32F2F"
TextWrapping="Wrap"
VerticalAlignment="Center"/>
</StackPanel>
</Border>
</StackPanel>
</Border>
</StackPanel>
<!-- ====== 已激活状态:许可证信息界面 ====== -->
<StackPanel x:Name="PanelActivated" Visibility="Collapsed">
<!-- 激活成功庆祝图标(默认隐藏,激活成功后弹出) -->
<StackPanel x:Name="CelebrationPanel"
HorizontalAlignment="Center"
Margin="0,0,0,20"
Visibility="Collapsed">
<!-- 绿色勾号庆祝动画 -->
<Grid Width="80" Height="80"
RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<ScaleTransform ScaleX="0" ScaleY="0"/>
</Grid.RenderTransform>
<!-- 外圈 -->
<Ellipse Fill="#4CAF50" Opacity="0.15"/>
<!-- 内圈 -->
<Ellipse Width="60" Height="60"
Fill="#4CAF50" Opacity="0.2"/>
<!-- 勾号 -->
<Path Data="M20,42 L35,55 L60,25"
Stroke="#4CAF50"
StrokeThickness="4"
StrokeLineCap="Round"
StrokeLineJoin="Round"
Fill="Transparent"
Stretch="Uniform"/>
</Grid>
<TextBlock Text="激活成功"
FontSize="16"
FontWeight="SemiBold"
Foreground="#4CAF50"
HorizontalAlignment="Center"
Margin="0,8,0,0"/>
</StackPanel>
<!-- 许可证信息卡片 -->
<Border Background="{DynamicResource CardBackgroundBrush}"
CornerRadius="12"
Padding="28"
Margin="0,0,0,20"
MaxWidth="580">
<StackPanel>
<!-- 许可证标题 -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,20">
<Border Background="#4CAF50"
CornerRadius="4"
Padding="8,4"
Margin="0,0,10,0">
<TextBlock Text="已激活"
FontSize="12"
FontWeight="Bold"
Foreground="White"/>
</Border>
<TextBlock Text="许可证信息"
FontSize="18"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
VerticalAlignment="Center"/>
</StackPanel>
<!-- 许可证类型 -->
<Grid Margin="0,0,0,14">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="许可证类型"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center"/>
<Border Grid.Column="1"
Background="{DynamicResource BackgroundBrush}"
CornerRadius="6"
Padding="10,8">
<TextBlock x:Name="LicenseTypeText"
Text="个人版"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource AccentBrush}"/>
</Border>
</Grid>
<!-- 激活日期 -->
<Grid Margin="0,0,0,14">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="激活日期"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center"/>
<Border Grid.Column="1"
Background="{DynamicResource BackgroundBrush}"
CornerRadius="6"
Padding="10,8">
<TextBlock x:Name="ActivateDateText"
Text="2024-01-01"
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"/>
</Border>
</Grid>
<!-- 到期日期 -->
<Grid Margin="0,0,0,14">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="到期日期"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center"/>
<Border Grid.Column="1"
Background="{DynamicResource BackgroundBrush}"
CornerRadius="6"
Padding="10,8">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="ExpiryDateText"
Text="2026-01-01"
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"/>
<Border Background="#4CAF50"
CornerRadius="3"
Padding="6,2"
Margin="10,0,0,0">
<TextBlock Text="有效"
FontSize="11"
FontWeight="Bold"
Foreground="White"/>
</Border>
</StackPanel>
</Border>
</Grid>
<!-- 设备信息 -->
<Grid Margin="0,0,0,14">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="设备信息"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center"/>
<Border Grid.Column="1"
Background="{DynamicResource BackgroundBrush}"
CornerRadius="6"
Padding="10,8">
<TextBlock x:Name="DeviceInfoText"
Text="当前设备已绑定"
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"/>
</Border>
</Grid>
<!-- 许可证状态 -->
<Grid Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="许可证状态"
FontSize="13"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center"/>
<Border Grid.Column="1"
Background="{DynamicResource BackgroundBrush}"
CornerRadius="6"
Padding="10,8">
<StackPanel Orientation="Horizontal">
<!-- 绿色状态点 -->
<Ellipse Width="10" Height="10"
Fill="#4CAF50"
Margin="0,0,8,0"
VerticalAlignment="Center"/>
<TextBlock Text="已激活"
FontSize="14"
FontWeight="SemiBold"
Foreground="#4CAF50"
VerticalAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 操作按钮区域 -->
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
Margin="0,0,0,20">
<Button x:Name="BtnRenew"
Content="续费"
Style="{StaticResource SecondaryButtonStyle}"
Click="BtnRenew_Click"/>
<Button x:Name="BtnDeactivate"
Content="取消激活"
Margin="10,0,0,0"
Style="{StaticResource SecondaryButtonStyle}"
Click="BtnDeactivate_Click"/>
</StackPanel>
</StackPanel>
<!-- ====== 底部版权信息 ====== -->
<Border Background="{DynamicResource CardBackgroundBrush}"
CornerRadius="10"
Padding="16"
Margin="0,10,0,0">
<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Better-Seewo"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
HorizontalAlignment="Center"/>
<TextBlock Text="雾生万象,启以为光"
FontSize="11"
Foreground="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Center"
Margin="0,4,0,0"/>
<TextBlock Text="© 2024-2026 雾启工作室"
FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Center"
Margin="0,6,0,0"/>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>