Browse Source

轻会员-部分高保真,轻会员-按需求修改部分逻辑

lvle 1 year ago
parent
commit
e292d9f72d

+ 4 - 2
PDF Office/Helper/ServiceHelper.cs

@@ -649,7 +649,8 @@ namespace PDF_Master.Helper
 
                     if (jobject["code"].ToObject<string>().ToLower() == "200")
                     {
-                        App.IsLogin =true;                  
+                        App.IsLogin =true;
+                        Settings.Default.UserDate.Email = intemail;
                         access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
                         Settings.Default.AppProperties.LoginToken = jobject["result"]["access_token"].ToObject<string>().ToLower();
                         Settings.Default.Save();
@@ -708,7 +709,8 @@ namespace PDF_Master.Helper
                     }
                     if (jobject["code"].ToObject<string>().ToLower() == "200")
                     {
-                        App.IsLogin = true;                  
+                        App.IsLogin = true;
+                        Settings.Default.UserDate.Email = intemail;
                         access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
                         Settings.Default.AppProperties.LoginToken = jobject["result"]["access_token"].ToObject<string>().ToLower();
                         Settings.Default.Save();

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

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -76,10 +77,11 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             }
             else { RegionMan("LoginRegion"); }
         }
-
+        public DelegateCommand LinkstoreCommand { get; set; }
         public DelegateCommand OpenIAPCommand { get; set; }
         LoginDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
+            LinkstoreCommand = new DelegateCommand(Linkstore);
             OpenIAPCommand = new DelegateCommand(OpenIAP);
             dialogs = dialogService;
             this.Region = regionManager;
@@ -90,6 +92,11 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             dialogs.ShowDialog(DialogNames.IAPCompareDialog);
 
         }
+        private void Linkstore()
+        {
+
+            Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/windows/store/permanent"));
+        }
         public void Close()
         {
            

+ 5 - 4
PDF Office/ViewModels/Dialog/ServiceDialog/LoginRegionViewModel.cs

@@ -195,7 +195,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             set { SetProperty(ref enableNextStep, value); }
         }
 
-        private string _LoginEmaillook;
+        private string _LoginEmaillook="";
         public string LoginEmaillook
         {
             get { return _LoginEmaillook; }
@@ -205,7 +205,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
         
 
-        private string _LoginEmail = "";
+        private string _LoginEmail = Settings.Default.UserDate.Email;
         public string LoginEmail
         {
             get { return _LoginEmail; }
@@ -261,13 +261,14 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         LoginRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
             dialogs = dialogService;
-
+            LinkPolicyCommand = new DelegateCommand(LinkPolicy);
+            LinkLicenseCommand = new DelegateCommand(LinkLicense);
             LoginNextCommand = new DelegateCommand(LoginNext);
             GoLoginCommand = new DelegateCommand(GoLogin);
             InitString();
+            CheckEnableNextStepEncrypt();
         }
 
-
         private void LoginNext()
         {
             if(CheckMail(LoginEmail)==true)

+ 7 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/RegisterDialogViewModel.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -75,17 +76,22 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             else { RegionMan("RegisterRegion"); };
            
         }
-
+        public DelegateCommand LinkstoreCommand { get; set; }
 
         public DelegateCommand OpenIAPCommand { get; set; }
         RegisterDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
+            LinkstoreCommand = new DelegateCommand(Linkstore);
             OpenIAPCommand = new DelegateCommand(OpenIAP);
             dialogs = dialogService;
             this.Region = regionManager;
             RegisterRegionName = Guid.NewGuid().ToString();
         }
+        private void Linkstore()
+        {
 
+            Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/windows/store/permanent"));
+        }
         private void OpenIAP()
         {
             dialogs.ShowDialog(DialogNames.IAPCompareDialog);

+ 7 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/RegisterOKRegionViewModel.cs

@@ -6,6 +6,7 @@ using Prism.Regions;
 using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -55,7 +56,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         #endregion
 
 
-
+        public DelegateCommand LinkstoreCommand { get; set; }
         public DelegateCommand OpenIAPCommand { get; set; }
 
 
@@ -63,6 +64,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
         public RegisterOKRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
+            LinkstoreCommand = new DelegateCommand(Linkstore);
             OpenIAPCommand = new DelegateCommand(OpenIAP);
             dialogs = dialogService;
             InitString();
@@ -75,7 +77,11 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
         }
 
