Browse Source

轻会员-个人中心-更换邮箱 UI

OYXH\oyxh 1 year ago
parent
commit
d9105fc6c1

+ 19 - 24
PDF Office/App.xaml.cs

@@ -83,7 +83,6 @@ namespace PDF_Master
     /// </summary>
     /// </summary>
     public partial class App : PrismApplication
     public partial class App : PrismApplication
     {
     {
-
         /// <summary>
         /// <summary>
         /// 产品名称
         /// 产品名称
         /// </summary>
         /// </summary>
@@ -142,7 +141,7 @@ namespace PDF_Master
         /// <summary>
         /// <summary>
         /// 激活窗体的原因
         /// 激活窗体的原因
         /// </summary>
         /// </summary>
-        public static string  WebOpencase = "";
+        public static string WebOpencase = "";
 
 
         public static bool IsBookMode = false;
         public static bool IsBookMode = false;
 
 
@@ -159,7 +158,6 @@ namespace PDF_Master
         /// </summary>
         /// </summary>
         public static bool IsLogin = false;
         public static bool IsLogin = false;
 
 
-
         /// <summary>
         /// <summary>
         /// 记录开始拖拽的窗口句柄,用于判断是否为跨窗口拖拽
         /// 记录开始拖拽的窗口句柄,用于判断是否为跨窗口拖拽
         /// </summary>
         /// </summary>
@@ -169,6 +167,7 @@ namespace PDF_Master
         /// 双击打开文件通知ID
         /// 双击打开文件通知ID
         /// </summary>
         /// </summary>
         public static uint MsgId;
         public static uint MsgId;
+
         /// <summary>
         /// <summary>
         /// 将应用前置通知ID
         /// 将应用前置通知ID
         /// </summary>
         /// </summary>
@@ -283,14 +282,14 @@ namespace PDF_Master
                 if (Settings.Default.PresetFontList == null)
                 if (Settings.Default.PresetFontList == null)
                     Settings.Default.PresetFontList = new PDFSettings.PresetFontList();
                     Settings.Default.PresetFontList = new PDFSettings.PresetFontList();
             }
             }
-            catch { 
-            
+            catch
+            {
             }
             }
         }
         }
 
 
         protected override void OnStartup(StartupEventArgs e)
         protected override void OnStartup(StartupEventArgs e)
         {
         {
-               MsgId = Win32Helper.RegisterWindowMessage("msgNotify_PDFMaster");
+            MsgId = Win32Helper.RegisterWindowMessage("msgNotify_PDFMaster");
             WakeId = Win32Helper.RegisterWindowMessage("msgWake_PDFMaster");
             WakeId = Win32Helper.RegisterWindowMessage("msgWake_PDFMaster");
             WakeId = Win32Helper.RegisterWindowMessage("webopenexpired_PDFMaster");
             WakeId = Win32Helper.RegisterWindowMessage("webopenexpired_PDFMaster");
             Process[] pros = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
             Process[] pros = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
@@ -299,11 +298,11 @@ namespace PDF_Master
             {
             {
                 if (e != null && e.Args != null && e.Args.Length > 0)
                 if (e != null && e.Args != null && e.Args.Length > 0)
                 {
                 {
-                    if (Webgoapp(e.Args)==true)
+                    if (Webgoapp(e.Args) == true)
                     {
                     {
-                        if(WebOpencase=="expired")
+                        if (WebOpencase == "expired")
                         {
                         {
-                            Win32Helper.PostMessage((IntPtr)0xffff,WebopenexpiredId, IntPtr.Zero, IntPtr.Zero);
+                            Win32Helper.PostMessage((IntPtr)0xffff, WebopenexpiredId, IntPtr.Zero, IntPtr.Zero);
                             IntPtr waitPtr = Win32Helper.CreateEvent(IntPtr.Zero, true, false, "Global\\shareWaitNotify" + Guid.NewGuid());
                             IntPtr waitPtr = Win32Helper.CreateEvent(IntPtr.Zero, true, false, "Global\\shareWaitNotify" + Guid.NewGuid());
                             Win32Helper.WaitForSingleObject(waitPtr, 5000);
                             Win32Helper.WaitForSingleObject(waitPtr, 5000);
                             Win32Helper.CloseHandle(waitPtr);
                             Win32Helper.CloseHandle(waitPtr);
@@ -315,8 +314,6 @@ namespace PDF_Master
                             Win32Helper.WaitForSingleObject(waitPtr, 5000);
                             Win32Helper.WaitForSingleObject(waitPtr, 5000);
                             Win32Helper.CloseHandle(waitPtr);
                             Win32Helper.CloseHandle(waitPtr);
                         }
                         }
-
-                      
                     }
                     }
                     else
                     else
                     {
                     {
@@ -354,12 +351,10 @@ namespace PDF_Master
                                 }
                                 }
                                 catch
                                 catch
                                 {
                                 {
-
                                 }
                                 }
                             }
                             }
                         }
                         }
                     }
                     }
