Ver Fonte

修复BUG18566,18565,18587,18633

(cherry picked from commit 135f4aa1a5ca2bebb449838e6582854fbad6d622)
lvle há 1 ano atrás
pai
commit
9c3f0954f3

+ 4 - 4
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -467,8 +467,8 @@
           <target state="new">Convert</target>
         </trans-unit>
         <trans-unit id="TextConvertPDF" translate="yes" xml:space="preserve">
-          <source>Convert PDF to Word/Excel/PPT and more</source>
-          <target state="new">Convert PDF to Word/Excel/PPT and more</target>
+          <source>Convert PDF to Office and more</source>
+          <target state="new">Convert PDF to Office and more</target>
         </trans-unit>
         <trans-unit id="TextConvertPDFto" translate="yes" xml:space="preserve">
           <source>Convert PDF to Office and image without any limitations, get converted files in high quality</source>
@@ -507,8 +507,8 @@
           <target state="new">More Features</target>
         </trans-unit>
         <trans-unit id="Textoff" translate="yes" xml:space="preserve">
-          <source>50% off</source>
-          <target state="new">50% off</target>
+          <source>50% OFF</source>
+          <target state="new">50% OFF</target>
         </trans-unit>
         <trans-unit id="TextOnTrial" translate="yes" xml:space="preserve">
           <source>On Trial</source>

+ 4 - 4
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -467,8 +467,8 @@
           <target state="new">Convert</target>
         </trans-unit>
         <trans-unit id="TextConvertPDF" translate="yes" xml:space="preserve">
-          <source>Convert PDF to Word/Excel/PPT and more</source>
-          <target state="new">Convert PDF to Word/Excel/PPT and more</target>
+          <source>Convert PDF to Office and more</source>
+          <target state="new">Convert PDF to Office and more</target>
         </trans-unit>
         <trans-unit id="TextConvertPDFto" translate="yes" xml:space="preserve">
           <source>Convert PDF to Office and image without any limitations, get converted files in high quality</source>
@@ -507,8 +507,8 @@
           <target state="new">More Features</target>
         </trans-unit>
         <trans-unit id="Textoff" translate="yes" xml:space="preserve">
-          <source>50% off</source>
-          <target state="new">50% off</target>
+          <source>50% OFF</source>
+          <target state="new">50% OFF</target>
         </trans-unit>
         <trans-unit id="TextOnTrial" translate="yes" xml:space="preserve">
           <source>On Trial</source>

+ 4 - 4
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -467,8 +467,8 @@
           <target state="new">Convert</target>
         </trans-unit>
         <trans-unit id="TextConvertPDF" translate="yes" xml:space="preserve">
-          <source>Convert PDF to Word/Excel/PPT and more</source>
-          <target state="new">Convert PDF to Word/Excel/PPT and more</target>
+          <source>Convert PDF to Office and more</source>
+          <target state="new">Convert PDF to Office and more</target>
         </trans-unit>
         <trans-unit id="TextConvertPDFto" translate="yes" xml:space="preserve">
           <source>Convert PDF to Office and image without any limitations, get converted files in high quality</source>
@@ -507,8 +507,8 @@
           <target state="new">More Features</target>
         </trans-unit>
         <trans-unit id="Textoff" translate="yes" xml:space="preserve">
-          <source>50% off</source>
-          <target state="new">50% off</target>
+          <source>50% OFF</source>
+          <target state="new">50% OFF</target>
         </trans-unit>
         <trans-unit id="TextOnTrial" translate="yes" xml:space="preserve">
           <source>On Trial</source>

+ 2 - 2
PDF Office/Strings/Service/Service.Designer.cs

@@ -1132,7 +1132,7 @@ namespace PDF_Master.Strings.Service {
         }
         
         /// <summary>
