|
@@ -1,6 +1,8 @@
|
|
|
using Newtonsoft.Json;
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
+using PDF_Master.Model;
|
|
|
using PDF_Master.Properties;
|
|
|
+using Prism.Services.Dialogs;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.IO;
|
|
@@ -11,6 +13,7 @@ using System.Runtime.InteropServices;
|
|
|
using System.Security.Cryptography;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Windows;
|
|
|
|
|
|
namespace PDF_Master.Helper
|
|
|
{
|
|
@@ -244,6 +247,51 @@ namespace PDF_Master.Helper
|
|
|
return DeviceBuilder.ToString();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 高级功能前弹出比较表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="post">是否请求服务器</param>
|
|
|
+ public static 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)
|
|
|
+ {
|
|
|
+ App.mainWindowViewModel.dialogs.ShowDialog(DialogNames.IAPCompareDialog);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//超时同步为20秒
|
|
|
/// <summary>
|