拼多多买手直接退款 其他订单逻辑优化

This commit is contained in:
wule committed 2026-07-09 20:08:27 +08:00
1 parent 1669305479
commit b877695e4b
42 files changed
+1958 -1980

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.4.11620.152 stable
# Visual Studio Version 17
VisualStudioVersion = 17.14.36221.1 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "29WxOrderAllBase", "AllBase\29WxOrderAllBase.csproj", "{6461D807-B1C8-45F0-B388-E0CA1A418DE0}"
EndProject
@@ -59,8 +59,8 @@ Global
{D51A1BB0-17BB-44C3-9129-1F3187E82729}.Release|x64.Build.0 = Release|x64
{D51A1BB0-17BB-44C3-9129-1F3187E82729}.Release|x86.ActiveCfg = Release|x86
{D51A1BB0-17BB-44C3-9129-1F3187E82729}.Release|x86.Build.0 = Release|x86
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|Any CPU.ActiveCfg = Debug|x86
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|Any CPU.Build.0 = Debug|x86
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|Mixed Platforms.Build.0 = Debug|x86
{1AD45D66-6872-4522-ACF0-04E2C0514048}.Debug|x64.ActiveCfg = Debug|x64
+1
View File
@@ -174,6 +174,7 @@
<Compile Include="Ctrls\OrderCtrls\OrderListCtrl.xaml.cs">
<DependentUpon>OrderListCtrl.xaml</DependentUpon>
</Compile>
<Compile Include="StartUp.cs" />
<Compile Include="ToolCtrls\Icons.xaml.cs">
<DependentUpon>Icons.xaml</DependentUpon>
</Compile>
+34 -35
View File
@@ -51,7 +51,7 @@ namespace _29WxOrderWpf
//处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//StartUp.Init();
StartUp.Init();
new Initialization().Get();
#region 贴牌
@@ -62,46 +62,45 @@ namespace _29WxOrderWpf
//string IbPakFile = "locales/ib.pak";//ico
string IcPakFile = "locales/ic.pak";//功能配置
if (!File.Exists("locales/io.pak"))
if (File.Exists("locales/io.pak"))
{
return;
}
var ioTxt = FileBase.ReadAllText("locales/io.pak");
if (ioTxt.StartsWith("MThd") || !ioTxt.Contains("MThd"))
return;
var ioTxt = FileBase.ReadAllText("locales/io.pak");
if (ioTxt.StartsWith("MThd") || !ioTxt.Contains("MThd"))
return;
string agentNameFile = "locales/na.pak";
if (File.Exists(agentNameFile))
{
var config = FileBase.ReadAllText(agentNameFile, Encoding.UTF8);
var configArr = config.Split(new string[] { "\r\n", "MThd" }, StringSplitOptions.RemoveEmptyEntries);
if (configArr.Length >= 2)
string agentNameFile = "locales/na.pak";
if (File.Exists(agentNameFile))
{
BaseClass.ProgramName = configArr[1];
BaseClass.ToolName = configArr[1];
BaseClass.AgentName = configArr[0];
var config = FileBase.ReadAllText(agentNameFile, Encoding.UTF8);
var configArr = config.Split(new string[] { "\r\n", "MThd" }, StringSplitOptions.RemoveEmptyEntries);
if (configArr.Length >= 2)
{
BaseClass.ProgramName = configArr[1];
BaseClass.ToolName = configArr[1];
BaseClass.AgentName = configArr[0];
}
}
}
string LogoPakFile = "locales/lo.pak"; // ico
if (File.Exists(LogoPakFile))
{
BitmapImage bitmap = new BitmapImage(new Uri(LogoPakFile, UriKind.Relative));
Application.Current.Resources["main29WeixinIcon"] = bitmap;
// winform部分,直接指定路径,从bitmap转换的会丢失颜色
BaseClass.Ico = new Icon(LogoPakFile); //BitmapImageToIcon(Application.Current.Resources["main29WeixinIcon"] as BitmapImage);
}
//BaseClass.ProgromLogo = Environment.CurrentDirectory + "\\locales\\ia.pak";//logo
//BaseClass.ProgromLogoIco = Environment.CurrentDirectory + "\\locales\\ib.pak";//ico
string ImgPakFile = "locales/im.pak";
if (File.Exists(ImgPakFile))
{
BaseClass.LogoImage = Image.FromFile(ImgPakFile);
}
string LogoPakFile = "locales/lo.pak"; // ico
if (File.Exists(LogoPakFile))
{
BitmapImage bitmap = new BitmapImage(new Uri(LogoPakFile, UriKind.Relative));
Application.Current.Resources["main29WeixinIcon"] = bitmap;
// winform部分,直接指定路径,从bitmap转换的会丢失颜色
BaseClass.Ico = new Icon(LogoPakFile); //BitmapImageToIcon(Application.Current.Resources["main29WeixinIcon"] as BitmapImage);
}
//BaseClass.ProgromLogo = Environment.CurrentDirectory + "\\locales\\ia.pak";//logo
//BaseClass.ProgromLogoIco = Environment.CurrentDirectory + "\\locales\\ib.pak";//ico
string ImgPakFile = "locales/im.pak";
if (File.Exists(ImgPakFile))
{
BaseClass.LogoImage = Image.FromFile(ImgPakFile);
}
// 待后续完善
OenMechanism(IgPakFile, OenVersionFile, IaPakFile, LogoPakFile, IcPakFile);
// 待后续完善
OenMechanism(IgPakFile, OenVersionFile, IaPakFile, LogoPakFile, IcPakFile);
}
#endregion
}
catch (Exception ex)
@@ -14,6 +14,8 @@ namespace _29WxOrderWpf.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ( value == null)
return Visibility.Collapsed;
return !value.ParseToString().Trim().IsNullOrEmpty() ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
@@ -28,8 +28,8 @@
<CheckBox Content="隐藏无微信订单的买手单" x:Name="chkHideNoWxIdOrder" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left"
Margin="6,0" VerticalAlignment="Center" Checked="chkHideNoWxIdOrder_CheckedChanged" Unchecked="chkHideNoWxIdOrder_CheckedChanged" IsChecked="True"/>
<CheckBox Content="未发货单自动售后" x:Name="chkAutoAfterSale" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left" Visibility="Collapsed"
Margin="6,0" VerticalAlignment="Center" IsChecked="True"/>
<CheckBox Content="未发货订单自动售后" x:Name="chkAutoAfterSale" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left" Visibility="Visible"
Margin="6,0" VerticalAlignment="Center" IsChecked="True" Checked="chkAutoAfterSale_Checked" Unchecked="chkAutoAfterSale_Checked"/>
<Button Grid.Column="8" x:Name="btnSearch" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0" Content="刷新订单" Width="118" Height="24" Click="btnSearch_Click"/>
</WrapPanel>
@@ -40,125 +40,188 @@
<Grid Grid.Row="1" Background="LightGray" x:Name="GridCef">
</Grid>
<Grid Grid.Row="1" VerticalAlignment="Bottom" Visibility="Visible" Height="330" Margin="4" Background="White">
<Grid Grid.Row="1" VerticalAlignment="Bottom" Visibility="Visible" Margin="0" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Label Content="正在操作:" VerticalAlignment="Center" x:Name="lblMsg"></Label>
<DataGrid Grid.Row="1" RowHeight="50" AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}" x:Name="dgBuyerOrder" RowHeaderWidth="0"
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}" CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="30" LoadingRow="dgBuyerOrder_LoadingRow">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}" CanUserSort="False" Header="序列" IsReadOnly="True" Width="40">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1.5*" Header="拍单订单号" Binding="{Binding order_sn}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1.5*" Header="店铺订单号" Binding="{Binding ShopOrderIdStr}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="买手名称" Binding="{Binding buyerName}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="0.8*" Header="拍单时间" Binding="{Binding OrderTimeStr}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1.8*" Header="商品信息" Binding="{Binding ProdInfoStr}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="0.8*" Header="金额" Binding="{Binding AmoutValue}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="订单状态" Binding="{Binding order_status_prompt}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="物流名称" Binding="{Binding outExpressCompanyCode}">
<!--outExpressCompanyName-->
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="物流单号" Binding="{Binding tracking_number}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="订单信息" Binding="{Binding sendStatus}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Width="0.6*" Header="手动发送" x:Name="colSendBuyerOrder" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnSendBuyerOrder" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center" Foreground="#409eff" BorderBrush="Transparent"
Margin="4,0,0,0" Content="发送" Click="btnSendBuyerOrder_Click" Visibility="{Binding TransitWarehouseIdStr, Converter={StaticResource HasTextVisibility}}"></Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Button Style="{StaticResource BasePageButtonStyle}" Margin="0,0,0,-10" Content="▼" VerticalContentAlignment="top" Width="60" Height="25" x:Name="btnHide" Click="btnHide_Click"/>
<Grid x:Name="gridTable" Grid.Row="1" VerticalAlignment="Bottom" Visibility="Visible" Height="330" Margin="2" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Label Content="正在操作:" Panel.ZIndex="1" Margin="180,0,0,0" VerticalAlignment="Center" x:Name="lblMsg"></Label>
<TabControl x:Name="tabOrderType" Grid.Row="1" Margin="0,-32,0,1" VerticalAlignment="Stretch" >
<TabControl.Resources>
<Style TargetType="{x:Type TabControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="1" Background="#f8f8f9" BorderThickness="1,1,1,0" BorderBrush="#e0e0e0" MinHeight="4" CornerRadius="0,4,0,0">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
</Border>
<Border HorizontalAlignment="Left" Background="#e8e8e9" BorderBrush="#e1e1e1" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0" Margin="0,0,0,0">
<TabPanel x:Name="HeaderPanel" Background="Transparent" IsItemsHost="True"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="TabItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border Name="Border" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0" Margin="-1,-2,-1,0">
<ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="10,5"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="#f8f8f9"/>
<Setter TargetName="Border" Property="BorderBrush" Value="#e0e0e0"/>
<Setter TargetName="Border" Property="Margin" Value="-1,-3,-1,-1"/>
<Setter Property="Foreground" Value="{StaticResource pageColorBrush}"/>
<Setter Property="Panel.ZIndex" Value="100"/>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#999999"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>
<TabItem Header="买手订单">
<DataGrid Grid.Row="1" RowHeight="50" AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}" x:Name="dgBuyerOrder"
RowHeaderWidth="0" VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}" CanUserDeleteRows="False" CanUserAddRows="False"
ColumnHeaderHeight="30" LoadingRow="dgBuyerOrder_LoadingRow">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"
CanUserSort="False" Header="序列" IsReadOnly="True" Width="40">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1.5*" Header="拍单订单号" Binding="{Binding order_sn}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1.5*" Header="店铺订单号" Binding="{Binding ShopOrderIdStr}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="买手名称" Binding="{Binding buyerName}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="0.8*" Header="拍单时间" Binding="{Binding OrderTimeStr}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1.8*" Header="商品信息" Binding="{Binding ProdInfoStr}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="0.8*" Header="金额" Binding="{Binding AmoutValue}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="订单状态" Binding="{Binding order_status_prompt}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="物流名称" Binding="{Binding outExpressCompanyCode}">
<!--outExpressCompanyName-->
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="物流单号" Binding="{Binding tracking_number}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="1*" Header="订单信息" Binding="{Binding sendStatus}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Width="0.6*" Header="手动发送" x:Name="colSendBuyerOrder" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnSendBuyerOrder" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center"
Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent" Margin="4,0,0,0" Content="发送" Click="btnSendBuyerOrder_Click"
Visibility="{Binding TransitWarehouseIdStr, Converter={StaticResource HasTextVisibility}}"></Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem Header="买手退款"></TabItem>
</TabControl>
</Grid>
</Grid>
</Grid>
</Border>
@@ -51,14 +51,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
ConcurrentList<PddBuyerAfterSaleLiteInfo> lstPddBuyerAfterSaleInfoLite { get; set; } = new ConcurrentList<PddBuyerAfterSaleLiteInfo>();
public CancellationTokenSource cancellationTokenSource { get; set; } = new CancellationTokenSource();
//public ChromiumWebBrowser cefWebBrowser = null;
public BuyerOrderConfig buyerOrderConfig = new BuyerOrderConfig();
public BuyerReadOrderConfig buyerReadOrderConfig = new BuyerReadOrderConfig();
public DateTime nextGetOrderTime = DateTime.MinValue;
public DateTime lastCefReadOrderTime = DateTime.Now;
/// <summary>
/// 是否自动读买手单
/// </summary>
public bool IsAutoReadBuyerOrder = true;
/// <summary>
/// 是否正在读买手单
/// </summary>
bool isReadBuyerOrder = false;
@@ -129,18 +125,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
return false;
if (isHideNoWxOrderNo && order.ShopOrderIdStr.IsNullOrEmpty())
return false;
if (!string.IsNullOrEmpty(filterTxt) && !order.order_sn.Contains(filterTxt) && !order.ShopOrderIdStr.Contains(filterTxt) && !order.tracking_number.Contains(filterTxt))
if (!string.IsNullOrEmpty(filterTxt) && !order.order_sn.Contains(filterTxt) && !order.ShopOrderIdStr.ParseToString().Contains(filterTxt) &&
!order.tracking_number.Contains(filterTxt) &&
!order.sendStatus.ParseToString().Contains(filterTxt))
return false;
return true;
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
buyerOrderConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<BuyerOrderConfig>("pdd_buyer_order_config");
if (buyerOrderConfig == null)
buyerOrderConfig = new BuyerOrderConfig();
this.chkAutoReadBuyerOrder.IsChecked = !buyerOrderConfig.IsPause;
//this.chkAutoAfterSale.IsChecked = buyerOrderConfig.IsAutoAfterSale;
buyerReadOrderConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<BuyerReadOrderConfig>("pdd_buyer_read_order_config");
if (buyerReadOrderConfig == null)
buyerReadOrderConfig = new BuyerReadOrderConfig();
this.chkAutoReadBuyerOrder.IsChecked = buyerReadOrderConfig.IsAutoReadOrder;
this.chkAutoAfterSale.IsChecked = buyerReadOrderConfig.IsAutoAfterSale;
lstPddBuyerOrderInfoLite = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ObservableCollection<PddBuyerOrderLiteInfo>>("pdd_buyer_order_list");
@@ -190,7 +188,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
Thread.Sleep(5000);
while (true)
{
if (!IsAutoReadBuyerOrder)
if (!buyerReadOrderConfig.IsAutoReadOrder)
{
Thread.Sleep(1000);
Dispatcher.Invoke(new Action(() =>
@@ -202,7 +200,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (DateTime.Now > nextGetOrderTime)
{
btnSearch_Click(null, null);
GetOrderAndAfterSale();
}
if (isReadBuyerOrder)
{
@@ -501,10 +499,91 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
//break;
}
List<oms_wei_external_procurement_log> transitOrderList = new List<oms_wei_external_procurement_log>();
try { transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString()); } catch { }
try
{
transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString());
// 直接过滤掉仓库售后单
transitOrderList = transitOrderList.Where(t => t.transfer_refund_status.IsNullOrZero()).ToList();
}
catch
{
}
return transitOrderList;
}
/// <summary>
/// 读取订单详情信息
/// </summary>
/// <param name="order_ids"></param>
/// <returns></returns>
List<oms_wei_order_info> GetOrderInfo(string order_ids)
{
Thread.Sleep(100);
var url1 = BaseClass.Build29WxObjString("order/get_erp_order_list");
var data1 = UserLogin.GetSignaturex();
data1 += "&erp_order_id_in=" + order_ids;
data1 += "&page_size=" + 1000;
var html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
{
//BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
//break;
}
List<oms_wei_order_info> orders = new List<oms_wei_order_info>();
try
{
orders = JsonHelper.DeserializeJsonToList<oms_wei_order_info>(JObject.Parse(html1)["data"].ParseToString());
if (orders == null)
orders = new List<oms_wei_order_info>();
}
catch
{
}
var orderItems = GetOrderItemInfo(order_ids);
foreach (var orderItem in orderItems)
{
var order = orders.FirstOrDefault(o => o.order_id == orderItem.order_id);
orderItem.ItemOrder = order;
order.orderItems.Add(orderItem);
}
return orders;
}
/// <summary>
/// 读取订单详情信息
/// </summary>
/// <param name="order_ids"></param>
/// <returns></returns>
List<oms_wei_order_item_info> GetOrderItemInfo(string order_ids)
{
Thread.Sleep(100);
var url1 = BaseClass.Build29WxObjString("order/get_erp_order_item_list");
var data1 = UserLogin.GetSignaturex();
data1 += "&erp_order_id_in=" + order_ids;
data1 += "&page_size=" + 1000;
var html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
{
//BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
//break;
}
List<oms_wei_order_item_info> orderItems = new List<oms_wei_order_item_info>();
try
{
orderItems = JsonHelper.DeserializeJsonToList<oms_wei_order_item_info>(JObject.Parse(html1)["data"].ParseToString());
if (orderItems == null)
orderItems = new List<oms_wei_order_item_info>();
}
catch
{
}
return orderItems;
}
/// <summary>
/// 读取售后单
/// </summary>
@@ -513,7 +592,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
List<oms_wei_refund_info> GetOrderRefundInfo(string order_ids)
{
Thread.Sleep(100);
var url2 = BaseClass.Build29WxObjString("order/get_refund_list");
var url2 = BaseClass.Build29WxObjString("order/get_erp_refund_list");
var data2 = UserLogin.GetSignaturex();
data2 += "&erp_order_id_in=" + order_ids;
var html2 = GetHtml.PostUtf8(url2, data2);
@@ -529,22 +608,29 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
return refunds;
}
void UpdateOrderStatus(PddBuyerOrderLiteInfo o, oms_wei_order_item_info order_item, oms_wei_refund_info refund_item, oms_wei_external_procurement_log transitOrderList)
void UpdateOrderStatus(PddBuyerOrderLiteInfo pdd_order, oms_wei_order_item_info wx_order_item, oms_wei_refund_info wx_refund_item, oms_wei_external_procurement_log wx_transit_order)
{
o.ShopOrderIdStr = order_item?.order_id ?? transitOrderList.order_no;
o.ShopOrderSkuIdStr = order_item?.sku_id ?? transitOrderList.order_sku_id;
o.ShopOrderSkuNameStr = order_item?.sku_attr_str;
o.ShopOrderRefundStr = refund_item?.count > 0 ? "店铺售后" : "";
o.TransitWarehouseIdStr = transitOrderList?.platform;
o.Express1WaybillStr = transitOrderList?.express_1_waybill;
o.Express1CompanyStr = transitOrderList?.express_1_company;
o.Express2WaybillStr = transitOrderList?.express_2_waybill;
o.Express2CompanyStr = transitOrderList?.express_2_company;
o.TransferWareHouseStatus = transitOrderList?.transfer_warehouse_status.ParseToString();
o.PreAllocatedOrderNoStr = transitOrderList?.pre_allocated_order_no.ParseToString();
pdd_order.ShopOrderIdStr = wx_order_item?.order_id ?? wx_transit_order?.order_no;
pdd_order.ShopOrderSkuIdStr = wx_order_item?.sku_id ?? wx_transit_order?.order_sku_id;
pdd_order.ShopOrderSkuNameStr = wx_order_item?.sku_attr_str;
pdd_order.WxOrderCreateTime = wx_order_item?.ItemOrder?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((wx_order_item?.ItemOrder?.create_time).ParseToInt());
pdd_order.ShopOrderRefundStr = ""; // (/*refund_item?.count > 0 &&*/ wx_order_item.refund_status > 1) ? "店铺售后" : "";
pdd_order.wxRefundStatus = "";
if (wx_order_item.refund_status > 1)
{
pdd_order.ShopOrderRefundStr = "店铺售后";
pdd_order.wxRefundStatus = pdd_order.order_status_prompt.Contains("待发货") ? "待退款" : "待退货";
}
pdd_order.TransitWarehouseIdStr = wx_transit_order?.platform;
pdd_order.Express1WaybillStr = wx_transit_order?.express_1_waybill;
pdd_order.Express1CompanyStr = wx_transit_order?.express_1_company;
pdd_order.Express2WaybillStr = wx_transit_order?.express_2_waybill;
pdd_order.Express2CompanyStr = wx_transit_order?.express_2_company;
pdd_order.TransferWareHouseStatus = wx_transit_order?.transfer_warehouse_status.ParseToString();
pdd_order.PreAllocatedOrderNoStr = wx_transit_order?.pre_allocated_order_no.ParseToString();
// 更新订单中转取号状态
o.sendStatus = (o.TransitOrderStatus + " " + o.ShopOrderRefundStr).Trim();
o.TransitCreateTime = transitOrderList?.created_time ?? DateTime.MinValue;
pdd_order.sendStatus = (pdd_order.TransitOrderStatus + " " + pdd_order.ShopOrderRefundStr).Trim();
pdd_order.TransitCreateTime = wx_transit_order?.created_time ?? DateTime.MinValue;
}
void CefReadBuyerOrder(string url, string data)
@@ -588,21 +674,32 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
var order_ids = string.Join(",", transitOrderList.Select(ts => ts.order_no));
var orders = GetOrderInfo(order_ids);
foreach(var order in orders)
{
foreach (var orderItem in order.orderItems)
{
// 中转仓订单
if (orderItem.ItemOrder.orderItems.Count > 1)
orderItem.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == orderItem.order_id && t.order_sku_id == orderItem.sku_id));
else
orderItem.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == orderItem.order_id));
}
}
var refunds = GetOrderRefundInfo(order_ids);
foreach (PddBuyerOrderLiteInfo o in list)
{
o.buyerId = buyer.buyer_id;
o.buyerName = buyer.buyer_name;
o.outExpressCompanyMsg = o.extra_info.order_hint?.message;
// 查找店铺订单并更新店铺订单状态
var ShopOrder = GlobalConfig.lstOrder.FirstOrDefault(o1 => o1.orderItems.Any(i1 => i1.ItemTransitOrders.Any(t1 => t1.out_order_no == o.order_sn)));
if (ShopOrder != null)
var transit_item = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn);
if (transit_item != null)
{
var order_item = ShopOrder.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == o.order_sn));
var shopOrder = orders.FirstOrDefault(o1 => o1.order_id == transit_item.order_no);
var order_item = shopOrder.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == o.order_sn));
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item.order_id) ?? order_item?.ItemRefund;
var transit_item = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn);
UpdateOrderStatus(o, order_item, refund_item, transit_item);
}
@@ -655,7 +752,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
order.parent_order_sn = o.parent_order_sn;
order.service_amount = o.service_amount;
order.shipping_amount = o.shipping_amount;
order.outExpressCompanyMsg = o.outExpressCompanyMsg;
order.order_time = o.order_time;
order.tracking_number = o.tracking_number;
order.ShopOrderIdStr = o.ShopOrderIdStr;
@@ -669,6 +765,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
order.TransferWareHouseStatus = o.TransferWareHouseStatus;
order.PreAllocatedOrderNoStr = o.PreAllocatedOrderNoStr;
order.ShopOrderRefundStr = o.ShopOrderRefundStr;
order.wxRefundStatus = o.wxRefundStatus;
var index = lstPddBuyerOrderInfoLite.IndexOf(order);
Dispatcher.Invoke(new Action(() =>
@@ -703,6 +800,14 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
Task.Run(() =>
{
//SendOrderE57(order);
//if (order.sendStatus.ParseToString().Contains("售后"))
if (order.ShopOrderRefundStr.ParseToString().Contains("售后"))
{
if (",2,3,4,5,7,8,10,31,".Contains((order.after_sales?.after_sales_status).ParseToString()))
{
var afterSaleRst = PddAutoAfterSale(order);
}
}
SendTransitOrderE57(order);
});
@@ -800,7 +905,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
{
Task.Run(() =>
{
SendAfterSaleE57(lstPddBuyerAfterSaleInfoLite.FirstOrDefault(a => a.orderSn == afterSale.orderSn));
//SendAfterSaleE57(lstPddBuyerAfterSaleInfoLite.FirstOrDefault(a => a.orderSn == afterSale.orderSn));
});
Dispatcher.Invoke(new Action(() =>
@@ -821,30 +926,25 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
TimeSpan PauseTick = new TimeSpan(1);
private void chkAutoReadBuyerOrder_CheckedChanged(object sender, RoutedEventArgs e)
{
IsAutoReadBuyerOrder = chkAutoReadBuyerOrder.IsChecked == true;
if (!IsAutoReadBuyerOrder)
if (isLoad)
{
//if (cancellationTokenSource != null)
// cancellationTokenSource.Cancel();
}
if (IsAutoReadBuyerOrder)
buyerReadOrderConfig.IsAutoReadOrder = chkAutoReadBuyerOrder.IsChecked == true;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_config", buyerReadOrderConfig);
//buyerOrderConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<BuyerOrderConfig>("pdd_buyer_order_config");
if (buyerReadOrderConfig.IsAutoReadOrder)
nextGetOrderTime = DateTime.Now + PauseTick;
else
PauseTick = nextGetOrderTime - DateTime.Now;
if (isLoad)
{
buyerOrderConfig.IsPause = !IsAutoReadBuyerOrder;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_config", buyerOrderConfig);
//buyerOrderConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<BuyerOrderConfig>("pdd_buyer_order_config");
return;
}
}
private void btnSearch_Click(object sender, RoutedEventArgs e)
{
GetOrderAndAfterSale();
}
void GetOrderAndAfterSale()
{
nextGetOrderTime = DateTime.Now.AddMinutes(25);
GetPddOrder();
@@ -1148,15 +1248,30 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
var order_ids = string.Join(",", transitOrderList.Select(ts => ts.order_no));
var orders = GetOrderInfo(order_ids);
//foreach (var order in orders)
//{
// foreach (var orderItem in order.orderItems)
// {
// // 中转仓订单
// if (orderItem.ItemOrder.orderItems.Count > 1)
// orderItem.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == orderItem.order_id && t.order_sku_id == orderItem.sku_id));
// else
// orderItem.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == orderItem.order_id));
// }
//}
var refunds = GetOrderRefundInfo(order_ids);
// 查找店铺订单并更新店铺订单状态
var ShopOrder = GlobalConfig.lstOrder.FirstOrDefault(o1 => o1.orderItems.Any(i1 => i1.ItemTransitOrders.Any(t1 => t1.out_order_no == buyerOrder.order_sn)));
if (ShopOrder != null)
//var ShopOrder = GlobalConfig.lstOrder.FirstOrDefault(o1 => o1.orderItems.Any(i1 => i1.ItemTransitOrders.Any(t1 => t1.out_order_no == buyerOrder.order_sn)));
//var ShopOrder = orders.FirstOrDefault(o1 => o1.orderItems.Any(i1 => i1.ItemTransitOrders.Any(t1 => t1.out_order_no == buyerOrder.order_sn)));
//if (ShopOrder != null)
var transit_item = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == buyerOrder.order_sn);
if (transit_item != null)
{
var order_item = ShopOrder.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == buyerOrder.order_sn));
var shopOrder = orders.FirstOrDefault(o => o.order_id == transit_item.order_no);
var order_item = shopOrder.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == buyerOrder.order_sn));
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item.order_id) ?? order_item?.ItemRefund;
var transit_item = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == buyerOrder.order_sn);
UpdateOrderStatus(buyerOrder, order_item, refund_item, transit_item);
}
@@ -1180,81 +1295,82 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
// order.sendStatus = "";
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
// 处理中, "已取号(更正)", 已取号, 提前取号, 取号失败
// 仓库处理中
if (order.sendStatus.ParseToString().Contains("仓库处理中"))
{
// 仓库处理中超过10分钟认为已处理完成,否则跳过。
if (order.TransitCreateTime.AddMinutes(10) < DateTime.Now)
{
order.sendStatus = order.sendStatus.Replace("仓库处理中", "").Trim();
}
else
{
return;
}
}
// "已取号(更正)", 已取号, 提前取号, 取号失败
// 正在处理取号、已取号(包括提前取号更正的订单)、有售后或者没有中转仓(非中转系统订单)的订单,不发送
if (order.sendStatus == "处理中" || order.sendStatus == "已取号" || order.sendStatus == "已取号(更正)" ||
if (order.sendStatus == "已取号" || order.sendStatus == "已取号(更正)" ||
order.sendStatus.ParseToString().Contains("售后") || order.TransitWarehouseIdStr.IsNullOrEmpty())
{
return;
}
// 物流单号不为空才更新服务端
if (order.outExpressCompanyCode.IsNullOrEmpty() || order.tracking_number.IsNullOrEmpty())
// 物流单号为空,先判断是否需要提前取号,无需提前取号则直接返回
if (order.outExpressCompanyCode.IsNullOrEmpty() || order.tracking_number.IsNullOrEmpty())
{
// 如果是隔天订单,拍单20分钟后立即提前取号
if (!order.sendStatus.Contains("提前取号") && order.TransitCreateTime != DateTime.MinValue &&
DateTime.Now.Date > order.WxOrderCreateTime.Date && DateTime.Now > order.TransitCreateTime.AddMinutes(20))
{
JObject data = new JObject();
data["outOrderNo"] = order.order_sn;
data["warehouseCode"] = order.TransitWarehouseIdStr; //transit.TransId; // 中转仓仓库对应编码
data["platform"] = "WEISHOP";
var getVirtualTicketUrl = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/order/virtual/create";
var getVirtualTicketDataStr = JsonHelper.SerializeObject(data);
var getVirtualTicketRst = HttpResponseWXBLL.e57PostResponse(getVirtualTicketUrl, getVirtualTicketDataStr, "");
if (!getVirtualTicketRst.ParseToString().Contains("<code>200</code>") && !getVirtualTicketRst.ParseToString().Contains("<code>0</code>"))
{
string msg = "";
string code = "";
try
{
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.LoadXml(getVirtualTicketRst);
code = xmlDoc["AjaxResult"]["code"].InnerText;
msg = xmlDoc["AjaxResult"]["msg"].InnerText;
}
catch
{
msg = getVirtualTicketRst.ParseToString();
}
//BaseMsgForm.ShowError("拍单信息保存成功,接收到erp服务端传递的错误消息:" + msg, "订单提前取号失败");
order.sendStatus = "提前取号失败,服务端返回 " + msg;
}
}
return;
}
// 如果物流不一致,提交物流信息
if (order.Express1CompanyStr != order.outExpressCompanyCode || order.Express1WaybillStr != order.tracking_number)
{
//JObject obj = new JObject();
//obj["orderNo"] = order.ShopOrderIdStr;
//obj["orderSkuId"] = order.ShopOrderSkuIdStr;
//obj["outOrderNo"] = order.order_sn;
//obj["outAmount"] = order.order_amount.ParseToString();
//obj["buyerAccount"] = order.buyerName;
//obj["purchaserNote"] = BaseClass.NickName;
//obj["platform"] = order.TransitWarehouseIdStr; // 中转仓ID
//obj["orderPlatformCode"] = "WEISHOP";
//if (!order.outExpressCompanyCode.IsNullOrEmpty() && !order.tracking_number.IsNullOrEmpty())
//{
// obj["express1Company"] = order.outExpressCompanyCode; // 物流公司编号
// obj["express1Waybill"] = order.tracking_number; // 物流单号
//}
//var dataStr = JsonHelper.SerializeObject(obj);
//string url = "https://po.e57.cn/prod-api/api/oms-api/externalProcurement/saveOrUpdate";
////<AjaxResult><msg>保存成功</msg><code>200</code></AjaxResult>
//var exportRst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
//if (!exportRst.Contains("<code>200</code>"))
//{
// order.sendStatus = "提交运单信息失败";
// return;
//}
//if (order.outExpressCompanyCode.IsNullOrEmpty() || order.tracking_number.IsNullOrEmpty())
//{
// order.sendStatus = "已提交";
//}
//var url3 = BaseClass.Build29WxObjString("order/wx_update_erp_order_express");
//var data3 = UserLogin.GetSignaturex();
//data3 += "&out_order_no=" + order.order_sn;
//data3 += "&express_1_company=" + order.outExpressCompanyCode; // 物流公司编号
//data3 += "&express_1_waybil=" + order.tracking_number; // 物流单号
//var html3 = GetHtml.PostUtf8(url3, data3);
//if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
// html3 = GetHtml.PostUtf8(url3, data3);
//if (html3.Contains("\"code\":200"))
//{
// order.sendStatus = "已提交";
//}
// 修改上游物流单号
string url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/update-upstream-waybill";
JObject obj = new JObject();
obj["platform"] = "WEISHOP";
obj["outOrderNo"] = order.order_sn; //外采单号
obj["outExpressCompany"] = order.outExpressCompanyCode; // 物流公司编号
obj["outExpressNo"] = order.tracking_number; // 物流单号
obj["orderCode"] = order.tracking_number; //实际就是外采单号
var dataStr = JsonHelper.SerializeObject(obj);
var exportRst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
if (exportRst.Contains("<code>0</code>") || exportRst.Contains("<code>200</code>"))
{
order.sendStatus = "提交物流信息失败";
return;
}
}
//// 如果物流不一致,提交物流信息 临时补救
//if (order.Express1CompanyStr != order.outExpressCompanyCode || order.Express1WaybillStr != order.tracking_number)
//{
// //var url3 = BaseClass.Build29WxObjString("order/wx_update_erp_order_express");
// //var data3 = UserLogin.GetSignaturex();
// //data3 += "&out_order_no=" + order.order_sn;
// //data3 += "&express_1_company=" + order.outExpressCompanyCode; // 物流公司编号
// //data3 += "&express_1_waybil=" + order.tracking_number; // 物流单号
// //var html3 = GetHtml.PostUtf8(url3, data3);
// //if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
// // html3 = GetHtml.PostUtf8(url3, data3);
// //if (html3.Contains("\"code\":200"))
// //{
// // order.sendStatus = "已提交";
// //}
//}
// 直接取号
if (order.sendStatus != "提前取号" && order.sendStatus != "提前取号(旧订单)")
{
@@ -1294,7 +1410,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
else
{
order.sendStatus = "直接取号失败" + BaseRegex.GetStringXml(ref dispatchRst, "msg");
order.sendStatus = "直接取号失败,服务端返回 " + BaseRegex.GetStringXml(ref dispatchRst, "msg");
}
}
// 修改提前取号
@@ -1303,6 +1419,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (order.TransitCreateTime.AddHours(23) > DateTime.Now)
{
order.sendStatus = "提前取号流程进行中";
return;
}
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/update-upstream-waybill";
@@ -1313,7 +1430,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
data["outExpressCompany"] = order.outExpressCompanyCode; // 物流公司编号
data["outExpressNo"] = order.tracking_number;
data["platform"] = "WEISHOP";
data["orderCode"] = order.order_sn; // 中转仓订单唯一标识码 = 外采定单号
data["orderCode"] = order.order_sn; // 中转仓订单唯一标识码 = 外采订单号
var dataStr2 = JsonHelper.SerializeObject(data);
var dispatchRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
@@ -1346,7 +1463,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
else
{
order.sendStatus = "修改提前取号失败" + BaseRegex.GetStringXml(ref dispatchRst, "msg");
order.sendStatus = "修改提前取号失败,服务端返回 " + BaseRegex.GetStringXml(ref dispatchRst, "msg");
}
}
}
@@ -1525,7 +1642,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
while (isReadBuyerOrder)
{
Thread.Sleep(500);
//break;
}
foreach (var buyer in GlobalConfig.PDDBuyerLoginList)
@@ -1533,7 +1649,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
//postman request POST 'https://po.e57.cn/prod-api/api/oms-api/external_procurement/hasAfterSsale' \
//--header 'Content-Type: application/json' \
//--body '{ "platform": "WEISHOP", "startTime": 1774763836, "endTime": "1776050614" , "userAccount": "闲鱼会开车的鱼2343"}'
JObject body = new JObject();
body["platform"] = "WEISHOP";
body["startTime"] = BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddDays(-7));
@@ -1561,14 +1676,14 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
order.wxRefundStatus = order.order_status_prompt.Contains("待发货") ? "待退款" : "待退货";
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
Dispatcher.Invoke(new Action(() =>
{
ShowOrder(order);
}));
if (chkAutoAfterSale.IsChecked == true)
{
MakeWxToPddAfterSale(order);
}
//Dispatcher.Invoke(new Action(() =>
//{
// ShowOrder(order);
//}));
//if (chkAutoAfterSale.IsChecked == true)
//{
// PddAutoAfterSale(order);
//}
}
}
catch (Exception ex)
@@ -1584,7 +1699,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
/// </summary>
/// <param name="order"></param>
/// <returns></returns>
public string MakeWxToPddAfterSale(PddBuyerOrderLiteInfo order)
public string PddAutoAfterSale(PddBuyerOrderLiteInfo order)
{
//if (isReadOrder)
//{
@@ -1625,6 +1740,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
var afterSaleRst = YkdBuyerOrder.SetOrderAfterSale(buyer, mobile, order.order_sn, applyAmount, refundAmount, newMaxApplyAmount);
if (afterSaleRst.Contains("\"after_sales_status\":1") || afterSaleRst.Contains("该订单已全额退款"))
{
// 保存退款成功状态
//order.refundStatus = "已完成/退货";
order.order_status_prompt = "退款成功";
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
@@ -1691,6 +1807,29 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
else
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
}
private void btnHide_Click(object sender, RoutedEventArgs e)
{
if (btnHide.Content.ParseToString() == "▲")
{
btnHide.Content = "▼";
gridTable.Visibility = Visibility.Visible;
}
else
{
btnHide.Content = "▲";
gridTable.Visibility = Visibility.Collapsed;
}
}
private void chkAutoAfterSale_Checked(object sender, RoutedEventArgs e)
{
if (isLoad)
{
buyerReadOrderConfig.IsAutoAfterSale = chkAutoAfterSale.IsChecked == true;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_config", buyerReadOrderConfig);
}
}
}
public class YkdBuyerOrder
@@ -1730,9 +1869,15 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
}
public class BuyerOrderConfig
public class BuyerReadOrderConfig
{
public bool IsPause = false;
/// <summary>
/// 是否自动读单
/// </summary>
public bool IsAutoReadOrder = true;
/// <summary>
/// 是否自动售后未发货订单
/// </summary>
public bool IsAutoAfterSale = true;
}
}
@@ -38,7 +38,7 @@
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<usercontrols:UcWaterMarkTextBox x:Name="txtOrderId" WaterMark="" DataContext="{Binding ElementName=txtOrderId,Path=DataContext}" Grid.Column="1" Margin="0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" Height="28" VerticalContentAlignment="Center"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" Grid.ColumnSpan="1" />
<TextBlock Text="店铺单号" Grid.Column="1" Margin="4,0,4,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray" Visibility="{Binding ElementName=txtOrderId,Path=Text,Converter={StaticResource NotHasTextVisibility}}" Grid.ColumnSpan="1"></TextBlock>
@@ -48,22 +48,25 @@
<TextBlock Text="全部店铺" Grid.Column="2" Margin="12,0,24,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray"
Visibility="{Binding ElementName=txtShopName,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<Button Grid.Column="2" x:Name="btnMultiShopChoice" Style="{StaticResource BasePageButtonStyle}" HorizontalAlignment="Right" Margin="0" Content=" ... " Width="28" Height="28" Click="btnMultiShopChoice_Click"/>
<TextBox x:Name="txtGoodsName" Grid.Column="4" Margin="8,0,0,0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" Height="28" VerticalContentAlignment="Center"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
<TextBlock Text="商品标题" Grid.Column="4" Margin="12,0,0,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray" Visibility="{Binding ElementName=txtGoodsName,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<ComboBox Grid.Column="5" x:Name="cmbUserNameMobile" Margin="12,0,4,0" VerticalContentAlignment="Center" Style="{StaticResource BaseComboBoxStyle}" Width="70" Height="28" Text="成交时间"/>
<Border Grid.Column="5" Margin="8,0,0,0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1,1,1,1" Height="28" VerticalAlignment="Center" CornerRadius="4,0,0,4"/>
<Border Grid.Column="6" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="0,1,1,1" Height="28" VerticalAlignment="Center" CornerRadius="0,0,0,0"/>
<DatePicker x:Name="dateStart" Grid.Column="6" Margin="0,0,4,0" VerticalAlignment="Center" BorderThickness="0" />
<Border Grid.Column="6" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="0,1,1,1" Height="28" VerticalAlignment="Center" CornerRadius="0,0,0,0" Margin="0,0,10,0"/>
<DatePicker x:Name="dateStart" Grid.Column="6" Margin="0,0,14,0" VerticalAlignment="Center" BorderThickness="0" />
<Border Grid.Column="7" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="0,1,1,1" Height="28" VerticalAlignment="Center" CornerRadius="0,4,4,0"/>
<DatePicker x:Name="dateEnd" Grid.Column="7" Margin="0,0,4,0" VerticalAlignment="Center" BorderThickness="0" />
<Border Grid.Column="7" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="0,1,1,1" Height="28" VerticalAlignment="Center" CornerRadius="0,4,4,0" Margin="-10,0,0,0"/>
<DatePicker x:Name="dateEnd" Grid.Column="7" Margin="10,0,4,0" VerticalAlignment="Center" BorderThickness="0" />
<CheckBox Grid.Column="7" x:Name="chkEndDate" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-6,0"/>
<Button Grid.Column="8" x:Name="btnFilter" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0" Content="过滤" Width="48" Height="24" Click="btnFilter_Click"/>
<Button Grid.Column="9" x:Name="btnSearch" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,4,0" Content="读单" Width="48" Height="24" Click="btnSearch_Click" IsEnabled="False"/>
<Image x:Name="imgLoading" Grid.Column="10" Source="{StaticResource imgLoadingPic}" Width="20" Height="20" Margin="0" IsEnabled="False">
<Button Grid.Column="8" x:Name="btnFilter" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0" Content="过滤" MinWidth="48" Height="28" Click="btnFilter_Click" Padding="4"/>
<Button Grid.Column="9" x:Name="btnSearch" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,4,0" Content="读单" MinWidth="48" Height="28" Click="btnSearch_Click" Padding="4" IsEnabled="False"/>
<WrapPanel Grid.Column="10" VerticalAlignment="Center">
<Image x:Name="imgLoading" Grid.Column="10" Source="{StaticResource imgLoadingPic}" Width="20" Height="20" Margin="0" IsEnabled="False">
<Image.RenderTransform>
<RotateTransform Angle="45" CenterX="10" CenterY="10"/>
</Image.RenderTransform>
@@ -83,9 +86,16 @@
</EventTrigger>
</Image.Triggers>
</Image>
<CheckBox Content="自动读单" x:Name="chkAutoReadOrder" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left"
Margin="2,0" VerticalAlignment="Center" Checked="chkAutoReadBuyerOrder_CheckedChanged" Unchecked="chkAutoReadBuyerOrder_CheckedChanged" IsChecked="true"/>
</WrapPanel>
</Grid>
<Grid x:Name="gridListHeader" Margin="8,2,8,0" Grid.Row="1">
<TextBox x:Name="txtAdminSearch" Grid.Column="4" Margin="8,0,56,0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" Height="28" VerticalContentAlignment="Center"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Right" Width="260" Visibility="Collapsed"/>
<Button Grid.Column="8" x:Name="btnAdminSearch" Style="{StaticResource BasePageButtonStyle}" Margin="4,2,0,0" Content="超管查询" Width="52" Height="24" Click="btnFilter_Click"
VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="Collapsed"/>
<TabControl x:Name="tabOrderType" VerticalAlignment="Stretch" FontSize="16" SelectionChanged="tabOrderType_SelectionChanged" >
<TabControl.Resources>
<Style TargetType="{x:Type TabControl}">
@@ -149,9 +159,9 @@
</Border>
</TabItem >
<TabItem Header="待发货"></TabItem>
<TabItem Header="待收货" BorderBrush="Transparent" Background="Transparent"> </TabItem>
<TabItem Header="退款单" Foreground="#FF6666" BorderBrush="Transparent" Background="Transparent"> </TabItem>
<TabItem Header="全部订单" BorderBrush="Transparent" Background="Transparent"> </TabItem>
<TabItem Header="待收货" BorderBrush="Transparent" Background="Transparent"></TabItem>
<TabItem Header="退款单" Foreground="#FF6666" BorderBrush="Transparent" Background="Transparent"></TabItem>
<TabItem Header="全部订单" BorderBrush="Transparent" Background="Transparent"></TabItem>
<!--<TabItem Header="发货异常">
<Grid Background="#FFE5E5E5"/>
</TabItem>-->
@@ -1,4 +1,5 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.Utils;
using AllBase;
using AllBase.Extension;
@@ -24,6 +25,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using TemuKJD.ToolForms;
using Work;
using Work._29Tools.BLL;
namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
@@ -32,9 +34,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
/// </summary>
public partial class OrderListCtrl : UserControl
{
public CheckBox chkSelectAll = null;
public bool IsAutoReadOrder = true;
public DateTime nextGetOrderTime = DateTime.MinValue;
public OrderListCtrl()
{
InitializeComponent();
@@ -49,19 +53,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
dateStart.SelectedDate = DateTime.Now.Date.AddDays(-7);
dateEnd.SelectedDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
Task.Run(() =>
{
while (!MainWindow.Instance.hasReadShop)
{
Thread.Sleep(100);
}
GetOrder();
//GetOrderTest();
});
AutoGetOrder();
}
void GetOrderTest()
public void GetOrderTest()
{
for (int i = 0; i < 10000; i++)
{
@@ -71,245 +66,284 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
GlobalConfig.lstOrder.SortDesc(o => o.order_id.ParseToLong());
}
public void AutoGetOrder()
{
Task.Run(() =>
{
Thread.Sleep(5000);
while (true)
{
if (!IsAutoReadOrder)
{
Thread.Sleep(1000);
Dispatcher.Invoke(new Action(() =>
{
btnSearch.Content = "自动读单暂停中";
imgLoading.Visibility = Visibility.Collapsed;
}));
continue;
}
if (DateTime.Now > nextGetOrderTime)
{
GetOrder();
nextGetOrderTime = DateTime.Now.AddMinutes(25);
}
Thread.Sleep(1000);
Dispatcher.Invoke(new Action(() =>
{
var ticks = nextGetOrderTime - DateTime.Now;
btnSearch.Content = "读单 " + ticks.Minutes.ToString("00") + ":" + ticks.Seconds.ToString("00");
}));
}
});
}
public bool hasReadOrder = false;
/// <summary>
///
/// </summary>
/// <param name="filterGetCondition">按过滤条件读取读取服务端订单</param>
void GetOrder(bool filterGetCondition = false)
public void GetOrder(string orderIds = "", bool filterGetCondition = false)
{
Dispatcher.Invoke(new Action(() =>
{
imgLoading.Visibility = Visibility.Visible;
btnSearch.IsEnabled = false;
}));
Task.Run(() =>
int page = 0;
int totalPage = 1;
int pageSize = 50;
while (true && IsAutoReadOrder)
{
int page = 0;
int totalPage = 1;
int pageSize = 50;
while (true)
if (page >= totalPage)
{
if (page >= totalPage)
{
break;
}
break;
}
page++;
var url = BaseClass.Build29WxObjString("order/get_order_list");
var data = UserLogin.GetSignaturex() + "&page=" + page;
if (page > 1)
data += "&is_not_count=true";
data += "&page_size=" + pageSize;
var shop_id = string.Join(",", GlobalConfig.ShopLoginList.Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
page++;
var url = BaseClass.Build29WxObjString("order/get_erp_order_list");
var data = UserLogin.GetSignaturex() + "&page=" + page;
if (!string.IsNullOrEmpty(orderIds))
data += "&erp_order_id_in=" + orderIds;
if (page > 1)
data += "&is_not_count=true";
data += "&page_size=" + pageSize;
var shop_id = string.Join(",", GlobalConfig.ShopLoginList.Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
Dispatcher.Invoke(new Action(() =>
{
// 按过滤条件读取
if (filterGetCondition)
{
if (!string.IsNullOrEmpty(txtShopName.Text.Trim()))
{
var shopNames = txtShopName.Text.Trim().Split(';').Where(s => !s.IsNullOrEmpty()).ToList();
shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
}
}
var startTime = BaseClass.DateTimeToTimestampSeconds(dateStart.SelectedDate.Value);
var endTime = BaseClass.DateTimeToTimestampSeconds(dateEnd.SelectedDate.Value.AddDays(1));
if (!chkEndDate.IsChecked.ParseToBool())
endTime = BaseClass.DateTimeToTimestampSeconds(DateTime.Now.Date.AddDays(1));
data += "&erp_shop_id_in=" + shop_id;
data += "&start_time=" + startTime;
data += "&end_time=" + endTime;
}));
Thread.Sleep(200);
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
break;
}
var jArr = JObject.Parse(html)["data"];
if (jArr.Count() == 0)
break;
var order_ids = string.Join(",", jArr.Select(a => a["order_id"].ParseToString()));
// 读取订单详情
Thread.Sleep(100);
var url1 = BaseClass.Build29WxObjString("order/get_erp_order_item_list");
var data1 = UserLogin.GetSignaturex();
data1 += "&erp_order_id_in=" + order_ids;
data1 += "&page_size=" + 1000;
var html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
break;
}
List<oms_wei_order_item_info> orderItems = new List<oms_wei_order_item_info>();
try { orderItems = JsonHelper.DeserializeJsonToList<oms_wei_order_item_info>(JObject.Parse(html1)["data"].ParseToString()); } catch { }
// 读取售后单
Thread.Sleep(100);
var url2 = BaseClass.Build29WxObjString("order/get_erp_refund_list");
var data2 = UserLogin.GetSignaturex();
data2 += "&erp_order_id_in=" + order_ids;
var html2 = GetHtml.PostUtf8(url2, data2);
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
html2 = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
break;
}
List<oms_wei_refund_info> refunds = new List<oms_wei_refund_info>();
try { refunds = JsonHelper.DeserializeJsonToList<oms_wei_refund_info>(JObject.Parse(html2)["data"].ParseToString()); } catch { }
// 读取中转仓拍单订单
var url3 = BaseClass.Build29WxObjString("order/wx_get_transit_order");
var data3 = UserLogin.GetSignaturex();
data3 += "&order_no=" + order_ids;
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
{
Dispatcher.Invoke(new Action(() =>
{
// 按过滤条件读取
if (filterGetCondition)
{
if (!string.IsNullOrEmpty(txtShopName.Text.Trim()))
{
var shopNames = txtShopName.Text.Trim().Split(';').Where(s => !s.IsNullOrEmpty()).ToList();
shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
}
}
var startTime = BaseClass.DateTimeToTimestampSeconds(dateStart.SelectedDate.Value);
var endTime = BaseClass.DateTimeToTimestampSeconds(dateEnd.SelectedDate.Value.AddDays(1));
data += "&erp_shop_id_in=" + shop_id;
data += "&start_time=" + startTime;
data += "&end_time=" + endTime;
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
}));
Thread.Sleep(200);
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
break;
}
List<oms_wei_external_procurement_log> transitOrderList = new List<oms_wei_external_procurement_log>();
try
{
transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString());
transitOrderList = transitOrderList.Where(t => t.transfer_refund_status.IsNullOrZero()).ToList();
}
catch { }
// 读取关联拍单商品
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
var dataMap = UserLogin.GetSignaturex()
+ "&spu_codes=" + string.Join(",", orderItems.Select(oi => oi.out_product_id)) + "," + string.Join(",", orderItems.Select(oi => oi.product_id));
dataMap += "&main_user_name=" + BaseClass.MainUserName;
var resultMap = GetHtml.PostUtf8(urlMap, dataMap);
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
GetHtml.PostUtf8(urlMap, dataMap);
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
break;
}
}));
break;
}
List<WXBuyMapInfo> byuMapList = new List<WXBuyMapInfo>();
try { byuMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString()); } catch { }
var jArr = JObject.Parse(html)["data"];
if (jArr.Count() == 0)
break;
var order_ids = string.Join(",", jArr.Select(a => a["order_id"].ParseToString()));
// 读取订单详情
Thread.Sleep(100);
var url1 = BaseClass.Build29WxObjString("order/get_order_item_list");
var data1 = UserLogin.GetSignaturex();
data1 += "&erp_order_id_in=" + order_ids;
data1 += "&page_size=" + 1000;
var html1 = GetHtml.PostUtf8(url1, data1);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
html1 = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html1) || !html1.Contains("\"code\":200"))
// 装载订单
foreach (JObject jObj in jArr)
{
try
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
break;
}
List<oms_wei_order_item_info> orderItems = new List<oms_wei_order_item_info>();
try { orderItems = JsonHelper.DeserializeJsonToList<oms_wei_order_item_info>(JObject.Parse(html1)["data"].ParseToString()); } catch { }
oms_wei_order_info order = null;
// 读取售后单
Thread.Sleep(100);
var url2 = BaseClass.Build29WxObjString("order/get_refund_list");
var data2 = UserLogin.GetSignaturex();
data2 += "&erp_order_id_in=" + order_ids;
var html2 = GetHtml.PostUtf8(url2, data2);
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
html2 = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
break;
}
List<oms_wei_refund_info> refunds = new List<oms_wei_refund_info>();
try { refunds = JsonHelper.DeserializeJsonToList<oms_wei_refund_info>(JObject.Parse(html2)["data"].ParseToString()); } catch { }
// 读取中转仓拍单订单
var url3 = BaseClass.Build29WxObjString("order/wx_get_transit_order");
var data3 = UserLogin.GetSignaturex();
data3 += "&order_no=" + order_ids;
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
order = JsonHelper.DeserializeJsonToObject<oms_wei_order_info>(JsonHelper.SerializeObject(jObj));
if (order.order_id == "3737398647233862400")
{
}
}));
break;
}
List<oms_wei_external_procurement_log> transitOrderList = new List<oms_wei_external_procurement_log>();
try { transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString()); } catch { }
// 读取关联拍单商品
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
var dataMap = UserLogin.GetSignaturex()
+ "&spu_codes=" + string.Join(",", orderItems.Select(oi => oi.out_product_id)) + "," + string.Join(",", orderItems.Select(oi => oi.product_id));
dataMap += "&main_user_name=" + BaseClass.MainUserName;
var resultMap = GetHtml.PostUtf8(urlMap, dataMap);
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
GetHtml.PostUtf8(urlMap, dataMap);
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
{
Dispatcher.Invoke(new Action(() =>
//装载订单商品详情
order.orderItems = new ObservableCollection<oms_wei_order_item_info>();
foreach (var item in orderItems.Where(oi => oi.order_id == order.order_id))
{
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
}));
break;
}
List<WXBuyMapInfo> byuMapList = new List<WXBuyMapInfo>();
try { byuMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString()); } catch { }
// 订单商品
item.ItemOrder = order;
order.orderItems.Add(item);
item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == item.order_id);
Dispatcher.Invoke(new Action(() => { item.UpdateOrderItemBuyButton(); }));
// 装载订单
foreach (JObject jObj in jArr)
{
try
{
oms_wei_order_info order = null;
Dispatcher.Invoke(new Action(() =>
// 关联拍单关系 // 危险物品禁止拍单,仅关联安全商品
if (!GlobalConfig.lstDangerItemWord.Any(d => (item.title).ParseToString().Contains(d)))
{
order = JsonHelper.DeserializeJsonToObject<oms_wei_order_info>(JsonHelper.SerializeObject(jObj));
if (order.order_id == "3737398647233862400")
{
}
}));
//装载订单商品详情
order.orderItems = new ObservableCollection<oms_wei_order_item_info>();
foreach (var item in orderItems.Where(oi => oi.order_id == order.order_id))
{
// 订单商品
item.ItemOrder = order;
order.orderItems.Add(item);
item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == item.order_id);
Dispatcher.Invoke(new Action(() => { item.UpdateOrderItemBuyButton(); }));
// 关联拍单关系 // 危险物品禁止拍单,仅关联安全商品
if (!GlobalConfig.lstDangerItemWord.Any(d => (item.title).ParseToString().Contains(d)))
{
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
if (item.BuyMap == null)
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
if (item.BuyMap == null)
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
if (item.BuyMap == null)
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
}
// 中转仓订单
if (item.ItemOrder.orderItems.Count > 1)
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
else
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id));
}
//装载订单售后详情
order.refundItems = new ObservableCollection<oms_wei_refund_info>(refunds.Where(of => of.order_id == order.order_id));
foreach (var orderItem in order.orderItems)
{
orderItem.SetItemRefund(order.refundItems.ToList());
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
if (item.BuyMap == null)
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
if (item.BuyMap == null)
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
if (item.BuyMap == null)
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
}
var orderExist = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == order.order_id);
if (orderExist != null)
GlobalConfig.lstOrder.Remove(orderExist);
var nextOrder = GlobalConfig.lstOrder.FirstOrDefault(o => o.create_time < order.create_time);
if (nextOrder != null)
{
GlobalConfig.lstOrder.Insert(GlobalConfig.lstOrder.IndexOf(nextOrder), order);
}
// 中转仓订单
if (item.ItemOrder.orderItems.Count > 1)
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
else
{
GlobalConfig.lstOrder.Add(order);
}
if (order.orderItems.Count > 1)
{
}
Dispatcher.Invoke(new Action(() =>
{
FilterOneOrder(order);
}));
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id));
}
catch (Exception ex)
//装载订单售后详情
order.refundItems = new ObservableCollection<oms_wei_refund_info>(refunds.Where(of => of.order_id == order.order_id));
foreach (var orderItem in order.orderItems)
{
orderItem.SetItemRefund(order.refundItems.ToList());
}
var orderExist = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == order.order_id);
if (orderExist != null)
GlobalConfig.lstOrder.Remove(orderExist);
var nextOrder = GlobalConfig.lstOrder.FirstOrDefault(o => o.create_time < order.create_time);
if (nextOrder != null)
{
GlobalConfig.lstOrder.Insert(GlobalConfig.lstOrder.IndexOf(nextOrder), order);
}
else
{
GlobalConfig.lstOrder.Add(order);
}
if (order.orderItems.Count > 1)
{
}
Dispatcher.Invoke(new Action(() =>
{
FilterOneOrder(order);
}));
}
Dispatcher.Invoke(new Action(() =>
catch (Exception ex)
{
disPlayOrderTabCount();
}));
var totalCount = BaseRegex.GetIntJson(ref html, "count");
if (totalCount > 0)
totalPage = Math.Ceiling(1m * totalCount / pageSize).ParseToInt();
else
{
}
}
hasReadOrder = true;
Dispatcher.Invoke(new Action(() =>
{
imgLoading.Visibility = Visibility.Hidden;
btnSearch.IsEnabled = true;
disPlayOrderTabCount();
}));
});
var totalCount = BaseRegex.GetIntJson(ref html, "count");
if (totalCount > 0)
totalPage = Math.Ceiling(1m * totalCount / pageSize).ParseToInt();
else
{
}
}
hasReadOrder = true;
Dispatcher.Invoke(new Action(() =>
{
imgLoading.Visibility = Visibility.Collapsed;
btnSearch.IsEnabled = true;
}));
}
void disPlayOrderTabCount()
@@ -418,6 +452,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
return true;
}
if (order.createDateTime < dateStart.SelectedDate.Value)
return true;
if (chkEndDate.IsChecked == true && order.createDateTime > dateEnd.SelectedDate.Value)
return true;
if (headerStr.StartsWith("待采购"))
{
if (!order.IsWaitBuy)
@@ -466,7 +504,23 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
private void btnSearch_Click(object sender, RoutedEventArgs e)
{
GetOrder();
this.btnSearch.IsEnabled = false;
Task.Run(() =>
{
Thread.Sleep(5000);
Dispatcher.Invoke(new Action(() => { this.btnSearch.IsEnabled = true; }));
});
Task.Run(() =>
{
while (!MainWindow.Instance.hasReadShop)
{
Thread.Sleep(100);
}
GetOrder();
nextGetOrderTime = DateTime.Now.AddMinutes(25);
});
}
private void btnFilter_Click(object sender, RoutedEventArgs e)
@@ -557,5 +611,22 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
chkMapProdOnly.IsChecked = false;
FilterOrders();
}
public static string addNotes(ShopLoginInfo shop, string orderId, string notes, int tagColor = -1)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/common/cgi/batchMerchantNotes?token=&lang=zh_CN";
string body = @"{""items"":[{""orderId"":""" + orderId + @""",""merchantNotes"":""" + notes + @""",""merchantNotesTagColor"":" + tagColor + @"}]}";
if (tagColor == -1)
body = @"{""items"":[{""orderId"":""" + orderId + @""",""merchantNotes"":""" + notes + @"""}]}";
string refere = "https://store.weixin.qq.com/shop/order/list";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
private void chkAutoReadBuyerOrder_CheckedChanged(object sender, RoutedEventArgs e)
{
IsAutoReadOrder = chkAutoReadOrder.IsChecked == true;
}
}
}
@@ -21,10 +21,10 @@
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="8,8,-4,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="店铺单号:" BorderThickness="0" />
<uc:UcWaterMarkTextBox Foreground="#409eff" Cursor="Hand" WaterMark="订单号" x:Name="txtOrderId" Grid.Column="1" Margin="0,8,4,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0" />
<uc:UcWaterMarkTextBox Foreground="{StaticResource PageLinkBrush}" Cursor="Hand" WaterMark="订单号" x:Name="txtOrderId" Grid.Column="1" Margin="0,8,4,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0" />
<Border Grid.Column="2" Width="12" Background="Transparent" Height="12" VerticalAlignment="Center" Cursor="Hand"
Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown">
<Path Margin="0,0,0,0" Fill="#409eff" Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
<Path Margin="0,0,0,0" Fill="{StaticResource PageLinkBrush}" Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>
<!--<Border x:Name="borderDeadline" Grid.Column="3" Margin="8,0,0,0" Background="#e8fbf9" BorderBrush="#d0fbea" BorderThickness="1" MinWidth="30" Height="24" CornerRadius="2">
@@ -62,13 +62,13 @@
VerticalAlignment="Center" FontSize="7" Background="{StaticResource ListHeadBackColorBrush}" IsReadOnly="True"
Text="{Binding order_item1.Shop.LoginStatusStr}" BorderThickness="0"
Foreground="{Binding order_item1.Shop.LoginStatusStr, Converter={StaticResource statusToColorBrushConverter}}"/>
<uc:UcWaterMarkTextBox Foreground="#409eff" Cursor="Hand" WaterMark="店铺名称" x:Name="txtShopName" Grid.Column="5" Margin="4,8,4,8" VerticalAlignment="Center"
<uc:UcWaterMarkTextBox Foreground="{StaticResource PageLinkBrush}" Cursor="Hand" WaterMark="店铺名称" x:Name="txtShopName" Grid.Column="5" Margin="4,8,4,8" VerticalAlignment="Center"
FontSize="14" Background="Transparent" IsReadOnly="True" Text="{Binding shop_name}" BorderThickness="0" />
<Border Grid.Column="6" Width="12" Background="Transparent" Height="12" VerticalAlignment="Center" Cursor="Hand"
Tag="{Binding order_id}" MouseLeftButtonDown="pathShop_MouseLeftButtonDown">
<Path Margin="0,0,0,0" Fill="#409eff" Tag="{Binding order_id}" MouseLeftButtonDown="pathShop_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
<Path Margin="0,0,0,0" Fill="{StaticResource PageLinkBrush}" Tag="{Binding order_id}" MouseLeftButtonDown="pathShop_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>
@@ -131,7 +131,7 @@
<uc:UcWaterMarkTextBox WaterMark="运费" Text="{Binding freight_str}" Grid.Column="1" Grid.Row="4" Margin="36,0,4,0" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding freight_visibility}"/>
<TextBox Text="平台服务费:" Grid.Column="1" Grid.Row="5" Margin="0,0,4,0" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="平台服务费" Text="{Binding predict_commission_fee_string}" Grid.Row="5" Margin="72,0,4,0" VerticalAlignment="Center"
<uc:UcWaterMarkTextBox WaterMark="平台服务费" Text="{Binding predict_commission_fee_str}" Grid.Row="5" Margin="72,0,4,0" VerticalAlignment="Center"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<TextBox Text="达人佣金:" Grid.Column="1" Grid.Row="6" Margin="0,0,4,0" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="达人佣金" Text="{Binding commission_amount_str}" Grid.Row="6" Margin="60,0,4,0" VerticalAlignment="Center"
@@ -181,19 +181,19 @@
<TextBox Text="收货地址:" Grid.Column="1" Grid.Row="5" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="收货地址" Text="{Binding ItemOrder.address_str}" Grid.Column="1" Grid.Row="5" Margin="0,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<Button Grid.Column="10" x:Name="btnSeeAddressDetail" Background="Transparent" Foreground="#409eff" BorderBrush="Transparent"
<Button Grid.Column="10" x:Name="btnSeeAddressDetail" Background="Transparent" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="4,0,0,0" Content="👁" Click="btnSeeAddressDetail_Click" Tag="{Binding order_id}"></Button>
</WrapPanel>
<!--<Button Grid.Column="1" Grid.Row="6" x:Name="btnGetRefundAddress" Background="Transparent" HorizontalAlignment="Center" Foreground="#409eff" BorderBrush="Transparent"
<!--<Button Grid.Column="1" Grid.Row="6" x:Name="btnGetRefundAddress" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="4,0,0,0" Content="仓库退货地址:点击复制" Click="btnGetRefundAddress_Click" Tag="{Binding order_id}"></Button>-->
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="6" Width="auto" HorizontalAlignment="Center">
<TextBlock Text="退款单号:" VerticalAlignment="Center" Visibility="{Binding ElementName=txtRefundId,Path=Visibility}"/>
<uc:UcWaterMarkTextBox WaterMark="退款单号" Text="{Binding ItemRefund.after_sale_order_id}" Grid.Column="1" Grid.Row="6" Margin="0,2,4,2" VerticalAlignment="Center"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Foreground="#409eff" Cursor="Hand" x:Name="txtRefundId"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Foreground="{StaticResource PageLinkBrush}" Cursor="Hand" x:Name="txtRefundId"
Visibility="{Binding Text,RelativeSource={RelativeSource Self},Converter={StaticResource HasTextVisibility}}" HorizontalAlignment="Center"/>
<Border Grid.Column="6" Width="12" Background="Transparent" Height="12" VerticalAlignment="Center" Cursor="Hand"
MouseLeftButtonDown="pathRefundId_MouseLeftButtonDown" Visibility="{Binding ElementName=txtRefundId,Path=Visibility}">
<Path Margin="0,0,0,0" Fill="#409eff" MouseLeftButtonDown="pathRefundId_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
<Path Margin="0,0,0,0" Fill="{StaticResource PageLinkBrush}" MouseLeftButtonDown="pathRefundId_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>
</WrapPanel>
</Grid>
@@ -209,20 +209,36 @@
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center">
<Border x:Name="borderBuyStatas" Grid.Row="1" Margin="8,0,0,0" Background="{Binding TransitWaybillStatusBackColor}" BorderBrush="{Binding TransitWaybillStatusBorderColor}"
BorderThickness="1" MinWidth="30" Height="auto" CornerRadius="2" HorizontalAlignment="Center" Visibility="{Binding TransitWaybillStatusStr,Converter={StaticResource HasTextVisibility}}">
<TextBox x:Name="txtBuyStatus" Grid.Column="1" Margin="2,0,2,1" Foreground="{Binding TransitWaybillStatusStrColor}" VerticalContentAlignment="Center" VerticalAlignment="Center"
Background="Transparent" IsReadOnly="True" MinWidth="20" Text="{Binding TransitWaybillStatusStr}" BorderThickness="0" />
</Border>
<!--<Border x:Name="borderWarehouseStatas" Grid.Row="1" Margin="8,0,0,0" Background="{Binding TransitWaybillStatusBackColor}" BorderBrush="{Binding TransitWaybillStatusBorderColor}"
BorderThickness="1" MinWidth="30" Height="auto" CornerRadius="2" HorizontalAlignment="Center" Visibility="{Binding TransitWaybillStatusStr,Converter={StaticResource HasTextVisibility}}">
<TextBox x:Name="txtWarehouseStatus" Grid.Column="1" Margin="2,0,2,1" Foreground="{Binding TransitWaybillStatusStrColor}" VerticalContentAlignment="Center" VerticalAlignment="Center"
Background="Transparent" IsReadOnly="True" MinWidth="20" Text="{Binding TransitWaybillStatusStr}" BorderThickness="0" />
</Border>-->
</WrapPanel>
<!--<TextBox Text="发货:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="发货" Text="" Grid.Column="1" Grid.Row="1" Margin="0,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>-->
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2">
<TextBlock Text="采购账户:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
Visibility="{Binding ElementName=txtOutOrderBuyerStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<uc:UcWaterMarkTextBox WaterMark="采购账户:" Text="{Binding ItemTransitOrder.OutOrderBuyerStr}" Grid.Column="1" Grid.Row="1"
Padding="0" Margin="-2,2" VerticalAlignment="Top" x:Name="txtOutOrderBuyerStr" Background="Transparent"
IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Cursor="Hand" Foreground="#0099ff"/>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2">
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
<TextBlock Text="采购单号:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
Visibility="{Binding ElementName=txtOutOrderNumStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<uc:UcWaterMarkTextBox WaterMark="采购单号:" Text="{Binding ItemTransitOrder.OutOrderNumStr}" Grid.Column="1" Grid.Row="1"
@@ -230,10 +246,10 @@
IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Cursor="Hand" Foreground="#0099ff"/>
<Border Grid.Column="2" Margin="4,0,0,0" Width="12" Background="Transparent" Height="12" VerticalAlignment="Center" Cursor="Hand" Visibility="{Binding ElementName=txtOutOrderBuyerStr,Path=Text,Converter={StaticResource HasTextVisibility}}"
Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown">
<Path Margin="0,0,0,0" Fill="#409eff" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
<Path Margin="0,0,0,0" Fill="{StaticResource PageLinkBrush}" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
<TextBlock Text="采购时间:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
Visibility="{Binding ElementName=txtOutOrderTimeQualifiedStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<uc:UcWaterMarkTextBox WaterMark="采购时间:" Text="{Binding OutOrderTimeQualifiedStr}" Grid.Column="1" Grid.Row="1"
@@ -241,10 +257,30 @@
IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Foreground="{Binding OutOrderTimeQualifiedBrush}"/>
<!--<Border Grid.Column="2" Margin="4,0,0,0" Width="12" Background="Transparent" Height="12" VerticalAlignment="Center" Cursor="Hand" Visibility="{Binding ElementName=txtOutOrderTimeQualifiedStr,Path=Text,Converter={StaticResource HasTextVisibility}}"
Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown">
<Path Margin="0,0,0,0" Fill="#409eff" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
<Path Margin="0,0,0,0" Fill="{StaticResource PageLinkBrush}" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>-->
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5" Visibility="{Binding TransitOrderWaybillToWareHouseStr, Converter={StaticResource HasTextVisibility}}">
<TextBlock Text="取号物流:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
Visibility="{Binding TransitOrderWaybillToWareHouseStr,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<uc:UcWaterMarkTextBox WaterMark="取号物流" Text="{Binding TransitOrderWaybillToWareHouseStr}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Foreground="{StaticResource PageOkBrush}"/>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="6" Visibility="{Binding TransitOrderWaybillFakeStr, Converter={StaticResource HasTextVisibility}}">
<TextBlock Text="提前物流:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
Visibility="{Binding TransitOrderWaybillFakeStr,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<uc:UcWaterMarkTextBox WaterMark="提前物流" Text="{Binding TransitOrderWaybillFakeStr}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Foreground="{StaticResource PageWarningBrush}"/>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="7" Visibility="{Binding TransitOrderWaybillFromWareHouseStr, Converter={StaticResource HasTextVisibility}}">
<TextBlock Text="仓库物流:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
Visibility="{Binding TransitOrderWaybillFromWareHouseStr,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
<uc:UcWaterMarkTextBox WaterMark="仓库物流" Text="{Binding TransitOrderWaybillFromWareHouseStr}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="8" Visibility="{Binding ItemOrder.out_express_no, Converter={StaticResource HasTextVisibility}}">
<TextBox Text="外采:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="外采" Text="{Binding ItemOrder.out_express_company}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
@@ -253,20 +289,20 @@
<uc:UcWaterMarkTextBox WaterMark="外采" Text="{Binding ItemOrder.out_express_no}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5">
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="9" Visibility="{Binding ReturnWaybillId, Converter={StaticResource HasTextVisibility}}">
<TextBox Text="退货:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="退货" Text="{Binding ItemRefund.return_delivery_name}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<uc:UcWaterMarkTextBox WaterMark="-" Text="-" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<uc:UcWaterMarkTextBox WaterMark="退货" Text="{Binding ItemRefund.return_waybill_id}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2,4,2" VerticalAlignment="Top"
<uc:UcWaterMarkTextBox WaterMark="退货" Text="{Binding ReturnWaybillId}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
</WrapPanel>
<!--
<TextBox Text="店铺备注:" Grid.Column="1" Grid.Row="2" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="店铺备注" Text="{Binding ItemOrder.shop_remark}" Grid.Column="1" Grid.Row="2" Margin="0,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCopyRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="#409eff" BorderBrush="Transparent"
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCopyRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="4,0,0,0" Content="编辑" Click="btnCopyRemark_Click"></Button>-->
</Grid>
<!--备注-->
@@ -285,17 +321,28 @@
</Grid.RowDefinitions>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">
<TextBox Text="买家留言:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="买家留言" Text="" Grid.Column="1" Grid.Row="1" Margin="0,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<TextBox Text="买家留言:" Grid.Column="1" Grid.Row="1" Margin="0,1,-8,1" VerticalAlignment="Top" Background="Transparent" BorderBrush="Transparent" IsReadOnly="True" BorderThickness="1"/>
<uc:UcWaterMarkTextBox WaterMark="买家留言" Text="" Grid.Column="1" Grid.Row="1" Margin="0,1,0,1" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="1" TextWrapping="Wrap"/>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2">
<TextBox Text="店铺备注:" Grid.Column="1" Grid.Row="2" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
<uc:UcWaterMarkTextBox WaterMark="店铺备注" Text="{Binding ItemOrder.shop_remark}" Grid.Column="1" Grid.Row="2" Margin="0,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCopyRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="#409eff" BorderBrush="Transparent"
Margin="4,0,0,0" Content="编辑" Click="btnCopyRemark_Click"></Button>
<TextBox Text="店铺备注:" Grid.Column="1" Grid.Row="2" Margin="0,1,-8,1" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderBrush="Transparent" BorderThickness="1"/>
<uc:UcWaterMarkTextBox x:Name="txtShopRemark" WaterMark="店铺备注" Text="{Binding ItemOrder.shop_remark}" Grid.Column="1" Grid.Row="2" Margin="0,1,0,1"
VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="1" TextWrapping="Wrap"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnEditShopRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="2,0,0,0" Content="编辑" Click="btnEditShopRemark_Click"></Button>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCancelEditShopRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="0,0,0,0" Content="取消" Click="btnCancelEditShopRemark_Click" Visibility="Collapsed"></Button>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
<TextBox Text="软件备注:" Grid.Column="1" Grid.Row="2" Margin="0,1,-8,1" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderBrush="Transparent" BorderThickness="1"/>
<uc:UcWaterMarkTextBox x:Name="txtAppRemark" WaterMark="软件备注" Text="{Binding ItemOrder.soft_remark}" Grid.Column="1" Grid.Row="2" Margin="0,1,0,1"
VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="1" TextWrapping="Wrap"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnEditAppRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="2,0,0,0" Content="编辑" Click="btnEditAppRemark_Click"></Button>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCancelEditAppRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="0,0,0,0" Content="取消" Click="btnCancelEditAppRemark_Click" Visibility="Collapsed"></Button>
</WrapPanel>
</Grid>
<!--操作-->
@@ -313,7 +360,7 @@
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!--<Button Grid.Column="1" Grid.Row="2" Background="Transparent" HorizontalAlignment="Center"
Foreground="#409eff" BorderBrush="Transparent" Margin="4,0,0,0" Content="核对拍单" Click=""></Button>-->
Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent" Margin="4,0,0,0" Content="核对拍单" Click=""></Button>-->
<!--<Button Grid.Column="1" Grid.Row="1" Background="Transparent" x:Name="btnBuyOrder" Click="btnBuyOrder_Click"
Visibility="{Binding ItemOrder.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}"
Style="{StaticResource BasePageButtonLightStyle}" Margin="4,0,0,0" Content="关联拍单" Width="56" Height="24"/>-->
@@ -323,6 +370,11 @@
Content="{Binding BuyGoodsBtnTxt}" IsEnabled="{Binding IsBuyGoodsBtnEnabled}" Style="{StaticResource BasePageButtonLightStyle}"
HorizontalAlignment="Center" MinWidth="38" Height="24" Margin="4,0,0,0">
</Button>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnDeleteTransitOrder" Click="btnDeleteTransitOrder_Click"
Visibility="Collapsed" BorderBrush="{Binding BuyGoodsBtnColor}" Background="{Binding BuyGoodsBtnBackColor}" Foreground="{Binding BuyGoodsBtnColor}"
Content="删除仓库订单" Style="{StaticResource BasePageButtonLightStyle}" HorizontalAlignment="Center" MinWidth="38" Height="24" Margin="4,0,0,0">
</Button>
</Grid>
</Grid>
</Grid>
@@ -1,9 +1,11 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Converters;
using _29WxOrderWpf.UserControls;
using AllBase;
using AllBase.Helper;
using AllBase.Model;
using AllBase.Model.Local;
using CefSharp.DevTools.DOM;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
@@ -27,6 +29,7 @@ using Work;
using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms;
using Work._29Tools.Forms.ToolForms;
using Work.BaseForms;
using static System.Net.WebRequestMethods;
namespace _29WxOrderWpf.Ctrls.OrderCtrls
@@ -82,14 +85,110 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
private void btnCopyRemark_Click(object sender, RoutedEventArgs e)
private void btnEditShopRemark_Click(object sender, RoutedEventArgs e)
{
if (this.DataContext is oms_wei_order_item_info orderItem)
{
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
if (shop == null)
return;
if (btnEditShopRemark.Content.ParseToString() == "保存")
{
var notesRst = OrderListCtrl.addNotes(shop, orderItem.order_id, txtShopRemark.Text);
if (!notesRst.Contains("\"code\":0"))
{
ShopBLL.CheckShopLogin(shop);
BaseMsgForm.ShowError("保存失败请重试");
return;
}
btnCancelEditShopRemark.Visibility = Visibility.Collapsed;
btnEditShopRemark.Content = "编辑";
txtShopRemark.SetValue(WidthProperty, Double.NaN);
txtShopRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtShopRemark.IsReadOnly = true;
}
else
{
btnCancelEditShopRemark.Visibility = Visibility.Visible;
btnEditShopRemark.Content = "保存";
txtShopRemark.SetValue(WidthProperty, 135.0);
txtShopRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(50, 0, 50, 150));
txtShopRemark.IsReadOnly = false;
}
}
}
private void btnCancelEditShopRemark_Click(object sender, RoutedEventArgs e)
{
btnCancelEditShopRemark.Visibility = Visibility.Collapsed;
btnEditShopRemark.Content = "编辑";
txtShopRemark.SetValue(WidthProperty, Double.NaN);
txtShopRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtShopRemark.IsReadOnly = true;
}
private void btnEditAppRemark_Click(object sender, RoutedEventArgs e)
{
if (this.DataContext is oms_wei_order_item_info orderItem)
{
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
if (shop == null)
return;
if (btnEditAppRemark.Content.ParseToString() == "保存")
{
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex();
data += "&order_id=" + orderItem.order_id;
data += "&soft_remark=" + txtAppRemark.Text;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (!html.Contains("\"code\":200"))
{
BaseMsgForm.ShowError("保存失败请重试");
return;
}
if (BaseRegex.GetIntJson(ref html, "affected_rows") == 0)
{
BaseMsgForm.ShowError("未找到指定订单");
return;
}
orderItem.ItemOrder.soft_remark = txtAppRemark.Text;
btnCancelEditAppRemark.Visibility = Visibility.Collapsed;
btnEditAppRemark.Content = "编辑";
txtAppRemark.SetValue(WidthProperty, Double.NaN);
txtAppRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtAppRemark.IsReadOnly = true;
}
else
{
btnCancelEditAppRemark.Visibility = Visibility.Visible;
btnEditAppRemark.Content = "保存";
txtAppRemark.SetValue(WidthProperty, 135.0);
txtAppRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(50, 0, 50, 150));
txtAppRemark.IsReadOnly = false;
}
}
}
private void btnCancelEditAppRemark_Click(object sender, RoutedEventArgs e)
{
btnCancelEditAppRemark.Visibility = Visibility.Collapsed;
btnEditAppRemark.Content = "编辑";
txtAppRemark.SetValue(WidthProperty, Double.NaN);
txtAppRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtAppRemark.IsReadOnly = true;
}
private void btnBuyOrder_Click(object sender, RoutedEventArgs e)
{
var orderItem = this.DataContext as oms_wei_order_item_info;
var refundItem = orderItem.ItemRefund;
if (orderItem == null)
{
BaseMsgWindow.ShowError("订单信息为空");
@@ -110,7 +209,41 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
});
Task.Run(() =>
{
// 拍单的时候检测一下买手号
// 拍单前查询订单是否退款
var orderId = orderItem.order_id;
var skuId = orderItem.sku_id;
MainWindow.Instance.orderListCtrl.GetOrder(orderId);
var newOrder = GlobalConfig.lstOrder.FirstOrDefault(or => or.order_id == orderId);
if (newOrder.orderItems.Count == 1)
orderItem = newOrder?.orderItems?.FirstOrDefault();
else
orderItem = newOrder?.orderItems?.FirstOrDefault(oi => oi.sku_id == skuId);
if (orderItem == null)
return;
// 如果是退款单,弹出退款窗口
if (/*orderItem?.ItemRefund?.count > 0 &&*/ orderItem.refund_status > 1)
{
Dispatcher.Invoke(new Action(() =>
{
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
if (shop != null)
{
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/aftersale/detail?orderid=" + orderItem.ItemRefund.after_sale_order_id;
shopLoginForm.Show();
}
else
{
BaseMsgWindow.ShowError("订单有售后,请去店铺后台退款");
}
}));
return;
}
// 拍单前检测买手号是否在线
if (GlobalConfig.CurrentPddBuyer.status == "在线")
{
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
@@ -125,59 +258,74 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return;
}
var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
var data = UserLogin.GetSignaturex();
data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
data += "&shop_id=" + orderItem.Shop.ErpShopId;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
// 拍单前查询账户余额
if (GlobalConfig.BuyConfig.IsUseAppBalance)
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
{
try
{
var erpMs = JsonHelper.DeserializeJsonToList<ErpMerchantInfo>(JsonHelper.JObjectParse(html)["data"].ParseToString());
var erpM = erpMs.FirstOrDefault();
if (erpM == null)
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("未找到店铺账户!");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
var balance = erpM.balance.ParseToDecimal();
if (balance < 10)
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
}
catch
if (BaseClass.Balance < 10)
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("拍单校验出错,请稍后重试");
BaseMsgWindow.ShowError("软件快递余额不足(剩余" + BaseClass.Balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
}));
return;
}
}
else
{
var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
var data = UserLogin.GetSignaturex();
data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
data += "&shop_id=" + orderItem.Shop.ErpShopId;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
{
try
{
var erpMs = JsonHelper.DeserializeJsonToList<ErpMerchantInfo>(JsonHelper.JObjectParse(html)["data"].ParseToString());
var erpM = erpMs.FirstOrDefault();
if (erpM == null)
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("未找到店铺账户!");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
var balance = erpM.balance.ParseToDecimal();
if (balance < 10)
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
}
catch
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("拍单校验出错,请稍后重试");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
}
}
if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
@@ -303,6 +451,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
buyOrderForm.pnlMap.Visible = false;
}
buyOrderForm.ShowDialog();
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
}));
});
}
@@ -315,6 +464,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
//if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
// txtProfitForecast.Visibility = Visibility.Visible;
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
//if (BaseClass.SaLevel == 1 && order_item.ItemTransitOrder != null)
//{
// btnDeleteTransitOrder.Visibility = Visibility.Visible;
//}
order_item.UpdateOrderItemBuyButton();
Task.Run(() =>
@@ -442,6 +597,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
imgFrom.ShowDialog();
}
}
private void btnDeleteTransitOrder_Click(object sender, RoutedEventArgs e)
{
}
}
@@ -126,6 +126,7 @@ namespace _29WxOrderWpf.LoginWindows
BaseMsgForm.ShowError(message, "登录失败");
return;
}
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
if (BaseClass.Remember)
{
Initialization i = new Initialization();
+3
View File
@@ -27,6 +27,9 @@
VerticalAlignment="Center" VerticalContentAlignment="Center" Content="拍单软件" Grid.Column="1"></Label>
<Label x:Name="lblVersion" FontSize="12" Margin="0,4,80,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Right"
VerticalAlignment="Top" VerticalContentAlignment="Center" Content="版本信息" Opacity="0.7" Grid.Column="4"></Label>
<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>
+18 -1
View File
@@ -16,6 +16,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Net;
@@ -38,16 +39,20 @@ using System.Windows.Shapes;
using System.Xml.Linq;
using Work;
using Work._29Tools.BLL;
using Work._29Tools.Forms.UserForms;
namespace _29WxOrderWpf
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : BaseWindow
public partial class MainWindow : BaseWindow, INotifyPropertyChanged
{
public static MainWindow Instance { get; private set; }
public event PropertyChangedEventHandler PropertyChanged;
public string Balance { get { return "快递余额:" + BaseClass.Balance.ToString("0.00"); } set { OnPropertyChanged("Balance"); } }
public MainWindow()
{
InitializeComponent();
@@ -88,6 +93,11 @@ namespace _29WxOrderWpf
});
}
}
protected virtual void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)//有改变
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
#region 反抓包功能
private void AutoAntiGrabbingMechanism()
@@ -332,6 +342,7 @@ namespace _29WxOrderWpf
#region 读取拼多多买手号
public bool isGetPddBuyer = false;
public bool hasGetPddBuyer = false;
/// <summary>
/// 读取拼多多买手
/// </summary>
@@ -414,5 +425,11 @@ namespace _29WxOrderWpf
hasGetPddBuyer = true;
}
#endregion
private void lblBalance_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
WXGetBalanceQrCodeForm balanceQrCodeForm = new WXGetBalanceQrCodeForm();
balanceQrCodeForm.ShowDialog();
}
}
}
+28
View File
@@ -0,0 +1,28 @@
using AllBase;
using AllBase.DouYinModel.Param.ConfigManage;
using AllBase.Helper;
using AllBase.Model.Config;
using NaiBa.Util.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _29WxOrderWpf
{
public class StartUp
{
public static void Init()
{
GlobalConfig.BuyConfig = ConfigHelper.LoadConfig<BuyConfig>("buy_config_260708");
if (GlobalConfig.BuyConfig == null)
GlobalConfig.BuyConfig = new BuyConfig();
}
public static void SaveBuyConfig()
{
ConfigHelper.SaveConfig("buy_config_260708", GlobalConfig.BuyConfig);
}
}
}
@@ -21,5 +21,9 @@
<SolidColorBrush x:Key="ListRowHoverBackColorBrush" Color="#FFf5f7fa"/>
<SolidColorBrush x:Key="HorizontalGridLinesBrush" Color="#FFf5f7fa"/>
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="PageOkBrush" Color="#FF67c23a" />
<SolidColorBrush x:Key="PageWarningBrush" Color="#FFfa4733" />
<SolidColorBrush x:Key="PageLinkBrush" Color="#409eff" />
</ResourceDictionary>
+1
View File
@@ -166,6 +166,7 @@
<Compile Include="DouYinModel\Param\ShopManage\DouShopSettingParam.cs" />
<Compile Include="DouYinModel\Result\DouGoodsInfo.cs" />
<Compile Include="DouYinModel\Result\DouOrderListInfo.cs" />
<Compile Include="Model\Config\BuyConfig.cs" />
<Compile Include="Model\Local\ErpMerchantInfo.cs" />
<Compile Include="Model\Local\oms_wei_external_procurement_log.cs" />
<Compile Include="Model\Local\TransitWarehouseParam.cs" />
+2 -2
View File
@@ -22,7 +22,7 @@ namespace AllBase
/// 版本ID
/// </summary>
public static int VersionCount = 130;
public static int VersionCount = 139;
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string DebugUrl { get; set; } = "http://localhost:9000";
@@ -182,7 +182,7 @@ namespace AllBase
public static int MinSales = 0;
public static int MinPercent = 0;
public static int MinLevel = 0;
public static int Balance = 0;
public static decimal Balance = 0;
public static int AlimamaPageCount = 0;
public static bool CloudTitle = false;
public static bool CloudBrand = false;
+15
View File
@@ -679,6 +679,21 @@ namespace AllBase
return temp;
}
/// <summary>
/// 获取值
/// </summary>
/// <param name="html"></param>
/// <param name="reg"></param>
/// <returns></returns>
public static string GetStringXml(ref string html, string reg, string defaultValue)
{
string temp = GetMatchRegexString(html, @"<" + reg + ">([^']+?)</" + reg + ">");
if (string.IsNullOrEmpty(temp))
return defaultValue;
return temp;
}
public static string GetOneJsonObjStrJson(ref string html, string reg)
{
return GetJsonObjStrJson(ref html, reg).FirstOrDefault();
+5 -1
View File
@@ -1,5 +1,6 @@
using AllBase.DouYinModel.Param.ConfigManage;
using AllBase.Model;
using AllBase.Model.Config;
using AllBase.Model.Local;
using AllBase.Model.Result;
using NaiBa.Util;
@@ -47,7 +48,8 @@ namespace AllBase.Helper
// 敏感词
//public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,燃气,气泡弹,喷雾";
public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,气泡弹,喷雾";
//public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,气泡弹,喷雾";
public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,气泡弹";
public static List<string> lstDangerItemWord { get; set; } = dangerItemWords.Split(',').ToList();
public static System.Drawing.Color DefaultMainColor { get; set; } = System.Drawing.Color.FromArgb(63, 126, 255);
@@ -65,5 +67,7 @@ namespace AllBase.Helper
public static System.Drawing.Color WeiXinMainColor { get; set; } = System.Drawing.Color.FromArgb(152, 99, 143);
public static System.Drawing.Color WeiXinMainColorLight { get; set; } = System.Drawing.Color.FromArgb(245, 235, 255);
public static System.Drawing.Color WeiXinBorderColor { get; set; } = System.Drawing.Color.FromArgb(107, 83, 147);
public static BuyConfig BuyConfig { get; set; }
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Config
{
public class BuyConfig
{
/// <summary>
/// 使用软件拍单余额拍单
/// </summary>
public bool IsUseAppBalance { get; set; } = true;
/// <summary>
/// 自动修改下单地址到仓库
/// </summary>
public bool IsAutoChangeWarehouseAddress { get; set; } = true;
}
}
+14 -10
View File
@@ -10,7 +10,7 @@ namespace AllBase.Model.Local
public class TransitWarehouseParam
{
/// <summary>
/// 中转仓编码
/// 中转仓编码 XDYYWC XDYJJC...
/// </summary>
public string TransId { get; set; }
/// <summary>
@@ -33,20 +33,22 @@ namespace AllBase.Model.Local
public int province_id { get; set; }
public int city_id { get; set; }
public int district_id { get; set; }
public string province_name { get;set; }
public string city_name { get; set; }
}
public class TransitWarehouseData
{
public static string TransitWarehouseDataStr = @"
XDYYWC ;义乌仓 ;小田 ;19058117371 ;浙江省金华市义乌市北苑街道西站大道妈妈商贸6号库3楼中库走到底鸿鹄云仓(康诚楼上) ;31 ;386 ;3409
XDYJJC ;晋江仓 ;安群 ;19905951984 ;福建省泉州市南安市霞美镇温山村431号鸿鹄大厦 ;4 ;58 ;569
XDYBJC ;北京仓 ;胡萍 ;18565773752 ;北京市顺义区光明街道滨河小区七区1号楼 ;2 ;52 ;511
XDYCDC ;成都仓 ;谢春虹 ;15828201479 ;四川省资阳市乐至县仙鹤大道桑都街15-19号仓库(不要放驿站,送到仓库) ;26 ;340 ;2898
XDYGZC ;广州仓 ;何外华 ;13826339849 ;广州市从化区太平镇高埔细埔街99号东门4栋3楼 ;6 ;76 ;692
XDYWHC ;武汉2仓 ;杨先生 ;13044121071 ;湖北省武汉市汉阳区洲头街道汉新大道2号鲲鹏公司 ;13 ;180 ;1548
XDYSHANDC ;山东2仓 ;鸿鹄小申 ;13044121239 ;山东省临沂市费县南外环东转盘往东200米顺通快递有限公司(仓库二楼) ;22 ;292 ;2415
XDYSHC ;上海新仓 ;纪先生 ;13044121150 ;上海市上海市普陀区真如镇街道真北路2653弄G区 ;25 ;321 ;2709
XDYSZC ;深圳仓 ;峰峰 ;15343351331 ;广东省东莞市东莞市凤岗镇 浸校塘东良巷兔喜生活(云仓);6 ;79 ;732";
XDYYWC ;义乌仓 ;小田 ;19058117371 ;浙江省金华市义乌市北苑街道西站大道妈妈商贸6号库3楼中库走到底鸿鹄云仓(康诚楼上) ;31 ;386 ;3409 ;浙江省 ;金华市
XDYJJC ;晋江仓 ;安群 ;19905951984 ;福建省泉州市南安市霞美镇温山村431号鸿鹄大厦 ;4 ;58 ;569 ;福建省 ;泉州市
XDYBJC ;北京仓 ;胡萍 ;18565773752 ;北京市顺义区光明街道滨河小区七区1号楼 ;2 ;52 ;511 ;北京市 ;北京市
XDYCDC ;成都仓 ;谢春虹 ;15828201479 ;四川省资阳市乐至县仙鹤大道桑都街15-19号仓库(不要放驿站,送到仓库) ;26 ;340 ;2898 ;四川省 ;资阳市
XDYGZC ;广州仓 ;何外华 ;13826339849 ;广州市从化区太平镇高埔细埔街99号东门4栋3楼 ;6 ;76 ;692 ;广东省 ;广州市
XDYWHC ;武汉2仓 ;杨先生 ;13044121071 ;湖北省武汉市汉阳区洲头街道汉新大道2号鲲鹏公司 ;13 ;180 ;1548 ;湖北省 ;武汉市
XDYSHANDC ;山东2仓 ;鸿鹄小申 ;13044121239 ;山东省临沂市费县南外环东转盘往东200米顺通快递有限公司(仓库二楼) ;22 ;292 ;2415 ;山东省 ;临沂市
XDYSHC ;上海新仓 ;纪先生 ;13044121150 ;上海市上海市普陀区真如镇街道真北路2653弄G区 ;25 ;321 ;2709 ;上海市 ;上海市
XDYSZC ;深圳仓 ;峰峰 ;15343351331 ;广东省东莞市东莞市凤岗镇 浸校塘东良巷兔喜生活(云仓);6 ;79 ;732 ;广东省 ;东莞市";
//XDYCHONGQC ;重庆2仓 ;翁桂柱 ;18923911055 ;重庆市九龙坡区中梁山街道云飞九龙香山(二纵线东50米)重庆九龙坡区渝州公司 ;32 ;394 ;3339
//XDYHEBC ;哈尔滨仓 ;韩健 ;13044121250 ;黑龙江省哈尔滨市双城区新兴镇钱江路南侧韵达快递分拨中心发出库房84号装车口旁边电梯 ;12 ;167 ;1426
//XDYXA ;西安仓 ;方先生 ;15813526665 ;陕西省西安市雁塔区田马路厨具市场内韵达超市(田马路店);24 ;311 ;2599
@@ -80,6 +82,8 @@ XDYSZC ;深圳仓 ;峰峰 ;15343351331 ;广东省东莞市东莞市凤
province_id = arr[5].Trim().ParseToInt(),
city_id = arr[6].Trim().ParseToInt(),
district_id = arr[7].Trim().ParseToInt(),
province_name = arr[8].Trim(),
city_name = arr[9].Trim(),
};
transitWarehouseList.Add(tw);
}
@@ -43,6 +43,9 @@ namespace AllBase.Model.Local
public DateTime updated_time { get; set; }
public string platform { get; set; }
public string order_platform_code { get; set; }
/// <summary>
/// 唯一值编码,一般为外采单号
/// </summary>
public string order_code { get; set; }
/// <summary>
/// 取号状态 1 正常取号 2提前取号 3已更正 (已修改提前取号为正常取号)
@@ -50,5 +53,8 @@ namespace AllBase.Model.Local
/// </summary>
public int? pre_allocated_order_no { get; set; }
public int? is_transfer_ship { get; set; }
public string random_code { get; set; }
public int? transfer_refund_status { get; set; }
}
}
@@ -39,6 +39,10 @@ namespace AllBase.Model.Local
{
get
{
if (order_id == "3737644875536802048")
{
}
if (orderItems.All(oi => oi.ItemTransitOrder != null)) return false;
if (purchase_status != 0) return false;
if (!out_order_no.IsNullOrEmpty()) return false;
+112 -2
View File
@@ -2,6 +2,7 @@
using AllBase.Model.MvvmBaseClasses;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Asn1.Mozilla;
using System;
using System.Collections.Generic;
@@ -80,10 +81,113 @@ namespace AllBase.Model.Local
public List<oms_wei_external_procurement_log> ItemTransitOrders { get; set; } = new List<oms_wei_external_procurement_log>();
public oms_wei_external_procurement_log ItemTransitOrder
{
get { return ItemTransitOrders.FirstOrDefault(); }
get { return ItemTransitOrders.FirstOrDefault(t => t.transfer_refund_status.IsNullOrZero()); }
set { }
}
/// <summary>
/// 拍单物流
/// </summary>
public string TransitOrderWaybillToWareHouseStr
{
get
{
// 直接取号和更正取号
if (ItemTransitOrder?.pre_allocated_order_no != 1 && ItemTransitOrder?.pre_allocated_order_no != 3)
return null;
return "买手物流:" + ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
}
set { }
}
/// <summary>
/// 提前取号物流
/// </summary>
public string TransitOrderWaybillFakeStr
{
get
{
// 提前取号
if (ItemTransitOrder?.pre_allocated_order_no != 2)
return null;
return "取号物流:" + ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
}
set { }
}
/// <summary>
/// 仓库物流
/// </summary>
public string TransitOrderWaybillFromWareHouseStr
{
get
{
// 仓库下游物流
if (ItemTransitOrder == null || ItemTransitOrder.express_2_company.IsNullOrEmpty() || ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
return null;
return "仓库物流:" + ItemTransitOrder.express_2_company + "-" + ItemTransitOrder.express_2_waybill;
}
set { }
}
public string TransitWaybillStatusStr
{
get
{
if ((ItemTransitOrder?.pre_allocated_order_no == 1 || ItemTransitOrder?.pre_allocated_order_no == 3) && !ItemTransitOrder.express_2_company.IsNullOrEmpty() && !ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
return "仓库已出单";
if (ItemTransitOrder?.pre_allocated_order_no == 1 || ItemTransitOrder?.pre_allocated_order_no == 3)
return "买手已出单";
if (ItemTransitOrder != null)
return "买手未出单";
return "";
}
set { }
}
public SolidColorBrush TransitWaybillStatusStrColor
{
get
{
if (TransitWaybillStatusStr == "仓库已出单")
return new SolidColorBrush(Color.FromRgb(19, 206, 102));
if (TransitWaybillStatusStr == "买手已出单")
return new SolidColorBrush(Color.FromRgb(255, 186, 0));
if (TransitWaybillStatusStr == "买手未出单")
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
}
set { }
}
public SolidColorBrush TransitWaybillStatusBorderColor
{
get
{
if (TransitWaybillStatusStr == "仓库已出单")
return new SolidColorBrush(Color.FromRgb(208, 245, 224));
if (TransitWaybillStatusStr == "买手已出单")
return new SolidColorBrush(Color.FromRgb(255, 241, 204));
if (TransitWaybillStatusStr == "买手未出单")
return new SolidColorBrush(Color.FromRgb(255, 219, 219));
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
}
set { }
}
public SolidColorBrush TransitWaybillStatusBackColor
{
get
{
if (TransitWaybillStatusStr == "仓库已出单")
return new SolidColorBrush(Color.FromRgb(231, 250, 240));
if (TransitWaybillStatusStr == "买手已出单")
return new SolidColorBrush(Color.FromRgb(255, 248, 230));
if (TransitWaybillStatusStr == "买手未出单")
return new SolidColorBrush(Color.FromRgb(255, 237, 237));
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
}
set { }
}
// 仓库采购时间是否达标字段
public string OutOrderTimeQualifiedStr
{
@@ -196,6 +300,12 @@ namespace AllBase.Model.Local
set { }
}
public string ReturnWaybillId
{
get { return ItemRefund?.return_waybill_id; }
set { }
}
/// <summary>
/// 订单退款时间
/// </summary>
@@ -275,7 +385,7 @@ namespace AllBase.Model.Local
/// <summary>
/// 平台服务费
/// </summary>
public string predict_commission_fee_string
public string predict_commission_fee_str
{
//get { return "¥" + (order_items.Sum(oi => oi.predict_commission_fee.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
get { return "¥" + (predict_commission_fee * 0.01m).ParseToDecimal().ToString("0.00"); }
+58 -12
View File
@@ -2,6 +2,7 @@
using AllBase.Model.MvvmBaseClasses;
using NaiBa.Util.Extension;
using NaiBa.Util.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -95,7 +96,6 @@ namespace AllBase.Model.Result
if (expressCompanyName.Contains("其他快递")) return "OTHER";
return "";
}
public string ShopOrderIdStr
{
get { return this.GetValue(x => x.ShopOrderIdStr); }
@@ -176,14 +176,16 @@ namespace AllBase.Model.Result
/// <summary>
/// 处理中, "已取号(更正)", 已取号, 提前取号, 取号失败
/// </summary>
[JsonIgnore]
public string TransitOrderStatus
{
get
{
if (TransferWareHouseStatus == "3")
{
return "处理中";
}
string wareHouseStatusStr = TransferWareHouseStatus == "3" ? " 仓库处理中" : "";
//if (TransferWareHouseStatus == "3")
//{
// return "处理中";
//}
// 不考虑仓库取号失败情况,只要取号状态不是3或者1,且有仓库订单记录,就处理取号
//if (TransferWareHouseStatus == "2")
//{
@@ -198,16 +200,16 @@ namespace AllBase.Model.Result
if (OrderTime >= new DateTime(2026, 6, 29))
return "已取号";
else
return "提前取号";
return "提前取号" + wareHouseStatusStr;
}
if (PreAllocatedOrderNoStr == "2")
{
return "提前取号";
return "提前取号" + wareHouseStatusStr;
}
if (!TransitWarehouseIdStr.IsNullOrEmpty() && OrderTime < new DateTime(2026, 6, 29))
{
return "提前取号(旧订单)";
return "提前取号(旧订单)" + wareHouseStatusStr;
}
if (TransitWarehouseIdStr.IsNullOrEmpty())
{
@@ -250,18 +252,35 @@ namespace AllBase.Model.Result
}
set { }
}
/// <summary>
/// 微信小店订单创建时间
/// </summary>
public DateTime WxOrderCreateTime
{
get { return this.GetValue(x => x.WxOrderCreateTime); }
set { this.SetValue(x => x.WxOrderCreateTime, value); }
}
/// <summary>
/// 中转单创建时间
/// </summary>
public DateTime TransitCreateTime
{
get { return this.GetValue(x => x.TransitCreateTime); }
set { this.SetValue(x => x.TransitCreateTime, value); }
}
/// <summary>
/// 买手订单时间
/// </summary>
[JsonIgnore]
public DateTime OrderTime
{
get { return BaseClass.StampToDateTime(order_time.ParseToInt()); }
set { }
}
[JsonIgnore]
public string OrderTimeStr
{
get { return BaseClass.StampToDateTime(order_time.ParseToInt()).ToString("yy-MM-dd HH:mm:ss"); }
@@ -271,23 +290,37 @@ namespace AllBase.Model.Result
/// <summary>
/// 商品信息
/// </summary>
[JsonIgnore]
public string ProdInfoStr
{
get { return order_Goods == null ? "" : string.Join("\r\n", order_Goods.Select(g => g.goods_name + " x" + g.goods_number)); }
set { }
}
/// <summary>
/// 购买金额
/// </summary>
[JsonIgnore]
public decimal AmoutValue
{
get { return order_amount.ParseToInt() * 0.01m; }
set { }
}
public string outExpressCompanyMsg { get; set; } // 物流公司名称,可以尝试直接从列表中匹配
/// <summary>
/// 中转仓物流公司编码
/// 物流公司名称,可以尝试直接从列表中匹配
/// </summary>
[JsonIgnore]
public string outExpressCompanyMsg
{
get { return extra_info.order_hint?.message; }
set { }
}
/// <summary>
/// 外采订单物流名称对应中转仓物流公司编码
/// </summary>
[JsonIgnore]
public string outExpressCompanyCode
{
get
@@ -330,6 +363,8 @@ namespace AllBase.Model.Result
/// 微信退款单状态
/// </summary>
public string wxRefundStatus { get; set; } = "";
public string buyerId { get; set; } // 买手Id
public string buyerName { get; set; } // 买手名称
/// <summary>
@@ -342,6 +377,9 @@ namespace AllBase.Model.Result
public int? discount_amount { get; set; } // 200,
public int? service_amount { get; set; } // 0,
public string display_amount { get; set; } // 2090 实付款
/// <summary>
/// 买手单创建时间
/// </summary>
public long? order_time { get; set; } // 1775731637
/// <summary>
/// 物流单号
@@ -374,6 +412,14 @@ namespace AllBase.Model.Result
{
public string after_sales_id { get; set; } // "20032511557436",
public int? after_sales_type { get; set; } // 2,
/// <summary>
/// 售后状态
/// 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理
/// 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期
/// 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货
/// 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货
/// 2, 3, 4, 5, 7, 8, 10, 31 // 售后,不支持修改物流
/// </summary>
public int? after_sales_status { get; set; } // 31 // 待用户拒收商品
}
+10
View File
@@ -297,6 +297,12 @@
<Compile Include="_29Tools\Forms\ToolForms\ShowImgForm.Designer.cs">
<DependentUpon>ShowImgForm.cs</DependentUpon>
</Compile>
<Compile Include="_29Tools\Forms\UserForms\WXGetBalanceQrCodeForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="_29Tools\Forms\UserForms\WXGetBalanceQrCodeForm.Designer.cs">
<DependentUpon>WXGetBalanceQrCodeForm.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AllBase\29WxOrderAllBase.csproj">
@@ -317,6 +323,7 @@
<None Include="packages.config" />
<None Include="Resources\icon.ico" />
<Content Include="Resources\errpic.png" />
<Content Include="Resources\loading_blue.gif" />
<Content Include="Resources\max.hover.png" />
<Content Include="Resources\max.png" />
<Content Include="Resources\min.hover.png" />
@@ -373,6 +380,9 @@
<EmbeddedResource Include="_29Tools\Forms\ToolForms\ShowImgForm.resx">
<DependentUpon>ShowImgForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="_29Tools\Forms\UserForms\WXGetBalanceQrCodeForm.resx">
<DependentUpon>WXGetBalanceQrCodeForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
+5 -4
View File
@@ -12,19 +12,20 @@ namespace Work
{
public class Base64ChangeImgUrl
{
/// <summary>
/// 将Base64字符串转换为图片
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public Bitmap ToImage(string imgBase64)
public static Bitmap Base64ToImage(string imgBase64)
{
imgBase64 = imgBase64.Substring("data:image/jpeg;base64,".Length);
if (imgBase64.StartsWith("data:image/jpeg;base64,"))
imgBase64 = imgBase64.Substring("data:image/jpeg;base64,".Length);
byte[] bytes = Convert.FromBase64String(imgBase64);
MemoryStream ms = new MemoryStream(bytes);
Image mImage = Image.FromStream(ms);
Bitmap bmpt = new Bitmap(ms);
ms.Dispose();
return bmpt;
}
/// <summary>
@@ -97,7 +98,7 @@ namespace Work
{
if (!string.IsNullOrEmpty(imgBase64))
{
return GetPictureData(ToImage(imgBase64));
return GetPictureData(Base64ToImage(imgBase64));
}
return null;
}
+1 -1
View File
@@ -73,7 +73,7 @@ namespace Work.BaseForms
if (BaseClass.Ico != null)
Iconx = Icon = BaseClass.Ico;
//else
// Iconx = Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(Properties.Resources.icon);
//Iconx = Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(Properties.Resources.icon);
if (this.IsShowMaxBox)
-386
View File
@@ -1,386 +0,0 @@
namespace Work.BaseForms
{
partial class PddMobileLoginForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PddMobileLoginForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnLoginAgain = new UserControls.ButtonEx();
this.label2 = new System.Windows.Forms.Label();
this.btnCopyPassword = new UserControls.ButtonEx();
this.btnCopyUserName = new UserControls.ButtonEx();
this.txtPassWord = new System.Windows.Forms.TextBox();
this.txtUserName = new System.Windows.Forms.TextBox();
this.btnStop = new UserControls.ButtonEx();
this.btnReload = new UserControls.ButtonEx();
this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnSaveCookie = new DevComponents.DotNetBar.PanelEx();
this.panel3 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.panel2.SuspendLayout();
this.panel3.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.panel3);
this.splitContainer1.Panel2.Controls.Add(this.label3);
this.splitContainer1.Panel2.Controls.Add(this.panel2);
this.splitContainer1.Panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.splitContainer1_Panel2_Paint);
this.splitContainer1.Size = new System.Drawing.Size(1022, 704);
this.splitContainer1.SplitterDistance = 484;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
// btnLoginAgain
//
this.btnLoginAgain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnLoginAgain.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnLoginAgain.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLoginAgain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLoginAgain.ForeColor = System.Drawing.Color.White;
this.btnLoginAgain.Location = new System.Drawing.Point(56, 163);
this.btnLoginAgain.Margin = new System.Windows.Forms.Padding(2);
this.btnLoginAgain.Name = "btnLoginAgain";
this.btnLoginAgain.Size = new System.Drawing.Size(91, 25);
this.btnLoginAgain.TabIndex = 462;
this.btnLoginAgain.Text = "重新登录";
this.btnLoginAgain.UseVisualStyleBackColor = false;
this.btnLoginAgain.Click += new System.EventHandler(this.btnLoginAgain_Click);
//
// label2
//
this.label2.Location = new System.Drawing.Point(73, 67);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 378;
this.label2.Text = "密码";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnCopyPassword
//
this.btnCopyPassword.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCopyPassword.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopyPassword.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyPassword.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopyPassword.ForeColor = System.Drawing.Color.White;
this.btnCopyPassword.Location = new System.Drawing.Point(255, 63);
this.btnCopyPassword.Margin = new System.Windows.Forms.Padding(2);
this.btnCopyPassword.Name = "btnCopyPassword";
this.btnCopyPassword.Size = new System.Drawing.Size(57, 25);
this.btnCopyPassword.TabIndex = 376;
this.btnCopyPassword.Text = "复制";
this.btnCopyPassword.UseVisualStyleBackColor = false;
this.btnCopyPassword.Click += new System.EventHandler(this.btnCopyPassword_Click);
//
// btnCopyUserName
//
this.btnCopyUserName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCopyUserName.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopyUserName.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyUserName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopyUserName.ForeColor = System.Drawing.Color.White;
this.btnCopyUserName.Location = new System.Drawing.Point(255, 36);
this.btnCopyUserName.Margin = new System.Windows.Forms.Padding(2);
this.btnCopyUserName.Name = "btnCopyUserName";
this.btnCopyUserName.Size = new System.Drawing.Size(57, 25);
this.btnCopyUserName.TabIndex = 375;
this.btnCopyUserName.Text = "复制";
this.btnCopyUserName.UseVisualStyleBackColor = false;
this.btnCopyUserName.Click += new System.EventHandler(this.btnCopyUserName_Click);
//
// txtPassWord
//
this.txtPassWord.Location = new System.Drawing.Point(117, 64);
this.txtPassWord.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtPassWord.Name = "txtPassWord";
this.txtPassWord.PasswordChar = '●';
this.txtPassWord.ReadOnly = true;
this.txtPassWord.Size = new System.Drawing.Size(135, 23);
this.txtPassWord.TabIndex = 374;
//
// txtUserName
//
this.txtUserName.Location = new System.Drawing.Point(117, 37);
this.txtUserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtUserName.Name = "txtUserName";
this.txtUserName.ReadOnly = true;
this.txtUserName.Size = new System.Drawing.Size(135, 23);
this.txtUserName.TabIndex = 373;
//
// btnStop
//
this.btnStop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnStop.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStop.ForeColor = System.Drawing.Color.White;
this.btnStop.Location = new System.Drawing.Point(243, 163);
this.btnStop.Margin = new System.Windows.Forms.Padding(2);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(91, 25);
this.btnStop.TabIndex = 372;
this.btnStop.Text = "停止操作";
this.btnStop.UseVisualStyleBackColor = false;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// btnReload
//
this.btnReload.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnReload.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnReload.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReload.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReload.ForeColor = System.Drawing.Color.White;
this.btnReload.Location = new System.Drawing.Point(150, 163);
this.btnReload.Margin = new System.Windows.Forms.Padding(2);
this.btnReload.Name = "btnReload";
this.btnReload.Size = new System.Drawing.Size(91, 25);
this.btnReload.TabIndex = 371;
this.btnReload.Text = "重新加载";
this.btnReload.UseVisualStyleBackColor = false;
this.btnReload.Click += new System.EventHandler(this.btnReload_Click);
//
// chkCloseAfterLogin
//
//
//
//
this.chkCloseAfterLogin.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.chkCloseAfterLogin.Checked = true;
this.chkCloseAfterLogin.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkCloseAfterLogin.CheckValue = "Y";
this.chkCloseAfterLogin.Location = new System.Drawing.Point(207, 138);
this.chkCloseAfterLogin.Name = "chkCloseAfterLogin";
this.chkCloseAfterLogin.Size = new System.Drawing.Size(135, 23);
this.chkCloseAfterLogin.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.chkCloseAfterLogin.TabIndex = 8;
this.chkCloseAfterLogin.Text = "登录成功后关闭窗口";
//
// splitContainer2
//
this.splitContainer2.BackColor = System.Drawing.Color.White;
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Location = new System.Drawing.Point(1, 33);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.txtAddress);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
this.splitContainer2.Size = new System.Drawing.Size(1022, 734);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 5;
//
// txtAddress
//
this.txtAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtAddress.Location = new System.Drawing.Point(3, 3);
this.txtAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtAddress.Name = "txtAddress";
this.txtAddress.Size = new System.Drawing.Size(1016, 23);
this.txtAddress.TabIndex = 7;
this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown);
//
// panel2
//
this.panel2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.panel2.Controls.Add(this.txtUserName);
this.panel2.Controls.Add(this.btnLoginAgain);
this.panel2.Controls.Add(this.chkCloseAfterLogin);
this.panel2.Controls.Add(this.label2);
this.panel2.Controls.Add(this.btnReload);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.btnStop);
this.panel2.Controls.Add(this.btnCopyPassword);
this.panel2.Controls.Add(this.txtPassWord);
this.panel2.Controls.Add(this.btnCopyUserName);
this.panel2.Location = new System.Drawing.Point(95, 398);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(376, 257);
this.panel2.TabIndex = 463;
this.panel2.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(73, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 17);
this.label1.TabIndex = 377;
this.label1.Text = "用户名";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(128, 58);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(285, 28);
this.label3.TabIndex = 464;
this.label3.Text = "请使用拼多多手机版扫码登录";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label3.Visible = false;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(28, 44);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(144, 17);
this.label4.TabIndex = 465;
this.label4.Text = "导入PDDAccessToken:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(31, 71);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(389, 108);
this.textBox1.TabIndex = 466;
//
// btnSaveCookie
//
this.btnSaveCookie.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSaveCookie.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSaveCookie.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveCookie.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveCookie.Location = new System.Drawing.Point(364, 185);
this.btnSaveCookie.Name = "btnSaveCookie";
this.btnSaveCookie.Size = new System.Drawing.Size(56, 25);
this.btnSaveCookie.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveCookie.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveCookie.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveCookie.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSaveCookie.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSaveCookie.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSaveCookie.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSaveCookie.Style.GradientAngle = 90;
this.btnSaveCookie.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveCookie.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSaveCookie.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSaveCookie.TabIndex = 470;
this.btnSaveCookie.Text = "保存";
this.btnSaveCookie.Click += new System.EventHandler(this.btnSaveCookie_Click);
//
// panel3
//
this.panel3.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.panel3.Controls.Add(this.textBox1);
this.panel3.Controls.Add(this.btnSaveCookie);
this.panel3.Controls.Add(this.label4);
this.panel3.Location = new System.Drawing.Point(51, 135);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(452, 241);
this.panel3.TabIndex = 471;
this.panel3.Visible = false;
//
// PddMobileLoginForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1024, 768);
this.Controls.Add(this.splitContainer2);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PddMobileLoginForm";
this.IsShowMaxBox = true;
this.Text = "店铺登录";
this.TitleText = "店铺登录";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ShopLoginForm_FormClosed);
this.Load += new System.EventHandler(this.ShopLoginForm_Load);
this.Controls.SetChildIndex(this.splitContainer2, 0);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel1.PerformLayout();
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private UserControls.ButtonEx btnStop;
private UserControls.ButtonEx btnReload;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.TextBox txtAddress;
private UserControls.ButtonEx btnLoginAgain;
public DevComponents.DotNetBar.Controls.CheckBoxX chkCloseAfterLogin;
public System.Windows.Forms.TextBox txtPassWord;
public System.Windows.Forms.TextBox txtUserName;
public System.Windows.Forms.Label label2;
public UserControls.ButtonEx btnCopyPassword;
public UserControls.ButtonEx btnCopyUserName;
private System.Windows.Forms.Panel panel2;
public System.Windows.Forms.Label label3;
public System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label4;
private DevComponents.DotNetBar.PanelEx btnSaveCookie;
private System.Windows.Forms.Panel panel3;
}
}
-616
View File
@@ -1,616 +0,0 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
//using TemuKJD.DashBoardForms;
using Microsoft.Win32;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
//using System.Web.Hosting;
using System.Windows.Forms;
using Work;
using Work._29Tools.CefTools;
namespace Work.BaseForms
{
public enum EnumOpenType
{
login,
manage,
refresh_cookie,
order_login,
}
// temu 一个登录账号下可以有多个店铺
public class ShopCompany
{
public string UserName { get; set; }
public string LoginName { get; set; }
public string AccountId { get; set; }
public string AccountName { get; set; }
public string LoginStatus { get; set; }
/// <summary>
/// 拼多多校验数据列表
/// </summary>
public string AntiContent { get; set; }
/// <summary>
/// 拼多多店铺信息
/// </summary>
public string MallId { get; set; }
/// <summary>
/// 微信小店开放Id信息
/// </summary>
public string openid { get; set; }
}
public partial class PddMobileLoginForm : BaseGeneralForm
{
public static PddMobileLoginForm PddMobileLoginInstance { get; set; } = null;
public int CloseAfterSecond { get; set; }
public EnumOpenType openType = EnumOpenType.manage;
public string InitUrl = "";
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 = null;
private BuyerLoginInfo buyer = null;
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
private string currentUrl = "";
public PddMobileLoginForm(BuyerLoginInfo buyerInfo)
{
PddMobileLoginInstance = this;
InitializeComponent();
this.buyer = buyerInfo;
this.txtUserName.Text = buyerInfo?.buyer_name;
this.txtPassWord.Text = ""; //DataOpenSSL.DecryptString(buyerInfo.Password);
}
private void ShopLoginForm_Load(object sender, EventArgs e)
{
//this.splitContainer1.SplitterDistance = this.splitContainer1.Height - 62;
if (openType == EnumOpenType.login)
{
this.label3.Visible = true;
this.panel3.Visible = true;
}
if (CloseAfterSecond > 0)
{
Task.Run(() =>
{
Thread.Sleep(1000 * CloseAfterSecond);
if (this.Created)
{
Invoke(new Action(() => { this.Close(); }));
}
});
}
AutoLogin();
CheckAndSaveShop(); //判断登录是否成功,成功则保存店铺信息和店铺cookie
//ClosePopWindow(); //自动关闭弹窗
}
/// <summary>
/// 判断登录,保存店铺
/// </summary>
private void CheckAndSaveShop()
{
}
/// <summary>
/// 自动关闭弹窗
/// </summary>
private void ClosePopWindow()
{
// 关闭弹窗
Task.Run(() =>
{
var sleepTime = 2500;
int i = 0;
while (true && i++ < 50)
{
try
{
Thread.Sleep(sleepTime);
var jsStr1 = "function ClosePopWindow(txt) {\r\n" +
" var result = 'no_pop'\r\n" +
" var item = document.getElementsByClassName(txt);\r\n" +
" for(i = 0; i < item.length; i++) {\r\n" +
" item[i].click();\r\n" +
" result = 'success'\r\n" +
" }\r\n" +
" return result;\r\n" +
"}\r\n" +
"ClosePopWindow('anticon-close-circle');\r\n" +
"ClosePopWindow('ant-modal-close-x');\r\n";
var jsStr2 = "function clickPopWindow(txt) {\r\n"
+ "var child = document.body.firstElementChild;\r\n"
+ "var element1 = null;\r\n"
+ " while (child) {\r\n"
+ " if (child.innerHTML.indexOf(txt) >= 0) {\r\n"
+ " element1 = child;\r\n"
+ " if (child.firstElementChild) {\r\n"
+ " child = child.firstElementChild; continue;\r\n"
+ " } else break;\r\n"
+ " }\r\n"
+ " child = child.nextElementSibling;\r\n"
+ " }\r\n"
+ " if (element1) {\r\n"
+ " element1.click(); return 'success';\r\n"
+ " } else return 'no_pop';\r\n"
+ "}\r\n"
+ "clickPopWindow('我知道了');\r\n"
+ "clickPopWindow('知道了');\r\n";
if (cefWebBrowser != null && cefWebBrowser.IsBrowserInitialized)
{
var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr1);
t1.Wait();
var t2 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr2);
t2.Wait();
if (t1.Result?.Result?.ToString() == "success" || t2.Result?.Result?.ToString() == "success")
sleepTime = Randomx.GetId(550, 650);
else
sleepTime = Randomx.GetId(1500, 2000);
}
}
catch (Exception ex) { }
}
});
}
/// <summary>
/// 自动登录店铺后台
/// </summary>
private void AutoLogin()
{
if (openType != EnumOpenType.login && buyer == null)
return;
if (cefWebBrowser == null)
{
//cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser("about:blank", false);
if (!string.IsNullOrEmpty(InitUrl))
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
else
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, false);
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
var lifeSapnHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow);
cefWebBrowser.LifeSpanHandler = lifeSapnHandler;
cefWebBrowser.KeyboardHandler = new KeyboardHandler();
cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
cefWebBrowser.LoadError += CefWebBrowser_LoadError;
cefWebBrowser.Dock = DockStyle.Fill;
//js绑定C#对象
//PDDShopBrowserObject shopObj = new PDDShopBrowserObject();
//shopObj.OnInfoReceived += ShopObj_OnInfoReceived;
//CefSharpSettings.WcfEnabled = true;
//cefWebBrowser.JavascriptObjectRepository.Register(
// name: "shopObj",
// objectToBind: shopObj,
// isAsync: false,
// options: new BindingOptions { Binder = BindingOptions.DefaultBinder.Binder /*CamelCaseJavascriptNames = false*/ /*cef79*/ }
//);
//if (buyer.cookie == null)
// buyer.cookie = "";
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(() =>
{
Invoke(new Action(() =>
{
splitContainer1.Panel1.Controls.Add(cefWebBrowser);
//cefWebBrowser.Load(shopMainUrl);
}));
// cef138必须init后方可设置或删除cookie
while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
Thread.Sleep(20);
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
//if (cookieLst.Any(c => c.Value.StartsWith("windows_1")))
// cefWebBrowser.ExecuteScriptAsync("navigator.__defineGetter__('userAgent', function() { return 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36 PddWorkbench-Online PddBrowser pdd_windows_version/3.0.3.12'; });");
//cef 138 如果没有设置RequestContext 可能为空,直接getCookieManager
//if (this.openType != EnumOpenType.login)
{
var t = CEFBrowser.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);
//if (cook.Name == "PDDAccessToken")
//{
// var jsStr = "var date = new Date();" +
// "date.setTime(date.getTime() + (465 * 24 * 60 * 60 * 1000)); " +
// "document.cookie='PDDAccessToken=" + cook.Value + ";domain=mobile.yangkeduo.com; expires=' + date.toUTCString()";
// jsStr = "document.cookie='PDDAccessToken=" + cook.Value + ";domain=mobile.yangkeduo.com;'";
// cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
// //cook.Expires = DateTime.Now.AddDays(465);
// //cefWebBrowser.GetCookieManager(null).SetCookie("https://" + cook.Domain.Trim('.'), cook);
//}
////else
//// cefWebBrowser.GetCookieManager(null).SetCookie("https://" + cook.Domain, cook);
}
}
//根据登录的具体店铺设置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)
{
Invoke(new Action(() =>
{
chkCloseAfterLogin.Visible = false;
btnLoginAgain.Visible = false;
}));
return;
}
for (int i = 0; i < 50; i++)
{
if (cefWebBrowser.IsLoading)
Thread.Sleep(100);
}
Thread.Sleep(Randomx.GetId(1500,2000));
if (!this.Created)
return;
while (!cefWebBrowser.Address.StartsWith(shopLoginUrl))
{
Thread.Sleep(1000);
if (!this.Created)
return;
}
//CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
//InputUserNameAndPassword(cefWebBrowser, shop.LoginName, DataOpenSSL.DecryptString(shop.Password));
});
}
}
private void ShopObj_OnInfoReceived(string information)
{
//BaseMsgForm.ShowInfo(information);
if (!string.IsNullOrEmpty(information))
cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync("alert('" + information + "');");
}
private void CefWebBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e)
{
}
private void CefWebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e)
{
if (this.Created && !this.Disposing && !this.IsDisposed)
{
Invoke(new Action(() =>
{
currentUrl = e.Address;
txtAddress.Text = e.Address;
}));
}
}
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());
}
//public Func<object, string, string, request, bool> BeforeResourceLoadEvent; // sender, requestUrl, postData, request, true(表示取消执行)
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
{
return false;
}
static int GetAntiContentsTimes = 40;
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
{
//if (url.Contains("https://mobile.yangkeduo.com/personal.html?refer_page_name=login") && openType == EnumOpenType.login)
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 = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.GetCookieManager(null));
var buyerUrl = BaseClass.BuildPDDObjString("user/add_buyer");
if (this.buyer == null || this.buyer.buyer_id != uid)
this.buyer = GlobalConfig.BuyerLoginList.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.BuildPDDObjString("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.BuildPDDObjString("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);
Invoke(new Action(() =>
{
try
{
if (chkCloseAfterLogin.Checked)
this.Close();
}
catch (Exception ex)
{ }
}));
}
}
});
}
}
}
// 鼠标左键按下,移动,移动...左键抬起。
public static void CefMouseDragDou(ChromiumWebBrowser webBrowser, int x1, int y1, int x2, int y2)
{
Thread.Sleep(100);
var host = webBrowser.GetBrowser().GetHost();
var rx = -6 + Randomx.GetId(13);
x2 = x2 + rx;
// 随机按下点的位置(正负6像素),提高仿真性
int x = x1 + rx;
int y = y1 - 6 + Randomx.GetId(13);
// 按下鼠标左键
host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None);
Thread.Sleep(100 + Randomx.GetId(300));
// 滑动光标
int times = -20;
while (x < x2 + 4 - Randomx.GetId(9))
{
times++;
x += (15 + Randomx.GetId(15)) / 8;
if (times % 5 == 0)
y = y - 1 + Randomx.GetId(3);
Thread.Sleep(6 + Math.Abs(times) / 5 + Randomx.GetId(16));
host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton);
}
if (x < x2 - 1)
while (x < x2)
{
times++;
x += (8 + Randomx.GetId(8)) / 8;
if (times % 5 == 0)
y = y - 1 + Randomx.GetId(3);
Thread.Sleep(6 + Math.Abs(times) / 5 + Randomx.GetId(16));
host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton);
}
else if (x > x2 + 1)
while (x > x2)
{
times++;
x -= (8 + Randomx.GetId(8)) / 8;
if (times % 5 == 0)
y = y - 1 + Randomx.GetId(3);
Thread.Sleep(6 + Math.Abs(times) / 5 + Randomx.GetId(16));
host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton);
}
// 如果最后位置偏差较多,再做一次调整
x = x2 - 1 + Randomx.GetId(3);
x = x2;
Thread.Sleep(18 + Math.Abs(times) / 5 + Randomx.GetId(16));
Thread.Sleep(18 + Math.Abs(times) / 5 + Randomx.GetId(16));
host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton);
// 抬起鼠标左键
Thread.Sleep(300 + Randomx.GetId(500));
host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None);
host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None);
}
private void btnStop_Click(object sender, EventArgs e)
{
}
private void btnCopyUserName_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtUserName.Text))
Clipboard.SetDataObject(txtUserName.Text);
}
private void btnCopyPassword_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtPassWord.Text))
Clipboard.SetDataObject(txtPassWord.Text);
}
private void btnReload_Click(object sender, EventArgs e)
{
if (cefWebBrowser != null)
{
if (txtAddress.Text != "about:blank")
cefWebBrowser.Load(txtAddress.Text);
else
cefWebBrowser.Load(shopMainUrl);
}
}
private void ShopLoginForm_FormClosed(object sender, FormClosedEventArgs e)
{
//OnSaveComplete(shop);
Task.Run(() => {
Thread.Sleep(500);
if (!this.Disposing && !this.IsDisposed)
{
//MainForm.instance.Invoke(new Action(() => { this.Dispose(); }));
}
});
}
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (cefWebBrowser != null)
{
cefWebBrowser.Load(txtAddress.Text);
}
}
}
string sInputValueChange { get; set; } = @"
let usernameId = document.getElementById('usernameId');
usernameId.value = '1';
var event = document.createEvent('HTMLEvents');
event.initEvent('input', true, true);
event.eventType = 'message';
usernameId.dispatchEvent(event);
";
string sInputValueChange2 { get; set; } = @"
function changeReactInputValue(inputDom,newText){
let lastValue = inputDom.value;
inputDom.value = newText;
let event = new Event('input', { bubbles: true });
event.simulated = true;
let tracker = inputDom._valueTracker;
if (tracker) {
tracker.setValue(lastValue);
}
inputDom.dispatchEvent(event);
}
";
string sGetElementWithText { get; set; } = @"
function getElementWithText(sText)
{
var elem=null;
const elements = document.querySelectorAll('*'); // 选择所有元素
elements.forEach(element => {
if (element.textContent.includes(sText)) {
// 对每个匹配的元素执行操作
//console.log(element);
elem=element;
}
});
return elem;
};
";
private void btnLoginAgain_Click(object sender, EventArgs e)
{
if (this.currentUrl != shopLoginUrl)
this.cefWebBrowser.Load(shopLoginUrl);
}
private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
{
}
private void btnSaveCookie_Click(object sender, EventArgs e)
{
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 = textBox1.Text.Trim();
if (this.cefWebBrowser != null)
{
var t = CEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(new List<Cookie> { cookie }), cefWebBrowser.GetCookieManager(null));
t.Wait(2000);
cefWebBrowser.Load("https://mobile.yangkeduo.com/personal.html");
}
}
}
}
-298
View File
@@ -1,298 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAgIAQYAAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AAAAAAAAAAAAAAAAABEZmbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZmZkQAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAZszMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMxmAAAAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMxkAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzGQAAAAAAAAAAAAAAAAAAAbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMYAAAAAAAAAAAAAAAAARszMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAABszMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAbMzMzMzMzMzMzMzMzM
zMzMzMzMzMx3d4iIiIiIiIh3fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAABszMzMzMzMzMzM
zMzMzMzMzMzHeIiIiIj/////////iIiIiId8zMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAGzMzMzMzM
zMzMzMzMzMzMzMeIiI/////////////////////4iIh8zMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAATMzM
zMzMzMzMzMzMzMzMzHiI////////////////////////////iIfMzMzMzMzMzMzMzMzMzMzMxAAAAAAA
AGzMzMzMzMzMzMzMzMzMx3iP///////////////////////////////4iHzMzMzMzMzMzMzMzMzMzMYA
AAAAAAbMzMzMzMzMzMzMzMzMx3iP//////////////////////////////////+IfMzMzMzMzMzMzMzM
zMzMYAAAAABMzMzMzMzMzMzMzMzMx3iP/////////////////////////////////////4h8zMzMzMzM
zMzMzMzMzMQAAAAAbMzMzMzMzMzMzMzMzHiP////////////////////////////////////////h3zM
zMzMzMzMzMzMzMzGAAAABMzMzMzMzMzMzMzMzHiP////////////////////////////////////////
//iHzMzMzMzMzMzMzMzMzEAAAAbMzMzMzMzMzMzMzMeI////////////////////////////////////
////////+IfMzMzMzMzMzMzMzMxgAABMzMzMzMzMzMzMzMx4////////////////////////////////
//////////////+IfMzMzMzMzMzMzMzMxAAAbMzMzMzMzMzMzMzHj///////////////////////////
/////////////////////4fMzMzMzMzMzMzMzMYAAMzMzMzMzMzMzMzMeP//////////////////////
///////////////////////////4fMzMzMzMzMzMzMzMAAbMzMzMzMzMzMzMx4//////////////////
/////////////////////////////////4fMzMzMzMzMzMzMzGAGzMzMzMzMzMzMzHj/////////////
///////////////////////////////////////4fMzMzMzMzMzMzMxgDMzMzMzMzMzMzMyI////////
/////////////////////////////////////////////4zMzMzMzMzMzMzMwEzMzMzMzMzMzMzHj///
//////////////////////////////////////////////////+HzMzMzMzMzMzMzMRszMzMzMzMzMzM
eP//////////////////////////////////////////////////////+HzMzMzMzMzMzMzGbMzMzMzM
zMzMzHj///////////////////////////////////////////////////////+MzMzMzMzMzMzMxmzM
zMzMzMzMzMyP////+IiP////////////////////////////////////////+I//////h8zMzMzMzMzM
zMZszMzMzMzMzMzHj////4iIiI//////////////////////////////////////+IiIj/////jMzMzM
zMzMzMzGbMzMzMzMzMzMyP////iIiIiI/////////////////////////////////////4iIiIj////4
fMzMzMzMzMzMxszMzMzMzMzMzHj////4iIiIiP////////////////////////////////////+IiIiI
j////4zMzMzMzMzMzMbMzMzMzMzMzMx4////iIiIiIj////////////////////////////////////4
iIiIiI////+HzMzMzMzMzMzMzMzMzMzMzMzMj////4iIiIiI//////////////+IiP//iI//////////
////+IiIiIiP////h8zMzMzMzMzMzMzMzMzMzMzMzI/////4iIiIiP/////////////4d3eIiIeIj///
//////////+IiIiIj/////jMzMzMzMzMzMzMzMzMzMzMzMyP////+IiIiIj/////////////iIiId3eI
iI//////////////iIiIiI/////4zMzMzMzMzMzMzMzMzMzMzMzHj/////+IiIiP/////////////4//
/4d4j/+P//////////////iIiIj/////+MzMzMzMzMzMzMzMzMzMzMzMx4//////+IiP////////////
///////4j///////////////////iIiP//////jMzMzMzMzMzMzMzMzMzMzMzMeP//////////+IiIj/
///////////////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzH//////////+H
fMx8eP//////////////////////////iId3iP//////////+HzMzMzMzMzMzMzMzMzMzMzMyP//////
///4fMzHh8eP////////////////////////+MzMzMd4//////////h8zMzMzMzMzMzMzMzMzMzMzMf/
////////+MzMePjMeP///////////////////////4zMzMeHx4/////////4fMzMzMzMzMzMzMzMzMzM
zMzH/////////4fMd3eHzMeP//////////////////////iMzMzIiHx4////////+HzMzMzMzMzMzMzM
zMzMzMzMx/////////+Hx4iIfMzMj//////////////////////4h3d8x4h8yP////////jMzMzMzMzM
zMzMzMzMzMzMzMeP////////+HiP+IfMzI//////////////////////+HiIiHd3zHj////////4zMzM
zMzMzMzMzMzMzMzMzMzHj/////////h4//+HzMeP//////////////////////h4//h8zMyP////////
+MzMzMzMzMzMzMzMzMzMzMzMzI/////////4iP//h8x4///////////////////////4j//4fMzHj///
//////jMzMzMzMzMzMzMzMzMzMzMzMyP///////4iIiP+IfHj///////////////////////+Ij/+HzM
eP/////////4zMzMzMzMzMzMzMzMzMzMzMzMj///////iIiIiIh3eP////////////////////////+I
j4h8x3iI////////h8zMzMzMzMzMzMzMzMzMzMzMzH//////+Hj///iIiI//////////////////////
/////4iId4iIiIj//////4zMzMzMzMzMzMzMzMzMzMzMzMx4//////iP////iP//////////////////
/////////////4iP//iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMyP//////////+I//////////////
///////////////////4eP//iP//////jMzMzMzMzMzMzMzMzMzMzMzMzMj///////////iP////////
/////////////////////////4j/////////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj///////////////
//////////////////////////////+I//////////jMzMzMzMzMzMzMzMzMzMzMzMzMzI//////////
//////////////////////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMyP////
////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM
eP///////////////////////////////////////////////////////4zMzMzMzMzMzMzMzMzMzMzM
zMzMzMj///////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzM
zMzMzMzMzMzHj//////////////////////////////////////////////////////4zMzMzMzMzMzM
zMzMzMzMzMzMzMzMzI//////////////////////////////////////////////////////h8zMzMzM
zMzMzMzMzMzMzMzMzMzMzMx4////////////////////////////////////////////////////+HzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMyI////+I////////////////////////////////////////////
//h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+Ij/////////////////////////////////////
//////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+IiIiIj//////////////////////////4
////iI/////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMiP/////4iIiP//////////////////////
////+IiIiIj/////iHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP//////////////////////////
///////////4iIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////////////
//////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP//////////////
//////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////
///////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////
////////////////////////////////////////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI
j/////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMeP//////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMx4////////+I//////////////////////////////////////jMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMeP///////4iIj///////////////////////////iP///////4fMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMx4////////iIiIiP///////////////////////4iIiP///////4zMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIj///////+HzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIj////////////////////4iIiIiIj///////
+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIiI//
//////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiP////////////////////iIiI
iIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiIj/////iIiIiIiIj/////
/4iIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiI/////4zMzMzMzM
j/////+IiIiIiIiP//////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//////+IiIiIiIj/////+MzM
zMzMzI//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iIiIiIiI////
//jMzMzMzMyP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP///////4iIiIiI
iP/////4zMzMzMzMj//////4iIiIiIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iI
iIiIiI//////+MzMzMzMzI//////+IiIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMyP////
///4iIiIiIiP//////fMzMzMzMyP//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzH
j///////+IiIiIiI//////+HzMzMzMzMeP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzM
zMzMyP////////iIiIiIiP//////jMzMzMzMzHj///////iIiIiIiI///////4fMzMzMzMzMzMzMzMzM
zMzMzMzMzMj///////+IiIiIiI///////4zMzMzMzMzI///////4iIiIiIiI///////3zMzMzMzMzMzM
zMzMzMzMzMzMzMzI////////iIiIiIiP//////+MzMzMzMzMyP//////+IiIiIiIiP//////+MzMzMzM
zMzMzMzMzMzMzMzMzMzMeP///////4iIiIiIj///////jMzMzMzMzMj///////+IiIiIiIj///////jM
zMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiIiP//////+HzMzMzMzMzHj///////iIiIiIiI////
///4zMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIiI////////jMzMzMzMzMzI///////4iIiIiI
iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMzMj////////4iIiIiP///////4zMzMzMzMzMyP///////4
iIiIiIiP//////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiI////////h8zMzMzMzMzMeP//
/////4iIiIiIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIj////////4fMzMzMzMzM
zHj///////+IiIiIiI//////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////iIiP////////+MzMzM
zMzMzMzI////////+IiIiIiP//////h8zMzMzMzMzMzMxmzMzMzMzMzMx4/////////4iP/////////4
fMzMzMzMzMzMx4////////+IiIiIj//////4fMzMzMzMzMzMzMZszMzMzMzMzMeP////////////////
////+MzMzMzMzMzMzMyP////////iIiIiP//////+HzMzMzMzMzMzMzGbMzMzMzMzMzH////////////
//////////fMzMzMzMzMzMzMeP////////iIiIj///////98zMzMzMzMzMzMxmzMzMzMzMzMyP//////
//////////////+HzMzMzMzMzMzMzHj/////////+IiP////////jMzMzMzMzMzMzMZszMzMzMzMzMj/
////////////////////jMzMzMzMzMzMzMzIj////////////////////4zMzMzMzMzMzMzGTMzMzMzM
zMzH////////////////////+HzMzMzMzMzMzMzMx4////////////////////+MzMzMzMzMzMzMxAzM
zMzMzMzMx/////////////////////jMzMzMzMzMzMzMzMyI///////////////////4fMzMzMzMzMzM
zMAGzMzMzMzMzMeP//////////////////+HzMzMzMzMzMzMzMzMeP//////////////////+HzMzMzM
zMzMzMxgBszMzMzMzMzHj//////////////////4fMzMzMzMzMzMzMzMzMeP//////////////////h8
zMzMzMzMzMzMYADMzMzMzMzMzI//////////////////+HzMzMzMzMzMzMzMzMzHj///////////////
///4zMzMzMzMzMzMzAAAbMzMzMzMzMyP/////////////////4fMzMzMzMzMzMzMzMzMzHj/////////
////////+MzMzMzMzMzMzMYAAEzMzMzMzMzMj/////////////////+MzMzMzMzMzMzMzMzMzMzIj///
/////////////4fMzMzMzMzMzMzEAAAGzMzMzMzMzHj////////////////4fMzMzMzMzMzMzMzMzMzM
x4////////////////+MzMzMzMzMzMzMYAAABMzMzMzMzMx4////////////////h8zMzMzMzMzMzMzM
zMzMzMx4///////////////4fMzMzMzMzMzMzEAAAABszMzMzMzMx4//////////////+HzMzMzMzMzM
zMzMzMzMzMzMx4//////////////+MzMzMzMzMzMzMYAAAAATMzMzMzMzMyP/////////////4fMzMzM
zMzMzMzMzMzMzMzMzMeI/////////////4fMzMzMzMzMzMzEAAAAAAbMzMzMzMzMeP////////////h8
zMzMzMzMzMzMzMzMzMzMzMzMeI////////////h8zMzMzMzMzMzMYAAAAAAAbMzMzMzMzMeP////////
//iHzMzMzMzMzMzMzMzMzMzMzMzMzMyI//////////+HzMzMzMzMzMzMxgAAAAAAAEzMzMzMzMzMeP//
//////iHfMzMzMzMzMzMzMzMzMzMzMzMzMzMx4/////////4fMzMzMzMzMzMzMQAAAAAAAAGzMzMzMzM
zMeI//////iHfMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4j//////4h8zMzMzMzMzMzMxgAAAAAAAAAGzM
zMzMzMzMx4iIiIiHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiIj/+Ih3zMzMzMzMzMzMzGAAAAAAAA
AAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx3iId8zMzMzMzMzMzMzMYAAA
AAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
xgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzGAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzGQAAAAAAAAAAAAAAAAAbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMYAAAAAAAAAAAAAAAAAAARszMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAABGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAAAABmzMzMzMzMzMzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGZmzMzMzMzMzMzMzM
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZmZEAAAAAAAAAAAAAAAAD////+AAAAAAAAAAD/////////AAAA
AAAAAAAAAP//////+AAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAB/////+AAAAAAAAAAAAAAAH////+
AAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAD////AAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAA
B///wAAAAAAAAAAAAAAAAAP//4AAAAAAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAAAAP/+AAAAAAAAAAAA
AAAAAAB//gAAAAAAAAAAAAAAAAAAf/wAAAAAAAAAAAAAAAAAAD/4AAAAAAAAAAAAAAAAAAAf+AAAAAAA
AAAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAP4AAAAAAAAAAAAAAAAAAAB+AA
AAAAAAAAAAAAAAAAAAfAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAA
AAOAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAA
AAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAABAAAAAAAA
AAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAA
AAGAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAA
AAAAAAABgAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAADwAAAAAAA
AAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAD/AA
AAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAf+AAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAA
AD/+AAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAP//gAAAAAAAAAAA
AAAAAAH//8AAAAAAAAAAAAAAAAAD///gAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAA////wAAAAA
AAAAAAAAAAA////+AAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAf/////
+AAAAAAAAAAAAAAf//////8AAAAAAAAAAAAA/////////gAAAAAAAAAAf////w==
</value>
</data>
</root>
+11 -1
View File
@@ -19,7 +19,7 @@ namespace Work.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -160,6 +160,16 @@ namespace Work.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap loading_blue {
get {
object obj = ResourceManager.GetObject("loading_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
+3
View File
@@ -199,4 +199,7 @@
<data name="weixin_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\weixin_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="loading_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\loading_blue.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

+1
View File
@@ -132,6 +132,7 @@ namespace Work
BaseClass.GroupId = BaseRegex.GetStringJson(ref html, "group_id").ParseToInt();
//BaseClass.AuthorizedAmount = BaseRegex.GetNullableDecimalJson(ref html, "authorized_amount");
BaseClass.Points = BaseRegex.GetStringJson(ref html, "points").ParseToInt();
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
BaseClass.ShopPointsPerMonth = BaseRegex.GetStringJson(ref html, "shop_points_per_month").ParseToInt();
if (BaseClass.GroupId != 3 && BaseClass.GroupId != 4 && BaseClass.GroupId != 9 && BaseClass.GroupId != 10 && BaseClass.GroupId != 11)
+157 -40
View File
@@ -4,6 +4,7 @@ using AllBase.Model;
using AllBase.Model.Local;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.DevTools.IO;
using CefSharp.WinForms;
using DevComponents.WinForms.Drawing;
@@ -21,6 +22,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -37,6 +39,7 @@ namespace TemuKJD.ToolForms
public partial class PddMobileBuyOrderForm : BaseGeneralForm
{
public bool IsAutoBuy { get; set; } = true;
public bool IsFormLoad { get; set; } = false;
public int CloseAfterSecond { get; set; }
public string InitUrl = "";
@@ -70,12 +73,18 @@ namespace TemuKJD.ToolForms
filterOrderAction = filterOrder;
}
private void ShopLoginForm_Load(object sender, EventArgs e)
private void PddBuyOrderForm_Load(object sender, EventArgs e)
{
//splitContainer1.Dock = DockStyle.Fill;
this.Height = SystemInformation.WorkingArea.Height - 80;
this.CenterToScreen();
//splitContainer1.Dock = DockStyle.Fill;
chkAutoChangeWarehouseAddress.Checked = GlobalConfig.BuyConfig.IsAutoChangeWarehouseAddress;
chkUseAppBalance.Checked = GlobalConfig.BuyConfig.IsUseAppBalance;
//chkUseAppBalance.Checked = false;
//chkUseAppBalance.Visible = false;
//GlobalConfig.BuyConfig.IsUseAppBalance = false;
if (CloseAfterSecond > 0)
{
@@ -133,6 +142,7 @@ namespace TemuKJD.ToolForms
LoadCef();
}));
});
IsFormLoad = true;
}
private void Rb_CheckedChanged(object sender, EventArgs e)
@@ -251,14 +261,14 @@ namespace TemuKJD.ToolForms
//public Func<object, string, string, request, bool> BeforeResourceLoadEvent; // sender, requestUrl, postData, request, true(表示取消执行)
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
{
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/origenes/address_info") && chkChangeWarehouseAddress.Checked && transitWarehouse != null)
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/origenes/address_info") && chkAutoChangeWarehouseAddress.Checked && transitWarehouse != null)
{
//var address = BaseRegex.GetStringJson(ref postData, "address");
JObject jObj = JsonHelper.JObjectParse(postData);
jObj["province_id"] = transitWarehouse.province_id;
jObj["city_id"] = transitWarehouse.city_id;
jObj["district_id"] = transitWarehouse.district_id;
jObj["address"] = transitWarehouse.TransDetailAddress + Randomx.GetId(1, 35) + Randomx.GetId(1, 9).ToString().PadLeft(2, '0') + "室";
jObj["address"] = transitWarehouse.TransDetailAddress + Randomx.GetId(1, 35) + Randomx.GetId(1, 9).ToString().PadLeft(2, '0') + "室" + txtSourceCode.Text;
jObj["mobile"] = WaybillHelper.MobileHead[Randomx.GetId(WaybillHelper.MobileHead.Count)] + Randomx.GetNumber(8);
jObj["name"] = WaybillHelper.LastName[Randomx.GetId(WaybillHelper.LastName.Count)] + (Randomx.GetId(2) == 1 ? "先生" : "女士");
postData = JsonHelper.SerializeObject(jObj);
@@ -402,6 +412,16 @@ namespace TemuKJD.ToolForms
{
IsChangeAddress = true;
Thread.Sleep(1000);
var sourceCodeRst = GetSourceCode(transit);
if (sourceCodeRst.Contains("失败"))
{
Invoke(new Action(() =>
{
this.cefWebBrowser.Visible = false;
BaseMsgForm.ShowError(sourceCodeRst);
}));
return;
}
ChangeAddress(transit);
IsChangeAddress = false;
@@ -438,6 +458,32 @@ namespace TemuKJD.ToolForms
}
}
/// <summary>
/// 获取溯源码
/// </summary>
/// <returns></returns>
public string GetSourceCode(TransitWarehouseParam transit)
{
JObject body = new JObject();
body["province"] = transit.province_name;
body["city"] = transit.city_name;
body["warehouseCode"] = transit.TransId;
body["matchType"] = 1;
var url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/getRandomTraceCode";
var dataStr = JsonHelper.SerializeObject(body);
var sourceCodeRst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
var randomCode = BaseRegex.GetStringXml(ref sourceCodeRst, "randomCode");
if (!string.IsNullOrEmpty(randomCode))
{
Invoke(new Action(() => { txtSourceCode.Text = randomCode; }));
return randomCode;
}
else
{
return "获取失败,请关闭拍单窗口重试 " + BaseRegex.GetStringXml(ref sourceCodeRst, "msg", sourceCodeRst);
}
}
bool IsChangeAddress = false;
bool HasChangeAddress = false;
/// <summary>
@@ -674,8 +720,40 @@ namespace TemuKJD.ToolForms
}
private void btnManualUpdateBuyOrder_Click(object sender, EventArgs e)
private async void btnManualUpdateBuyOrder_Click(object sender, EventArgs e)
{
if (txtSourceCode.Text.Trim().Length != 6)
{
BaseMsgForm.ShowError("溯源码长度错误!");
return;
}
var client = cefWebBrowser.GetDevToolsClient();
if (client == null)
{
BaseMsgForm.ShowError("页面未加载!");
return;
}
var sourceCode = txtSourceCode.Text.Trim();
var jsStr1 = @"(function() { var elements = document.getElementsByTagName('div');
for (i = elements.length - 1; i >= 0; i--){
var element = elements[i];
if (element.innerHTML.indexOf('" + sourceCode + @"') >= 0) {
return 'success';
}
}
return '';
})();";
var ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
await ts1;
// 付款页面没法匹配,暂时注释
//if (ts1.Result?.Result?.Value.ParseToString() != "success")
//{
// BaseMsgForm.ShowError("溯源码不匹配!");
// return;
//}
if (string.IsNullOrEmpty(txtBuyTransitWarehouse.Text.Trim()))
{
BaseMsgForm.ShowError("缺少中转地址,请重新绑定商品并选择仓库地址");
@@ -705,12 +783,18 @@ namespace TemuKJD.ToolForms
body["orderSkuId"] = orderItem.sku_id;
body["outOrderNo"] = txtBuyOrderId.Text.Trim();
body["outAmount"] = (txtBuyPrice.Text.ParseToDecimal() * 100).ParseToInt() + "";
body["buyerAccount"] = buyer.buyer_nick;
body["purchaserNote"] = BaseClass.NickName;
body["buyerAccount"] = buyer.buyer_nick; // 买手昵称
body["purchaserNote"] = BaseClass.NickName; // 购买软件账户备注
body["express1Company"] = ""; // 物流公司编号
body["express1Waybill"] = ""; // 物流编号
body["platform"] = transit.TransId; // 中转仓ID
body["orderPlatformCode"] = "WEISHOP";
body["randomCode"] = txtSourceCode.Text.Trim();
if (GlobalConfig.BuyConfig.IsUseAppBalance)
{
body["userName"] = BaseClass.UserName; // 软件端用户名
body["purchaserNote"] = BaseClass.UserName + "-" + BaseClass.NickName; // 购买软件账户备注
}
var url = "https://po.e57.cn/prod-api/api/oms-api/externalProcurement/saveOrUpdate";
var dataStr = JsonHelper.SerializeObject(body);
//dataStr = "{\"orderNo\":\"3737339733954942720\",\"outOrderNo\":\"2606846854564\",\"buyerAccount\":\"测试\",\"outAmount\":\"2000\",\"purchaserNote\":\"测试\",\"express1Company\":\"\"" +
@@ -733,11 +817,20 @@ namespace TemuKJD.ToolForms
{
msg = exportRst.ParseToString();
}
BaseMsgForm.ShowError("接收到erp服务端传递的错误消息:" + msg, "拍单信息保存失败");
BaseMsgForm.ShowError("拍单保存失败,服务端返回 " + msg, "拍单信息保存失败");
btnManualUpdateBuyOrder.Enabled = true;
return;
}
url = BaseClass.Build29WxObjString("user/get_all_user");
var data = UserLogin.GetSignaturex();
data += "&search_user_name=" + BaseClass.UserName;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (html.Contains("\"code\":200"))
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
orderItem.ItemTransitOrders.Insert(0, new oms_wei_external_procurement_log()
{
buyer_account = buyer.buyer_nick,
@@ -746,7 +839,7 @@ namespace TemuKJD.ToolForms
order_sku_id = orderItem.sku_id,
out_amount = (txtBuyPrice.Text.ParseToDecimal() * 100).ParseToInt(),
out_order_no = txtBuyOrderId.Text.Trim(),
purchaser_note = BaseClass.NickName,
purchaser_note = body["purchaserNote"].ParseToString(),
});
// 利润计算重置为最小值,控件Resource更新时将计算利润
orderItem.ProfitCount = decimal.MinValue;
@@ -757,38 +850,38 @@ namespace TemuKJD.ToolForms
filterOrderAction(order, true);
}
// 提前取号
if (DateTime.Now.Date > BaseClass.StampToDateTime(order.create_time).Date)
{
JObject data = new JObject();
data["outOrderNo"] = txtBuyOrderId.Text.Trim();
data["warehouseCode"] = transit.TransId; // 中转仓仓库对应编码
//data["warehouseCode"] = txtBuyOrderId.Text.Trim(); // 中转仓仓库对应编码
data["platform"] = "WEISHOP";
var getVirtualTicketUrl = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/order/virtual/create";
var getVirtualTicketDataStr = JsonHelper.SerializeObject(data);
//// 前一天的订单直接提前取号
//if (DateTime.Now.Date > BaseClass.StampToDateTime(order.create_time).Date)
//{
// JObject data = new JObject();
// data["outOrderNo"] = txtBuyOrderId.Text.Trim();
// data["warehouseCode"] = transit.TransId; // 中转仓仓库对应编码 XDYSZC XDYYWC ...
// //data["warehouseCode"] = txtBuyOrderId.Text.Trim(); // 中转仓仓库对应编码
// data["platform"] = "WEISHOP";
// var getVirtualTicketUrl = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/order/virtual/create";
// var getVirtualTicketDataStr = JsonHelper.SerializeObject(data);
var getVirtualTicketRst = HttpResponseWXBLL.e57PostResponse(getVirtualTicketUrl, getVirtualTicketDataStr, "");
if (!getVirtualTicketRst.ParseToString().Contains("<code>200</code>") && !getVirtualTicketRst.ParseToString().Contains("<code>0</code>"))
{
string msg = "";
string code = "";
try
{
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.LoadXml(getVirtualTicketRst);
code = xmlDoc["AjaxResult"]["code"].InnerText;
msg = xmlDoc["AjaxResult"]["msg"].InnerText;
}
catch
{
msg = getVirtualTicketRst.ParseToString();
}
BaseMsgForm.ShowError("拍单信息保存成功,接收到erp服务端传递的错误消息:" + msg, "订单提前取号失败");
btnManualUpdateBuyOrder.Enabled = true;
return;
}
}
// var getVirtualTicketRst = HttpResponseWXBLL.e57PostResponse(getVirtualTicketUrl, getVirtualTicketDataStr, "");
// if (!getVirtualTicketRst.ParseToString().Contains("<code>200</code>") && !getVirtualTicketRst.ParseToString().Contains("<code>0</code>"))
// {
// string msg = "";
// string code = "";
// try
// {
// System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
// xmlDoc.LoadXml(getVirtualTicketRst);
// code = xmlDoc["AjaxResult"]["code"].InnerText;
// msg = xmlDoc["AjaxResult"]["msg"].InnerText;
// }
// catch
// {
// msg = getVirtualTicketRst.ParseToString();
// }
// BaseMsgForm.ShowError("拍单信息保存成功,接收到服务端传递的错误消息:" + msg, "订单提前取号失败");
// btnManualUpdateBuyOrder.Enabled = true;
// return;
// }
//}
BaseMsgForm.ShowInfo("拍单信息保存成功");
this.Close();
@@ -814,7 +907,31 @@ namespace TemuKJD.ToolForms
private void btnReMap_Click(object sender, EventArgs e)
{
transitWarehouse = null;
pnlMap.Visible = true;
}
private void cmbTransitWarehouse_SelectedIndexChanged(object sender, EventArgs e)
{
transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransName + " " + t.TransDetailAddress == cmbTransitWarehouse.Text);
}
private void chkAutoChangeWarehouseAddress_CheckedChanged(object sender, EventArgs e)
{
if (IsFormLoad)
{
GlobalConfig.BuyConfig.IsAutoChangeWarehouseAddress = chkAutoChangeWarehouseAddress.Checked;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("buy_config_260708", GlobalConfig.BuyConfig);
}
}
private void chkUseAppBalance_CheckedChanged(object sender, EventArgs e)
{
if (IsFormLoad)
{
GlobalConfig.BuyConfig.IsUseAppBalance = chkUseAppBalance.Checked;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("buy_config_260708", GlobalConfig.BuyConfig);
}
}
}
}
+58 -15
View File
@@ -83,6 +83,7 @@
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.chkUseAppBalance = new Work.UserComponents.UcCheckBox(this.components);
this.txtShopName = new System.Windows.Forms.TextBox();
this.label27 = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
@@ -92,8 +93,10 @@
this.label25 = new System.Windows.Forms.Label();
this.txtBuyTransitWarehouse = new System.Windows.Forms.TextBox();
this.pnlMap = new System.Windows.Forms.Panel();
this.chkChangeWarehouseAddress = new Work.UserComponents.UcCheckBox(this.components);
this.chkAutoChangeWarehouseAddress = new Work.UserComponents.UcCheckBox(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label28 = new System.Windows.Forms.Label();
this.txtSourceCode = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel2.SuspendLayout();
@@ -264,6 +267,7 @@
this.cmbTransitWarehouse.Name = "cmbTransitWarehouse";
this.cmbTransitWarehouse.Size = new System.Drawing.Size(388, 25);
this.cmbTransitWarehouse.TabIndex = 838;
this.cmbTransitWarehouse.SelectedIndexChanged += new System.EventHandler(this.cmbTransitWarehouse_SelectedIndexChanged);
//
// txtBuyPrice
//
@@ -344,7 +348,7 @@
this.txtBuyOrderId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuyOrderId.Location = new System.Drawing.Point(74, 139);
this.txtBuyOrderId.Name = "txtBuyOrderId";
this.txtBuyOrderId.Size = new System.Drawing.Size(388, 23);
this.txtBuyOrderId.Size = new System.Drawing.Size(152, 23);
this.txtBuyOrderId.TabIndex = 829;
//
// label15
@@ -698,13 +702,14 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.chkUseAppBalance);
this.panel1.Controls.Add(this.txtShopName);
this.panel1.Controls.Add(this.label27);
this.panel1.Controls.Add(this.label26);
this.panel1.Controls.Add(this.txtOrderId);
this.panel1.Controls.Add(this.pnlBuy);
this.panel1.Controls.Add(this.pnlMap);
this.panel1.Controls.Add(this.chkChangeWarehouseAddress);
this.panel1.Controls.Add(this.chkAutoChangeWarehouseAddress);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Controls.Add(this.txtShopOrderItemPrice);
this.panel1.Controls.Add(this.txtShopOrderItemCnt);
@@ -728,6 +733,19 @@
this.panel1.Size = new System.Drawing.Size(487, 730);
this.panel1.TabIndex = 0;
//
// chkUseAppBalance
//
this.chkUseAppBalance.AutoSize = true;
this.chkUseAppBalance.Checked = true;
this.chkUseAppBalance.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkUseAppBalance.Location = new System.Drawing.Point(172, 11);
this.chkUseAppBalance.Name = "chkUseAppBalance";
this.chkUseAppBalance.Size = new System.Drawing.Size(123, 21);
this.chkUseAppBalance.TabIndex = 877;
this.chkUseAppBalance.Text = "使用快递余额拍单";
this.chkUseAppBalance.UseVisualStyleBackColor = true;
this.chkUseAppBalance.CheckedChanged += new System.EventHandler(this.chkUseAppBalance_CheckedChanged);
//
// txtShopName
//
this.txtShopName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -772,6 +790,8 @@
//
this.pnlBuy.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlBuy.Controls.Add(this.label28);
this.pnlBuy.Controls.Add(this.txtSourceCode);
this.pnlBuy.Controls.Add(this.btnReMap);
this.pnlBuy.Controls.Add(this.label25);
this.pnlBuy.Controls.Add(this.txtBuyTransitWarehouse);
@@ -864,17 +884,18 @@
this.pnlMap.Size = new System.Drawing.Size(468, 203);
this.pnlMap.TabIndex = 871;
//
// chkChangeWarehouseAddress
// chkAutoChangeWarehouseAddress
//
this.chkChangeWarehouseAddress.AutoSize = true;
this.chkChangeWarehouseAddress.Checked = true;
this.chkChangeWarehouseAddress.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkChangeWarehouseAddress.Location = new System.Drawing.Point(309, 11);
this.chkChangeWarehouseAddress.Name = "chkChangeWarehouseAddress";
this.chkChangeWarehouseAddress.Size = new System.Drawing.Size(171, 21);
this.chkChangeWarehouseAddress.TabIndex = 859;
this.chkChangeWarehouseAddress.Text = "保存地址时替换为云仓地址";
this.chkChangeWarehouseAddress.UseVisualStyleBackColor = true;
this.chkAutoChangeWarehouseAddress.AutoSize = true;
this.chkAutoChangeWarehouseAddress.Checked = true;
this.chkAutoChangeWarehouseAddress.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkAutoChangeWarehouseAddress.Location = new System.Drawing.Point(309, 11);
this.chkAutoChangeWarehouseAddress.Name = "chkAutoChangeWarehouseAddress";
this.chkAutoChangeWarehouseAddress.Size = new System.Drawing.Size(171, 21);
this.chkAutoChangeWarehouseAddress.TabIndex = 859;
this.chkAutoChangeWarehouseAddress.Text = "保存地址时替换为云仓地址";
this.chkAutoChangeWarehouseAddress.UseVisualStyleBackColor = true;
this.chkAutoChangeWarehouseAddress.CheckedChanged += new System.EventHandler(this.chkAutoChangeWarehouseAddress_CheckedChanged);
//
// pictureBox1
//
@@ -887,6 +908,25 @@
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// label28
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(266, 142);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(44, 17);
this.label28.TabIndex = 884;
this.label28.Text = "溯源码";
//
// txtSourceCode
//
this.txtSourceCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtSourceCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSourceCode.Location = new System.Drawing.Point(310, 139);
this.txtSourceCode.Name = "txtSourceCode";
this.txtSourceCode.Size = new System.Drawing.Size(152, 23);
this.txtSourceCode.TabIndex = 885;
//
// PddMobileBuyOrderForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -900,7 +940,7 @@
this.Text = "买手拍单";
this.TitleText = "买手拍单";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ShopLoginForm_FormClosed);
this.Load += new System.EventHandler(this.ShopLoginForm_Load);
this.Load += new System.EventHandler(this.PddBuyOrderForm_Load);
this.Controls.SetChildIndex(this.splitContainer2, 0);
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
this.splitContainer1.Panel2.ResumeLayout(false);
@@ -976,7 +1016,7 @@
private System.Windows.Forms.Label label20;
private System.Windows.Forms.ComboBox cmbTransitWarehouse;
private System.Windows.Forms.PictureBox pictureBox1;
private Work.UserComponents.UcCheckBox chkChangeWarehouseAddress;
private Work.UserComponents.UcCheckBox chkAutoChangeWarehouseAddress;
private System.Windows.Forms.Panel panel1;
private DevComponents.DotNetBar.PanelEx btnJumpOrderList;
private System.Windows.Forms.Label label25;
@@ -988,5 +1028,8 @@
private System.Windows.Forms.TextBox txtOrderId;
private System.Windows.Forms.TextBox txtShopName;
private System.Windows.Forms.Label label27;
private Work.UserComponents.UcCheckBox chkUseAppBalance;
private System.Windows.Forms.Label label28;
private System.Windows.Forms.TextBox txtSourceCode;
}
}
@@ -0,0 +1,143 @@
namespace Work._29Tools.Forms.UserForms
{
partial class WXGetBalanceQrCodeForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.btnRefresh = new DevComponents.DotNetBar.PanelEx();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// pbCloseBase
//
this.pbCloseBase.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.pbCloseBase.Location = new System.Drawing.Point(412, 0);
//
// label1
//
this.label1.Font = new System.Drawing.Font("微软雅黑", 11F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
this.label1.Location = new System.Drawing.Point(29, 409);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(384, 44);
this.label1.TabIndex = 1;
this.label1.Text = "支付宝扫码充值,备注软件登录账户。如忘记备注,请联系购买方充值。";
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(29, 19);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(384, 384);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// btnRefresh
//
this.btnRefresh.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnRefresh.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRefresh.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRefresh.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRefresh.Location = new System.Drawing.Point(329, 450);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(84, 23);
this.btnRefresh.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnRefresh.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRefresh.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRefresh.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnRefresh.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnRefresh.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnRefresh.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnRefresh.Style.GradientAngle = 90;
this.btnRefresh.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnRefresh.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnRefresh.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnRefresh.TabIndex = 1135;
this.btnRefresh.Text = "刷新";
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// pbLoading
//
this.pbLoading.Image = global::Work.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(196, 186);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pbLoading.TabIndex = 1136;
this.pbLoading.TabStop = false;
this.pbLoading.Visible = false;
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Controls.Add(this.btnRefresh);
this.panel1.Controls.Add(this.pbLoading);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(1, 33);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(444, 488);
this.panel1.TabIndex = 1140;
//
// WXGetBalanceQrCodeForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.ClientSize = new System.Drawing.Size(446, 522);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "WXGetBalanceQrCodeForm";
this.Padding = new System.Windows.Forms.Padding(1);
this.Text = "二维码充值";
this.TitleText = "二维码充值";
this.Load += new System.EventHandler(this.WXGetTopUpQrCode_Load);
this.Controls.SetChildIndex(this.panel1, 0);
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox pictureBox1;
private DevComponents.DotNetBar.PanelEx btnRefresh;
private System.Windows.Forms.PictureBox pbLoading;
private System.Windows.Forms.Panel panel1;
}
}
@@ -0,0 +1,64 @@
using AllBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Work;
using Work.BaseForms;
namespace Work._29Tools.Forms.UserForms
{
public partial class WXGetBalanceQrCodeForm : BaseForms.BaseGeneralForm
{
public WXGetBalanceQrCodeForm()
{
InitializeComponent();
}
public void refreshQrcode()
{
Invoke(new Action(() =>
{
pbLoading.Visible = true;
}));
var url = BaseClass.Build29WxObjString("user/get_top_up_qrcode");
var data = UserLogin.GetSignaturex();
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJson(ref html, "msg");
BaseMsgForm.ShowError(msg);
}
else
{
Invoke(new Action(() =>
{
pbLoading.Visible = false;
var base64Str = BaseRegex.GetStringJson(ref html, "qrcode_base64");
if (!string.IsNullOrEmpty(base64Str))
pictureBox1.Image = Base64ChangeImgUrl.Base64ToImage(base64Str);
else
pictureBox1.Image = Properties.Resources.errpic;
}));
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
Task.Run(() => { refreshQrcode(); });
}
private void WXGetTopUpQrCode_Load(object sender, EventArgs e)
{
Task.Run(() => { refreshQrcode(); });
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>