修改主窗口 header 拖动bug.

拼多多登录 改为WPF 。PddMobileLoginForm 不再使用
This commit is contained in:
chfei committed 2026-09-01 14:30:25 +08:00
1 parent ce828fe467
commit 446224f4cf
15 files changed
+1326 -465

No files matched your search

+19 -20
View File
@@ -1,24 +1,23 @@
<Window x:Class="_29WxOrderWpf.Common.DialogWindow" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="_29WxOrderWpf.Common.DialogWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Common" xmlns:local="clr-namespace:_29WxOrderWpf.Common"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="{Binding Title}" Title="{Binding Title}"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
Background="#FFFFFF" Background="#FFFFFF"
WindowStartupLocation="CenterOwner"> WindowStartupLocation="CenterOwner"
<Window.Resources> mc:Ignorable="d">
<Window.Resources>
<Style x:Key="DialogWindowStyle" TargetType="Window"> <Style x:Key="DialogWindowStyle" TargetType="Window">
<Setter Property="Tag" Value="Default"/> <Setter Property="Tag" Value="Default" />
<Setter Property="ResizeMode" Value="NoResize"/> <Setter Property="ResizeMode" Value="NoResize" />
<Setter Property="ShowInTaskbar" Value="False"/> <Setter Property="ShowInTaskbar" Value="False" />
<Setter Property="WindowChrome.GlassFrameThickness" Value="-1"/> <Setter Property="WindowChrome.GlassFrameThickness" Value="-1" />
</Style> </Style>
</Window.Resources> </Window.Resources>
<Grid> <Grid />
</Grid>
</Window> </Window>
@@ -37,7 +37,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Xml.XPath; using System.Xml.XPath;
using TemuKJD.ToolForms; using _29WxOrderWpf.ViewModels;
using Work; using Work;
using Work._29Tools.BLL; using Work._29Tools.BLL;
using Work._29Tools.CefTools; using Work._29Tools.CefTools;
@@ -641,7 +641,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (data.Contains("\"error_code\":40001")) if (data.Contains("\"error_code\":40001"))
{ {
currentReadBuyer = ""; currentReadBuyer = "";
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false); PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
return; return;
} }
@@ -957,7 +957,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
//{"errorCode":72004,"errorMsg":"","error_code":72004,"error_msg":"","result":null} //{"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")) 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 == "掉线") if (buyer.status == "掉线")
currentReadBuyer = ""; currentReadBuyer = "";
return; return;
@@ -1364,7 +1364,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (tokenSource.IsCancellationRequested) if (tokenSource.IsCancellationRequested)
break; break;
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer }); PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
if (buyer.status != "在线") if (buyer.status != "在线")
continue; continue;
@@ -1446,7 +1446,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30)) if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
{ {
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer }); PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
BindBuyer(buyer, "店铺掉线"); BindBuyer(buyer, "店铺掉线");
@@ -1522,7 +1522,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30)) if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
{ {
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer }); PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
BindBuyer(buyer, "店铺掉线"); BindBuyer(buyer, "店铺掉线");
@@ -1534,7 +1534,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (times % 100 == 0) if (times % 100 == 0)
{ {
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer }); PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
} }
if (buyer.status != "在线") if (buyer.status != "在线")
break; break;
@@ -1604,7 +1604,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30)) if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
{ {
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer }); PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
BindBuyer(buyer, "店铺掉线"); BindBuyer(buyer, "店铺掉线");
@@ -1,4 +1,7 @@
using _29WxOrderWpf.BaseWindows; using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Common;
using _29WxOrderWpf.ViewModels;
using _29WxOrderWpf.Views;
using AllBase; using AllBase;
using AllBase.Helper; using AllBase.Helper;
using AllBase.Model.DBModel; using AllBase.Model.DBModel;
@@ -24,146 +27,166 @@ using Work.BaseForms;
namespace _29WxOrderWpf.Ctrls.BuyerCtrls namespace _29WxOrderWpf.Ctrls.BuyerCtrls
{ {
/// <summary> /// <summary>
/// PDDBuyerSelectCtrl.xaml 的交互逻辑 /// PDDBuyerSelectCtrl.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class PDDBuyerSelectCtrl : UserControl public partial class PDDBuyerSelectCtrl : UserControl
{ {
public PDDBuyerSelectCtrl() public PDDBuyerSelectCtrl()
{ {
InitializeComponent(); InitializeComponent();
} }
private void UserControl_Loaded(object sender, RoutedEventArgs e) private void UserControl_Loaded(object sender, RoutedEventArgs e)
{ {
cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList; cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList;
} }
private void btnLoginPdd_Click(object sender, RoutedEventArgs e) private void btnLoginPdd_Click(object sender, RoutedEventArgs e)
{ {
BuyerLoginInfo buyer = null; BuyerLoginInfo buyer = null;
if (cmbPddBuyer.SelectedItem != null) if (cmbPddBuyer.SelectedItem != null)
{ {
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo; buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
} }
PddMobileLoginForm pddBuyerForm = new PddMobileLoginForm(buyer); PddMobileLoginView pddBuyerForm = new PddMobileLoginView(buyer);
pddBuyerForm.openType = EnumOpenType.login; pddBuyerForm.ViewModel.OpenType = EnumOpenType.login;
pddBuyerForm.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html"; pddBuyerForm.ViewModel.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
pddBuyerForm.ShowDialog(); //pddBuyerForm.ShowDialog();
MainWindow.Instance.GetPddBuyer(); new DialogWindow()
} {
Title = "买手登录",
Content = pddBuyerForm,
}.ShowDialog();
private void cmbPddBuyer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) MainWindow.Instance.GetPddBuyer();
{
if (e.GetPosition(sender as IInputElement).X > cmbPddBuyer.ActualWidth - 18)
return;
BuyerLoginInfo buyer = null;
if (cmbPddBuyer.SelectedItem != null)
{
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
}
if (buyer == null)
return;
PddMobileLoginForm.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false); //PddMobileLoginForm pddBuyerForm = new PddMobileLoginForm(buyer);
if (buyer.status == "在线") //pddBuyerForm.openType = TemuKJD.ToolForms.EnumOpenType.login;
{ //pddBuyerForm.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
PddMobileLoginForm shopLoginForm = new PddMobileLoginForm(buyer); //pddBuyerForm.ShowDialog();
shopLoginForm.openType = EnumOpenType.manage; //MainWindow.Instance.GetPddBuyer();
//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();
}
}
private void cmbPddBuyer_SelectionChanged(object sender, SelectionChangedEventArgs e) private void cmbPddBuyer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{ {
BuyerLoginInfo buyer = null; if (e.GetPosition(sender as IInputElement).X > cmbPddBuyer.ActualWidth - 18)
if (cmbPddBuyer.SelectedItem != null) return;
{
buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
}
GlobalConfig.CurrentPddBuyer = buyer;
}
private void btnDeleteItem_Click(object sender, RoutedEventArgs e) BuyerLoginInfo buyer = null;
{ if (cmbPddBuyer.SelectedItem != null)
if (BaseMsgWindow.ShowConfirm("确定删除吗?删除后不可恢复!").DialogResult != true) {
return; buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
}
if (buyer == null)
return;
if (sender is Button btn) bool islogin = false;
{ PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
if (btn.DataContext is BuyerLoginInfo buyer) PddMobileLoginView shopLoginForm = new PddMobileLoginView(buyer);
{ if (buyer.status == "在线")
Task.Run(() => {
{ shopLoginForm.ViewModel.OpenType = EnumOpenType.manage;
var url = BaseClass.Build29PDDObjString("user/del_buyer"); shopLoginForm.ViewModel.InitUrl = "https://mobile.yangkeduo.com";
var data = UserLogin.GetSignaturex() //shopLoginForm.Show();
+ "&buyer_id=" + buyer.buyer_id; }
var result = GetHtml.PostUtf8(url, data); else
if (result.Contains("\"code\":200")) {
{ shopLoginForm.ViewModel.OpenType = EnumOpenType.login;
Dispatcher.Invoke(new Action(() => shopLoginForm.ViewModel.InitUrl = "https://mobile.yangkeduo.com/login.html?from=https%3A%2F%2Fmobile.yangkeduo.com%2Fpersonal.html";
{ //shopLoginForm.ShowDialog();
GlobalConfig.PDDBuyerLoginList.Remove(buyer); islogin = true;
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(); new DialogWindow()
//this.statusBar.pgbTaskProgress.Maximum = buyers.Count; {
//pbLoading.Visible = true; Title = "买手登录",
Content = shopLoginForm,
}.ShowDialog();
if (islogin)
MainWindow.Instance.GetPddBuyer();
}
//Task.Run(() => private void cmbPddBuyer_SelectionChanged(object sender, SelectionChangedEventArgs e)
//{ {
// int i = 0; BuyerLoginInfo buyer = null;
// foreach (var buyer in buyers) if (cmbPddBuyer.SelectedItem != null)
// { {
// i++; buyer = cmbPddBuyer.SelectedItem as BuyerLoginInfo;
// this.Invoke(new Action(() => }
// { GlobalConfig.CurrentPddBuyer = buyer;
// this.statusBar.lblTaskStatus.Text = "正在删除..."; }
// this.statusBar.pgbTaskProgress.Value = i;
// this.statusBar.pgbTaskProgress.Text = i + "/" + buyers.Count; 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); // Thread.Sleep(100);
// } // }
// this.Invoke(new Action(() => // this.Invoke(new Action(() =>
// { // {
// this.statusBar.lblTaskStatus.Text = "删除完成"; // this.statusBar.lblTaskStatus.Text = "删除完成";
// this.statusBar.pgbTaskProgress.Value = buyers.Count; // this.statusBar.pgbTaskProgress.Value = buyers.Count;
// this.statusBar.pgbTaskProgress.Text = buyers.Count + "/" + buyers.Count; // this.statusBar.pgbTaskProgress.Text = buyers.Count + "/" + buyers.Count;
// })); // }));
// GetPddBuyer(); // GetPddBuyer();
//}); //});
} }
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{ {
if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible) if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible; MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1) if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1); Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
else else
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1); Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
} }
} }
} }
@@ -42,7 +42,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using TemuKJD.ToolForms; using _29WxOrderWpf.ViewModels;
using Work; using Work;
using Work._29Tools.BLL; using Work._29Tools.BLL;
using Work.BuyUsers; using Work.BuyUsers;
@@ -2136,7 +2136,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 检测一下买手号 // 检测一下买手号
if (buyer.status == "在线") if (buyer.status == "在线")
{ {
PddMobileLoginForm.CheckBuyerLogin(buyer); PddMobileLoginViewModel.CheckBuyerLogin(buyer);
} }
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
@@ -30,6 +30,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Windows.Threading; using System.Windows.Threading;
using _29WxOrderWpf.ViewModels;
using TemuKJD.ToolForms; using TemuKJD.ToolForms;
using Work; using Work;
using Work._29Tools.BLL; using Work._29Tools.BLL;
@@ -381,7 +382,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 拍单前检测买手号是否在线 // 拍单前检测买手号是否在线
if (GlobalConfig.CurrentPddBuyer.status == "在线") if (GlobalConfig.CurrentPddBuyer.status == "在线")
{ {
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer); PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
} }
if (GlobalConfig.CurrentPddBuyer.status != "在线") if (GlobalConfig.CurrentPddBuyer.status != "在线")
{ {
@@ -751,7 +752,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 拍单的时候检测一下买手号 // 拍单的时候检测一下买手号
if (buyer.status == "在线") if (buyer.status == "在线")
{ {
PddMobileLoginForm.CheckBuyerLogin(buyer); PddMobileLoginViewModel.CheckBuyerLogin(buyer);
} }
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
@@ -811,7 +812,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 拍单的时候检测一下买手号 // 拍单的时候检测一下买手号
if (buyer.status == "在线") if (buyer.status == "在线")
{ {
PddMobileLoginForm.CheckBuyerLogin(buyer); PddMobileLoginViewModel.CheckBuyerLogin(buyer);
} }
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
@@ -946,7 +947,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{ {
await Task.Run(() => await Task.Run(() =>
{ {
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer); PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
}); });
} }
if (GlobalConfig.CurrentPddBuyer.status != "在线") if (GlobalConfig.CurrentPddBuyer.status != "在线")
@@ -1265,7 +1266,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 检测买手号是否掉线 // 检测买手号是否掉线
if (GlobalConfig.CurrentPddBuyer.status == "在线") if (GlobalConfig.CurrentPddBuyer.status == "在线")
{ {
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer); PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
} }
if (GlobalConfig.CurrentPddBuyer.status != "在线") if (GlobalConfig.CurrentPddBuyer.status != "在线")
{ {
@@ -1478,7 +1479,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 检测一下买手号 // 检测一下买手号
if (buyer.status == "在线") if (buyer.status == "在线")
{ {
PddMobileLoginForm.CheckBuyerLogin(buyer); PddMobileLoginViewModel.CheckBuyerLogin(buyer);
} }
if (buyer.status != "在线") if (buyer.status != "在线")
{ {
+198 -66
View File
@@ -1,72 +1,204 @@
<basewindows:BaseWindow xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows" x:Class="_29WxOrderWpf.MainWindow" <basewindows:BaseWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="_29WxOrderWpf.MainWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
xmlns:local="clr-namespace:_29WxOrderWpf" xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
xmlns:orderctrls="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:shopctrls="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls" xmlns:local="clr-namespace:_29WxOrderWpf"
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls" xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}" xmlns:orderctrls="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
x:Name="mainWindow" Title="MainWindow" Height="900" Width="1600" Loaded="Window_Loaded" Closing="BaseWindow_Closing"> 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
<Grid.RowDefinitions> x:Name="mainGrid"
<RowDefinition Height="60"></RowDefinition> Margin="{Binding ElementName=mainWindow, Path=Padding}"
<RowDefinition Height="*"></RowDefinition> Background="Transparent">
</Grid.RowDefinitions> <Grid.RowDefinitions>
<Grid x:Name="gridTitle"> <RowDefinition Height="60" />
<Grid.ColumnDefinitions> <RowDefinition Height="*" />
<ColumnDefinition Width="auto"></ColumnDefinition> </Grid.RowDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition> <Grid
<ColumnDefinition></ColumnDefinition> x:Name="gridTitle"
<ColumnDefinition></ColumnDefinition> Background="Transparent"
</Grid.ColumnDefinitions> MouseLeftButtonDown="gridTitle_MouseLeftButtonDown">
<Image Source="{StaticResource main29WeixinIcon}" Height="50" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"></Image> <Grid.ColumnDefinitions>
<Label x:Name="lblAppName" FontSize="20" Margin="0,0,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center" <ColumnDefinition Width="auto" />
VerticalAlignment="Center" VerticalContentAlignment="Center" Content="拍单软件" Grid.Column="1"></Label> <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"> <WrapPanel
<Label x:Name="lblDebug" FontSize="12" Margin="2,4,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Right" Grid.Column="12"
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="[release]" Opacity="0.7" Grid.Column="4"></Label> Margin="0,4,80,0"
<Label x:Name="lblVersion" FontSize="12" Margin="2,4,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="版本信息" Opacity="0.7" Grid.Column="4"></Label> 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" />
</WrapPanel> </WrapPanel>
<Label x:Name="lblBalance" FontSize="12" Margin="0,25,80,0" HorizontalAlignment="Right" Foreground="#60ff66" MouseLeftButtonUp="lblBalance_MouseLeftButtonUp" <Label
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="{Binding Balance}" Opacity="0.7" Grid.Column="4" Cursor="Hand"></Label> x:Name="lblBalance"
</Grid> Grid.Column="4"
<Grid x:Name="gridContainer" Grid.Row="1" Background="White" Margin="2,0,2,2"> Margin="0,25,80,0"
<Grid.ColumnDefinitions> HorizontalAlignment="Right"
<ColumnDefinition Width="auto"></ColumnDefinition> VerticalAlignment="Top"
<ColumnDefinition Width="*"></ColumnDefinition> VerticalContentAlignment="Center"
</Grid.ColumnDefinitions> Content="{Binding Balance}"
<orderctrls:OrderListCtrl x:Name="orderListCtrl" Grid.Column="1" Visibility="Collapsed"></orderctrls:OrderListCtrl> Cursor="Hand"
<Grid x:Name="gridPddBuyerOrderReadCtrl" Visibility="Hidden" Grid.ColumnSpan="2" Background="#7F000000" MouseLeftButtonUp="gridPddBuyerOrderReadCtrl_MouseLeftButtonUp"> FontSize="12"
<Border CornerRadius="10" HorizontalAlignment="Right" Height="auto" Background="White" Margin="0,50,0,0"> Foreground="#60ff66"
<buyerctrls:PDDBuyerOrderReadCtrl x:Name="pddBuyerOrderReadCtrl" Grid.Column="1" Visibility="Collapsed" Panel.ZIndex="-1" Width="1200" MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
HorizontalAlignment="Right"/> Opacity="0.7" />
</Border> </Grid>
</Grid> <Grid
<buyerctrls:PDDBuyerSelectCtrl x:Name="pddBuyerSelectCtrl" Visibility="Collapsed" Width="280" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="8"/> x:Name="gridContainer"
<Grid x:Name="gridUser" Visibility="Hidden" Grid.ColumnSpan="2" Background="#7F000000"> Grid.Row="1"
<Border CornerRadius="4" Width="500" Height="600" Background="White"> Margin="2,0,2,2"
<shopctrls:ShopListCtrl x:Name="shopListCtrl" Visibility="{Binding ElementName=gridUser,Mode=TwoWay,Path=Visibility}" Margin="2" Background="White">
Grid.ColumnSpan="2"></shopctrls:ShopListCtrl> <Grid.ColumnDefinitions>
</Border> <ColumnDefinition Width="auto" />
</Grid> <ColumnDefinition Width="*" />
</Grid> </Grid.ColumnDefinitions>
<userctrls:UcWindowBoxes x:Name="ucWindowBox" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/> <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" HorizontalAlignment="Center" Margin="10,50" VerticalAlignment="Top" BorderThickness="1" Opacity="0" <Border
BorderBrush="{StaticResource pageColorBrush}" CornerRadius="6" Background="White" IsHitTestVisible="False" x:Name="borderMessage"
MinWidth="120" MinHeight="2" MaxWidth="1200" Panel.ZIndex="1000000"> Grid.Row="1"
<Border.Effect> Width="auto"
<DropShadowEffect ShadowDepth="5" Color="#FF98638f" BlurRadius="40" Opacity="0.2"/> Height="auto"
</Border.Effect> MinWidth="120"
<TextBlock Text="这里是默认提示信息" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="tbMessage" TextWrapping="Wrap"></TextBlock> MinHeight="2"
</Border> MaxWidth="1200"
<!--<Image x:Name="imageBig" HorizontalAlignment="Left" Height="800" Width="800" VerticalAlignment="Center" Grid.Row="1" Margin="200,0,0,0"/>--> Margin="10,50"
</Grid> 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> </basewindows:BaseWindow>
+16 -1
View File
@@ -450,5 +450,20 @@ namespace _29WxOrderWpf
//else //else
// Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1); // 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
}
}
+112
View File
@@ -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);
}
}
}
}
+1
View File
@@ -14,6 +14,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
using Color = System.Windows.Media.Color;
namespace AllBase.Helper namespace AllBase.Helper
{ {
@@ -13,6 +13,7 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel; using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using Color = System.Windows.Media.Color;
namespace AllBase.Model.DBModel namespace AllBase.Model.DBModel
{ {
+5
View File
@@ -10,6 +10,7 @@
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<UseWPF>true</UseWPF>
<!-- Properties\AssemblyInfo.cs already contains assembly attributes, <!-- Properties\AssemblyInfo.cs already contains assembly attributes,
so disable the SDK's auto-generated AssemblyInfo to avoid duplicates. --> so disable the SDK's auto-generated AssemblyInfo to avoid duplicates. -->
@@ -150,6 +151,10 @@
<None Include="Resources\icon.ico" /> <None Include="Resources\icon.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Views\" />
<Folder Include="ViewModels\" />
</ItemGroup>
<!-- app.config is picked up automatically by the SDK's default None glob <!-- app.config is picked up automatically by the SDK's default None glob
and MSBuild's app.config handling (based on the filename), so no and MSBuild's app.config handling (based on the filename), so no
+234 -234
View File
@@ -29,220 +29,220 @@ namespace Work.UserControls
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.btnPrev = new DevComponents.DotNetBar.PanelEx(); this.btnPrev = new DevComponents.DotNetBar.PanelEx();
this.btnNext = new DevComponents.DotNetBar.PanelEx(); this.btnNext = new DevComponents.DotNetBar.PanelEx();
this.lblPage = new System.Windows.Forms.Label(); this.lblPage = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.btnJump = new DevComponents.DotNetBar.PanelEx(); this.btnJump = new DevComponents.DotNetBar.PanelEx();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.txtJumpPage = new DevComponents.DotNetBar.Controls.TextBoxX(); this.txtJumpPage = new DevComponents.DotNetBar.Controls.TextBoxX();
this.lblJump = new System.Windows.Forms.Label(); this.lblJump = new System.Windows.Forms.Label();
this.lblTotal = new System.Windows.Forms.Label(); this.lblTotal = new System.Windows.Forms.Label();
this.lblPageSize = new System.Windows.Forms.Label(); this.lblPageSize = new System.Windows.Forms.Label();
this.cmbPageSize = new System.Windows.Forms.ComboBox(); this.cmbPageSize = new System.Windows.Forms.ComboBox();
this.flowLayoutPanel2.SuspendLayout(); this.flowLayoutPanel2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnPrev // btnPrev
// //
this.btnPrev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.btnPrev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.btnPrev.AutoSize = true; this.btnPrev.AutoSize = true;
this.btnPrev.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnPrev.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnPrev.Cursor = System.Windows.Forms.Cursors.Hand; this.btnPrev.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnPrev.DisabledBackColor = System.Drawing.Color.Empty; this.btnPrev.DisabledBackColor = System.Drawing.Color.Empty;
this.btnPrev.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnPrev.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnPrev.Location = new System.Drawing.Point(259, 0); this.btnPrev.Location = new System.Drawing.Point(259, 0);
this.btnPrev.Margin = new System.Windows.Forms.Padding(0); this.btnPrev.Margin = new System.Windows.Forms.Padding(0);
this.btnPrev.Name = "btnPrev"; this.btnPrev.Name = "btnPrev";
this.btnPrev.Size = new System.Drawing.Size(31, 20); this.btnPrev.Size = new System.Drawing.Size(31, 20);
this.btnPrev.Style.Alignment = System.Drawing.StringAlignment.Center; this.btnPrev.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnPrev.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.btnPrev.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnPrev.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.btnPrev.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnPrev.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.btnPrev.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnPrev.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; this.btnPrev.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnPrev.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; this.btnPrev.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnPrev.Style.ForeColor.Color = System.Drawing.Color.White; this.btnPrev.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnPrev.Style.GradientAngle = 90; this.btnPrev.Style.GradientAngle = 90;
this.btnPrev.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; this.btnPrev.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnPrev.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnPrev.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnPrev.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnPrev.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnPrev.TabIndex = 431; this.btnPrev.TabIndex = 431;
this.btnPrev.Text = "上页"; this.btnPrev.Text = "上页";
this.btnPrev.Click += new System.EventHandler(this.btnPrev_Click); this.btnPrev.Click += new System.EventHandler(this.btnPrev_Click);
// //
// btnNext // btnNext
// //
this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.btnNext.AutoSize = true; this.btnNext.AutoSize = true;
this.btnNext.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnNext.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnNext.Cursor = System.Windows.Forms.Cursors.Hand; this.btnNext.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnNext.DisabledBackColor = System.Drawing.Color.Empty; this.btnNext.DisabledBackColor = System.Drawing.Color.Empty;
this.btnNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNext.Location = new System.Drawing.Point(311, 0); this.btnNext.Location = new System.Drawing.Point(311, 0);
this.btnNext.Margin = new System.Windows.Forms.Padding(0); this.btnNext.Margin = new System.Windows.Forms.Padding(0);
this.btnNext.Name = "btnNext"; this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(31, 20); this.btnNext.Size = new System.Drawing.Size(31, 20);
this.btnNext.Style.Alignment = System.Drawing.StringAlignment.Center; this.btnNext.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnNext.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.btnNext.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnNext.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.btnNext.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnNext.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.btnNext.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnNext.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; this.btnNext.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnNext.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; this.btnNext.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnNext.Style.ForeColor.Color = System.Drawing.Color.White; this.btnNext.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnNext.Style.GradientAngle = 90; this.btnNext.Style.GradientAngle = 90;
this.btnNext.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; this.btnNext.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnNext.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnNext.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnNext.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnNext.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnNext.TabIndex = 435; this.btnNext.TabIndex = 435;
this.btnNext.Text = "下页"; this.btnNext.Text = "下页";
this.btnNext.Click += new System.EventHandler(this.btnNext_Click); this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
// //
// lblPage // lblPage
// //
this.lblPage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.lblPage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.lblPage.AutoSize = true; this.lblPage.AutoSize = true;
this.lblPage.Location = new System.Drawing.Point(293, 0); this.lblPage.Location = new System.Drawing.Point(293, 0);
this.lblPage.Name = "lblPage"; this.lblPage.Name = "lblPage";
this.lblPage.Size = new System.Drawing.Size(15, 20); this.lblPage.Size = new System.Drawing.Size(15, 20);
this.lblPage.TabIndex = 436; this.lblPage.TabIndex = 436;
this.lblPage.Text = "1"; this.lblPage.Text = "1";
this.lblPage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblPage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(200, 100); this.flowLayoutPanel1.Size = new System.Drawing.Size(200, 100);
this.flowLayoutPanel1.TabIndex = 437; this.flowLayoutPanel1.TabIndex = 437;
// //
// flowLayoutPanel2 // flowLayoutPanel2
// //
this.flowLayoutPanel2.Controls.Add(this.btnJump); this.flowLayoutPanel2.Controls.Add(this.btnJump);
this.flowLayoutPanel2.Controls.Add(this.label1); this.flowLayoutPanel2.Controls.Add(this.label1);
this.flowLayoutPanel2.Controls.Add(this.txtJumpPage); this.flowLayoutPanel2.Controls.Add(this.txtJumpPage);
this.flowLayoutPanel2.Controls.Add(this.lblJump); this.flowLayoutPanel2.Controls.Add(this.lblJump);
this.flowLayoutPanel2.Controls.Add(this.btnNext); this.flowLayoutPanel2.Controls.Add(this.btnNext);
this.flowLayoutPanel2.Controls.Add(this.lblPage); this.flowLayoutPanel2.Controls.Add(this.lblPage);
this.flowLayoutPanel2.Controls.Add(this.btnPrev); this.flowLayoutPanel2.Controls.Add(this.btnPrev);
this.flowLayoutPanel2.Controls.Add(this.lblTotal); this.flowLayoutPanel2.Controls.Add(this.lblTotal);
this.flowLayoutPanel2.Controls.Add(this.lblPageSize); this.flowLayoutPanel2.Controls.Add(this.lblPageSize);
this.flowLayoutPanel2.Controls.Add(this.cmbPageSize); this.flowLayoutPanel2.Controls.Add(this.cmbPageSize);
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.flowLayoutPanel2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.flowLayoutPanel2.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.flowLayoutPanel2.Size = new System.Drawing.Size(480, 23); this.flowLayoutPanel2.Size = new System.Drawing.Size(480, 23);
this.flowLayoutPanel2.TabIndex = 0; this.flowLayoutPanel2.TabIndex = 0;
// //
// btnJump // btnJump
// //
this.btnJump.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.btnJump.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.btnJump.AutoSize = true; this.btnJump.AutoSize = true;
this.btnJump.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnJump.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnJump.Cursor = System.Windows.Forms.Cursors.Hand; this.btnJump.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnJump.DisabledBackColor = System.Drawing.Color.Empty; this.btnJump.DisabledBackColor = System.Drawing.Color.Empty;
this.btnJump.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnJump.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnJump.Location = new System.Drawing.Point(446, 0); this.btnJump.Location = new System.Drawing.Point(446, 0);
this.btnJump.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.btnJump.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.btnJump.Name = "btnJump"; this.btnJump.Name = "btnJump";
this.btnJump.Size = new System.Drawing.Size(31, 20); this.btnJump.Size = new System.Drawing.Size(31, 20);
this.btnJump.Style.Alignment = System.Drawing.StringAlignment.Center; this.btnJump.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnJump.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.btnJump.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnJump.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.btnJump.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnJump.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.btnJump.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnJump.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; this.btnJump.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnJump.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; this.btnJump.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnJump.Style.ForeColor.Color = System.Drawing.Color.White; this.btnJump.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnJump.Style.GradientAngle = 90; this.btnJump.Style.GradientAngle = 90;
this.btnJump.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; this.btnJump.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnJump.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnJump.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnJump.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnJump.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnJump.TabIndex = 439; this.btnJump.TabIndex = 439;
this.btnJump.Text = "跳转"; this.btnJump.Text = "跳转";
this.btnJump.Click += new System.EventHandler(this.pnlJump_Click); this.btnJump.Click += new System.EventHandler(this.pnlJump_Click);
// //
// label1 // label1
// //
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(423, 0); this.label1.Location = new System.Drawing.Point(423, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(20, 20); this.label1.Size = new System.Drawing.Size(20, 20);
this.label1.TabIndex = 445; this.label1.TabIndex = 445;
this.label1.Text = "页"; this.label1.Text = "页";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// txtJumpPage // txtJumpPage
// //
this.txtJumpPage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.txtJumpPage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
// //
// //
// //
this.txtJumpPage.Border.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.txtJumpPage.Border.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.txtJumpPage.Border.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.txtJumpPage.Border.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.txtJumpPage.Border.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.txtJumpPage.Border.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.txtJumpPage.Border.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.txtJumpPage.Border.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.txtJumpPage.Border.Class = "CrumbBarBackgroundKey"; this.txtJumpPage.Border.Class = "CrumbBarBackgroundKey";
this.txtJumpPage.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.txtJumpPage.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtJumpPage.Border.PaddingBottom = 2; this.txtJumpPage.Border.PaddingBottom = 2;
this.txtJumpPage.Border.PaddingLeft = 2; this.txtJumpPage.Border.PaddingLeft = 2;
this.txtJumpPage.Border.PaddingRight = 2; this.txtJumpPage.Border.PaddingRight = 2;
this.txtJumpPage.Border.PaddingTop = 2; this.txtJumpPage.Border.PaddingTop = 2;
this.txtJumpPage.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtJumpPage.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtJumpPage.Location = new System.Drawing.Point(393, 0); this.txtJumpPage.Location = new System.Drawing.Point(393, 0);
this.txtJumpPage.Margin = new System.Windows.Forms.Padding(0); this.txtJumpPage.Margin = new System.Windows.Forms.Padding(0);
this.txtJumpPage.Name = "txtJumpPage"; this.txtJumpPage.Name = "txtJumpPage";
this.txtJumpPage.Size = new System.Drawing.Size(30, 21); this.txtJumpPage.Size = new System.Drawing.Size(30, 21);
this.txtJumpPage.TabIndex = 444; this.txtJumpPage.TabIndex = 444;
this.txtJumpPage.Text = "1"; this.txtJumpPage.Text = "1";
// //
// lblJump // lblJump
// //
this.lblJump.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.lblJump.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.lblJump.AutoSize = true; this.lblJump.AutoSize = true;
this.lblJump.Location = new System.Drawing.Point(345, 0); this.lblJump.Location = new System.Drawing.Point(345, 0);
this.lblJump.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.lblJump.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.lblJump.Name = "lblJump"; this.lblJump.Name = "lblJump";
this.lblJump.Size = new System.Drawing.Size(48, 20); this.lblJump.Size = new System.Drawing.Size(48, 20);
this.lblJump.TabIndex = 437; this.lblJump.TabIndex = 437;
this.lblJump.Text = "跳转到 "; this.lblJump.Text = "跳转到 ";
this.lblJump.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblJump.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblTotal // lblTotal
// //
this.lblTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.lblTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.lblTotal.AutoSize = true; this.lblTotal.AutoSize = true;
this.lblTotal.Location = new System.Drawing.Point(220, 0); this.lblTotal.Location = new System.Drawing.Point(220, 0);
this.lblTotal.Margin = new System.Windows.Forms.Padding(0); this.lblTotal.Margin = new System.Windows.Forms.Padding(0);
this.lblTotal.Name = "lblTotal"; this.lblTotal.Name = "lblTotal";
this.lblTotal.Size = new System.Drawing.Size(39, 20); this.lblTotal.Size = new System.Drawing.Size(39, 20);
this.lblTotal.TabIndex = 446; this.lblTotal.TabIndex = 446;
this.lblTotal.Text = "共1页"; this.lblTotal.Text = "共1页";
this.lblTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblPageSize // lblPageSize
// //
this.lblPageSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.lblPageSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.lblPageSize.AutoSize = true; this.lblPageSize.AutoSize = true;
this.lblPageSize.Location = new System.Drawing.Point(177, 0); this.lblPageSize.Location = new System.Drawing.Point(177, 0);
this.lblPageSize.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.lblPageSize.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblPageSize.Name = "lblPageSize"; this.lblPageSize.Name = "lblPageSize";
this.lblPageSize.Size = new System.Drawing.Size(37, 20); this.lblPageSize.Size = new System.Drawing.Size(37, 20);
this.lblPageSize.TabIndex = 453; this.lblPageSize.TabIndex = 453;
this.lblPageSize.Text = "条/页"; this.lblPageSize.Text = "条/页";
this.lblPageSize.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblPageSize.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblPageSize.Visible = false; this.lblPageSize.Visible = false;
// //
// cmbPageSize // cmbPageSize
// //
this.cmbPageSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); this.cmbPageSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.cmbPageSize.Font = new System.Drawing.Font("微软雅黑", 7F); this.cmbPageSize.Font = new System.Drawing.Font("微软雅黑", 7F);
this.cmbPageSize.FormattingEnabled = true; this.cmbPageSize.FormattingEnabled = true;
this.cmbPageSize.Items.AddRange(new object[] { this.cmbPageSize.Items.AddRange(new object[] {
"50", "50",
"100", "100",
"200", "200",
@@ -250,26 +250,26 @@ namespace Work.UserControls
"1000", "1000",
"2000", "2000",
"5000"}); "5000"});
this.cmbPageSize.Location = new System.Drawing.Point(132, 0); this.cmbPageSize.Location = new System.Drawing.Point(132, 0);
this.cmbPageSize.Margin = new System.Windows.Forms.Padding(0); this.cmbPageSize.Margin = new System.Windows.Forms.Padding(0);
this.cmbPageSize.Name = "cmbPageSize"; this.cmbPageSize.Name = "cmbPageSize";
this.cmbPageSize.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmbPageSize.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.cmbPageSize.Size = new System.Drawing.Size(45, 22); this.cmbPageSize.Size = new System.Drawing.Size(45, 22);
this.cmbPageSize.TabIndex = 452; this.cmbPageSize.TabIndex = 452;
this.cmbPageSize.Text = "50"; this.cmbPageSize.Text = "50";
this.cmbPageSize.Visible = false; this.cmbPageSize.Visible = false;
// //
// UcSplitPage // UcSplitPage
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.flowLayoutPanel2);
this.Controls.Add(this.flowLayoutPanel1); this.Controls.Add(this.flowLayoutPanel1);
this.Margin = new System.Windows.Forms.Padding(0); this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "UcSplitPage"; this.Name = "UcSplitPage";
this.Size = new System.Drawing.Size(480, 23); this.Size = new System.Drawing.Size(480, 23);
this.flowLayoutPanel2.ResumeLayout(false); this.flowLayoutPanel2.ResumeLayout(false);
this.flowLayoutPanel2.PerformLayout(); this.flowLayoutPanel2.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
+1 -1
View File
@@ -35,7 +35,7 @@ namespace TemuKJD.ToolForms
refresh_cookie, refresh_cookie,
order_login, order_login,
} }
[Obsolete]
public partial class PddMobileLoginForm : BaseGeneralForm public partial class PddMobileLoginForm : BaseGeneralForm
{ {
// 拼多多买手退货退款售后地址 // 拼多多买手退货退款售后地址