Преглед изворни кода

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng пре 1 година
родитељ
комит
62ee1a4601
31 измењених фајлова са 448 додато и 206 уклоњено
  1. 7 0
      PDF Office/App.xaml.cs
  2. 15 11
      PDF Office/Helper/ServiceHelper.cs
  3. 7 0
      PDF Office/Model/DialogNames.cs
  4. 6 5
      PDF Office/PDF Office.csproj
  5. 11 0
      PDF Office/Properties/Settings.Designer.cs
  6. 3 0
      PDF Office/Properties/Settings.settings
  7. 12 1
      PDF Office/ViewModels/Dialog/ServiceDialog/CodeRegionViewModel.cs
  8. 2 2
      PDF Office/ViewModels/Dialog/ServiceDialog/IAPCompareDialogViewModel.cs
  9. 2 0
      PDF Office/ViewModels/Dialog/ServiceDialog/LoginPasswordRegionViewModel.cs
  10. 9 2
      PDF Office/ViewModels/Dialog/ServiceDialog/LoginRegionViewModel.cs
  11. 4 4
      PDF Office/ViewModels/Dialog/ServiceDialog/RegisterRegionViewModel.cs
  12. 3 3
      PDF Office/ViewModels/Dialog/ServiceDialog/UserDialogViewModel.cs
  13. 43 62
      PDF Office/ViewModels/Dialog/ServiceDialog/UserOutCodeRegionViewModel.cs
  14. 57 0
      PDF Office/ViewModels/Dialog/ServiceDialog/UserOutingLoginViewModel.cs
  15. 6 10
      PDF Office/ViewModels/MainWindowViewModel.cs
  16. 1 0
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  17. 44 25
      PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml
  18. 35 19
      PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml.cs
  19. 5 1
      PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml
  20. 5 0
      PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml.cs
  21. 14 7
      PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml
  22. 5 0
      PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml.cs
  23. 6 1
      PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml
  24. 5 1
      PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml.cs
  25. 45 32
      PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml
  26. 17 1
      PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml.cs
  27. 12 11
      PDF Office/Views/Dialog/ServiceDialog/UserOut.xaml
  28. 8 8
      PDF Office/Views/Dialog/ServiceDialog/UserOut.xaml.cs
  29. 2 0
      PDFSettings/PDFSettings.csproj
  30. 51 0
      PDFSettings/UserDate.cs
  31. 6 0
      PDFSettings/list.cs

+ 7 - 0
PDF Office/App.xaml.cs

@@ -170,6 +170,12 @@ namespace PDF_Office
                 //重置用于弹窗的记录参数
             }
 
+            if (Settings.Default.UserDate == null)
+            {
+                Settings.Default.UserDate = new PDFSettings.UserDate();
+            }
+
+
             if (Settings.Default.RecentOpenFiles == null)
             {
                 Settings.Default.RecentOpenFiles = new RecentOpenFiles();
@@ -457,6 +463,7 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<RegisterDialog>(DialogNames.RegisterDialog);
             containerRegistry.RegisterDialog<LoginDialog>(DialogNames.LoginDialog);
             containerRegistry.RegisterDialog<UserDialog>(DialogNames.UserDialog);
+            containerRegistry.RegisterDialog<UserOutingLogin>(DialogNames.UserOutingLogin);
 
             //新手引导弹窗
             containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);

+ 15 - 11
PDF Office/Helper/ServiceHelper.cs

@@ -255,7 +255,8 @@ namespace PDF_Office.Helper
                     if(jobject.TryGetValue("msg" ,out jToken)==false)
                     {
                         App.IsLogin = true;
-                        return jobject["email"].ToObject<string>().ToLower();
+                        Settings.Default.UserDate.Email= jobject["email"].ToObject<string>().ToLower();
+                        return "ture";
                     }
                    else
                     {
@@ -265,7 +266,7 @@ namespace PDF_Office.Helper
            }
             catch
             {
-                return "false";
+                return "NOINT";
             }
            
                
@@ -300,14 +301,15 @@ namespace PDF_Office.Helper
                 writer.WriteValue(validType);
                 writer.WriteEndObject();
             }