-        ///   查找类似 Convert PDF to Word/Excel/PPT and more 的本地化字符串。
+        ///   查找类似 Convert PDF to Office and more 的本地化字符串。
         /// </summary>
         public static string TextConvertPDF {
             get {
@@ -1222,7 +1222,7 @@ namespace PDF_Master.Strings.Service {
         }
         
         /// <summary>
-        ///   查找类似 50% off 的本地化字符串。
+        ///   查找类似 50% OFF 的本地化字符串。
         /// </summary>
         public static string Textoff {
             get {

+ 2 - 2
PDF Office/Strings/Service/Service.resx

@@ -286,7 +286,7 @@
     <value>Convert</value>
   </data>
   <data name="TextConvertPDF" xml:space="preserve">
-    <value>Convert PDF to Word/Excel/PPT and more</value>
+    <value>Convert PDF to Office and more</value>
   </data>
   <data name="TextConvertPDFto" xml:space="preserve">
     <value>Convert PDF to Office and image without any limitations, get converted files in high quality</value>
@@ -316,7 +316,7 @@
     <value>More Features</value>
   </data>
   <data name="Textoff" xml:space="preserve">
-    <value>50% off</value>
+    <value>50% OFF</value>
   </data>
   <data name="TextOnTrial" xml:space="preserve">
     <value>On Trial</value>

+ 25 - 9
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialogViewModel.cs

@@ -110,6 +110,7 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         public CPDFViewer PDFViewer;
 
         public ViewContentViewModel viewContentViewModel;
+        public IDialogService dialogs;
 
         private CPDFViewer pdfViewer = null;
 
@@ -218,8 +219,9 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         public DelegateCommand CancelCommand { get; set; }
         public DelegateCommand CancelProgressCommand { get; set; }
         #endregion
-        public DocumentaryTranslationDialogViewModel(IRegionManager regionManager)
+        public DocumentaryTranslationDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
+            dialogs = dialogService;
             this.regionManager = regionManager;
             CancelCommand = new DelegateCommand(cancel);
             TranslateCommand = new DelegateCommand(translate);
@@ -264,15 +266,29 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         /// </summary>
         public async void translate()
         {
-            //添加付费拦截锁
-            if (!ServiceHelper.IAPBeforeFunction())
+            bool flg = false;
+            //权益弹窗
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
             {
-                return;
-            }
-            if (Settings.Default.UserDate.subscribestatus != 1)
-            {
-                App.mainWindowViewModel.dialogs.ShowDialog(DialogNames.IAPCompareDialog);
-                return;
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.Open, "AI");
+                dialogs.ShowDialog(DialogNames.SubscriptionDialog, value, dialogResult =>
+                {
+                    if (dialogResult.Result == ButtonResult.OK)
+                    {
+                        flg = true;
+                    }
+                    else
+                    {
+                        flg = false;
+                    }
+
+
+                });
+                if (flg == false)
+                {
+                    return ;
+                }
             }
             ProgressVisible = Visibility.Visible;
             Value = 1;

+ 25 - 10
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs

@@ -260,10 +260,11 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         public DelegateCommand TranslateCommand { get; set; }
         public DelegateCommand CopyCommand { get; set; }
         public DelegateCommand<object> textBoxEnterCharactersTextChangedCommad { get; set; }
-
+        public IDialogService dialogs;
         #endregion
-        public SelectedTranslationDialogViewModel()
+        public SelectedTranslationDialogViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             TranslateCommand = new DelegateCommand(translate);
             CopyCommand = new DelegateCommand(copy);
             textBoxEnterCharactersTextChangedCommad = new DelegateCommand<object>(textBoxEnterCharactersTextChanged);
@@ -312,15 +313,29 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         public async void translate()
         {
 
-            //添加付费拦截锁
-            if (!ServiceHelper.IAPBeforeFunction())
-            {
-                return;
-            }
-            if (Settings.Default.UserDate.subscribestatus != 1)
+            bool flg = false;
+            //权益弹窗
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
             {
-                App.mainWindowViewModel.dialogs.ShowDialog(DialogNames.IAPCompareDialog);
-                return;
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.Open, "AI");
+                dialogs.ShowDialog(DialogNames.SubscriptionDialog, value, dialogResult =>
+                {
+                    if (dialogResult.Result == ButtonResult.OK)
+                    {
+                        flg = true;
+                    }
+                    else
+                    {
+                        flg = false;
+                    }
+
+
+                });
+                if (flg == false)
+                {
+                    return;
+                }
             }
             ErrorVisible = Visibility.Collapsed;
             ProgressVisible = Visibility.Visible;

+ 35 - 2
PDF Office/ViewModels/Dialog/ServiceDialog/SubscriptionDialogViewModel.cs

@@ -48,6 +48,33 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             }
         }
 
+        private double _RightBtnWidth = 192;
+
+        public double RightBtnWidth
+        {
+            get { return _RightBtnWidth; }
+            set
+            {
+                SetProperty(ref _RightBtnWidth, value);
+            }
+        }
+
+
+
+        /// <summary>
+        /// 左边按钮的vis
+        /// </summary>
+        private Visibility _LeftBtnVis = Visibility.Visible;
+
+        public Visibility LeftBtnVis
+        {
+            get { return _LeftBtnVis; }
+            set
+            {
+                SetProperty(ref _LeftBtnVis, value);
+            }
+        }
+
 
         /// <summary>
         /// 价格优惠
@@ -63,6 +90,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             }
         }
 
+
         private string _TextSubscriptionBenefit;
         public string TextSubscriptionBenefit
         {
@@ -209,7 +237,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             {
                 RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
             }
-            else
+            else 
             {
                if( viewContentViewModel.saveAsFile(null, IsFormSave)==false)
                 {
@@ -220,6 +248,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                     RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
                 }
             }
+                 
         }
 
         /// <summary>