+        private void Linkstore()
+        {
 
+            Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/windows/store/permanent"));
+        }
 
         public void Close()
         {

+ 1 - 2
PDF Office/ViewModels/Dialog/ServiceDialog/RegisterRegionViewModel.cs

@@ -355,7 +355,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         public DelegateCommand RegisterNextCommand { get; set; }
         public DelegateCommand GoLoginCommand { get; set; }
         public DelegateCommand RegisterPasswordChangedCommand { get; set; }
-        
+
         public DelegateCommand LinkLicenseCommand { get; set; }
         RegisterRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
@@ -451,7 +451,6 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         }
 
 
-
         private void LinkPolicy()
         {
            

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

@@ -145,7 +145,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                             watermark.SetScale(1);
                             watermark.SetRotation(0);
                             watermark.SetOpacity(255);
-                            watermark.SetFront(false);
+                            watermark.SetFront(true);
                             watermark.SetVertalign(C_Watermark_Vertalign.WATERMARK_VERTALIGN_TOP);
                             watermark.SetHorizalign(C_Watermark_Horizalign.WATERMARK_HORIZALIGN_LEFT);
                             watermark.SetFullScreen(false);
@@ -159,7 +159,6 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                         viewContentViewModel.PDFViewer.Document.ReleasePages();
                         viewContentViewModel.PDFViewer.ReloadDocument();
                         //viewContentViewModel.saveFile();
-                        Close();
                     }
                    
                 }

+ 26 - 4
PDF Office/ViewModels/Dialog/ServiceDialog/UserDialogViewModel.cs

@@ -3,6 +3,7 @@ using System.Diagnostics;
 using System.Runtime.InteropServices;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Media;
 using PDF_Master.CustomControl;
 using PDF_Master.Helper;
 using PDF_Master.Properties;
@@ -125,9 +126,18 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
                 SetProperty(ref _Text_userouttol, value);
             }
         }
+        
 
+        private Brush _TextSubscribeStateColor = (Brush)new BrushConverter().ConvertFromString("#252629");
 
-
+        public Brush TextSubscribeStateColor
+        {
+            get { return _TextSubscribeStateColor; }
+            set
+            {
+                SetProperty(ref _TextSubscribeStateColor, value);
+            }
+        }
 
         private string _TextSubscribeState = "";
 
@@ -258,25 +268,37 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             TextSubscribeEndtime = Settings.Default.UserDate.subscribeendDate;
             UserEmail = Settings.Default.UserDate.Email;
             if(Settings.Default.UserDate.subscribestatus==1&& Settings.Default.UserDate.subscribepayType==1)
-            {
-                Subscriptionbox = Visibility.Visible;
+            {                
+                   Subscriptionbox = Visibility.Visible;
                 Subscriptionauto= Visibility.Visible;
                 TextSubscribeState= App.ServiceLoader.GetString("TextSubscribeStateOnTrial");
+                TextSubscribeStateColor = (Brush)new BrushConverter().ConvertFromString("#252629");
                 TextSubscribetimetext = App.ServiceLoader.GetString("TextSubscribetimetextOnTrial");
             }
             else if(Settings.Default.UserDate.subscribestatus == 1 && Settings.Default.UserDate.subscribepayType == 0)
             {
                 Subscriptionbox = Visibility.Visible;
                 Subscriptionbtn = Visibility.Visible;
-                Subscriptionauto = Visibility.Collapsed;
+                Subscriptionauto = Visibility.Hidden;
                 TextSubscribeState = App.ServiceLoader.GetString("TextSubscribeStateOnTrial");
+                TextSubscribeStateColor = (Brush)new BrushConverter().ConvertFromString("#252629");
                 TextSubscribetimetext = App.ServiceLoader.GetString("TextSubscribetimetextOnTrial");
             }
+            else if (Settings.Default.UserDate.subscribestatus == 2 )
+            {
+                Subscriptionbox = Visibility.Visible;
+                Subscriptionbtn = Visibility.Visible;
+                Subscriptionauto = Visibility.Hidden;
+                TextSubscribeState = App.ServiceLoader.GetString("TextSubscribeStateExpired");
+                TextSubscribeStateColor= (Brush)new BrushConverter().ConvertFromString("#F3465B");
+                TextSubscribetimetext = App.ServiceLoader.GetString("TextSubscribetimeExpired");
+            }
             else
             {
                 Subscriptionbox = Visibility.Collapsed;
                 Subscriptionbtn = Visibility.Collapsed;
                 TextSubscribeState = App.ServiceLoader.GetString("TextSubscribeStateExpired");
+                TextSubscribeStateColor = (Brush)new BrushConverter().ConvertFromString("#F3465B");
                 TextSubscribetimetext = App.ServiceLoader.GetString("TextSubscribetimeExpired");
 
             }

+ 3 - 45
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -2334,48 +2334,6 @@ namespace PDF_Master.ViewModels
             return viewModel;
         }
 