-            string postBody = sw.ToString();
+            try
+            {
+                string postBody = sw.ToString();
             using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
             {
                 writer.Write(postBody);
                 writer.Close();
             }
-            try
-            {
+            
                 response = (HttpWebResponse)request.GetResponse();
                 using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
@@ -451,14 +453,15 @@ namespace PDF_Office.Helper
                 writer.WriteValue(intcode);
                 writer.WriteEndObject();
             }
-            string postBody = sw.ToString();
+            try
+            {
+                string postBody = sw.ToString();
             using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
             {
                 writer.Write(postBody);
                 writer.Close();
             }
-            try
-            {
+            
                 response = (HttpWebResponse)request.GetResponse();
                 using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
@@ -661,14 +664,15 @@ namespace PDF_Office.Helper
                 writer.WriteValue(intcode);
                 writer.WriteEndObject();
             }
-            string postBody = sw.ToString();
+            try
+            {
+                string postBody = sw.ToString();
             using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
             {
                 writer.Write(postBody);
                 writer.Close();
             }
-            try
-            {
+            
                 response = (HttpWebResponse)request.GetResponse();
                 using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {

+ 7 - 0
PDF Office/Model/DialogNames.cs

@@ -21,6 +21,13 @@ namespace PDF_Office.Model
         /// </summary>
         public static string GuidDialog = "GuidDialog";
 
+
+        /// <summary>
+        /// 注销期间登录弹窗
+        /// </summary>
+        public static string UserOutingLogin = "UserOutingLogin";
+
+
         /// <summary>
         /// 注册弹窗
         /// </summary>

+ 6 - 5
PDF Office/PDF Office.csproj

@@ -508,6 +508,7 @@
     <Compile Include="ViewModels\Dialog\ServiceDialog\RegisterRegionViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\UserDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\UserOutCodeRegionViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ServiceDialog\UserOutingLoginViewModel.cs" />
     <Compile Include="ViewModels\Dialog\SettingsDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ToolsDialogs\MergeDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialogViewModel.cs" />
@@ -921,12 +922,12 @@
     <Compile Include="Views\Dialog\ServiceDialog\UserDialog.xaml.cs">
       <DependentUpon>UserDialog.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\Dialog\ServiceDialog\UserOut.xaml.cs">
-      <DependentUpon>UserOut.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Views\Dialog\ServiceDialog\UserOutCodeRegion.xaml.cs">
       <DependentUpon>UserOutCodeRegion.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\ServiceDialog\UserOutingLogin.xaml.cs">
+      <DependentUpon>UserOutingLogin.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\SettingsDialog.xaml.cs">
       <DependentUpon>SettingsDialog.xaml</DependentUpon>
     </Compile>
@@ -1713,11 +1714,11 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ServiceDialog\UserOut.xaml">
+    <Page Include="Views\Dialog\ServiceDialog\UserOutCodeRegion.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\Dialog\ServiceDialog\UserOutCodeRegion.xaml">
+    <Page Include="Views\Dialog\ServiceDialog\UserOutingLogin.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>

+ 11 - 0
PDF Office/Properties/Settings.Designer.cs

@@ -260,5 +260,16 @@ namespace PDF_Office.Properties {
                 this["IsGuidPDFUpdated"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.UserDate UserDate {
+            get {
+                return ((global::PDFSettings.UserDate)(this["UserDate"]));
+            }
+            set {
+                this["UserDate"] = value;
+            }
+        }
     }
 }

+ 3 - 0
PDF Office/Properties/Settings.settings

@@ -65,5 +65,8 @@
     <Setting Name="IsGuidPDFUpdated" Type="System.Boolean" Scope="User">
       <Value Profile="(Default)">True</Value>
     </Setting>
+    <Setting Name="UserDate" Type="PDFSettings.UserDate" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>

+ 12 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/CodeRegionViewModel.cs

@@ -1,4 +1,5 @@
 using PDF_Office.Helper;
+using PDF_Office.Properties;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -281,6 +282,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                             App.mainWindowViewModel.RegisterVis = Visibility.Collapsed;
                             App.mainWindowViewModel.LoginVis = Visibility.Collapsed;
                             App.mainWindowViewModel.OphVis = Visibility.Collapsed;
+                            Settings.Default.UserDate.Email = RegisterDialogViewModel.RegisterEmail;
                             RegisterDialogViewModel.RegionMan("RegisterOKRegion");
                         }
                         else
@@ -338,6 +340,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                                 App.mainWindowViewModel.RegisterVis = Visibility.Collapsed;
                                 App.mainWindowViewModel.LoginVis = Visibility.Collapsed;
                                 App.mainWindowViewModel.OphVis = Visibility.Collapsed;
+                                Settings.Default.UserDate.Email = RegisterDialogViewModel.RegisterEmail;
                                 RegisterDialogViewModel.RegionMan("RegisterOKRegion");
                             }
                             else
@@ -382,7 +385,15 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             time = 60;
             Codeagin = Visibility.Collapsed;
-            ServiceHelper.Get_code(CodeType, RegisterDialogViewModel.RegisterEmail);
+            if (CodeType == "user_register")
+            {
+                ServiceHelper.Get_code(CodeType, RegisterDialogViewModel.RegisterEmail);
+            }
+            else if (CodeType == "user_reset_password")
+            {
+                ServiceHelper.Get_code(CodeType, LoginDialogViewModel.LoginEmail);
+            }
+            
         }
 
         //计数

+ 2 - 2
PDF Office/ViewModels/Dialog/ServiceDialog/IAPCompareDialogViewModel.cs

@@ -57,7 +57,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
 
             RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
-            App.mainWindowViewModel.OpenLogin();
+            App.mainWindowViewModel.OpenRegister();
         }
 
 
@@ -66,7 +66,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
 
             RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
-            App.mainWindowViewModel.OpenRegister();
+            App.mainWindowViewModel.OpenLogin();
 
         }
 

+ 2 - 0
PDF Office/ViewModels/Dialog/ServiceDialog/LoginPasswordRegionViewModel.cs

@@ -1,6 +1,7 @@
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Properties;
 using PDF_Office.Views.Dialog.ServiceDialog;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -223,6 +224,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                 App.mainWindowViewModel.RegisterVis = Visibility.Collapsed;
                 App.mainWindowViewModel.LoginVis = Visibility.Collapsed;
                 App.mainWindowViewModel.OphVis = Visibility.Collapsed;
