修改主窗口 header 拖动bug.
拼多多登录 改为WPF 。PddMobileLoginForm 不再使用
This commit is contained in:
1 parent
ce828fe467
commit
446224f4cf
15 files changed
+1328
-467
No files matched your search
@@ -1,24 +1,23 @@
|
||||
<Window x:Class="_29WxOrderWpf.Common.DialogWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Common"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding Title}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#FFFFFF"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Window.Resources>
|
||||
<Window
|
||||
x:Class="_29WxOrderWpf.Common.DialogWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="{Binding Title}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#FFFFFF"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<Style x:Key="DialogWindowStyle" TargetType="Window">
|
||||
<Setter Property="Tag" Value="Default"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="ShowInTaskbar" Value="False"/>
|
||||
<Setter Property="WindowChrome.GlassFrameThickness" Value="-1"/>
|
||||
<Setter Property="Tag" Value="Default" />
|
||||
<Setter Property="ResizeMode" Value="NoResize" />
|
||||
<Setter Property="ShowInTaskbar" Value="False" />
|
||||
<Setter Property="WindowChrome.GlassFrameThickness" Value="-1" />
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
<Grid />
|
||||
</Window>
|
||||
@@ -37,7 +37,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.XPath;
|
||||
using TemuKJD.ToolForms;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work._29Tools.CefTools;
|
||||
@@ -641,7 +641,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
if (data.Contains("\"error_code\":40001"))
|
||||
{
|
||||
currentReadBuyer = "";
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -957,7 +957,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
//{"errorCode":72004,"errorMsg":"","error_code":72004,"error_msg":"","result":null}
|
||||
if (data.Contains("\"error_code\":40001") || data.Contains("\"error_code\":50000") || data.Contains("\"error_code\":72004"))
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
if (buyer.status == "掉线")
|
||||
currentReadBuyer = "";
|
||||
return;
|
||||
@@ -1364,7 +1364,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
if (tokenSource.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
if (buyer.status != "在线")
|
||||
continue;
|
||||
|
||||
@@ -1446,7 +1446,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BindBuyer(buyer, "店铺掉线");
|
||||
@@ -1522,7 +1522,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BindBuyer(buyer, "店铺掉线");
|
||||
@@ -1534,7 +1534,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
if (times % 100 == 0)
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
break;
|
||||
@@ -1604,7 +1604,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BindBuyer(buyer, "店铺掉线");
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Common;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using _29WxOrderWpf.Views;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
@@ -24,146 +27,166 @@ using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// PDDBuyerSelectCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PDDBuyerSelectCtrl : UserControl
|
||||
{
|
||||
public PDDBuyerSelectCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// PDDBuyerSelectCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PDDBuyerSelectCtrl : UserControl
|
||||
{
|
||||
public PDDBuyerSelectCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList;
|
||||
}
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList;
|
||||
}
|
||||
|
||||
private void btnLoginPdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbPddBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
private void btnLoginPdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbPddBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
|
||||
PddMobileLoginForm pddBuyerForm = new PddMobileLoginForm(buyer);
|
||||
pddBuyerForm.openType = EnumOpenType.login;
|
||||
pddBuyerForm.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
|
||||
pddBuyerForm.ShowDialog();
|
||||
MainWindow.Instance.GetPddBuyer();
|
||||
}
|
||||
PddMobileLoginView pddBuyerForm = new PddMobileLoginView(buyer);
|
||||
pddBuyerForm.ViewModel.OpenType = EnumOpenType.login;
|
||||
pddBuyerForm.ViewModel.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
|
||||
//pddBuyerForm.ShowDialog();
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "买手登录",
|
||||
Content = pddBuyerForm,
|
||||
}.ShowDialog();
|
||||
|
||||
private void cmbPddBuyer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.GetPosition(sender as IInputElement).X > cmbPddBuyer.ActualWidth - 18)
|
||||
return;
|
||||
MainWindow.Instance.GetPddBuyer();
|
||||
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbPddBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
if (buyer == null)
|
||||
return;
|
||||
|
||||
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm shopLoginForm = new PddMobileLoginForm(buyer);
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
//shopLoginForm.WindowState = FormWindowState.Maximized;
|
||||
shopLoginForm.InitUrl = "https://mobile.yangkeduo.com";
|
||||
shopLoginForm.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
PddMobileLoginForm shopLoginForm = new PddMobileLoginForm(buyer);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
|
||||
shopLoginForm.ShowDialog();
|
||||
MainWindow.Instance.GetPddBuyer();
|
||||
}
|
||||
}
|
||||
//PddMobileLoginForm pddBuyerForm = new PddMobileLoginForm(buyer);
|
||||
//pddBuyerForm.openType = TemuKJD.ToolForms.EnumOpenType.login;
|
||||
//pddBuyerForm.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
|
||||
//pddBuyerForm.ShowDialog();
|
||||
//MainWindow.Instance.GetPddBuyer();
|
||||
}
|
||||
|
||||
private void cmbPddBuyer_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbPddBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
GlobalConfig.CurrentPddBuyer = buyer;
|
||||
}
|
||||
private void cmbPddBuyer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.GetPosition(sender as IInputElement).X > cmbPddBuyer.ActualWidth - 18)
|
||||
return;
|
||||
|
||||
private void btnDeleteItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("确定删除吗?删除后不可恢复!").DialogResult != true)
|
||||
return;
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbPddBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
if (buyer == null)
|
||||
return;
|
||||
|
||||
if (sender is Button btn)
|
||||
{
|
||||
if (btn.DataContext is BuyerLoginInfo buyer)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var url = BaseClass.Build29PDDObjString("user/del_buyer");
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&buyer_id=" + buyer.buyer_id;
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (result.Contains("\"code\":200"))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
GlobalConfig.PDDBuyerLoginList.Remove(buyer);
|
||||
this.cmbPddBuyer.SelectedIndex = 0;
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//var pddBuyer =
|
||||
bool islogin = false;
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
PddMobileLoginView shopLoginForm = new PddMobileLoginView(buyer);
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
shopLoginForm.ViewModel.OpenType = EnumOpenType.manage;
|
||||
shopLoginForm.ViewModel.InitUrl = "https://mobile.yangkeduo.com";
|
||||
//shopLoginForm.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
shopLoginForm.ViewModel.OpenType = EnumOpenType.login;
|
||||
shopLoginForm.ViewModel.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
|
||||
//shopLoginForm.ShowDialog();
|
||||
islogin = true;
|
||||
|
||||
//var ids = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
|
||||
//var buyers = GlobalConfig.PDDBuyerLoginList.Where(b => ids.Contains(b.buyer_id)).ToList();
|
||||
//this.statusBar.pgbTaskProgress.Maximum = buyers.Count;
|
||||
//pbLoading.Visible = true;
|
||||
}
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "买手登录",
|
||||
Content = shopLoginForm,
|
||||
}.ShowDialog();
|
||||
if (islogin)
|
||||
MainWindow.Instance.GetPddBuyer();
|
||||
}
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// int i = 0;
|
||||
// foreach (var buyer in buyers)
|
||||
// {
|
||||
// i++;
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// this.statusBar.lblTaskStatus.Text = "正在删除...";
|
||||
// this.statusBar.pgbTaskProgress.Value = i;
|
||||
// this.statusBar.pgbTaskProgress.Text = i + "/" + buyers.Count;
|
||||
// }));
|
||||
private void cmbPddBuyer_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbPddBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
GlobalConfig.CurrentPddBuyer = buyer;
|
||||
}
|
||||
|
||||
private void btnDeleteItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("确定删除吗?删除后不可恢复!").DialogResult != true)
|
||||
return;
|
||||
|
||||
if (sender is Button btn)
|
||||
{
|
||||
if (btn.DataContext is BuyerLoginInfo buyer)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var url = BaseClass.Build29PDDObjString("user/del_buyer");
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&buyer_id=" + buyer.buyer_id;
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (result.Contains("\"code\":200"))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
GlobalConfig.PDDBuyerLoginList.Remove(buyer);
|
||||
this.cmbPddBuyer.SelectedIndex = 0;
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//var pddBuyer =
|
||||
|
||||
//var ids = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
|
||||
//var buyers = GlobalConfig.PDDBuyerLoginList.Where(b => ids.Contains(b.buyer_id)).ToList();
|
||||
//this.statusBar.pgbTaskProgress.Maximum = buyers.Count;
|
||||
//pbLoading.Visible = true;
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// int i = 0;
|
||||
// foreach (var buyer in buyers)
|
||||
// {
|
||||
// i++;
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// this.statusBar.lblTaskStatus.Text = "正在删除...";
|
||||
// this.statusBar.pgbTaskProgress.Value = i;
|
||||
// this.statusBar.pgbTaskProgress.Text = i + "/" + buyers.Count;
|
||||
// }));
|
||||
|
||||
|
||||
|
||||
// Thread.Sleep(100);
|
||||
// }
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// this.statusBar.lblTaskStatus.Text = "删除完成";
|
||||
// this.statusBar.pgbTaskProgress.Value = buyers.Count;
|
||||
// this.statusBar.pgbTaskProgress.Text = buyers.Count + "/" + buyers.Count;
|
||||
// }));
|
||||
// GetPddBuyer();
|
||||
//});
|
||||
}
|
||||
// Thread.Sleep(100);
|
||||
// }
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// this.statusBar.lblTaskStatus.Text = "删除完成";
|
||||
// this.statusBar.pgbTaskProgress.Value = buyers.Count;
|
||||
// this.statusBar.pgbTaskProgress.Text = buyers.Count + "/" + buyers.Count;
|
||||
// }));
|
||||
// GetPddBuyer();
|
||||
//});
|
||||
}
|
||||
|
||||
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
||||
else
|
||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
||||
}
|
||||
}
|
||||
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
||||
else
|
||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using TemuKJD.ToolForms;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work.BuyUsers;
|
||||
@@ -2136,7 +2136,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(buyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
@@ -381,7 +382,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 拍单前检测买手号是否在线
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
@@ -751,7 +752,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 拍单的时候检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(buyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
@@ -811,7 +812,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 拍单的时候检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(buyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
@@ -946,7 +947,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
});
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
@@ -1265,7 +1266,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 检测买手号是否掉线
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
@@ -1478,7 +1479,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(buyer);
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
|
||||
+200
-68
@@ -1,72 +1,204 @@
|
||||
<basewindows:BaseWindow xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows" x:Class="_29WxOrderWpf.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf"
|
||||
xmlns:orderctrls="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:shopctrls="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls" xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
x:Name="mainWindow" Title="MainWindow" Height="900" Width="1600" Loaded="Window_Loaded" Closing="BaseWindow_Closing">
|
||||
<basewindows:BaseWindow
|
||||
x:Class="_29WxOrderWpf.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:orderctrls="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:shopctrls="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
x:Name="mainWindow"
|
||||
Title="MainWindow"
|
||||
Width="1600"
|
||||
Height="900"
|
||||
Closing="BaseWindow_Closing"
|
||||
Loaded="Window_Loaded"
|
||||
Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="Transparent" x:Name="mainGrid" Margin="{Binding ElementName=mainWindow, Path=Padding}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gridTitle">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{StaticResource main29WeixinIcon}" Height="50" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"></Image>
|
||||
<Label x:Name="lblAppName" FontSize="20" Margin="0,0,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" VerticalContentAlignment="Center" Content="拍单软件" Grid.Column="1"></Label>
|
||||
<Grid
|
||||
x:Name="mainGrid"
|
||||
Margin="{Binding ElementName=mainWindow, Path=Padding}"
|
||||
Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid
|
||||
x:Name="gridTitle"
|
||||
Background="Transparent"
|
||||
MouseLeftButtonDown="gridTitle_MouseLeftButtonDown">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="50"
|
||||
Height="50"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Source="{StaticResource main29WeixinIcon}" />
|
||||
<Label
|
||||
x:Name="lblAppName"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="拍单软件"
|
||||
FontSize="20"
|
||||
Foreground="{StaticResource mainColorLightBrush}" />
|
||||
|
||||
<WrapPanel Margin="0,4,80,0" Grid.Column="12" HorizontalAlignment="Right" VerticalAlignment="Top">
|
||||
<Label x:Name="lblDebug" FontSize="12" Margin="2,4,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="[release]" Opacity="0.7" Grid.Column="4"></Label>
|
||||
<Label x:Name="lblVersion" FontSize="12" Margin="2,4,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="版本信息" Opacity="0.7" Grid.Column="4"></Label>
|
||||
|
||||
</WrapPanel>
|
||||
|
||||
<Label x:Name="lblBalance" FontSize="12" Margin="0,25,80,0" HorizontalAlignment="Right" Foreground="#60ff66" MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
|
||||
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="{Binding Balance}" Opacity="0.7" Grid.Column="4" Cursor="Hand"></Label>
|
||||
</Grid>
|
||||
<Grid x:Name="gridContainer" Grid.Row="1" Background="White" Margin="2,0,2,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<orderctrls:OrderListCtrl x:Name="orderListCtrl" Grid.Column="1" Visibility="Collapsed"></orderctrls:OrderListCtrl>
|
||||
<Grid x:Name="gridPddBuyerOrderReadCtrl" Visibility="Hidden" Grid.ColumnSpan="2" Background="#7F000000" MouseLeftButtonUp="gridPddBuyerOrderReadCtrl_MouseLeftButtonUp">
|
||||
<Border CornerRadius="10" HorizontalAlignment="Right" Height="auto" Background="White" Margin="0,50,0,0">
|
||||
<buyerctrls:PDDBuyerOrderReadCtrl x:Name="pddBuyerOrderReadCtrl" Grid.Column="1" Visibility="Collapsed" Panel.ZIndex="-1" Width="1200"
|
||||
HorizontalAlignment="Right"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<buyerctrls:PDDBuyerSelectCtrl x:Name="pddBuyerSelectCtrl" Visibility="Collapsed" Width="280" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="8"/>
|
||||
<Grid x:Name="gridUser" Visibility="Hidden" Grid.ColumnSpan="2" Background="#7F000000">
|
||||
<Border CornerRadius="4" Width="500" Height="600" Background="White">
|
||||
<shopctrls:ShopListCtrl x:Name="shopListCtrl" Visibility="{Binding ElementName=gridUser,Mode=TwoWay,Path=Visibility}" Margin="2"
|
||||
Grid.ColumnSpan="2"></shopctrls:ShopListCtrl>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<userctrls:UcWindowBoxes x:Name="ucWindowBox" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/>
|
||||
<WrapPanel
|
||||
Grid.Column="12"
|
||||
Margin="0,4,80,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top">
|
||||
<Label
|
||||
x:Name="lblDebug"
|
||||
Grid.Column="4"
|
||||
Margin="2,4,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="[release]"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Opacity="0.7" />
|
||||
<Label
|
||||
x:Name="lblVersion"
|
||||
Grid.Column="4"
|
||||
Margin="2,4,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="版本信息"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Opacity="0.7" />
|
||||
|
||||
<Border x:Name="borderMessage" Grid.Row="1" Width="auto" Height="auto" HorizontalAlignment="Center" Margin="10,50" VerticalAlignment="Top" BorderThickness="1" Opacity="0"
|
||||
BorderBrush="{StaticResource pageColorBrush}" CornerRadius="6" Background="White" IsHitTestVisible="False"
|
||||
MinWidth="120" MinHeight="2" MaxWidth="1200" Panel.ZIndex="1000000">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="5" Color="#FF98638f" BlurRadius="40" Opacity="0.2"/>
|
||||
</Border.Effect>
|
||||
<TextBlock Text="这里是默认提示信息" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="tbMessage" TextWrapping="Wrap"></TextBlock>
|
||||
</Border>
|
||||
<!--<Image x:Name="imageBig" HorizontalAlignment="Left" Height="800" Width="800" VerticalAlignment="Center" Grid.Row="1" Margin="200,0,0,0"/>-->
|
||||
</Grid>
|
||||
</WrapPanel>
|
||||
|
||||
<Label
|
||||
x:Name="lblBalance"
|
||||
Grid.Column="4"
|
||||
Margin="0,25,80,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="{Binding Balance}"
|
||||
Cursor="Hand"
|
||||
FontSize="12"
|
||||
Foreground="#60ff66"
|
||||
MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
|
||||
Opacity="0.7" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridContainer"
|
||||
Grid.Row="1"
|
||||
Margin="2,0,2,2"
|
||||
Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<orderctrls:OrderListCtrl
|
||||
x:Name="orderListCtrl"
|
||||
Grid.Column="1"
|
||||
Visibility="Collapsed" />
|
||||
<Grid
|
||||
x:Name="gridPddBuyerOrderReadCtrl"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="#7F000000"
|
||||
MouseLeftButtonUp="gridPddBuyerOrderReadCtrl_MouseLeftButtonUp"
|
||||
Visibility="Hidden">
|
||||
<Border
|
||||
Height="auto"
|
||||
Margin="0,50,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
Background="White"
|
||||
CornerRadius="10">
|
||||
<buyerctrls:PDDBuyerOrderReadCtrl
|
||||
x:Name="pddBuyerOrderReadCtrl"
|
||||
Grid.Column="1"
|
||||
Width="1200"
|
||||
HorizontalAlignment="Right"
|
||||
Panel.ZIndex="-1"
|
||||
Visibility="Collapsed" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<buyerctrls:PDDBuyerSelectCtrl
|
||||
x:Name="pddBuyerSelectCtrl"
|
||||
Grid.Column="1"
|
||||
Width="280"
|
||||
Margin="8"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="Collapsed" />
|
||||
<Grid
|
||||
x:Name="gridUser"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="#7F000000"
|
||||
Visibility="Hidden">
|
||||
<Border
|
||||
Width="500"
|
||||
Height="600"
|
||||
Background="White"
|
||||
CornerRadius="4">
|
||||
<shopctrls:ShopListCtrl
|
||||
x:Name="shopListCtrl"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="2"
|
||||
Visibility="{Binding ElementName=gridUser, Mode=TwoWay, Path=Visibility}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<userctrls:UcWindowBoxes
|
||||
x:Name="ucWindowBox"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
MaxBoxVisibility="Visible" />
|
||||
|
||||
<Border
|
||||
x:Name="borderMessage"
|
||||
Grid.Row="1"
|
||||
Width="auto"
|
||||
Height="auto"
|
||||
MinWidth="120"
|
||||
MinHeight="2"
|
||||
MaxWidth="1200"
|
||||
Margin="10,50"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Panel.ZIndex="1000000"
|
||||
Background="White"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="40"
|
||||
Opacity="0.2"
|
||||
ShadowDepth="5"
|
||||
Color="#FF98638f" />
|
||||
</Border.Effect>
|
||||
<TextBlock
|
||||
x:Name="tbMessage"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="这里是默认提示信息"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
<!--<Image x:Name="imageBig" HorizontalAlignment="Left" Height="800" Width="800" VerticalAlignment="Center" Grid.Row="1" Margin="200,0,0,0"/>-->
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -450,5 +450,20 @@ namespace _29WxOrderWpf
|
||||
//else
|
||||
// Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
||||
}
|
||||
}
|
||||
|
||||
private void gridTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ClickCount == 2)
|
||||
{
|
||||
// 双击切换窗口状态
|
||||
this.WindowState = this.WindowState == WindowState.Maximized
|
||||
? WindowState.Normal
|
||||
: WindowState.Maximized;
|
||||
}
|
||||
else if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
this.DragMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,511 @@
|
||||
using _29WxOrderWpf.CefHelper;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using CefSharp;
|
||||
using CefSharp.Handler;
|
||||
using CefSharp.Wpf;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work._29Tools.CefTools;
|
||||
|
||||
namespace _29WxOrderWpf.ViewModels
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 拼多多买手移动版登录窗口 视图模型(WPF 版 PddMobileLoginForm)
|
||||
/// </summary>
|
||||
public class PddMobileLoginViewModel : PropertyNotifyObject
|
||||
{
|
||||
// 拼多多买手退货退款售后地址
|
||||
// https://mobile.yangkeduo.com/complaint.html?order_sn=260718-101481213440980&after_sales_reason=0&after_sales_type=2&after_sales_code=1002
|
||||
|
||||
public static PddMobileLoginViewModel PddMobileLoginInstance { get; set; } = null;
|
||||
|
||||
/// <summary>浏览器创建完成后触发(视图在此把浏览器加入可视树)</summary>
|
||||
public event Action<ChromiumWebBrowser> BrowserCreated;
|
||||
|
||||
/// <summary>请求关闭窗口</summary>
|
||||
public event Action RequestClose;
|
||||
|
||||
public int CloseAfterSecond { get; set; }
|
||||
|
||||
private EnumOpenType _openType = EnumOpenType.manage;
|
||||
public EnumOpenType OpenType
|
||||
{
|
||||
get { return _openType; }
|
||||
set
|
||||
{
|
||||
_openType = value;
|
||||
OnPropertyChanged(nameof(OpenType));
|
||||
OnPropertyChanged(nameof(IsLoginMode));
|
||||
}
|
||||
}
|
||||
|
||||
public string InitUrl { get; set; } = "";
|
||||
|
||||
private string shopCookieHead = "yangkeduo.com";
|
||||
private string shopLoginUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
|
||||
private string shopMainUrl = "https://mobile.yangkeduo.com/index.html";
|
||||
|
||||
public ChromiumWebBrowser CefWebBrowser { get; private set; }
|
||||
private BuyerLoginInfo buyer = null;
|
||||
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
|
||||
private string currentUrl = "";
|
||||
private volatile bool _isWindowLoaded = false;
|
||||
|
||||
#region 界面绑定属性
|
||||
|
||||
/// <summary>用户名</summary>
|
||||
public string UserName
|
||||
{
|
||||
get { return this.GetValue(x => x.UserName); }
|
||||
set { this.SetValue(x => x.UserName, value); }
|
||||
}
|
||||
|
||||
/// <summary>密码</summary>
|
||||
public string PassWord
|
||||
{
|
||||
get { return this.GetValue(x => x.PassWord); }
|
||||
set { this.SetValue(x => x.PassWord, value); }
|
||||
}
|
||||
|
||||
/// <summary>地址栏</summary>
|
||||
public string Address
|
||||
{
|
||||
get { return this.GetValue(x => x.Address); }
|
||||
set { this.SetValue(x => x.Address, value); }
|
||||
}
|
||||
|
||||
/// <summary>登录成功后关闭窗口</summary>
|
||||
public bool IsCloseAfterLogin
|
||||
{
|
||||
get { return this.GetValue(x => x.IsCloseAfterLogin); }
|
||||
set { this.SetValue(x => x.IsCloseAfterLogin, value); }
|
||||
}
|
||||
|
||||
/// <summary>登录模式(显示扫码提示和导入PDDAccessToken面板)</summary>
|
||||
public bool IsLoginMode
|
||||
{
|
||||
get { return this.GetValue(x => x.IsLoginMode); }
|
||||
set { this.SetValue(x => x.IsLoginMode, value); }
|
||||
}
|
||||
|
||||
/// <summary>导入的PDDAccessToken</summary>
|
||||
public string AccessToken
|
||||
{
|
||||
get { return this.GetValue(x => x.AccessToken); }
|
||||
set { this.SetValue(x => x.AccessToken, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 命令
|
||||
|
||||
public ICommand ReloadCommand { get; }
|
||||
public ICommand LoginAgainCommand { get; }
|
||||
public ICommand StopCommand { get; }
|
||||
public ICommand CopyUserNameCommand { get; }
|
||||
public ICommand CopyPasswordCommand { get; }
|
||||
public ICommand SaveCookieCommand { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
public PddMobileLoginViewModel(BuyerLoginInfo buyerInfo)
|
||||
{
|
||||
PddMobileLoginInstance = this;
|
||||
|
||||
buyer = buyerInfo;
|
||||
UserName = buyerInfo?.buyer_name;
|
||||
PassWord = ""; //DataOpenSSL.DecryptString(buyerInfo.Password);
|
||||
IsCloseAfterLogin = true;
|
||||
IsLoginMode = OpenType == EnumOpenType.login;
|
||||
|
||||
ReloadCommand = new DelegateCommand(Reload);
|
||||
LoginAgainCommand = new DelegateCommand(LoginAgain);
|
||||
StopCommand = new DelegateCommand(StopButton);
|
||||
CopyUserNameCommand = new DelegateCommand(CopyUserName);
|
||||
CopyPasswordCommand = new DelegateCommand(CopyPassword);
|
||||
SaveCookieCommand = new DelegateCommand(SaveCookie);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口加载完成时调用
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
IsLoginMode = OpenType == EnumOpenType.login;
|
||||
_isWindowLoaded = true;
|
||||
|
||||
if (CloseAfterSecond > 0)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(1000 * CloseAfterSecond);
|
||||
if (_isWindowLoaded)
|
||||
{
|
||||
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
if (_isWindowLoaded)
|
||||
RequestClose?.Invoke();
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
AutoLogin();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口关闭时调用,停止后台任务
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
_isWindowLoaded = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动登录店铺后台
|
||||
/// </summary>
|
||||
private void AutoLogin()
|
||||
{
|
||||
if (OpenType != EnumOpenType.login && buyer == null)
|
||||
return;
|
||||
|
||||
if (CefWebBrowser == null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(InitUrl))
|
||||
CefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
|
||||
else
|
||||
CefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser(shopMainUrl, false);
|
||||
|
||||
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
||||
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
||||
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
|
||||
CefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
||||
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||
CefWebBrowser.LifeSpanHandler = lifeSapnHandler;
|
||||
CefWebBrowser.KeyboardHandler = new KeyboardHandler();
|
||||
CefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
|
||||
CefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
|
||||
CefWebBrowser.LoadError += CefWebBrowser_LoadError;
|
||||
|
||||
// 通知视图把浏览器加入可视树(必须在等待浏览器初始化之前完成)
|
||||
BrowserCreated?.Invoke(CefWebBrowser);
|
||||
|
||||
List<Cookie> cookieLst = new List<Cookie>();
|
||||
try
|
||||
{
|
||||
if (buyer != null)
|
||||
{
|
||||
cookieLst = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(buyer?.cookie);
|
||||
if (cookieLst == null)
|
||||
cookieLst = new List<Cookie>();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
// cef138必须init后方可设置或删除cookie
|
||||
while (!CefWebBrowser.IsBrowserInitialized || !CefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||
Thread.Sleep(20);
|
||||
WPFCEFBrowser.DeleteCookie(CefWebBrowser.GetCookieManager(null));
|
||||
|
||||
//cef 138 如果没有设置RequestContext 可能为空,直接getCookieManager
|
||||
var t = WPFCEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), CefWebBrowser.GetCookieManager(null));
|
||||
foreach (var cook in cookieLst)
|
||||
{
|
||||
//var t = CEFBrowser.SetCookieAsync(cook.Domain.Trim('.'), cook.Name + "=" + cook.Value + ";", CefWebBrowser.GetCookieManager(null));
|
||||
//t.Wait(5000);
|
||||
}
|
||||
|
||||
//根据登录的具体店铺设置local storage
|
||||
if (!string.IsNullOrEmpty(buyer?.buyer_id))
|
||||
{
|
||||
//var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n";
|
||||
//storageJsCode += "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n";
|
||||
//while (!CefWebBrowser.IsBrowserInitialized || !CefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||
// Thread.Sleep(20);
|
||||
//CefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(InitUrl))
|
||||
CefWebBrowser.Load(InitUrl);
|
||||
else
|
||||
CefWebBrowser.Load(shopMainUrl);
|
||||
|
||||
//不是登录的话就此返回
|
||||
if (OpenType != EnumOpenType.login)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (CefWebBrowser.IsLoading)
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
Thread.Sleep(Randomx.GetId(1500, 2000));
|
||||
|
||||
if (!_isWindowLoaded)
|
||||
return;
|
||||
|
||||
while (!CefWebBrowser.Address.StartsWith(shopLoginUrl))
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
if (!_isWindowLoaded)
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void CefWebBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void CefWebBrowser_AddressChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (Application.Current?.Dispatcher != null)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
currentUrl = e.NewValue.ParseToString();
|
||||
Address = e.NewValue.ParseToString();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e)
|
||||
{
|
||||
//js绑定C#对象 html页面内声明绑定的C#对象
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("(function(){");
|
||||
sb.Append("CefSharp.BindObjectAsync('shopObj');");
|
||||
sb.Append("})();");
|
||||
CefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString());
|
||||
}
|
||||
|
||||
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||
{
|
||||
if (url.Contains("https://mobile.yangkeduo.com/index.html") && OpenType == EnumOpenType.login)
|
||||
{
|
||||
Task.Run(() => { CefWebBrowser.Load("https://mobile.yangkeduo.com/personal.html"); });
|
||||
}
|
||||
|
||||
if (url.Contains("https://mobile.yangkeduo.com/personal.html"))
|
||||
{
|
||||
if (OpenType == EnumOpenType.login)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var data = responseData;
|
||||
if (data.Contains("\"success\":true") || data.Contains("nickname"))
|
||||
{
|
||||
var uid = BaseRegex.GetStringJson(ref data, "uid");
|
||||
var nickname = BaseRegex.GetStringJson(ref data, "nickname");
|
||||
var username = nickname;
|
||||
|
||||
if (!string.IsNullOrEmpty(nickname) && !string.IsNullOrEmpty(uid))
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
|
||||
List<Cookie> cookieList = WPFCEFBrowser.GetCookieList(shopCookieHead, CefWebBrowser.GetCookieManager(null));
|
||||
|
||||
var buyerUrl = BaseClass.Build29PDDObjString("user/add_buyer");
|
||||
|
||||
if (this.buyer == null || this.buyer.buyer_id != uid)
|
||||
this.buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_id == uid);
|
||||
if (this.buyer != null)
|
||||
{
|
||||
this.buyer.user_name = username;
|
||||
this.buyer.buyer_nick = nickname;
|
||||
this.buyer.cookie = JsonHelper.SerializeObject(cookieList);
|
||||
buyerUrl = BaseClass.Build29PDDObjString("user/mdy_buyer");
|
||||
}
|
||||
|
||||
var buyerData = UserLogin.GetSignaturex()
|
||||
+ "&buyer_id=" + uid
|
||||
+ "&buyer_name=" + username
|
||||
+ "&buyer_nick=" + nickname;
|
||||
var result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||
result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||
|
||||
buyerUrl = BaseClass.Build29PDDObjString("user/mdy_buyer_cookie");
|
||||
buyerData = UserLogin.GetSignaturex()
|
||||
+ "&buyer_id=" + uid
|
||||
+ "&status=" + "在线"
|
||||
+ "&cookie=" + GetHtml.UrlEncodeUtf8(JsonHelper.SerializeObject(cookieList));
|
||||
result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||
result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||
|
||||
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsCloseAfterLogin)
|
||||
RequestClose?.Invoke();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{ }
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void StopButton()
|
||||
{
|
||||
}
|
||||
|
||||
private void CopyUserName()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(UserName))
|
||||
Clipboard.SetDataObject(UserName);
|
||||
}
|
||||
|
||||
private void CopyPassword()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(PassWord))
|
||||
Clipboard.SetDataObject(PassWord);
|
||||
}
|
||||
|
||||
private void Reload()
|
||||
{
|
||||
if (CefWebBrowser != null)
|
||||
{
|
||||
if (Address != "about:blank")
|
||||
CefWebBrowser.Load(Address);
|
||||
else
|
||||
CefWebBrowser.Load(shopMainUrl);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoginAgain()
|
||||
{
|
||||
if (this.currentUrl != shopLoginUrl)
|
||||
this.CefWebBrowser?.Load(shopLoginUrl);
|
||||
}
|
||||
|
||||
private void SaveCookie()
|
||||
{
|
||||
Cookie cookie = new Cookie();
|
||||
cookie.Name = "PDDAccessToken";
|
||||
cookie.Domain = "mobile.yangkeduo.com";
|
||||
cookie.Expires = DateTime.Now.AddDays(465);
|
||||
cookie.HttpOnly = true;
|
||||
cookie.Secure = true;
|
||||
cookie.Value = AccessToken.Trim();
|
||||
|
||||
if (this.CefWebBrowser != null)
|
||||
{
|
||||
var t = WPFCEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(new List<Cookie> { cookie }), CefWebBrowser.GetCookieManager(null));
|
||||
t.Wait(2000);
|
||||
CefWebBrowser.Load("https://mobile.yangkeduo.com/personal.html");
|
||||
}
|
||||
}
|
||||
|
||||
#region 静态方法(检测/更新买手登录状态)
|
||||
|
||||
public static void CheckBuyerLogin(List<BuyerLoginInfo> checkBuyers, bool isShowProgress = true)
|
||||
{
|
||||
for (int i = 0; i < checkBuyers.Count; i++)
|
||||
{
|
||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(v => v.buyer_id == checkBuyers[i].buyer_id);
|
||||
var buys = GlobalConfig.PDDBuyerLoginList.Where(v => v.buyer_id == checkBuyers[i].buyer_id).ToList();
|
||||
if (buyer == null)
|
||||
continue;
|
||||
|
||||
// 先从服务端取最新cookie
|
||||
var url = BaseClass.Build29PDDObjString("user/get_buyer");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&buyer_ids=" + buyer.buyer_id;
|
||||
data += "&page_size=1";
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
continue;
|
||||
List<BuyerLoginInfo> loginInfoLst = JsonHelper.DeserializeJsonToList<BuyerLoginInfo>(JsonHelper.JObjectParse(result)["data"].ParseToString());
|
||||
|
||||
var serverBuyer = loginInfoLst.FirstOrDefault();
|
||||
if (buyer != null && serverBuyer != null)
|
||||
{
|
||||
buyer.cookie = serverBuyer.cookie;
|
||||
foreach (var buy in buys)
|
||||
{
|
||||
buy.cookie = serverBuyer.cookie;
|
||||
}
|
||||
}
|
||||
|
||||
if (buyer != null)
|
||||
{
|
||||
var loginResult = CheckBuyerLogin(buyer);
|
||||
if (!loginResult.Contains("\"success\":true") && !loginResult.Contains("\"login\":true") && !loginResult.Contains("\"nickname\""))
|
||||
{
|
||||
buyer.cookie = "[]";
|
||||
foreach (var buy in buys)
|
||||
{
|
||||
buy.status = "掉线";
|
||||
buy.cookie = "[]";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var buy in buys)
|
||||
{
|
||||
buy.status = "在线";
|
||||
}
|
||||
}
|
||||
UpdateServerBuyerCookies(buyer); // 店铺cookie和状态写入服务端
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string CheckBuyerLogin(BuyerLoginInfo buyer, string refere = "https://mobile.yangkeduo.com/goods.html")
|
||||
{
|
||||
string url = "https://mobile.yangkeduo.com/proxy/api/api/apollo/v3/user/me?pdduid=" + buyer.buyer_id;
|
||||
return HttpResponseYkdBLL.YangkeduoGetResponse(buyer, url, refere);
|
||||
}
|
||||
|
||||
public static string UpdateServerBuyerCookies(BuyerLoginInfo buyer, string fromTool = null)
|
||||
{
|
||||
var url = BaseClass.Build29PDDObjString("user/mdy_buyer_cookie");
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&status=" + buyer.status
|
||||
+ "&cookie=" + GetHtml.UrlEncodeUtf8(buyer.cookie)
|
||||
+ "&buyer_id=" + buyer.buyer_id;
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Views.PddMobileLoginView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
xmlns:comn="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpf="WPFCommon"
|
||||
x:Name="pddMobileLoginView"
|
||||
Width="1024"
|
||||
Height="768"
|
||||
MinWidth="800"
|
||||
MinHeight="600"
|
||||
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||
comn:DialogWindowProperty.ShowMinButton="False"
|
||||
comn:DialogWindowProperty.Width="1300"
|
||||
Loaded="PddMobileLoginView_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||||
</UserControl.Resources>
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 地址栏 -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Background="White"
|
||||
BorderBrush="#E0E0E0"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBox
|
||||
x:Name="txtAddress"
|
||||
Margin="3,2"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="#D0D0D0"
|
||||
BorderThickness="1"
|
||||
KeyDown="txtAddress_KeyDown"
|
||||
Text="{Binding Address, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Border>
|
||||
|
||||
<!-- 主区域:浏览器 + 右侧面板 -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="530" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 浏览器容器 -->
|
||||
<Grid
|
||||
x:Name="BrowserHost"
|
||||
Grid.Column="0"
|
||||
Background="White"
|
||||
ClipToBounds="True" />
|
||||
|
||||
<GridSplitter
|
||||
Grid.Column="1"
|
||||
Width="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#E0E0E0"
|
||||
ResizeBehavior="PreviousAndNext"
|
||||
ShowsPreview="True" />
|
||||
|
||||
<!-- 右侧面板 -->
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Background="White"
|
||||
BorderBrush="#E0E0E0"
|
||||
BorderThickness="1,0,0,0">
|
||||
<StackPanel Margin="24,24,24,0">
|
||||
<TextBlock
|
||||
Margin="0,0,0,20"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="15"
|
||||
Foreground="#333333"
|
||||
Text="请使用拼多多手机版扫码登录"
|
||||
Visibility="{Binding IsLoginMode, Converter={StaticResource BoolToVis}}" />
|
||||
|
||||
<StackPanel Visibility="{Binding IsLoginMode, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock
|
||||
Margin="0,0,0,8"
|
||||
Foreground="#555555"
|
||||
Text="导入PDDAccessToken:" />
|
||||
<TextBox
|
||||
x:Name="txtAccessToken"
|
||||
Height="120"
|
||||
VerticalContentAlignment="Top"
|
||||
AcceptsReturn="True"
|
||||
BorderBrush="#D0D0D0"
|
||||
BorderThickness="1"
|
||||
Text="{Binding AccessToken, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
<Button
|
||||
Width="64"
|
||||
Height="26"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding SaveCookieCommand}"
|
||||
Content="保存"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,61 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase.Model.DBModel;
|
||||
using CefSharp.Wpf;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace _29WxOrderWpf.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// 拼多多买手移动版登录窗口(WPF 版 PddMobileLoginForm)
|
||||
/// </summary>
|
||||
public partial class PddMobileLoginView : UserControl
|
||||
{
|
||||
/// <summary>视图模型</summary>
|
||||
public PddMobileLoginViewModel ViewModel { get; }
|
||||
|
||||
public PddMobileLoginView(BuyerLoginInfo buyerInfo)
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
ViewModel = new PddMobileLoginViewModel(buyerInfo);
|
||||
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||
//ViewModel.RequestClose += ViewModel_RequestClose;
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
private void PddMobileLoginView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.Start();
|
||||
}
|
||||
|
||||
private void PddMobileLoginView_Closed(object sender, System.EventArgs e)
|
||||
{
|
||||
ViewModel.Stop();
|
||||
}
|
||||
|
||||
private void ViewModel_BrowserCreated(ChromiumWebBrowser browser)
|
||||
{
|
||||
Grid.SetRow(browser, 0);
|
||||
Grid.SetColumn(browser, 0);
|
||||
BrowserHost.Children.Add(browser);
|
||||
}
|
||||
|
||||
//private void ViewModel_RequestClose()
|
||||
//{
|
||||
// if (this.IsLoaded)
|
||||
// this.Close();
|
||||
//}
|
||||
|
||||
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
ViewModel.ReloadCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user