@@ -284,7 +313,11 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         {
             parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             parameters.TryGetValue<String>(ParameterNames.Open, out open);
-
+            if (open == "AI")
+            {
+                LeftBtnVis = Visibility.Collapsed;
+                RightBtnWidth = 280;
+            }
         }
 
     }   

+ 25 - 10
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContentViewModel.cs

@@ -109,7 +109,7 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 
         #region 参数和属性
         public HomeContentViewModel homeContentViewModel = null;
-
+        public IDialogService dialogs;
         private string inputText;
 
         public string InputText
@@ -180,8 +180,9 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 
         #endregion
 
-        public ChatGPTAIErrorCorrectionContentViewModel()
+        public ChatGPTAIErrorCorrectionContentViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             CopyCommand = new DelegateCommand(copy);
             ErrorCorrectionCommand = new DelegateCommand(errorCorrection);
             textBoxEnterCharactersTextChangedCommad = new DelegateCommand<object>(textBoxEnterCharactersTextChanged);
@@ -233,15 +234,29 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
         /// </summary>
         public async void errorCorrection()
         {
-            //添加付费拦截锁
-            if (!ServiceHelper.IAPBeforeFunction())
-            {
-                return;
-            }
-            if(Settings.Default.UserDate.subscribestatus!=1)
+            bool flg = false;
+            //权益弹窗
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
             {
-                App.mainWindowViewModel.dialogs.ShowDialog(DialogNames.IAPCompareDialog);
-                return;
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.Open, "AI");
+                dialogs.ShowDialog(DialogNames.SubscriptionDialog, value, dialogResult =>
+                {
+                    if (dialogResult.Result == ButtonResult.OK)
+                    {
+                        flg = true;
+                    }
+                    else
+                    {
+                        flg = false;
+                    }
+
+
+                });
+                if (flg == false)
+                {
+                    return;
+                }
             }
             ErrorVisible = Visibility.Collapsed;
             await Task.Run(async delegate

+ 25 - 10
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIRewritingContentViewModel.cs

@@ -110,7 +110,7 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 
         #region 参数和属性
         public HomeContentViewModel homeContentViewModel = null;
-
+        public IDialogService dialogs;
         private string inputText;
 
         public string InputText
@@ -181,8 +181,9 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 
         #endregion
 
-        public ChatGPTAIRewritingContentViewModel()
+        public ChatGPTAIRewritingContentViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             CopyCommand = new DelegateCommand(copy);
             RewriteCommand = new DelegateCommand(rewrite);
             textBoxEnterCharactersTextChangedCommad = new DelegateCommand<object>(textBoxEnterCharactersTextChanged);
@@ -235,15 +236,29 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
         /// </summary>
         public async void rewrite() 
         {
-            //添加付费拦截锁
-            if (!ServiceHelper.IAPBeforeFunction())
-            {
-                return;
-            }
-            if (Settings.Default.UserDate.subscribestatus != 1)
+            bool flg = false;
+            //权益弹窗
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
             {
-                App.mainWindowViewModel.dialogs.ShowDialog(DialogNames.IAPCompareDialog);
-                return;
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.Open, "AI");
+                dialogs.ShowDialog(DialogNames.SubscriptionDialog, value, dialogResult =>
+                {
+                    if (dialogResult.Result == ButtonResult.OK)
+                    {
+                        flg = true;
+                    }
+                    else
+                    {
+                        flg = false;
+                    }
+
+
+                });
+                if (flg == false)
+                {
+                    return;
+                }
             }
             ErrorVisible = Visibility.Collapsed;
             await Task.Run(async delegate

+ 25 - 10
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAITranslationContentViewModel.cs

@@ -107,7 +107,7 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 
         #region 参数和属性
         public HomeContentViewModel homeContentViewModel = null;
-
+        public IDialogService dialogs;
         /// <summary>
         /// 初始化需要翻译的内容语言
         /// </summary>
@@ -200,8 +200,9 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
         public DelegateCommand SelectFilesCommand { get; set; }
         #endregion
 
-        public ChatGPTAITranslationContentViewModel()
+        public ChatGPTAITranslationContentViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             SelectFilesCommand = new DelegateCommand(selectFiles);
             dispatcherTimer.Interval = TimeSpan.FromSeconds(3);
             dispatcherTimer.Tick += Dispatchertimer_Tick;
@@ -237,15 +238,29 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
         /// </summary>
         public async void selectFiles()
         {
-            //添加付费拦截锁
-            if (!ServiceHelper.IAPBeforeFunction())
-            {
-                return;
-            }
-            if (Settings.Default.UserDate.subscribestatus != 1)
+            bool flg = false;
+            //权益弹窗
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
             {
-                App.mainWindowViewModel.dialogs.ShowDialog(DialogNames.IAPCompareDialog);
-                return;
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.Open, "AI");
+                dialogs.ShowDialog(DialogNames.SubscriptionDialog, value, dialogResult =>
+                {
+                    if (dialogResult.Result == ButtonResult.OK)
+                    {
+                        flg = true;
+                    }
+                    else
+                    {
+                        flg = false;
+                    }
+
+
+                });
+                if (flg == false)
+                {
+                    return;
+                }
             }
             string word = Properties.Resources.wordex;
             string pdf = Properties.Resources.pdf;

+ 5 - 5
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -360,11 +360,11 @@ namespace PDF_Master.ViewModels.Tools
                 case "Link"://链接
                             //付费锁
                             //判断本地有没有token,没有显示登录,有再判断登录状态
-                            //if (!ServiceHelper.IAPBeforeFunction())
-                            //{
-                            //    StrAnnotToolChecked = "";
-                            //    return;
-                            //}
+                    if (!ServiceHelper.IAPBeforeFunction())
+                    {
+                        StrAnnotToolChecked = "";
+                        return;
+                    }
                     PropertyPanel.IsAddLink = true;
                     ViewContentViewModel.IsRightMenuCreateLink = isRightMenuAdd;
                     annotArgs = GetLink();

+ 1 - 6
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -492,12 +492,7 @@ namespace PDF_Master.ViewModels.Tools
                     annotHandler = GetArrowLine("Line");
                 }
                 if (str == AddAnnotType.AnnotLink.ToString())
-                {
-                    //添加付费拦截锁
-                    if (!ServiceHelper.IAPBeforeFunction())
-                    {
-                        return;
-                    }
+                {
                     PropertyPanel.IsAddLink = true;
                     ViewContentViewModel.IsRightMenuCreateLink = true;
                     annotHandler = GetLink();

+ 4 - 0
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -3280,6 +3280,10 @@ namespace PDF_Master.ViewModels
         /// </summary>
         private void saveAsFlatten()
         {
+            if (!ServiceHelper.IAPBeforeFunction())
+            {
+                return;
+            }
             var dlg = new SaveFileDialog();
             dlg.Filter = Properties.Resources.OpenDialogFilter;
             dlg.FileName = PDFViewer.Document.FileName + "_Flattened.pdf";

+ 1 - 1
PDF Office/Views/Dialog/ServiceDialog/RegisterOKRegion.xaml

@@ -87,7 +87,7 @@
                 <TextBlock
                     FontFamily="Segoe UI"
                     FontSize="14"
-                    Foreground="#252629"
+                    Foreground="#1AD598"
                     LineHeight="22"
                     Text="{Binding TextOrsubscribe}"
                     TextWrapping="Wrap" />

+ 9 - 9
PDF Office/Views/Dialog/ServiceDialog/SubscriptionDialog.xaml

@@ -6,8 +6,8 @@
     xmlns:local="clr-namespace:PDF_Master.Views.Dialog.ServiceDialog"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
-    Width="432"
-    Height="446"
+    Width="448"
+    Height="430"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
@@ -126,14 +126,14 @@
             </StackPanel>
         </StackPanel>
         <WrapPanel
-            Width="377"
             Height="40"
-            Margin="24,366,0,0"
-            HorizontalAlignment="Left"
+            Margin="0,366,0,0"
+            HorizontalAlignment="Center"
             VerticalAlignment="Top">
             <Button
-                Width="177"
+                Width="192"
                 Height="40"
+                Visibility="{Binding LeftBtnVis}"
                 Command="{Binding WarermarkSavingCommand}"
                 Content="{Binding BtnTextSavewithWatermark}"
                 FontFamily="Segoe UI"
@@ -173,7 +173,7 @@
                     HorizontalAlignment="Right"
                     VerticalAlignment="Top"
                     Panel.ZIndex="1"
-                    Background="#FFDE8A"
+                    Background="#FFE297"
                     CornerRadius="10,10,10,0"
                     Visibility="{Binding Vishalfprice}">
                     <TextBlock
@@ -186,7 +186,7 @@
                         Text="{Binding Textoff}" />
                 </Border>
                 <Button
-                    Width="177"
+                    Width="{Binding RightBtnWidth}"
                     Height="40"
                     Margin="16,0,0,0"
                     Command="{Binding LinkstoreCommand}"
@@ -200,7 +200,7 @@
         </WrapPanel>
         <Button
             Width="Auto"
-            Height="40"
+            Height="20"
             Margin="2"
             HorizontalAlignment="Right"
             VerticalAlignment="Bottom"