+                Settings.Default.UserDate.Email = LoginEmail;
             }
             else if(ServiceHelper.Login(LoginEmail, LoginPassword, uuid) == "网络不稳定请重试")
             {

+ 9 - 2
PDF Office/ViewModels/Dialog/ServiceDialog/LoginRegionViewModel.cs

@@ -128,10 +128,17 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                 LoginDialogViewModel.LoginEmail = LoginEmail;
                 LoginDialogViewModel.RegionMan("LoginPasswordRegion");
             }
+            else if (ServiceHelper.Ok_email(LoginEmail, "1") == "网络不稳定请重试")
+            {
+                LoginDialogViewModel.RegionMan("NOInternetRegion");
+            }
             else if (ServiceHelper.Ok_email(LoginEmail, "1") == "注销中,无法登录,若有问题可联系客服")
             {
-                UserOut window = new UserOut() ;
-                window.ShowDialog();
+                
+                    dialogs.ShowDialog(DialogNames.UserOutingLogin, new DialogParameters(""), r =>
+                    {
+                    });
+                
 
             }
             else if (ServiceHelper.Ok_email(LoginEmail, "1") == "当前账号未注册,点击下一步我们将为您注册账号")

+ 4 - 4
PDF Office/ViewModels/Dialog/ServiceDialog/RegisterRegionViewModel.cs

@@ -276,14 +276,14 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
         private void RegisterNext()
         {
-            
-            
-            if(ServiceHelper.Ok_email(RegisterEmail, "2")== "success")
+
+
+            if (ServiceHelper.Ok_email(RegisterEmail, "2") == "success")
             {
                 RegisterDialogViewModel.RegisterEmail = RegisterEmail;
                 RegisterDialogViewModel.RegisterPassword = RegisterPassword;
                 ServiceHelper.Get_code("user_register", RegisterEmail);
-                RegisterDialogViewModel.RegionMan( "CodeRegion");
+                RegisterDialogViewModel.RegionMan("CodeRegion");
             }
             else 
             {

+ 3 - 3
PDF Office/ViewModels/Dialog/ServiceDialog/UserDialogViewModel.cs

@@ -23,8 +23,8 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
         public event Action<IDialogResult> RequestClose;
 
-        
-        private string _UserEmail=ServiceHelper.GetUser() ;
+
+        private string _UserEmail = Settings.Default.UserDate.Email;
         public string UserEmail
         {
             get { return _UserEmail; }
@@ -71,7 +71,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             UserOutCommand = new DelegateCommand(UserOut);
             LogOutCommand = new DelegateCommand(LogOut);
 
-            UserEmail = ServiceHelper.GetUser();
+            UserEmail = Settings.Default.UserDate.Email;
            
         }
         public void UserOut()

+ 43 - 62
PDF Office/ViewModels/Dialog/ServiceDialog/UserOutCodeRegionViewModel.cs

@@ -24,7 +24,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
 
 
-        private bool _EnableNextStep = true;
+        private bool _EnableNextStep =false;
         public bool EnableNextStep
         {
             get { return _EnableNextStep; }
@@ -53,10 +53,13 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             get { return _Code1; }
             set { SetProperty(ref _Code1, value);
-                if (CodeSum())
+                if(CodeSum()==true)
                 {
-                    Code6Changed();
-
+                    EnableNextStep = true;
+                }
+                else
+                {
+                    EnableNextStep = false;
                 }
             }
         }
@@ -68,10 +71,13 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             get { return _Code2; }
             set { SetProperty(ref _Code2, value);
-                if (CodeSum())
+                if (CodeSum() == true)
                 {
-                    Code6Changed();
-
+                    EnableNextStep = true;
+                }
+                else
+                {
+                    EnableNextStep = false;
                 }
             }
         }
@@ -83,10 +89,13 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             get { return _Code3; }
             set { SetProperty(ref _Code3, value);
-                if (CodeSum())
+                if (CodeSum() == true)
                 {
-                    Code6Changed();
-
+                    EnableNextStep = true;
+                }
+                else
+                {
+                    EnableNextStep = false;
                 }
             }
         }
@@ -97,26 +106,31 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             get { return _Code4; }
             set { SetProperty(ref _Code4, value);
-                if (CodeSum())
+                if (CodeSum() == true)
                 {
-                    Code6Changed();
-
+                    EnableNextStep = true;
+                }
+                else
+                {
+                    EnableNextStep = false;
                 }
             }
         }
 
 
-
         private string _Code5 = "";
 
         public string Code5
         {
             get { return _Code5; }
             set { SetProperty(ref _Code5, value);
-                if (CodeSum())
+                if (CodeSum() == true)
                 {
-                    Code6Changed();
-
+                    EnableNextStep = true;
+                }
+                else
+                {
+                    EnableNextStep = false;
                 }
             }
         }
@@ -127,6 +141,14 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             get { return _Code6; }
             set { SetProperty(ref _Code6, value);
+                if (CodeSum() == true)
+                {
+                    EnableNextStep = true;
+                }
+                else
+                {
+                    EnableNextStep = false;
+                }
             }
         }
 
@@ -136,6 +158,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             get { return _UserCodemsg; }
             set { SetProperty(ref _UserCodemsg, value); }
+
         }
 
 
