Просмотр исходного кода

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

OYXH\oyxh 1 год назад
Родитель
Сommit
d9105fc6c1

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

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

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

@@ -246,5 +246,10 @@ namespace PDF_Master.Model
         public static string SelectedTranslation = "SelectedTranslationDialog";
 
         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>
     </Compile>
     <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\SubscriptionDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ServiceDialog\SubscriptionOKDialogViewModel.cs" />
@@ -1485,6 +1486,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\RegisterStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\SeparatorStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>

Разница между файлами не показана из-за своего большого размера
+ 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 PDF_Master.CustomControl;
 using PDF_Master.Helper;
+using PDF_Master.Model.HomePageToolsDialogs;
+using PDF_Master.Model;
 using PDF_Master.Properties;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -18,6 +20,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
     {
         private string uuid = ServiceHelper.GetDeviceSerialNumber();
         public IRegionManager Region;
+        private IDialogService dialogs;
         public string Title => "";
 
         public event Action<IDialogResult> RequestClose;
@@ -344,18 +347,20 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         public DelegateCommand UserOutCommand { get; set; }
         public DelegateCommand LogOutCommand { get; set; }
         public DelegateCommand LinkuserdataCommand { get; set; }
-       
 
+        public DelegateCommand ChangeEmailCommand { get; set; }
         UserDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
             this.Region = regionManager;
+            this.dialogs=dialogService;
+
             InitString();
             UserRegionName = Guid.NewGuid().ToString();
             UserOutCommand = new DelegateCommand(UserOut);
             LogOutCommand = new DelegateCommand(LogOut);
             LinkstoreCommand = new DelegateCommand(Linkstore);
             LinkuserdataCommand = new DelegateCommand(Linkuserdata);
-
+            ChangeEmailCommand = new DelegateCommand(ChangeEmail);
 
             TextSubscribeEndtime = Settings.Default.UserDate.subscribeendDate;
             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()
         {
             Process.Start(new ProcessStartInfo(Uristore));

Разница между файлами не показана из-за своего большого размера
+ 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
 {
-    /// <summary>
+/// <summary>
     /// 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}"
                         TextAlignment="Center"
                         TextWrapping="Wrap" />
-
+                    <Button Command="{Binding ChangeEmailCommand}" Content="Change Email" />
                 </StackPanel>
             </Grid>
             <TextBlock
                 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
                 Width="392"
                 Margin="0,22,0,30"