-        /// <summary>
-        /// 高级功能前弹出比较表
-        /// </summary>
-        /// <param name="post">是否请求服务器</param>
-        public bool IAPBeforeFunction(bool post = false)
-        {
-            if (post)
-            {
-                //判断本地有没有token,没有显示登录,有再判断登录状态
-                if (Settings.Default.AppProperties.LoginToken != "")
-                {
-                    if (ServiceHelper.GetUser() == "401")
-                    {
-                        App.mainWindowViewModel.UserVis = Visibility.Collapsed;
-                        App.mainWindowViewModel.LoginVis = Visibility.Visible;
-                        App.mainWindowViewModel.OphVis = Visibility.Visible;
-                       
-                       if( Settings.Default.UserDate.IsLoginoff == false)
-                        {
-                            App.mainWindowViewModel.OpenLoginoff();
-                            Settings.Default.UserDate.IsLoginoff = true;
-                            Settings.Default.Save();
-                        }
-                    }
-                }
-                else
-                {
-                    App.mainWindowViewModel.UserVis = Visibility.Collapsed;
-                    App.mainWindowViewModel.LoginVis = Visibility.Visible;
-                    App.mainWindowViewModel.OphVis = Visibility.Visible;
-                }
-            }
-
-            //付费锁
-            //删掉 Settings.Default.UserDate.isInFreeUseTime == false,没有试用期了;
-            if (!App.IsLogin )
-            {
-                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
-                return false;
-            }
-            return true;
-        }
 
         #region PDFViewer鼠标滚轮缩放事件
 
@@ -2747,7 +2705,7 @@ namespace PDF_Master.ViewModels
             try
             {
                 //删掉Settings.Default.UserDate.isInFreeUseTime == false,没有试用期策略了
-                if (!App.IsLogin|| Settings.Default.UserDate.subscribestatus==0)
+                if (!App.IsLogin|| Settings.Default.UserDate.subscribestatus!=1)
                 {
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.ViewContentViewModel, this);
@@ -3016,7 +2974,7 @@ namespace PDF_Master.ViewModels
         {
             bool flg = false;
             //删掉Settings.Default.UserDate.isInFreeUseTime == false,没有试用期策略了
-            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus == 0)
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus !=1)
             {
                 DialogParameters value = new DialogParameters();
                 value.Add(ParameterNames.ViewContentViewModel, this);
@@ -3290,7 +3248,7 @@ namespace PDF_Master.ViewModels
         {
             if (currentBar == "TabItemEdit")
             {
-                if (!IAPBeforeFunction())
+                if (!ServiceHelper.IAPBeforeFunction())
                 {
                     TabSelectedIndex = 0;
                     isInPageEdit = false;

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

@@ -192,7 +192,7 @@
                 FontSize="12"
                 FontWeight="SemiBold"
                 Foreground="#3F8FF6">
-                <Hyperlink Command="{Binding OpenIAPCommand}">
+                <Hyperlink Command="{Binding LinkstoreCommand}">
                     <Hyperlink.Style>
                         <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
                             <Setter Property="FocusVisualStyle" Value="{x:Null}" />

+ 1 - 0
PDF Office/Views/Dialog/ServiceDialog/LoginRegion.xaml.cs

@@ -31,6 +31,7 @@ namespace PDF_Master.Views.Dialog.ServiceDialog
         private void Focus_Loaded(object sender, RoutedEventArgs e)
         {
             Text_Email.Focus();
+            Text_Email.SelectAll();
         }
     
     }

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

@@ -192,7 +192,7 @@
                 FontSize="12"
                 FontWeight="SemiBold"
                 Foreground="#3F8FF6" >
-                   <Hyperlink Command="{Binding OpenIAPCommand}">
+                   <Hyperlink Command="{Binding LinkstoreCommand}">
                          <Hyperlink.Style>
                         <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
                             <Setter Property="FocusVisualStyle" Value="{x:Null}" />

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

@@ -148,7 +148,7 @@
                     Content="Become a Subscriber"
                     FontFamily="Segoe UI"
                     FontSize="16"
-                    Command="{Binding OpenIAPCommand}"
+                    Command="{Binding LinkstoreCommand}"
                     FontWeight="SemiBold"
                     Style="{StaticResource btn.upgrade}" />
             </StackPanel>

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

@@ -190,7 +190,7 @@
                     Height="40"
                     Margin="16,0,0,0"
                     Command="{Binding LinkstoreCommand}"
-                    Content="{Binding Textprice}"
+                    Content="Subscribe Now"
                     FontFamily="Segoe UI"
                     FontSize="16"
                     Style="{StaticResource btn.upgrade}" />

+ 1 - 0
PDF Office/Views/Dialog/ServiceDialog/UserDialog.xaml

@@ -129,6 +129,7 @@
                         FontFamily="Segoe UI"
                         FontSize="16"
                         FontWeight="SemiBold"
+                        Foreground="{Binding TextSubscribeStateColor}"
                         LineHeight="24"
                         Text="{Binding TextSubscribeState}" />
                     <Border

+ 1 - 1
PDF Office/Views/MainWindow.xaml

@@ -245,7 +245,7 @@
                 DockPanel.Dock="Left"
                 x:Name="Grid_Openhight"
                 IsVisibleChanged="Grid_Openhight_IsVisibleChanged"
-                Visibility="{Binding OphVis, Mode=OneWay}">
+                Visibility="Collapsed">
 
                 <WrapPanel VerticalAlignment="Center">
                     <Border