@@ -174,7 +197,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
         public DelegateCommand UserOutCancelCommand { get; set; }
         public DelegateCommand CodetooCommand { get; set; }
-        public DelegateCommand Code6ChangedCommand { get; set; }
+  
         public DelegateCommand UserOutCommand { get; set; }
 
         public UserOutCodeRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
@@ -185,7 +208,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             dialogs = dialogService;
             UserOutCancelCommand = new DelegateCommand(UserOutCancel);
             CodetooCommand = new DelegateCommand(Codetoo);
-            Code6ChangedCommand = new DelegateCommand(Code6Changed);
+
             UserOutCommand = new DelegateCommand(UserOut);
 
 
@@ -256,49 +279,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             }
         }
 
-
-        private void Code6Changed()
-        {
-            if (Code6.Length == 1)
-            {
-                if (CodeSum() == true)
-                {
-                    if (ServiceHelper.Ok_code(UserDialogViewModel.UserEmail, Codesum, "user_log_off") == "success")
-                    {
-
-                        if (ServiceHelper.Usergout(Codesum) == "success")
-                        {
-                            Settings.Default.AppProperties.LoginToken = "";
-                            App.IsLogin = false;
-                            Settings.Default.Save();
-                            App.mainWindowViewModel.UserVis = Visibility.Collapsed;
-                            App.mainWindowViewModel.RegisterVis = Visibility.Collapsed;
-                            App.mainWindowViewModel.LoginVis = Visibility.Visible;
-                            UserDialogViewModel.Close();
-                        }
-                        else
-                        {
-                            UserCodemsg = ServiceHelper.Usergout(Codesum);
-                            UserCodemsgVis = Visibility.Visible;
-                        }
-                    }
-                    else
-                    {
-                        UserCodemsg = ServiceHelper.Ok_code(UserDialogViewModel.UserEmail, Codesum, "user_log_off");
-                        UserCodemsgVis = Visibility.Visible;
-                    }
-
-
-
-                }
-                else
-                {
-                    UserCodemsg = "请输入六位数验证码";
-                    UserCodemsgVis = Visibility.Visible;
-                }
-            }
-            
-        }
+     
 
         private void Codetoo()
         {

+ 57 - 0
PDF Office/ViewModels/Dialog/ServiceDialog/UserOutingLoginViewModel.cs

@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Properties;
+using PDF_Office.Views.Dialog.ServiceDialog;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+
+namespace PDF_Office.ViewModels.Dialog.ServiceDialog
+{
+    public class UserOutingLoginViewModel : BindableBase, IDialogAware
+    {
+      
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+
+     
+        public void Close()
+        {
+
+            RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
+        }
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+
+        }
+
+
+
+        public DelegateCommand UserOutCommand { get; set; }
+        public DelegateCommand LogOutCommand { get; set; }
+
+
+       
+
+    }
+}

+ 6 - 10
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -298,7 +298,7 @@ namespace PDF_Office.ViewModels
                         OphVis = Visibility.Visible;
 
                     }
-                    else
+                    else 
                     {
 
                         UserVis = Visibility.Visible;
@@ -345,25 +345,21 @@ namespace PDF_Office.ViewModels
         //打开注册弹窗
         public void OpenRegister()
         {
-            dialogs.ShowDialog(DialogNames.RegisterDialog, new DialogParameters(), r =>
-            {
-            });
+            dialogs.ShowDialog(DialogNames.RegisterDialog);
         }
 
         //打开登录弹窗
         public void OpenLogin()
         {
-            dialogs.ShowDialog(DialogNames.LoginDialog, new DialogParameters(""), r =>
-            {
-            });
+            dialogs.ShowDialog(DialogNames.LoginDialog);
         }
 
+
+
         //打开用户弹窗
         public void OpenUser()
         {
-            dialogs.ShowDialog(DialogNames.UserDialog, new DialogParameters(""), r =>
-            {
-            });
+            dialogs.ShowDialog(DialogNames.UserDialog);
         }
 
         /// <summary>

+ 1 - 0
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -1205,6 +1205,7 @@ namespace PDF_Office.ViewModels.PageEdit
 
             //刷新页码等
             ReloadAfterOption(true, true, new Tuple<int, int>(0, PDFViewer.Document.PageCount));
+              NotifyUIToRefresh(pageRange);
             IsLoading = Visibility.Collapsed;
         }
 

+ 44 - 25
PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml

@@ -55,13 +55,16 @@
                         x:Name="text_Code1"
                         Width="36"
                         Height="42"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code1_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code1, Mode=TwoWay}"
                         TextChanged="Code_TextChanged" />
                     <TextBox
@@ -69,13 +72,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code2_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code2, Mode=TwoWay}"
                         TextChanged="text_Code2_TextChanged" />
                     <TextBox
@@ -83,13 +89,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code3_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code3, Mode=TwoWay}"
                         TextChanged="text_Code3_TextChanged" />
                     <TextBox
@@ -97,13 +106,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code4_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code4, Mode=TwoWay}"
                         TextChanged="text_Code4_TextChanged" />
                     <TextBox
@@ -111,13 +123,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code5_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code5, Mode=TwoWay}"
                         TextChanged="text_Code5_TextChanged" />
                     <TextBox
@@ -125,13 +140,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code6_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code6, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         TextChanged="text_Code6_TextChanged">
                         <i:Interaction.Triggers>