-                 
                 }
                 }
                 else
                 else
                 {
                 {
@@ -373,8 +368,6 @@ namespace PDF_Master
                 return;
                 return;
             }
             }
 
 
-
-
             if (!LicenseVerify())
             if (!LicenseVerify())
             {
             {
 #if !DEBUG
 #if !DEBUG
@@ -392,7 +385,7 @@ namespace PDF_Master
             InitSettings();
             InitSettings();
 
 
 #if DEBUG
 #if DEBUG
-            IsLogin =false;
+            IsLogin = false;
 #endif
 #endif
 
 
             CachePath = CacheFilePath.Instance;
             CachePath = CacheFilePath.Instance;
@@ -432,13 +425,13 @@ namespace PDF_Master
                 {
                 {
                     GuidPDFPath = Path.Combine(CachePath.GuidPDFPath, "Quick Start Guide.pdf");
                     GuidPDFPath = Path.Combine(CachePath.GuidPDFPath, "Quick Start Guide.pdf");
                 }
                 }
-
             }
             }
             catch
             catch
             {
             {
             }
             }
 
 
             #region 设置软件语系
             #region 设置软件语系
+
             List<string> lang = new List<string>() { "zh-CN", "zh-TW", "en-US" };
             List<string> lang = new List<string>() { "zh-CN", "zh-TW", "en-US" };
             CultureInfo cultureInfo = new CultureInfo("en-US");
             CultureInfo cultureInfo = new CultureInfo("en-US");
             //if (lang.Contains(Settings.Default.AppProperties.culture))
             //if (lang.Contains(Settings.Default.AppProperties.culture))
@@ -454,7 +447,7 @@ namespace PDF_Master
             }
             }
             catch { }
             catch { }
 
 
-            #endregion
+            #endregion 设置软件语系
 
 
             //启动循环检查更新线程
             //启动循环检查更新线程
             CheckUpdate();
             CheckUpdate();
@@ -473,6 +466,7 @@ namespace PDF_Master
 
 
             base.OnStartup(e);
             base.OnStartup(e);
         }
         }
+
         /// <summary>
         /// <summary>
         /// 解析是否带参数启动
         /// 解析是否带参数启动
         /// </summary>
         /// </summary>
@@ -545,6 +539,7 @@ namespace PDF_Master
             Crashes.TrackError(e.Exception);
             Crashes.TrackError(e.Exception);
 #endif
 #endif
         }
         }
+
         /// <summary>
         /// <summary>
         /// 创建启动窗口
         /// 创建启动窗口
         /// </summary>
         /// </summary>
@@ -758,7 +753,6 @@ namespace PDF_Master
             containerRegistry.RegisterDialog<SubscriptionOKDialog>(DialogNames.SubscriptionOKDialog);
             containerRegistry.RegisterDialog<SubscriptionOKDialog>(DialogNames.SubscriptionOKDialog);
             containerRegistry.RegisterDialog<LoginoffDialog>(DialogNames.LoginoffDialog);
             containerRegistry.RegisterDialog<LoginoffDialog>(DialogNames.LoginoffDialog);
 
 
-
             //新手引导弹窗
             //新手引导弹窗
             containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
             containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
             containerRegistry.RegisterDialog<IAPCompareDialog>(DialogNames.IAPCompareDialog);
             containerRegistry.RegisterDialog<IAPCompareDialog>(DialogNames.IAPCompareDialog);
