Browse Source

轻会员-页面编辑-网络请求去除,轻会员-账号去掉前后空格

lvle 1 year ago
parent
commit
8d690ed931

+ 17 - 18
PDF Office/Helper/ServiceHelper.cs

@@ -314,10 +314,24 @@ namespace PDF_Master.Helper
         /// <summary>
         /// 高级功能前弹出比较表
         /// </summary>
-        /// <param name="post">是否请求服务器</param>
+        /// <param name="post">是否请求服务器,默认false为请求</param>
         public static bool IAPBeforeFunction(bool post = false)
         {
-           (App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).IsUsedVIP=true;
+            if (!App.IsLogin)
+            {
+                if (Settings.Default.UserDate.Email == "")
+                {
+                    App.mainWindowViewModel.OpenRegister();
+                    return false;
+                }
+                else
+                {
+                    App.mainWindowViewModel.OpenLogin();
+                    return false;
+                }
+
+            }
+        
             if (!post)
             {
                 //判断本地有没有token,没有显示登录,有再判断登录状态
@@ -348,22 +362,7 @@ namespace PDF_Master.Helper
                 }
             }
 
-            //付费锁
-            //删掉 Settings.Default.UserDate.isInFreeUseTime == false,没有试用期了;
-            if (!App.IsLogin)
-            {
-                if(Settings.Default.UserDate.Email=="")
-                {
-                    App.mainWindowViewModel.OpenRegister();
-                    return false;
-                }
-                else
-                {
-                    App.mainWindowViewModel.OpenLogin();
-                    return false;
-                }
-                
-            }
+               (App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).IsUsedVIP = true;
             return true;
         }
 

+ 3 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/LoginRegionViewModel.cs

@@ -271,7 +271,9 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
         private void LoginNext()
         {
-            if(CheckMail(LoginEmail)==true)
+            //去掉前后空格
+            LoginEmail = LoginEmail.Trim();
+            if (CheckMail(LoginEmail)==true)
             {
                 string code = ServiceHelper.Ok_email(LoginEmail, "1");
                 if (code == "200")

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

@@ -412,7 +412,8 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
         private void RegisterNext()
         {
-
+            //去掉前后空格
+            RegisterEmail = RegisterEmail.Trim();
             string code = ServiceHelper.Ok_email(RegisterEmail, "2");
             if (code == "200")
             {

+ 11 - 11
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -779,7 +779,7 @@ namespace PDF_Master.ViewModels.PageEdit
             if ((bool)dialog.ShowDialog())
             {
                 //付费锁
-                if (!ServiceHelper.IAPBeforeFunction())
+                if (!ServiceHelper.IAPBeforeFunction(true))
                 {
                     return;
                 }
@@ -865,7 +865,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 if (e.Result == ButtonResult.OK && e.Parameters != null)
                 {
                     //付费锁
-                    if (!ServiceHelper.IAPBeforeFunction())
+                    if (!ServiceHelper.IAPBeforeFunction(true))
                     {
                         return;
                     }
@@ -905,7 +905,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 if (e.Result == ButtonResult.OK && e.Parameters != null)
                 {
                     //付费锁
-                    if (!ServiceHelper.IAPBeforeFunction())
+                    if (!ServiceHelper.IAPBeforeFunction(true))
                     {
                         return;
                     }
@@ -971,7 +971,7 @@ namespace PDF_Master.ViewModels.PageEdit
             if ((string)type == ParameterNames.InsertType_Blank)
             {
                 //付费锁
-                if (!ServiceHelper.IAPBeforeFunction())
+                if (!ServiceHelper.IAPBeforeFunction(true))
                 {
                     return;
                 }
@@ -1032,7 +1032,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 if ((bool)dialog.ShowDialog())
                 {
                     //付费锁
-                    if (!ServiceHelper.IAPBeforeFunction())
+                    if (!ServiceHelper.IAPBeforeFunction(true))
                     {
                         return;
                     }
@@ -1079,7 +1079,7 @@ namespace PDF_Master.ViewModels.PageEdit
                       if (e.Result == ButtonResult.OK && e.Parameters != null)
                       {
                           //付费锁
-                          if (!ServiceHelper.IAPBeforeFunction())
+                          if (!ServiceHelper.IAPBeforeFunction(true))
                           {
                               return;
                           }
@@ -1408,7 +1408,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 return;
             }
             //付费锁
-            if (!ServiceHelper.IAPBeforeFunction())
+            if (!ServiceHelper.IAPBeforeFunction(true))
             {
                 return;
             }
@@ -1950,7 +1950,7 @@ namespace PDF_Master.ViewModels.PageEdit
             DataTrackingHelper.AddFirstAndSecondaryPath(DataTrackingHelper.FirstPath.Reading, DataTrackingHelper.SecondaryPath.Copy);
             DataTrackingHelper.IsClearEntryPath = true;
             DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.SubTbr_PageEdit, "SubTbr_Btn", "Btn_SubTbr_Copy");
-            if (!ServiceHelper.IAPBeforeFunction())
+            if (!ServiceHelper.IAPBeforeFunction(true))
             {
                 return;
             }
@@ -2008,7 +2008,7 @@ namespace PDF_Master.ViewModels.PageEdit
         /// </summary>
         private void Paste(int Index = -1)
         {
-            if (!ServiceHelper.IAPBeforeFunction())
+            if (!ServiceHelper.IAPBeforeFunction(true))
             {
                 return;
             }
@@ -2326,7 +2326,7 @@ namespace PDF_Master.ViewModels.PageEdit
         {
             PageEditItem pageEditItem = null;
             int index = -1;
-            if (!ServiceHelper.IAPBeforeFunction())
+            if (!ServiceHelper.IAPBeforeFunction(true))
             {
                 return index;
             }
@@ -3102,7 +3102,7 @@ namespace PDF_Master.ViewModels.PageEdit
         /// <param name="rightRotate"></param>
         private async void RotateSelectedPages(bool rightRotate = true, List<int> pageitems = null, bool isFromUndoRedo = false)
         {
-            if (!ServiceHelper.IAPBeforeFunction())
+            if (!ServiceHelper.IAPBeforeFunction(true))
             {
                 return;
             }

+ 2 - 2
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -503,7 +503,7 @@ namespace PDF_Master.Views.PageEdit
                         //页面 是App内的拖拽 ,还是拖拽 页面 出 App 是一起处理
 
                         //将付费锁逻辑提前,避免拖拽出窗体成功
-                        if (!ServiceHelper.IAPBeforeFunction())
+                        if (!ServiceHelper.IAPBeforeFunction(true))
                         {
                             return;
                         }
@@ -803,7 +803,7 @@ namespace PDF_Master.Views.PageEdit
                 {
                     //不能将付费锁 放到 grid_DragOver,会卡顿
                     //将付费锁逻辑提前,避免因弹窗显示后导致虚影无法消失问题
-                    if (!ServiceHelper.IAPBeforeFunction())
+                    if (!ServiceHelper.IAPBeforeFunction(true))
                     {
                         LineInset.Visibility = Visibility.Collapsed;
                         ImgPicture.Visibility = Visibility.Collapsed;