@@ -189,8 +207,9 @@
                     VerticalAlignment="Top"
                     Command="{Binding RegisterNextCommand}"
                     Content="Sign up"
+                    IsDefault="True"
                     IsEnabled="{Binding EnableNextStep, Mode=TwoWay}"
-                    Style="{StaticResource Btn.cta}" IsDefault="True" />
+                    Style="{StaticResource Btn.cta}" />
                 <TextBlock
                     Width="114"
                     Height="20"

+ 35 - 19
PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -37,6 +38,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         private void Code_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_RegisterVis.Visibility = Visibility.Collapsed;
+            text_Code1.Select(text_Code1.Text.Length, 0);
             if (text_Code1.Text.Length == 1)
             {
                 text_Code2.Focus();
@@ -45,23 +47,25 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             else if (text_Code1.Text.Length > 1)
             {
                 string str = text_Code1.Text;
-               
-                 text_Code1.Text = str.Substring(0, 1);
+
+                text_Code1.Text = str.Substring(0, 1);
                 str = str.Remove(0, 1);
-                if(str.Length>0)
+                if (str.Length > 0)
                 {
                     text_Code2.Text = str;
-                   
+
                 }
-               
-                
-                
+
+
+
             }
         }
 
         private void text_Code2_TextChanged(object sender, TextChangedEventArgs e)
         {
+
             Grid_RegisterVis.Visibility = Visibility.Collapsed;
+            text_Code2.Select(text_Code2.Text.Length, 0);
             if (text_Code2.Text.Length == 1)
             {
                 text_Code3.Focus();
@@ -77,13 +81,14 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
                 {
                     text_Code3.Text = str;
                 }
-                
+
             }
         }
 
         private void text_Code3_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_RegisterVis.Visibility = Visibility.Collapsed;
+            text_Code3.Select(text_Code3.Text.Length, 0);
             if (text_Code3.Text.Length == 1)
             {
                 text_Code4.Focus();
@@ -92,20 +97,20 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             else if (text_Code3.Text.Length > 1)
             {
                 string str = text_Code3.Text;
-
                 text_Code3.Text = str.Substring(0, 1);
                 str = str.Remove(0, 1);
                 if (str.Length > 0)
                 {
                     text_Code4.Text = str;
                 }
-                
+
             }
         }
 
         private void text_Code4_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_RegisterVis.Visibility = Visibility.Collapsed;
+            text_Code4.Select(text_Code4.Text.Length, 0);
             if (this.text_Code4.Text.Length == 1)
             {
                 this.text_Code5.Focus();
@@ -121,13 +126,14 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
                 {
                     text_Code5.Text = str;
                 }
-               
+
             }
         }
 
         private void text_Code5_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_RegisterVis.Visibility = Visibility.Collapsed;
+            text_Code5.Select(text_Code5.Text.Length, 0);
             if (this.text_Code5.Text.Length == 1)
             {
                 this.text_Code6.Focus();
@@ -143,25 +149,25 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
                 {
                     text_Code6.Text = str;
                 }
-                
+
             }
         }
 
         private void text_Code6_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_RegisterVis.Visibility = Visibility.Collapsed;
+            text_Code6.Select(text_Code6.Text.Length, 0);
             if (this.text_Code6.Text.Length == 1)
             {
                 text_Code6.Focus();
             }
 
-            else 
-            if(text_Code6.Text.Length >1)
+            else if (text_Code6.Text.Length > 1)
             {
                 string str = text_Code6.Text;
                 text_Code6.Focus();
                 text_Code6.Text = str.Substring(0, 1);
-                
+
 
             }
 
@@ -182,44 +188,54 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code2.Text = "";
                 text_Code1.Focus();
+                text_Code1.Select(text_Code1.Text.Length, 0);
             }
         }
 
         private void text_Code3_KeyUp(object sender, KeyEventArgs e)
         {
-            if (e.Key == Key.Back )
+            if (e.Key == Key.Back)
             {
                 text_Code3.Text = "";
                 text_Code2.Focus();
+                text_Code2.Select(text_Code2.Text.Length, 0);
             }
 
         }
 
         private void text_Code4_KeyUp(object sender, KeyEventArgs e)
         {
-            if (e.Key == Key.Back )
+            if (e.Key == Key.Back)
             {
                 text_Code4.Text = "";
                 text_Code3.Focus();
+                text_Code3.Select(text_Code3.Text.Length, 0);
             }
         }
 
         private void text_Code5_KeyUp(object sender, KeyEventArgs e)
         {
-            if (e.Key == Key.Back )
+            if (e.Key == Key.Back)
             {
                 text_Code5.Text = "";
                 text_Code4.Focus();
+                text_Code4.Select(text_Code4.Text.Length, 0);
             }
         }
 
         private void text_Code6_KeyUp(object sender, KeyEventArgs e)
         {
-            if (e.Key == Key.Back )
+            if (e.Key == Key.Back)
             {
                 text_Code6.Text = "";
                 text_Code5.Focus();
+                text_Code5.Select(text_Code5.Text.Length, 0);
             }
         }
+
+        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
     }
 }

+ 5 - 1
PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml

@@ -350,17 +350,21 @@
                         <ColumnDefinition Width="24" />
                     </Grid.ColumnDefinitions>
                     <PasswordBox
