Pārlūkot izejas kodu

轻会员-BUG:水印保存逻辑,18387,18309,18386修复

lvle 1 gadu atpakaļ
vecāks
revīzija
eebe432ca8

+ 4 - 0
PDF Office/Model/ParameterNames.cs

@@ -55,6 +55,10 @@ namespace PDF_Master.Model
         /// </summary>
         public static string Open = "Open";
 
+        /// <summary>
+        /// 来自登录下线
+        /// </summary>
+        public static string Loginoff = "Loginoff";
         /// <summary>
         /// 页码集合
         /// </summary>

BIN
PDF Office/Resources/Service/Warermark.png


+ 9 - 0
PDF Office/Strings/Service/Service.Designer.cs

@@ -1041,6 +1041,15 @@ namespace PDF_Master.Strings.Service {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Cancellation failed 的本地化字符串。
+        /// </summary>
+        public static string TextCancellationtop {
+            get {
+                return ResourceManager.GetString("TextCancellationtop", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Change Password 的本地化字符串。
         /// </summary>

+ 3 - 0
PDF Office/Strings/Service/Service.resx

@@ -255,6 +255,9 @@
   <data name="TextCancellation" xml:space="preserve">
     <value>Cancellation failed, please apply for cancellation when the subscription ends</value>
   </data>
+  <data name="TextCancellationtop" xml:space="preserve">
+    <value>Cancellation failed</value>
+  </data>
   <data name="TextChange" xml:space="preserve">
     <value>Change Password</value>
   </data>

+ 14 - 0
PDF Office/ViewModels/Dialog/ServiceDialog/CodeRegionViewModel.cs

@@ -282,6 +282,13 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                     Timebegin();
 
                 }
+                else
+                {
+                    RegisterCodemsg = ErrorCodeHelper.Ercode("codehad");
+                    Bordcolor = "#F3465B";
+                    BottomBackgroubd = "#FFF1C1";
+                    RegisterCodemsgVis = Visibility.Visible;
+                }
 
             }
             else
@@ -305,6 +312,13 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                     Timebegin();
 
                 }
+                else
+                {
+                    RegisterCodemsg = ErrorCodeHelper.Ercode("codehad");
+                    Bordcolor = "#F3465B";
+                    BottomBackgroubd = "#FFF1C1";
+                    RegisterCodemsgVis = Visibility.Visible;
+                }
 
             }
             if (CodeType == "user_reset_password")

+ 10 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/LoginDialogViewModel.cs

@@ -20,7 +20,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         public IDialogService dialogs;
         public IRegionManager Region;
         public string Title => "登录窗口";
-
+        private string Loginoff;
         public event Action<IDialogResult> RequestClose;
 
 
@@ -160,6 +160,14 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                 RegionMan("NOInternetRegion");
             }
             else { RegionMan("LoginRegion"); }
+
+            parameters.TryGetValue<String>(ParameterNames.Loginoff, out Loginoff);
+            if (Loginoff != null)
+            {
+                LoginEmail = Settings.Default.UserDate.Email;
+                IsReset = true;
+                RegionMan("CodeRegion");
+            }
         }
 
         private void InitString()
@@ -190,6 +198,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             this.Region = regionManager;
             LoginRegionName = Guid.NewGuid().ToString();
             InitString();
+
         }
         private void OpenIAP()
         {

+ 32 - 5
PDF Office/ViewModels/Dialog/ServiceDialog/LoginoffViewModel.cs

@@ -15,7 +15,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
     {
 
 
-
+        public IRegionManager Region;
         public string Title => "";
 
         public event Action<IDialogResult> RequestClose;
@@ -50,10 +50,28 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             set { _TextOK = value; }
         }
 
+        private string _TextCancel;
+        public string TextCancel
+        {
+            get { return _TextCancel; }
+            set { _TextCancel = value; }
+        }
 
+        private string _TextLogin;
+        public string TextLogin
+        {
+            get { return _TextLogin; }
+            set { _TextLogin = value; }
+        }
 
-        #endregion
 
+        private string _LoginoffRegionName;
+        public string LoginoffRegionName
+        {
+            get { return _LoginoffRegionName; }
+            set { _LoginoffRegionName = value; }
+        }
+        #endregion
 
 
         private void InitString()
@@ -62,8 +80,9 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             TextPleaseLog = App.ServiceLoader.GetString("TextPleaseLog");
             TextYouraccount = App.ServiceLoader.GetString("TextYouraccount");
             TextChange = App.ServiceLoader.GetString("TextChange");
-            TextOK = App.ServiceLoader.GetString("TextOK");
-
+            TextOK = App.ServiceLoader.GetString("Text_ok");
+            TextCancel = App.ServiceLoader.GetString("Text_cancel");
+            TextLogin = App.ServiceLoader.GetString("Text_Login");
         }
 
 
@@ -89,10 +108,13 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
 
         public DelegateCommand GoLoginCommand { get; set; }