@@ -773,7 +767,8 @@ namespace PDF_Master
 
 
             //OCR下载弹窗
             //OCR下载弹窗
             containerRegistry.RegisterDialog<OCRDownloadProgress>(DialogNames.OCRDownloadProgress);
             containerRegistry.RegisterDialog<OCRDownloadProgress>(DialogNames.OCRDownloadProgress);
-            
+
+            containerRegistry.RegisterDialog<ChangeEmailDialog>(DialogNames.ChangeEmailDialog);
 
 
             #endregion 注册弹窗
             #endregion 注册弹窗
         }
         }
@@ -826,7 +821,6 @@ namespace PDF_Master
                 Trace.WriteLine("CPDFSDK License Code." + verifyResult + "\n");
                 Trace.WriteLine("CPDFSDK License Code." + verifyResult + "\n");
                 if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
                 if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
                     return false;
                     return false;
-
             }
             }
             catch { Trace.WriteLine("CPDFSDK License Code Error \n"); }
             catch { Trace.WriteLine("CPDFSDK License Code Error \n"); }
 
 
@@ -848,10 +842,10 @@ namespace PDF_Master
                 return false;
                 return false;
                 }
                 }
                 CPDFConverter.Init(resPath);*/
                 CPDFConverter.Init(resPath);*/
-               
+
                 string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
                 string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
                 CPDFConverter.Init(resPath);
                 CPDFConverter.Init(resPath);
-                
+
                 LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
                 LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
                 //初始化ocr库
                 //初始化ocr库
                 CPDFConverter.InitOCRLibrary(Path.Combine(resPath, "x64"));
                 CPDFConverter.InitOCRLibrary(Path.Combine(resPath, "x64"));
@@ -909,9 +903,11 @@ namespace PDF_Master
                     case "zh-CN":
                     case "zh-CN":
                         lang = "zh_Hans";
                         lang = "zh_Hans";
                         break;
                         break;
+
                     case "zh-TW":
                     case "zh-TW":
                         lang = "zh_Hant";
                         lang = "zh_Hant";
                         break;
                         break;
+
                     default:
                     default:
                         lang = "en_Us";
                         lang = "en_Us";
                         break;
                         break;
@@ -953,7 +949,6 @@ namespace PDF_Master
             }
             }
             catch
             catch
             {
             {
-
             }
             }
         }
         }
 
 

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

@@ -246,5 +246,10 @@ namespace PDF_Master.Model
         public static string SelectedTranslation = "SelectedTranslationDialog";
         public static string SelectedTranslation = "SelectedTranslationDialog";
 
 
         public static string OCRDownloadProgress = "OCRDownloadProgress";
         public static string OCRDownloadProgress = "OCRDownloadProgress";
+
+        /// <summary>
+        ///个人中心-更换邮箱
+        /// </summary>
+        public static string ChangeEmailDialog = "ChangeEmailDialog";
     }
     }
 }
 }

+ 5 - 0
PDF Office/PDF Master.csproj

@@ -527,6 +527,7 @@
       <DependentUpon>Service.resx</DependentUpon>
       <DependentUpon>Service.resx</DependentUpon>
     </Compile>
     </Compile>
     <Compile Include="ViewModels\Dialog\ChatGPTAIDialogs\DocumentaryTranslationDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ChatGPTAIDialogs\DocumentaryTranslationDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ServiceDialog\ChangeEmailDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\LoginoffViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\LoginoffViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\SubscriptionDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\SubscriptionDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\SubscriptionOKDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\SubscriptionOKDialogViewModel.cs" />
@@ -1485,6 +1486,10 @@
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>
     </Page>
     </Page>
+    <Page Include="Styles\RegisterStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\SeparatorStyle.xaml">
     <Page Include="Styles\SeparatorStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>

File diff suppressed because it is too large
+ 217 - 0
PDF Office/Styles/RegisterStyle.xaml


+ 33 - 0
PDF Office/ViewModels/Dialog/ServiceDialog/ChangeEmailDialogViewModel.cs