+                        x:Name="Text_Password"
                         Grid.ColumnSpan="2"
                         help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg, Mode=TwoWay}"
                         help:PasswordBoxHelper.Password="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource LoginPasswordBoxStyle}"
                         Visibility="{Binding LoginPasswordVisibility, Mode=TwoWay}" />
                     <TextBox
-                        x:Name="Text_Password"
                         Grid.ColumnSpan="2"
                         Width="262"
                         HorizontalAlignment="Left"
                         help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg, Mode=TwoWay}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource LoginPasswordTextBoxStyle}"
                         Text="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Visibility="{Binding LoginTextVisibility, Mode=TwoWay}">

+ 5 - 0
PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -32,5 +33,9 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         {
             Text_Password.Focus();
         }
+        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
     }
 }

+ 14 - 7
PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml

@@ -422,22 +422,26 @@
                     Width="262"
                     Height="32"
                     Margin="0,32,0,0"
-                    VerticalAlignment="Center"
-                    IsEnabled="{Binding ElementName=LoginPasswordChk2, Path=IsChecked}">
+                    VerticalAlignment="Center">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition />
                         <ColumnDefinition Width="24" />
                     </Grid.ColumnDefinitions>
                     <PasswordBox
+                         x:Name="Text_RePassword2"
                         Grid.ColumnSpan="2"
                         help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg2, Mode=TwoWay}"
                         help:PasswordBoxHelper.Password="{Binding LoginPassword2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource LoginPasswordBoxStyle2}"
                         Visibility="{Binding LoginPasswordVisibility2, Mode=TwoWay}" />
                     <TextBox
-                        x:Name="Text_RePassword2"
+                       
                         Grid.ColumnSpan="2"
                         help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg2, Mode=TwoWay}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource LoginPasswordTextBoxStyle2}"
                         Text="{Binding LoginPassword2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Visibility="{Binding LoginTextVisibility2, Mode=TwoWay}">
@@ -456,7 +460,6 @@
                         Panel.ZIndex="1"
                         Command="{Binding DisplayPasswordCommand2}"
                         CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
-                        IsChecked="{Binding IsLoginPasswordDisplayed2, Mode=TwoWay}"
                         Style="{StaticResource EyeCheckbox}"
                         Visibility="{Binding ChkVis2}" />
 
@@ -471,8 +474,7 @@
                 <Grid
                     Width="262"
                     Height="32"
-                    Margin="0,8,0,0"
-                    IsEnabled="{Binding ElementName=LoginPasswordChk, Path=IsChecked}">
+                    Margin="0,8,0,0">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition />
                         <ColumnDefinition Width="24" />
@@ -481,11 +483,15 @@
                         Grid.ColumnSpan="2"
                         help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg, Mode=TwoWay}"
                         help:PasswordBoxHelper.Password="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource LoginPasswordBoxStyle}"
                         Visibility="{Binding LoginPasswordVisibility, Mode=TwoWay}" />
                     <TextBox
                         Grid.ColumnSpan="2"
                         help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg, Mode=TwoWay}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource LoginPasswordTextBoxStyle}"
                         Text="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Visibility="{Binding LoginTextVisibility, Mode=TwoWay}">
@@ -518,8 +524,9 @@
                     Margin="0,16,0,0"
                     Command="{Binding PasswordUpdataCommand}"
                     Content="OK"
+                    IsDefault="True"
                     IsEnabled="{Binding EnableNextStep, Mode=TwoWay}"
-                    Style="{StaticResource Btn.cta}" IsDefault="True" />
+                    Style="{StaticResource Btn.cta}" />
             </StackPanel>
         </Grid>
         <Grid

+ 5 - 0
PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -35,5 +36,9 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         {
             Text_RePassword2.Focus();
         }
+        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
     }
 }

+ 6 - 1
PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml

@@ -343,6 +343,8 @@
                     </Grid.ColumnDefinitions>
                     <PasswordBox
                         Grid.ColumnSpan="2"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         help:PasswordBoxHelper.DisplayText="{Binding RegisterPasswordMsg, Mode=TwoWay}"
                         help:PasswordBoxHelper.Password="{Binding RegisterPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Style="{StaticResource RegisterPasswordBoxStyle}"
@@ -350,6 +352,8 @@
                     <TextBox
                         Grid.ColumnSpan="2"
                         help:PasswordBoxHelper.DisplayText="{Binding RegisterPasswordMsg, Mode=TwoWay}"
+                        InputMethod.IsInputMethodEnabled="False"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Style="{StaticResource RegisterPasswordTextBoxStyle}"
                         Text="{Binding RegisterPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Visibility="{Binding RegisterTextVisibility, Mode=TwoWay}">
@@ -388,8 +392,9 @@
                     VerticalAlignment="Top"
                     Command="{Binding RegisterNextCommand}"
                     Content="{Binding RegisterNextStep}"
+                    IsDefault="True"
                     IsEnabled="{Binding EnableNextStep, Mode=TwoWay}"
-                    Style="{StaticResource Btn.cta}" IsDefault="True" />
+                    Style="{StaticResource Btn.cta}" />
                 <WrapPanel
                     Margin="0,8,0,0"
                     HorizontalAlignment="Center"

