拍单功能继续优化
This commit is contained in:
1 parent
29042424dc
commit
34c51c6fcd
64 files changed
+7138
-305
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerOrderListCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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.Ctrls.BuyerCtrls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// PDDBuyerOrderListCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PDDBuyerOrderListCtrl : UserControl
|
||||
{
|
||||
public PDDBuyerOrderListCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerSelectCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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.Ctrls.BuyerCtrls" xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="30" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ComboBox Grid.Column="1" x:Name="cmbPddBuyer" Margin="8,0,0,0" VerticalContentAlignment="Center" Style="{StaticResource RoundedComboBox}" Height="24"
|
||||
MouseLeftButtonUp="cmbPddBuyer_MouseLeftButtonUp" SelectionChanged="cmbPddBuyer_SelectionChanged" SelectedIndex="0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}">-->
|
||||
<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ComboBox}},
|
||||
Path=ActualWidth, Converter={StaticResource ValueMinus24Converter}}" Height="auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Name="tbName" Text="{Binding buyer_nick}" VerticalAlignment="Center"/>
|
||||
<userctrls:UcImageButton Width="15" Height="15" ButtonImage="{StaticResource imgCloseGray}" BorderThickness="0" Cursor="Hand" Grid.Column="0" Visibility="Collapsed"
|
||||
MouseOverButtonImage="{StaticResource imgCloseGray}" MousePressButtonImage="{StaticResource imgCloseGray}" Background="Transparent"
|
||||
x:Name="btnDeleteItem" Tag="{Binding ElementName=tbName, Path=Text}" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Click="btnDeleteItem_Click"/>
|
||||
<TextBlock x:Name="tbStatus" Text="{Binding status}" Foreground="{Binding status, Converter={StaticResource statusToColorBrushConverter}}" Grid.Column="2"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnDeleteItem" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<!--<TextBlock Text="选择买手" Grid.Column="12" Margin="12,0,0,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray"
|
||||
Visibility="{Binding ElementName=cmbBuyer,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>-->
|
||||
<Button Grid.Column="2" x:Name="btnLoginPdd" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0"
|
||||
Content="多多登录" Width="56" Height="24" Click="btnLoginPdd_Click"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,158 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Result;
|
||||
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.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
/// <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 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();
|
||||
}
|
||||
|
||||
private void cmbPddBuyer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
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);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
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(MainWindow.Instance, "确定删除吗?删除后不可恢复!").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();
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user