Browse Source

充值端界面调整

Lishi
xxe 2 years ago
parent
commit
b343d01411
4 changed files with 30 additions and 37 deletions
  1. +6
    -0
      HKCardIN/Helper/DataBus.cs
  2. +2
    -13
      HKCardIN/ViewModels/RootViewModel.cs
  3. +21
    -23
      HKCardIN/Views/RootView.xaml
  4. +1
    -1
      HKCardIN/Views/RootView.xaml.cs

+ 6
- 0
HKCardIN/Helper/DataBus.cs View File

@@ -18,7 +18,13 @@ namespace HKCardIN.Helper
} }
public class ApiRoute public class ApiRoute
{ {
/// <summary>
/// 拉取用户和卡信息
/// </summary>
public static string PullUserAndCardInfo = DataBus.SaasRoute + ""; public static string PullUserAndCardInfo = DataBus.SaasRoute + "";
/// <summary>
/// 推送充值到服务器
/// </summary>
public static string PushMoneyToServer = DataBus.SaasRoute + ""; public static string PushMoneyToServer = DataBus.SaasRoute + "";
} }
} }

+ 2
- 13
HKCardIN/ViewModels/RootViewModel.cs View File

@@ -36,12 +36,6 @@ namespace HKCardIN.ViewModels
get => _CodeVisible; get => _CodeVisible;
set => SetAndNotify(ref _CodeVisible, value); set => SetAndNotify(ref _CodeVisible, value);
} }
string _LockCode;
public string LockCode
{
get => _LockCode;
set => SetAndNotify(ref _LockCode, value);
}
string _InputMoney; string _InputMoney;
public string InputMoney public string InputMoney
{ {
@@ -67,20 +61,15 @@ namespace HKCardIN.ViewModels
ContentVisible = Visibility.Collapsed; ContentVisible = Visibility.Collapsed;
CodeVisible = Visibility.Visible; CodeVisible = Visibility.Visible;
} }
public void UnLockAction()
public void UnLockAction(HandyControl.Controls.PasswordBox input)
{ {
if (LockCode.Equals(DataBus.LockCode))
if (input.Password.Equals(DataBus.LockCode))
{ {
IsLocker = false; IsLocker = false;
CodeVisible = Visibility.Collapsed; CodeVisible = Visibility.Collapsed;
ContentVisible = Visibility.Visible; ContentVisible = Visibility.Visible;
LockCode = string.Empty;
} }
} }
public void ResetAction()
{
LockCode = string.Empty;
}
public void SaveAction() public void SaveAction()
{ {
if (!DataBus.NetWordState) if (!DataBus.NetWordState)


+ 21
- 23
HKCardIN/Views/RootView.xaml View File

@@ -1,4 +1,4 @@
<hc:Window
<Window
x:Class="HKCardIN.Views.RootView" x:Class="HKCardIN.Views.RootView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -13,11 +13,9 @@
Width="800" Width="800"
Height="420" Height="420"
d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}" d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}"
ShowMaxButton="False"
ShowTitle="True"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<hc:Window.Resources>
mc:Ignorable="d" ResizeMode="CanMinimize">
<Window.Resources>
<Style <Style
x:Key="充值" x:Key="充值"
BasedOn="{StaticResource ButtonDefault}" BasedOn="{StaticResource ButtonDefault}"
@@ -44,11 +42,15 @@
TargetType="TextBlock"> TargetType="TextBlock">
<Setter Property="Foreground" Value="WhiteSmoke" /> <Setter Property="Foreground" Value="WhiteSmoke" />
</Style> </Style>
</hc:Window.Resources>
<hc:Window.Background>
</Window.Resources>
<Window.Background>
<ImageBrush ImageSource="/HKResouces/背景.jpg" /> <ImageBrush ImageSource="/HKResouces/背景.jpg" />
</hc:Window.Background>
<hc:Window.InputBindings>
</Window.Background>
<Window.InputBindings>
<KeyBinding
Key="E"
Command="{s:Action UnLockAction}"
CommandParameter="{Binding ., ElementName=Pwd}" />
<KeyBinding <KeyBinding
Key="F1" Key="F1"
Command="{s:Action InputAction}" Command="{s:Action InputAction}"
@@ -66,31 +68,27 @@
Command="{s:Action InputAction}" Command="{s:Action InputAction}"
CommandParameter="500" /> CommandParameter="500" />
<KeyBinding Key="F5" Command="{s:Action LockSreenAction}" /> <KeyBinding Key="F5" Command="{s:Action LockSreenAction}" />
</hc:Window.InputBindings>
</Window.InputBindings>
<Grid> <Grid>
<StackPanel <StackPanel
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Visibility="{Binding CodeVisible}"> Visibility="{Binding CodeVisible}">
<TextBox
<hc:PasswordBox
x:Name="Pwd"
Width="200" Width="200"
hc:InfoElement.Placeholder="请输入解锁码" hc:InfoElement.Placeholder="请输入解锁码"
Style="{StaticResource TextBoxExtend}"
Text="{Binding LockCode}" />
hc:PasswordBoxAttach.PasswordLength="20"
ShowClearButton="True"
Style="{StaticResource PasswordBoxPlusBaseStyle}" />
<WrapPanel Margin="0,10,0,0" HorizontalAlignment="Center"> <WrapPanel Margin="0,10,0,0" HorizontalAlignment="Center">
<Button <Button
Width="60"
Width="70"
Height="40" Height="40"
Margin="0,0,10,0" Margin="0,0,10,0"
Command="{s:Action UnLockAction}" Command="{s:Action UnLockAction}"
Content="确定"
FontSize="15" />
<Button
Width="60"
Height="40"
Margin="10,0,0,0"
Command="{s:Action ResetAction}"
Content="取消"
CommandParameter="{Binding ., ElementName=Pwd}"
Content="确定[E]"
FontSize="15" /> FontSize="15" />
</WrapPanel> </WrapPanel>
</StackPanel> </StackPanel>
@@ -307,4 +305,4 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>
</hc:Window>
</Window>

+ 1
- 1
HKCardIN/Views/RootView.xaml.cs View File

@@ -4,7 +4,7 @@ using System.Windows.Media;


namespace HKCardIN.Views namespace HKCardIN.Views
{ {
public partial class RootView : HandyControl.Controls.Window
public partial class RootView : Window
{ {
public RootView() public RootView()
{ {


Loading…
Cancel
Save