+ 5 - 1
PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -34,7 +35,10 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         {
             Text_Email.Focus();
         }
-    
+        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
 
     }
 }

+ 45 - 32
PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml

@@ -53,13 +53,16 @@
                         x:Name="text_Code1"
                         Width="36"
                         Height="42"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code1_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code1, Mode=TwoWay}"
                         TextChanged="Code_TextChanged" />
                     <TextBox
@@ -67,13 +70,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code2_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code2, Mode=TwoWay}"
                         TextChanged="text_Code2_TextChanged" />
                     <TextBox
@@ -81,13 +87,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code3_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code3, Mode=TwoWay}"
                         TextChanged="text_Code3_TextChanged" />
                     <TextBox
@@ -95,13 +104,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code4_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code4, Mode=TwoWay}"
                         TextChanged="text_Code4_TextChanged" />
                     <TextBox
@@ -109,13 +121,16 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code5_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code5, Mode=TwoWay}"
                         TextChanged="text_Code5_TextChanged" />
                     <TextBox
@@ -123,21 +138,18 @@
                         Width="36"
                         Height="42"
                         Margin="9,0,0,0"
-                        Padding="10"
-                        HorizontalAlignment="Left"
-                        VerticalAlignment="Top"
+                        Padding="10,0,10,0"
+                        HorizontalAlignment="Right"
+                        VerticalContentAlignment="Center"
                         FontFamily="Segoe UI"
-                        FontSize="12"
+                        FontSize="20"
                         FontStyle="Normal"
+                        FontWeight="SemiBold"
+                        InputMethod.IsInputMethodEnabled="False"
                         KeyUp="text_Code6_KeyUp"
+                        PreviewTextInput="TextBox_PreviewTextInput"
                         Text="{Binding Code6, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                        TextChanged="text_Code6_TextChanged">
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="TextChanged">
-                                <i:InvokeCommandAction Command="{Binding Code6ChangedCommand}" />
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </TextBox>
+                        TextChanged="text_Code6_TextChanged" />
                 </WrapPanel>
                 <WrapPanel Margin="0,10,0,0">
                     <TextBlock
@@ -179,8 +191,9 @@
                     VerticalAlignment="Top"
                     Command="{Binding UserOutCommand}"
                     Content="Cancellation"
+                    IsDefault="True"
                     IsEnabled="{Binding EnableNextStep, Mode=TwoWay}"
-                    Style="{StaticResource Btn.cta}" IsDefault="True" />
+                    Style="{StaticResource Btn.cta}" />
                 <Button
                     Width="200"
                     Height="32"

+ 17 - 1
PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -40,6 +41,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         private void Code_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_UserCodemsgVis.Visibility = Visibility.Collapsed;
+            text_Code1.Select(text_Code1.Text.Length, 0);
             if (text_Code1.Text.Length == 1)
             {
                 text_Code2.Focus();
@@ -64,7 +66,9 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
 
         private void text_Code2_TextChanged(object sender, TextChangedEventArgs e)
         {
+
             Grid_UserCodemsgVis.Visibility = Visibility.Collapsed;
+            text_Code2.Select(text_Code2.Text.Length, 0);
             if (text_Code2.Text.Length == 1)
             {
                 text_Code3.Focus();
@@ -87,6 +91,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         private void text_Code3_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_UserCodemsgVis.Visibility = Visibility.Collapsed;
+            text_Code3.Select(text_Code3.Text.Length, 0);
             if (text_Code3.Text.Length == 1)
             {
                 text_Code4.Focus();
@@ -95,7 +100,6 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             else if (text_Code3.Text.Length > 1)
             {
                 string str = text_Code3.Text;
-
                 text_Code3.Text = str.Substring(0, 1);
                 str = str.Remove(0, 1);
                 if (str.Length > 0)
@@ -109,6 +113,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         private void text_Code4_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_UserCodemsgVis.Visibility = Visibility.Collapsed;
+            text_Code4.Select(text_Code4.Text.Length, 0);
             if (this.text_Code4.Text.Length == 1)
             {
                 this.text_Code5.Focus();
@@ -131,6 +136,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         private void text_Code5_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_UserCodemsgVis.Visibility = Visibility.Collapsed;
+            text_Code5.Select(text_Code5.Text.Length, 0);
             if (this.text_Code5.Text.Length == 1)
             {
                 this.text_Code6.Focus();
@@ -153,6 +159,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         private void text_Code6_TextChanged(object sender, TextChangedEventArgs e)
         {
             Grid_UserCodemsgVis.Visibility = Visibility.Collapsed;
+            text_Code6.Select(text_Code6.Text.Length, 0);
             if (this.text_Code6.Text.Length == 1)
             {
                 text_Code6.Focus();
@@ -184,6 +191,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code2.Text = "";
                 text_Code1.Focus();
+                text_Code1.Select(text_Code1.Text.Length, 0);
             }
         }
 
@@ -193,6 +201,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code3.Text = "";
                 text_Code2.Focus();
+                text_Code2.Select(text_Code2.Text.Length, 0);
             }
 
         }
@@ -203,6 +212,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code4.Text = "";
                 text_Code3.Focus();
+                text_Code3.Select(text_Code3.Text.Length, 0);
             }
         }
 
@@ -212,6 +222,7 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code5.Text = "";
                 text_Code4.Focus();
+                text_Code4.Select(text_Code4.Text.Length, 0);
             }
         }
 
@@ -221,8 +232,13 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code6.Text = "";
                 text_Code5.Focus();
+                text_Code5.Select(text_Code5.Text.Length, 0);
             }
         }
 
