|
@@ -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;
|