@@ -0,0 +1,33 @@
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Master.ViewModels.Dialog.ServiceDialog
+{
+    public class ChangeEmailDialogViewModel : BindableBase, IDialogAware
+    {
+        public string Title => throw new NotImplementedException();
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+            //throw new NotImplementedException();
+        }
+
+        public void OnDialogClosed()
+        {
+            //throw new NotImplementedException();
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            //throw new NotImplementedException();
+        }
+    }
+}

+ 24 - 2
PDF Office/ViewModels/Dialog/ServiceDialog/UserDialogViewModel.cs

@@ -6,6 +6,8 @@ using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Media;
 using PDF_Master.CustomControl;
 using PDF_Master.CustomControl;
 using PDF_Master.Helper;
 using PDF_Master.Helper;
+using PDF_Master.Model.HomePageToolsDialogs;
+using PDF_Master.Model;
 using PDF_Master.Properties;
 using PDF_Master.Properties;
 using Prism.Commands;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Mvvm;
@@ -18,6 +20,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
     {
     {
         private string uuid = ServiceHelper.GetDeviceSerialNumber();
         private string uuid = ServiceHelper.GetDeviceSerialNumber();
         public IRegionManager Region;
         public IRegionManager Region;
+        private IDialogService dialogs;
         public string Title => "";
         public string Title => "";
 
 
         public event Action<IDialogResult> RequestClose;
         public event Action<IDialogResult> RequestClose;
@@ -344,18 +347,20 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         public DelegateCommand UserOutCommand { get; set; }
         public DelegateCommand UserOutCommand { get; set; }
         public DelegateCommand LogOutCommand { get; set; }
         public DelegateCommand LogOutCommand { get; set; }
         public DelegateCommand LinkuserdataCommand { get; set; }
         public DelegateCommand LinkuserdataCommand { get; set; }
-       
 
 
+        public DelegateCommand ChangeEmailCommand { get; set; }
         UserDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         UserDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
         {
             this.Region = regionManager;
             this.Region = regionManager;
+            this.dialogs=dialogService;
+
             InitString();
             InitString();
             UserRegionName = Guid.NewGuid().ToString();
             UserRegionName = Guid.NewGuid().ToString();
             UserOutCommand = new DelegateCommand(UserOut);
             UserOutCommand = new DelegateCommand(UserOut);
             LogOutCommand = new DelegateCommand(LogOut);
             LogOutCommand = new DelegateCommand(LogOut);
             LinkstoreCommand = new DelegateCommand(Linkstore);
             LinkstoreCommand = new DelegateCommand(Linkstore);
             LinkuserdataCommand = new DelegateCommand(Linkuserdata);
             LinkuserdataCommand = new DelegateCommand(Linkuserdata);
-
+            ChangeEmailCommand = new DelegateCommand(ChangeEmail);
 
 
             TextSubscribeEndtime = Settings.Default.UserDate.subscribeendDate;
             TextSubscribeEndtime = Settings.Default.UserDate.subscribeendDate;
             UserEmail = Settings.Default.UserDate.Email;
             UserEmail = Settings.Default.UserDate.Email;
@@ -402,6 +407,23 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
   
   
 
 
         }
         }
+
+        private void ChangeEmail()
+        {
+            dialogs.ShowDialog(DialogNames.ChangeEmailDialog, null , e =>
+            {
+                if (e.Result == ButtonResult.OK && e.Parameters != null)
+                {
+                    //付费锁
+                    if (!ServiceHelper.IAPBeforeFunction())
+                    {
+                        return;
+                    }
+                   
+                }
+            });
+        }
+
         private void Linkstore()
         private void Linkstore()
         {
         {
             Process.Start(new ProcessStartInfo(Uristore));
             Process.Start(new ProcessStartInfo(Uristore));

File diff suppressed because it is too large
+ 144 - 7
PDF Office/Views/Dialog/ServiceDialog/ChangeEmailDialog.xaml


+ 24 - 20
PDF Office/Views/Dialog/ServiceDialog/ChangeEmailDialog.xaml.cs

@@ -15,30 +15,34 @@ using System.Windows.Shapes;
 
 
 namespace PDF_Master.Views.Dialog.ServiceDialog
 namespace PDF_Master.Views.Dialog.ServiceDialog
 {
 {
-    /// <summary>
+/// <summary>
     /// ChangeEmailDialog.xaml 的交互逻辑
     /// ChangeEmailDialog.xaml 的交互逻辑
-    /// </summary>
-    public partial class ChangeEmailDialog : UserControl
-    {
-        public ChangeEmailDialog()
-        {
-            InitializeComponent();
-        }
+/// </summary>
+public partial class ChangeEmailDialog : UserControl
+{
+public ChangeEmailDialog()
+{
+InitializeComponent();
+}
 
 
-        private void BtnNext_Click(object sender, RoutedEventArgs e)
+private void BtnNext_Click(object sender, RoutedEventArgs e)
+{
+  if (StepBar.Items.Count > 0 && StepBar.CurrentIndex < (StepBar.Items.Count - 1))
+  {
+  StepBar.CurrentIndex++;
+  }
+  }
+
+  private void BtnPrevious_Click(object sender, RoutedEventArgs e)
+  {
+  if (StepBar.Items.Count > 0 && StepBar.CurrentIndex != 0)
         {
         {
-            if (StepBar.Items.Count > 0 && StepBar.CurrentIndex < (StepBar.Items.Count - 1))
-            {
-                StepBar.CurrentIndex++;
-            }
+        StepBar.CurrentIndex--;
+        }
         }
         }
 
 
-        private void BtnPrevious_Click(object sender, RoutedEventArgs e)
+        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
         {
         {
-            if (StepBar.Items.Count > 0 && StepBar.CurrentIndex != 0)
-            {
-                StepBar.CurrentIndex--;
-            }
         }
         }
-    }
-}
+        }
+        }

+ 22 - 22
PDF Office/Views/Dialog/ServiceDialog/UserDialog.xaml

@@ -109,32 +109,32 @@
                         Text="{Binding UserEmail}"
                         Text="{Binding UserEmail}"
                         TextAlignment="Center"
                         TextAlignment="Center"
                         TextWrapping="Wrap" />
                         TextWrapping="Wrap" />
-
+                    <Button Command="{Binding ChangeEmailCommand}" Content="Change Email" />
                 </StackPanel>
                 </StackPanel>
             </Grid>
             </Grid>
             <TextBlock
             <TextBlock
                 Height="54"
                 Height="54"
-                    Margin="0,24,0,0"
-                    Visibility="{Binding LinkuserdataVis,Mode=TwoWay}"
-                    FontFamily="Segoe UI"
-                    FontSize="14"
-                    Foreground="#1770F4"
-                    LineHeight="22">
-                    <Hyperlink Command="{Binding LinkuserdataCommand}">
-                        <Hyperlink.Style>
-                            <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
-                                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
-                                <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
-                                <Style.Triggers>
-                                    <Trigger Property="IsMouseOver" Value="True">
-                                        <Setter Property="TextBlock.TextDecorations" Value="None" />
-                                    </Trigger>
-                                </Style.Triggers>
-                            </Style>
-                        </Hyperlink.Style>
-                        <TextBlock Text="{Binding TextOrderInformation}" />
-                    </Hyperlink>
-                </TextBlock>
+                Margin="0,24,0,0"
+                FontFamily="Segoe UI"
+                FontSize="14"
+                Foreground="#1770F4"
+                LineHeight="22"
+                Visibility="{Binding LinkuserdataVis, Mode=TwoWay}">
+                <Hyperlink Command="{Binding LinkuserdataCommand}">
+                    <Hyperlink.Style>
+                        <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
+                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                            <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
+                            <Style.Triggers>
+                                <Trigger Property="IsMouseOver" Value="True">
+                                    <Setter Property="TextBlock.TextDecorations" Value="None" />
+                                </Trigger>
+                            </Style.Triggers>
+                        </Style>
+                    </Hyperlink.Style>
+                    <TextBlock Text="{Binding TextOrderInformation}" />
+                </Hyperlink>
+            </TextBlock>
             <StackPanel
             <StackPanel
                 Width="392"
                 Width="392"
                 Margin="0,22,0,30"
                 Margin="0,22,0,30"