+        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
     }
 }

+ 12 - 11
PDF Office/Views/Dialog/ServiceDialog/UserOut.xaml

@@ -1,17 +1,17 @@
-<Window
-    x:Class="PDF_Office.Views.Dialog.ServiceDialog.UserOut"
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.ServiceDialog.UserOutingLogin"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.Views.Dialog.ServiceDialog"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    Title="UserOut"
+    xmlns:prism="http://prismlibrary.com/"
     Width="392"
-    Height="202"
-    WindowStartupLocation="CenterScreen"
-    WindowStyle="None"
+    Height="209"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
-    <Grid>
+    <Grid Background="White">
         <Grid>
             <StackPanel>
                 <WrapPanel Margin="18,18,0,0" HorizontalAlignment="Left">
@@ -40,7 +40,7 @@
                     FontSize="14"
                     LineHeight="22"
                     TextWrapping="Wrap">
-                    <Run Text="Your account is currently being logged out and cannot be logged in.                                                                              " />
+                    <Run Text="Your account is currently being logged out and cannot be logged in.                                                                               " />
                     <Run Text="If you have questions, you can " />
                     <Hyperlink
                         Click="Hyperlink_Click"
@@ -55,10 +55,11 @@
                     Margin="296,32,0,0"
                     HorizontalAlignment="Left"
                     Background="#1770F4"
-                    Click="Button_Click"
                     Content="OK"
-                    Foreground="White" IsDefault="True" />
+                    Foreground="White"
+                    IsCancel="True"
+                    IsDefault="True" />
             </StackPanel>
         </Grid>
     </Grid>
-</Window>
+</UserControl>

+ 8 - 8
PDF Office/Views/Dialog/ServiceDialog/UserOut.xaml.cs

@@ -11,28 +11,28 @@ using System.Windows.Documents;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
 using System.Windows.Shapes;
 
 namespace PDF_Office.Views.Dialog.ServiceDialog
 {
     /// <summary>
-    /// UserOut.xaml 的交互逻辑
+    /// UserOutingLogin.xaml 的交互逻辑
     /// </summary>
-    public partial class UserOut : Window
+    public partial class UserOutingLogin : UserControl
     {
-        public UserOut()
+        public UserOutingLogin()
         {
             InitializeComponent();
         }
 
         private void Hyperlink_Click(object sender, RoutedEventArgs e)
         {
-            Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/zh-cn/contact"));
-        }
+            StringBuilder sr = new StringBuilder();
+            sr.AppendFormat("{0} - {1};{2}", "PDF Offers", App.Version, "Report a Bug");
 
-        private void Button_Click(object sender, RoutedEventArgs e)
-        {
-            this.Close();
+            System.Diagnostics.Process.Start(string.Format("mailto:support@pdfreaderpro.com?subject={0}", sr));
+            //Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/zh-cn/contact"));
         }
     }
 }

+ 2 - 0
PDFSettings/PDFSettings.csproj

@@ -98,6 +98,7 @@
     <Compile Include="DialogCounter.cs" />
     <Compile Include="DpiHelpers.cs" />
     <Compile Include="BackgroundTemplateList.cs" />
+    <Compile Include="list.cs" />
     <Compile Include="PDFToolsList.cs" />
     <Compile Include="PresetFontList.cs" />
     <Compile Include="ProductActiveInfo.cs" />
@@ -105,6 +106,7 @@
     <Compile Include="RecentOpenFiles.cs" />
     <Compile Include="RedactionSettings.cs" />
     <Compile Include="SignatureList.cs" />
+    <Compile Include="UserDate.cs" />
     <Compile Include="WatermarkTemplateList.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 51 - 0
PDFSettings/UserDate.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+   namespace PDFSettings
+{
+
+    public class UserDate
+    {
+        public string id { get; set; }
+        public string companyId { get; set; }
+        public string appId { get; set; }
+        public string Email { get; set; }
+        public string fullName { get; set; }
+        public string subscriberType { get; set; }
+
+        public string subscribed { get; set; }
+
+        public string digestPassword { get; set; }
+
+
+        public string phone { get; set; }
+
+        public string industry { get; set; }
+        public string lastPopularizeAt { get; set; }
+        public string lastPresentedCouponAt { get; set; }
+        public string mailable { get; set; }
+        public string resetToken { get; set; }
+
+        public string role { get; set; }
+        public string job { get; set; }
+        public string area { get; set; }
+        public string platformType { get; set; }
+        public string accountType { get; set; }
+
+        public string accountSource { get; set; }
+        public string createdAt { get; set; }
+        public string updatedAt { get; set; }
+        public string remark { get; set; }
+        public string validFlag { get; set; }
+
+        public list<string> subscriptionInfoList { get; set; }
+        public string freeDate { get; set; }
+        public string isInFreeUseTime { get; set; }
+    }
+
+
+  
+}

+ 6 - 0
PDFSettings/list.cs

@@ -0,0 +1,6 @@
+namespace PDFSettings
+{
+    public class list<T>
+    {
+    }
+}