Explorar o código

轻会员-权益弹窗策略修改,添加UPgrade按钮,订阅期注销弹窗样式修改

lvle hai 1 ano
pai
achega
7c634398e6

+ 5 - 0
PDF Office/App.xaml.cs

@@ -136,6 +136,11 @@ namespace PDF_Master
 
         public static bool IsBookMode = false;
 
+        /// <summary>
+        /// 是否使用过高级功能
+        /// </summary>
+        public static bool IsUsedVIP = false;
+
         /// <summary>
         /// 是否已经登陆
         /// </summary>

+ 16 - 5
PDF Office/Helper/ServiceHelper.cs

@@ -253,6 +253,7 @@ namespace PDF_Master.Helper
         /// <param name="post">是否请求服务器</param>
         public static bool IAPBeforeFunction(bool post = false)
         {
+            App.IsUsedVIP= true;
             if (!post)
             {
                 //判断本地有没有token,没有显示登录,有再判断登录状态
@@ -358,13 +359,21 @@ namespace PDF_Master.Helper
                                 if (Settings.Default.UserDate.subscribestatus > 0)
                                 {
                                     Settings.Default.UserDate.subscribeendDate = (string)info["endDate"];
+                                    Settings.Default.UserDate.subscribepayType = (int)info["payType"];
                                 }
-                                Settings.Default.UserDate.subscribepayType = (int)info["payType"];
+                              
 
                             }
                         }
-
-
+                        //此处为主页UPgread按钮的Visible
+                        if (Settings.Default.UserDate.subscribestatus == 1)
+                        {
+                            App.mainWindowViewModel.UpgradeVis = Visibility.Collapsed;
+                        }
+                        else
+                        {
+                            App.mainWindowViewModel.UpgradeVis = Visibility.Visible;
+                        }
                         #region 试用策略
                         //Settings.Default.UserDate.isInFreeUseTime= jobject["isInFreeUseTime"].ToObject<bool>();
                         //Settings.Default.UserDate.freeDate= jobject["freeDate"].ToObject<string>().ToLower();
@@ -417,11 +426,11 @@ namespace PDF_Master.Helper
                 //}
                 return "300";
             }
+
            
-               
 
 
-            
+
         }
 
         /// <summary>
@@ -773,6 +782,7 @@ namespace PDF_Master.Helper
                     App.IsLogin = false;
                     Settings.Default.UserDate.subscribestatus = -1;
                     Settings.Default.UserDate.subscribepayType = 0;
+                    App.mainWindowViewModel.UpgradeVis = Visibility.Visible;
                     if (response != null)
                     {
                         response.Close();
@@ -823,6 +833,7 @@ namespace PDF_Master.Helper
                     App.IsLogin = false;
                     Settings.Default.UserDate.subscribestatus = -1;
                     Settings.Default.UserDate.subscribepayType = 0;
+                    App.mainWindowViewModel.UpgradeVis = Visibility.Visible;
                     if (response != null)
                     {
                         response.Close();

+ 1 - 0
PDF Office/PDF Master.csproj

@@ -2368,6 +2368,7 @@
     <Resource Include="Resources\Service\Warermark.png" />
     <Resource Include="Resources\Service\NOai.png" />
     <Resource Include="Resources\Service\Noconvert.png" />
+    <Resource Include="Resources\Service\Upgrade.png" />
     <Content Include="source\models\OCR.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

BIN=BIN
PDF Office/Resources/Service/Upgrade.png


+ 1 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/UserDialogViewModel.cs

@@ -318,7 +318,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             if(Settings.Default.UserDate.subscribestatus == 1)
             {
                 AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.ShowDialog("注不了销 ", "无法注销,需要订阅期结束后再申请注销 ", App.ServiceLoader.GetString("Text_yes"), App.ServiceLoader.GetString("Text_no"), IconType.Tip);
+                alertsMessage.ShowDialog("注不了销 ", "无法注销,需要订阅期结束后再申请注销 ", App.ServiceLoader.GetString("Text_yes"),IconType.Tip);
             }
             else
             {

+ 22 - 1
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -24,6 +24,7 @@ using PDF_Master.Properties;
 using PDF_Master.Helper;
 using PDFSettings;
 using PDF_Master.ViewModels.Dialog.ServiceDialog;
+using System.Diagnostics;
 
 namespace PDF_Master.ViewModels
 {
@@ -140,7 +141,19 @@ namespace PDF_Master.ViewModels
             }
         }
 
+        /// <summary>
+        /// UpgradeVis按钮只在订阅期中显示
+        /// </summary>
+        private Visibility _UpgradeVis = Visibility.Visible;
 
+        public Visibility UpgradeVis
+        {
+            get { return _UpgradeVis; }
+            set
+            {
+                SetProperty(ref _UpgradeVis, value);
+            }
+        }
         /// <summary>
         ///提示登录高级功能
         /// </summary>
@@ -156,7 +169,6 @@ namespace PDF_Master.ViewModels
         }
 
 
-
         private Visibility _RegisterVis = Visibility.Collapsed;
 
         public Visibility RegisterVis
@@ -265,6 +277,8 @@ namespace PDF_Master.ViewModels
         public DelegateCommand OpenLoginCommand { get; set; }
         public DelegateCommand OpenUserCommand { get; set; }
         public DelegateCommand LoadCommand { get; set; }
+        public DelegateCommand UpgradelinkCommand { get; set; }
+       
 
         public IRegionManager region;
 
@@ -298,6 +312,7 @@ namespace PDF_Master.ViewModels
             OpenRegisterCommand = new DelegateCommand(OpenRegister);
             OpenLoginCommand = new DelegateCommand(OpenLogin);
             OpenUserCommand = new DelegateCommand(OpenUser);
+            UpgradelinkCommand= new DelegateCommand(Upgradelink);
             CloseAllTabCommand = new DelegateCommand(() =>
             {
                 if (closeAllTabItem())
@@ -391,6 +406,12 @@ namespace PDF_Master.ViewModels
             InitString();
         }
 
+       
+
+            private void Upgradelink()
+        {
+            Process.Start(new ProcessStartInfo("http://test-pdf-pro.kdan.cn:3021/master/checkout?email="+Settings.Default.UserDate.Email));
+        }
         //显示新手引导弹窗
         private bool ShowGuidDialog()
         {

+ 2 - 2
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -2716,7 +2716,7 @@ namespace PDF_Master.ViewModels
             try
             {
                 //删掉Settings.Default.UserDate.isInFreeUseTime == false,没有试用期策略了
-                if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
+                if ((!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)&&App.IsUsedVIP==true)
                 {
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.ViewContentViewModel, this);
@@ -2985,7 +2985,7 @@ namespace PDF_Master.ViewModels
             {
                 bool flg = false;
                 //删掉Settings.Default.UserDate.isInFreeUseTime == false,没有试用期策略了
-                if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
+                if ((!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1) && App.IsUsedVIP == true)
                 {
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.ViewContentViewModel, this);

+ 7 - 0
PDF Office/Views/MainWindow.xaml

@@ -277,7 +277,14 @@
             Orientation="Horizontal"
             WindowChrome.IsHitTestVisibleInChrome="True">
 
+                <Border Width="87" Height="24"  Visibility="{Binding UpgradeVis}">
+                    <Border.InputBindings>
+                        <MouseBinding MouseAction="LeftClick" Command="{Binding  UpgradelinkCommand}" />
+                    </Border.InputBindings>
+                    <Image Source="pack://application:,,,/PDF Master;component/Resources/Service/Upgrade.png" />
+                    </Border>
 
+               
                 <Button
                 x:Name="Btn_Register"
                 Width="40"