Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

319 righe
14 KiB

  1. <Window
  2. x:Class="HKCardIN.Views.RootView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:HKCardIN"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:s="https://github.com/canton7/Stylet"
  10. xmlns:viewModels="clr-namespace:HKCardIN.ViewModels"
  11. x:Name="Root"
  12. Title="海科智慧一卡通平台"
  13. Width="800"
  14. Height="460"
  15. d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}"
  16. ResizeMode="CanMinimize"
  17. WindowStartupLocation="CenterScreen"
  18. mc:Ignorable="d">
  19. <Window.Resources>
  20. <Style
  21. x:Key="充值"
  22. BasedOn="{StaticResource ButtonDefault}"
  23. TargetType="Button">
  24. <Setter Property="Width" Value="75" />
  25. <Setter Property="Height" Value="75" />
  26. <Setter Property="Margin" Value="5" />
  27. <Setter Property="Foreground" Value="Red" />
  28. <Setter Property="FontSize" Value="18" />
  29. </Style>
  30. <Style
  31. x:Key="操作"
  32. BasedOn="{StaticResource ButtonDefault}"
  33. TargetType="Button">
  34. <Setter Property="Width" Value="120" />
  35. <Setter Property="Height" Value="75" />
  36. <Setter Property="Margin" Value="5" />
  37. <Setter Property="Foreground" Value="Red" />
  38. <Setter Property="FontSize" Value="18" />
  39. </Style>
  40. <Style
  41. x:Key="Title"
  42. BasedOn="{StaticResource TextBlockDefaultBold}"
  43. TargetType="TextBlock">
  44. <Setter Property="Foreground" Value="WhiteSmoke" />
  45. </Style>
  46. </Window.Resources>
  47. <Window.Background>
  48. <ImageBrush ImageSource="/HKResouces/背景.jpg" />
  49. </Window.Background>
  50. <Window.InputBindings>
  51. <KeyBinding
  52. Key="E"
  53. Command="{s:Action UnLockAction}"
  54. CommandParameter="{Binding ., ElementName=Pwd}" />
  55. <KeyBinding
  56. Key="F1"
  57. Command="{s:Action InputAction}"
  58. CommandParameter="50" />
  59. <KeyBinding
  60. Key="F2"
  61. Command="{s:Action InputAction}"
  62. CommandParameter="100" />
  63. <KeyBinding
  64. Key="F3"
  65. Command="{s:Action InputAction}"
  66. CommandParameter="200" />
  67. <KeyBinding
  68. Key="F4"
  69. Command="{s:Action InputAction}"
  70. CommandParameter="500" />
  71. <KeyBinding Key="F5" Command="{s:Action LockSreenAction}" />
  72. </Window.InputBindings>
  73. <Grid>
  74. <StackPanel
  75. HorizontalAlignment="Center"
  76. VerticalAlignment="Center"
  77. Visibility="{Binding CodeVisible}">
  78. <hc:PasswordBox
  79. x:Name="Pwd"
  80. Width="200"
  81. hc:InfoElement.Placeholder="请输入解锁码"
  82. hc:PasswordBoxAttach.PasswordLength="20"
  83. ShowClearButton="True"
  84. Style="{StaticResource PasswordBoxPlusBaseStyle}" />
  85. <WrapPanel Margin="0,10,0,0" HorizontalAlignment="Center">
  86. <Button
  87. Width="70"
  88. Height="40"
  89. Margin="0,0,10,0"
  90. Command="{s:Action UnLockAction}"
  91. CommandParameter="{Binding ., ElementName=Pwd}"
  92. Content="确定[E]"
  93. FontSize="15" />
  94. </WrapPanel>
  95. </StackPanel>
  96. <Grid Visibility="{Binding ContentVisible}">
  97. <Grid.ColumnDefinitions>
  98. <ColumnDefinition />
  99. <ColumnDefinition Width="13" />
  100. <ColumnDefinition />
  101. </Grid.ColumnDefinitions>
  102. <StackPanel Margin="0,12,0,0">
  103. <Grid>
  104. <Grid.ColumnDefinitions>
  105. <ColumnDefinition Width=".4*" />
  106. <ColumnDefinition Width=".6*" />
  107. </Grid.ColumnDefinitions>
  108. <Border
  109. Width="100"
  110. Height="120"
  111. BorderBrush="BlanchedAlmond"
  112. BorderThickness="1">
  113. <Border.Effect>
  114. <DropShadowEffect ShadowDepth="1" Color="Black" />
  115. </Border.Effect>
  116. <Image
  117. Width="100"
  118. Height="120"
  119. Source="{Binding Info.MemberHeadImgUrl}"
  120. Stretch="UniformToFill" />
  121. </Border>
  122. <StackPanel Grid.Column="1">
  123. <WrapPanel>
  124. <TextBlock
  125. FontSize="18"
  126. Style="{StaticResource Title}"
  127. Text="姓名:" />
  128. <TextBlock
  129. FontSize="18"
  130. Foreground="Red"
  131. Style="{StaticResource TextBlockDefaultBold}"
  132. Text="{Binding Info.MemberName}" />
  133. </WrapPanel>
  134. <WrapPanel Margin="0,20,0,0">
  135. <TextBlock
  136. FontSize="18"
  137. Style="{StaticResource Title}"
  138. Text="手机:" />
  139. <TextBlock
  140. FontSize="18"
  141. Foreground="Red"
  142. Style="{StaticResource TextBlockDefaultBold}"
  143. Text="{Binding Info.MemberPhone}" />
  144. </WrapPanel>
  145. <WrapPanel Margin="0,20,0,0">
  146. <TextBlock
  147. FontSize="18"
  148. Style="{StaticResource Title}"
  149. Text="身份证:" />
  150. <TextBlock
  151. FontSize="18"
  152. Foreground="Red"
  153. Style="{StaticResource TextBlockDefaultBold}"
  154. Text="{Binding Info.MemberCardId}" />
  155. </WrapPanel>
  156. </StackPanel>
  157. </Grid>
  158. <hc:Divider
  159. Content="卡信息"
  160. FontSize="16"
  161. FontWeight="Bold"
  162. Foreground="WhiteSmoke" />
  163. <StackPanel Margin="20,0,0,0">
  164. <WrapPanel>
  165. <TextBlock
  166. FontSize="18"
  167. Style="{StaticResource Title}"
  168. Text="卡号:" />
  169. <TextBlock
  170. FontSize="18"
  171. Foreground="Red"
  172. Style="{StaticResource TextBlockDefaultBold}"
  173. Text="{Binding Info.CardNum}" />
  174. </WrapPanel>
  175. <WrapPanel Margin="0,20,0,0">
  176. <TextBlock
  177. FontSize="18"
  178. Style="{StaticResource Title}"
  179. Text="卡状态:" />
  180. <TextBlock
  181. FontSize="18"
  182. Foreground="Red"
  183. Style="{StaticResource TextBlockDefaultBold}"
  184. Text="{Binding Info.Stutas}" />
  185. </WrapPanel>
  186. <WrapPanel Margin="0,20,0,0">
  187. <TextBlock
  188. FontSize="18"
  189. Style="{StaticResource Title}"
  190. Text="卡上余额:" />
  191. <TextBlock
  192. FontSize="18"
  193. Foreground="Red"
  194. Style="{StaticResource TextBlockDefaultBold}"
  195. Text="{Binding Info.Money}" />
  196. </WrapPanel>
  197. <WrapPanel Margin="0,20,0,0">
  198. <TextBlock
  199. FontSize="18"
  200. Style="{StaticResource Title}"
  201. Text="启用日期:" />
  202. <TextBlock
  203. FontSize="18"
  204. Foreground="Red"
  205. Style="{StaticResource TextBlockDefaultBold}"
  206. Text="{Binding Info.CreateAt, StringFormat={}{0:yyyy-MM-dd}}" />
  207. </WrapPanel>
  208. </StackPanel>
  209. </StackPanel>
  210. <hc:Divider
  211. Grid.Column="1"
  212. Height="{Binding ActualHeight, ElementName=Root}"
  213. Orientation="Vertical" />
  214. <StackPanel Grid.Column="2">
  215. <hc:Divider
  216. Content="充值金额"
  217. FontSize="16"
  218. FontWeight="Bold"
  219. Foreground="WhiteSmoke" />
  220. <TextBlock
  221. Margin="5,0,0,0"
  222. FontSize="18"
  223. Style="{StaticResource Title}">
  224. <Run Foreground="WhiteSmoke" Text="当前充值金额:" />
  225. <Run Foreground="Red" Text="{Binding ShowMoney}" />
  226. </TextBlock>
  227. <WrapPanel HorizontalAlignment="Center">
  228. <Button
  229. Command="{s:Action InputAction}"
  230. CommandParameter="50"
  231. Style="{StaticResource 充值}">
  232. <Button.Content>
  233. <StackPanel HorizontalAlignment="Center">
  234. <TextBlock HorizontalAlignment="Center" Text="¥50" />
  235. <TextBlock HorizontalAlignment="Center" Text="[F1]" />
  236. </StackPanel>
  237. </Button.Content>
  238. </Button>
  239. <Button
  240. Command="{s:Action InputAction}"
  241. CommandParameter="100"
  242. Style="{StaticResource 充值}">
  243. <Button.Content>
  244. <StackPanel HorizontalAlignment="Center">
  245. <TextBlock HorizontalAlignment="Center" Text="¥100" />
  246. <TextBlock HorizontalAlignment="Center" Text="[F2]" />
  247. </StackPanel>
  248. </Button.Content>
  249. </Button>
  250. <Button
  251. Command="{s:Action InputAction}"
  252. CommandParameter="200"
  253. Style="{StaticResource 充值}">
  254. <Button.Content>
  255. <StackPanel HorizontalAlignment="Center">
  256. <TextBlock HorizontalAlignment="Center" Text="¥200" />
  257. <TextBlock HorizontalAlignment="Center" Text="[F3]" />
  258. </StackPanel>
  259. </Button.Content>
  260. </Button>
  261. <Button
  262. Command="{s:Action InputAction}"
  263. CommandParameter="500"
  264. Style="{StaticResource 充值}">
  265. <Button.Content>
  266. <StackPanel HorizontalAlignment="Center">
  267. <TextBlock HorizontalAlignment="Center" Text="¥500" />
  268. <TextBlock HorizontalAlignment="Center" Text="[F4]" />
  269. </StackPanel>
  270. </Button.Content>
  271. </Button>
  272. </WrapPanel>
  273. <WrapPanel HorizontalAlignment="Center">
  274. <TextBox
  275. Width="330"
  276. Margin="5,10,0,10"
  277. HorizontalAlignment="Left"
  278. hc:InfoElement.Placeholder="请输入自定义金额"
  279. Style="{StaticResource TextBoxExtend}">
  280. <TextBox.Text>
  281. <Binding Path="InputMoney" UpdateSourceTrigger="PropertyChanged">
  282. <Binding.ValidationRules>
  283. <local:ValidataRule />
  284. </Binding.ValidationRules>
  285. </Binding>
  286. </TextBox.Text>
  287. </TextBox>
  288. </WrapPanel>
  289. <WrapPanel HorizontalAlignment="Center">
  290. <TextBox
  291. Width="330"
  292. Margin="5,0,0,10"
  293. HorizontalAlignment="Left"
  294. hc:InfoElement.Placeholder="手动录入卡号"
  295. Style="{StaticResource TextBoxExtend}"
  296. Text="{Binding CardNo}" />
  297. </WrapPanel>
  298. <hc:Divider
  299. Content="操作"
  300. FontSize="16"
  301. FontWeight="Bold"
  302. Foreground="WhiteSmoke" />
  303. <WrapPanel HorizontalAlignment="Center">
  304. <Button
  305. Command="{s:Action SaveAction}"
  306. Content="确定[Enter]"
  307. IsDefault="True"
  308. Style="{StaticResource 操作}" />
  309. <Button
  310. Command="{s:Action LockSreenAction}"
  311. Content="锁屏[F5]"
  312. IsDefault="True"
  313. Style="{StaticResource 操作}" />
  314. </WrapPanel>
  315. </StackPanel>
  316. </Grid>
  317. </Grid>
  318. </Window>