+        public DelegateCommand GoCodeCommand { get; set; }
+
         public LoginoffDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
-
+            GoCodeCommand= new DelegateCommand(GoCode);
             GoLoginCommand = new DelegateCommand(GoLogin);
+            LoginoffRegionName = Guid.NewGuid().ToString();
             InitString();
 
         }
@@ -109,5 +131,10 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         
         }
 
+        private void GoCode()
+        {
+            Close();
+            App.mainWindowViewModel.OpenLogin("Loginoff");
+        }
     }
 }

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

@@ -384,7 +384,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             if(Settings.Default.UserDate.subscribestatus == 1)
             {
                 AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.ShowDialog("", App.ServiceLoader.GetString("TextCancellation"), App.ServiceLoader.GetString("Text_yes"),IconType.Tip);
+                alertsMessage.ShowDialog(App.ServiceLoader.GetString("TextCancellationtop"), App.ServiceLoader.GetString("TextCancellation"), App.ServiceLoader.GetString("Text_yes"),IconType.Tip);
             }
             else
             {

+ 9 - 4
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -274,7 +274,7 @@ namespace PDF_Master.ViewModels
         public DelegateCommand CloseOCRCommand { get; set; }
 
         public DelegateCommand OpenRegisterCommand { get; set; }
-        public DelegateCommand OpenLoginCommand { get; set; }
+        public DelegateCommand<string> OpenLoginCommand { get; set; }
         public DelegateCommand OpenUserCommand { get; set; }
         public DelegateCommand LoadCommand { get; set; }
         public DelegateCommand UpgradelinkCommand { get; set; }
@@ -310,7 +310,7 @@ namespace PDF_Master.ViewModels
             AddTab = new DelegateCommand(AddTabItem);
             CloseOCRCommand = new DelegateCommand(closeocr);
             OpenRegisterCommand = new DelegateCommand(OpenRegister);
-            OpenLoginCommand = new DelegateCommand(OpenLogin);
+            OpenLoginCommand = new DelegateCommand<string>(OpenLogin);
             OpenUserCommand = new DelegateCommand(OpenUser);
             UpgradelinkCommand= new DelegateCommand(Upgradelink);
             CloseAllTabCommand = new DelegateCommand(() =>
@@ -435,9 +435,14 @@ namespace PDF_Master.ViewModels
         }
 
         //打开登录弹窗
-        public void OpenLogin()
+        public void OpenLogin(String Loginoff=null)
         {
-            dialogs.ShowDialog(DialogNames.LoginDialog);
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.Loginoff, Loginoff);
+            dialogs.ShowDialog(DialogNames.LoginDialog, value, dialogResult =>
+            {
+
+            });
         }
 
         public void OpenRegisterOK()

+ 18 - 10
PDF Office/Views/Dialog/ServiceDialog/LoginoffDialog.xaml

@@ -7,7 +7,7 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     Width="392"
-    Height="209"
+    Height="202"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
@@ -34,16 +34,15 @@
                         Text="{Binding TextPleaseLog}" />
                 </WrapPanel>
                 <TextBlock
-                    Width="392"
+                    Width="360"
                     Margin="0,16,0,0"
-                    HorizontalAlignment="Left"
+                    VerticalAlignment="Center"
+                    HorizontalAlignment="Center"
                     FontFamily="Segoe UI"
                     FontSize="14"
-                    LineHeight="22"
-                    TextAlignment="Center"
                     TextWrapping="Wrap">
                     <Run Text="{Binding TextYouraccount}" />
-                    <Hyperlink  Command="{Binding GOLoginCommand}">
+                    <Hyperlink  Command="{Binding GoCodeCommand}">
                           <Hyperlink.Style>
                         <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
                             <Setter Property="FocusVisualStyle" Value="{x:Null}" />
@@ -58,16 +57,25 @@
                         <TextBlock Margin="0,16,0,0" Text="{Binding TextChange}" />
                     </Hyperlink>
                 </TextBlock>
-                <StackPanel Margin="0,32,0,0">
+                <StackPanel Margin="200,32,0,0" Orientation="Horizontal" >
                     <Button
                         HorizontalAlignment="Right"
                         Width="80"
                         Height="32"
-                        Margin="0,0,20,0"
-                        Content="{Binding TextOK}"
-                        IsCancel="True"
                         IsDefault="True"
+                        Margin="0,0,20,0"
+                        Command="{Binding GoLoginCommand}"
+                        Content="{Binding TextLogin}"
                         Style="{StaticResource Btn.cta}" />
+
+                    <Button
+                        HorizontalAlignment="Right"
+                        Width="80"
+                        Height="32"
+                        Margin="0,0,20,0"
+                        Content="{Binding TextCancel}"
+                        IsCancel="True"
+                        Style="{StaticResource btn.sec}" />
                 </StackPanel>
 
             </StackPanel>