1中转仓订单退货功能 2中转仓订单运费根据oem或管理员设定调整 3其他一些问题修复
This commit is contained in:
1 parent
d6f81f9ef4
commit
2e20cbdf68
24 files changed
+834
-292
No files matched your search
@@ -0,0 +1,71 @@
|
||||
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.LoginWindows.LoginWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.LoginWindows"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
x:Name="loginWindow" Title="登录" Height="300" Width="400" ResizeMode="NoResize" Loaded="loginWindow_Loaded" Closing="BaseWindow_Closing">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="120"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Background="{StaticResource mainLinearColorBrush}"></Border>
|
||||
<Grid Grid.Row="1" Margin="2,0,2,2" Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="180"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20"></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="20"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="1" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||
<Grid>
|
||||
<ComboBox x:Name="cmbUserNameMobile" Margin="3,0" VerticalContentAlignment="Center" Style="{StaticResource BaseComboBoxStyle}"
|
||||
SelectionChanged="cmbUserNameMobile_SelectionChanged">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<Grid HorizontalAlignment="Stretch" Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}, Path=Width}">
|
||||
<TextBlock Text="{Binding}"/>
|
||||
<Button x:Name="btnDeleteItem" HorizontalAlignment="Right" Content="X" Click="btnDeleteItem_Click"/>
|
||||
</Grid>-->
|
||||
<Grid HorizontalAlignment="Stretch" Width="140">
|
||||
<TextBlock x:Name="txtName" Text="{Binding}" Padding="0" VerticalAlignment="Center"/>
|
||||
<userctrls:UcImageButton Width="17" Height="17" ButtonImage="{StaticResource imgCloseGray}" BorderThickness="0" Cursor="Hand"
|
||||
MouseOverButtonImage="{StaticResource imgCloseGray}" MousePressButtonImage="{StaticResource imgCloseGray}" Background="Transparent"
|
||||
x:Name="btnDeleteItem" Tag="{Binding ElementName=txtName, Path=Text}" HorizontalAlignment="Right" Click="btnDeleteItem_Click"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||
<PasswordBox x:Name="txtPassword" Margin="6,0" VerticalContentAlignment="Center" Style="{StaticResource BasePasswordBoxStyle}"></PasswordBox>
|
||||
</Border>
|
||||
<CheckBox Content="记住密码" x:Name="chkRemember" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left" Grid.Row="3" VerticalAlignment="Center" Checked="chkRemember_Checked"/>
|
||||
<Button x:Name="btnLogin" Style="{StaticResource BaseButtonStyle}" Grid.Row="4" Content="安 全 登 录" Height="26" Click="btnLogin_Click"></Button>
|
||||
<CheckBox Content="调试模式" Height="24" Visibility="Collapsed" x:Name="chkDebug" BorderBrush="{StaticResource mainColorBrush}"
|
||||
FontSize="12" VerticalContentAlignment="Center" HorizontalAlignment="Left" Grid.Row="5" VerticalAlignment="Center" Checked="chkDebug_Checked" Unchecked="chkDebug_Checked"/>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Image Source="{StaticResource main29WeixinIcon}" Height="24" Width="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="4"></Image>
|
||||
<Label x:Name="lblAppName" FontSize="28" Margin="0,14,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" Content="拍单软件"></Label>
|
||||
<Label x:Name="lblTitle" Margin="30,2" Foreground="White" Content="{Binding ElementName=loginWindow, Path=Title}"></Label>
|
||||
<userctrls:UcWindowBoxes VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Collapsed" MinBoxVisibility="Collapsed"/>
|
||||
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,215 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.UserControls;
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Param.LoginManage;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Extension;
|
||||
using NaiBa.Util.Helper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Work;
|
||||
using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.Windows.LoginWindows
|
||||
{
|
||||
/// <summary>
|
||||
/// LoginWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LoginWindow : BaseWindow
|
||||
{
|
||||
public static ConcurrentList<UserParam> UserParamList { get; set; } = new ConcurrentList<UserParam>();
|
||||
|
||||
public bool IsLogin { get; set; } = false;
|
||||
|
||||
string[] argsuser;
|
||||
|
||||
public LoginWindow(string[] args)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (!string.IsNullOrEmpty(BaseClass.ProgramName))
|
||||
{
|
||||
lblAppName.Content = BaseClass.ProgramName;
|
||||
MainWindow.Instance.lblAppName.Content = lblAppName.Content;
|
||||
}
|
||||
|
||||
this.Title = "用户登录";
|
||||
argsuser = args;
|
||||
}
|
||||
|
||||
private void loginWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
#if DEBUG
|
||||
chkDebug.Visibility = Visibility.Visible;
|
||||
#endif
|
||||
|
||||
GetUserList();
|
||||
foreach (var user in UserParamList)
|
||||
{
|
||||
cmbUserNameMobile.Items.Insert(0, user.UserName);
|
||||
}
|
||||
|
||||
this.Title = "登录";
|
||||
if (BaseClass.Remember)
|
||||
{
|
||||
chkRemember.IsChecked = true;
|
||||
cmbUserNameMobile.Text = BaseClass.UserName;
|
||||
if (!string.IsNullOrEmpty(BaseClass.PassWord))
|
||||
txtPassword.Password = "******";
|
||||
}
|
||||
|
||||
if (argsuser.Length > 1)
|
||||
{
|
||||
cmbUserNameMobile.Text = argsuser[0].Replace(" ", "");
|
||||
txtPassword.Password = "******";
|
||||
BaseClass.PassWord = argsuser[1].Replace(" ", "");
|
||||
btnLogin_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
//if (BaseMsgForm.ShowConfirm("是否关闭软件?\r\n必须登录账户才能使用,无账户请先注册一个", "请先登录或者注册").DialogResult == System.Windows.Forms.DialogResult.OK)
|
||||
// Process.GetCurrentProcess().Kill();
|
||||
//else
|
||||
// e.Cancel = true;
|
||||
|
||||
if (!IsLogin)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("是否关闭软件?\r\n必须登录账户才能使用,无账户请先注册一个。", "请先登录或者注册", this).DialogResult == true)
|
||||
Process.GetCurrentProcess().Kill();
|
||||
else
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnLogin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UserLogin ul = new UserLogin();
|
||||
ul.Mobile = cmbUserNameMobile.Text;
|
||||
ul.Password = txtPassword.Password;
|
||||
|
||||
if (cmbUserNameMobile.Text.Length != 11)
|
||||
{
|
||||
BaseMsgWindow.ShowError("手机号不正确", "提示", this);
|
||||
cmbUserNameMobile.Focus();
|
||||
return;
|
||||
}
|
||||
if (txtPassword.Password.Length < 6)
|
||||
{
|
||||
BaseMsgWindow.ShowError("密码长度不正确", "提示", this);
|
||||
txtPassword.Password = "";
|
||||
txtPassword.Focus();
|
||||
return;
|
||||
}
|
||||
string message = "";
|
||||
int weakPassword = 0;
|
||||
int lockUserName = 0;
|
||||
string messageInfo = "";
|
||||
bool ok = ul.Get(ref message, out lockUserName, out weakPassword, out messageInfo);
|
||||
if (!ok)
|
||||
{
|
||||
BaseMsgForm.ShowError(message, "登录失败");
|
||||
return;
|
||||
}
|
||||
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
|
||||
if (BaseClass.Remember)
|
||||
{
|
||||
Initialization i = new Initialization();
|
||||
i.SaveConfig();
|
||||
|
||||
var eUser = UserParamList.FirstOrDefault(u => u.UserName == BaseClass.UserName);
|
||||
if (eUser != null)
|
||||
UserParamList.Remove(eUser);
|
||||
UserParamList.Add(new UserParam()
|
||||
{
|
||||
UserName = BaseClass.UserName,
|
||||
PasswordMd5 = BaseClass.PassWord
|
||||
});
|
||||
SaveUserList();
|
||||
}
|
||||
this.IsLogin = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
public static void SaveUserList()
|
||||
{
|
||||
ConfigHelper.SaveConfig("user_login_config", UserParamList);
|
||||
}
|
||||
public static void GetUserList()
|
||||
{
|
||||
#region 用户账户记忆功能
|
||||
UserParamList = ConfigHelper.LoadConfig<ConcurrentList<UserParam>>("user_login_config");
|
||||
if (UserParamList == null)
|
||||
UserParamList = new ConcurrentList<UserParam>();
|
||||
#endregion
|
||||
}
|
||||
|
||||
private void btnDeleteItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var imgButton = sender as UcImageButton;
|
||||
if (imgButton != null)
|
||||
{
|
||||
var userName = imgButton.Tag.ParseToString();
|
||||
if (!string.IsNullOrEmpty(userName))
|
||||
{
|
||||
UserParamList.RemoveAll(u => u.UserName == userName);
|
||||
SaveUserList();
|
||||
foreach (var item in cmbUserNameMobile.Items.Cast<string>().ToList())
|
||||
{
|
||||
if (item.ParseToString() == userName)
|
||||
{
|
||||
cmbUserNameMobile.Items.Remove(item);
|
||||
}
|
||||
|
||||
}
|
||||
//ShowUserDropDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void cmbUserNameMobile_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
var userName = cmbUserNameMobile.SelectedItem.ParseToString();
|
||||
var user = UserParamList.FirstOrDefault(u => u.UserName == userName);
|
||||
if (user != null)
|
||||
{
|
||||
BaseClass.UserName = user.UserName;
|
||||
BaseClass.PassWord = user.PasswordMd5;
|
||||
this.cmbUserNameMobile.Text = user.UserName;
|
||||
this.txtPassword.Password = "******";
|
||||
}
|
||||
}
|
||||
|
||||
private void chkRemember_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BaseClass.Remember = chkRemember.IsChecked.ParseToBool();
|
||||
}
|
||||
|
||||
private void chkDebug_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (chkDebug.IsChecked == true)
|
||||
{
|
||||
BaseClass.LoginApiUrl = BaseClass.DebugUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass.LoginApiUrl = BaseClass.ServerUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.OrderWindows.TransitAfterSaleWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.OrderWindows"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls" xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
Title="TransitAfterSaleWindow" Height="650" Width="600" ResizeMode="NoResize" Loaded="TransitAfterSaleWindow_Loaded">
|
||||
<Grid Background="Transparent" x:Name="mainGrid" Margin="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gridTitle">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{StaticResource main29WeixinIcon}" Height="50" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"></Image>
|
||||
<Label x:Name="lblAppName" FontSize="20" Margin="0,0,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" VerticalContentAlignment="Center" Content="中转单售后" Grid.Column="1"></Label>
|
||||
</Grid>
|
||||
<Border Background="White" Grid.Row="1" Padding="40, 20">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="1">仓库:</Label>
|
||||
<ComboBox x:Name="cmbWareHouse" Grid.Row="1" Grid.Column="1" VerticalContentAlignment="Center" VerticalAlignment="Top" IsReadOnly="True" IsEnabled="False"
|
||||
Style="{StaticResource RoundedComboBox}" Height="28" SelectedIndex="0" Margin="0,0,0,25">
|
||||
</ComboBox>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="2">物流公司:</Label>
|
||||
<TextBox x:Name="txtExpressName" Grid.Row="2" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="3">物流单号:</Label>
|
||||
<TextBox x:Name="txtWarehouseWaybill" Grid.Row="3" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="4">地址解析:</Label>
|
||||
<TextBox x:Name="txtAddressAnalysis" Grid.Row="4" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" Height="80" BorderThickness="1" Padding="0,4"
|
||||
VerticalContentAlignment="Top" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" TextWrapping="Wrap" Margin="0,0,0,25"/>
|
||||
<Button Grid.Row="4" Grid.Column="1" x:Name="btnAddressAnalysis" Style="{StaticResource BasePageButtonStyle}" Click="btnAddressAnalysis_Click"
|
||||
Margin="4, 29" Content="解 析" MinWidth="48" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="4"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="5">收件人:</Label>
|
||||
<TextBox x:Name="txtUser" Grid.Row="5" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="6">联系电话:</Label>
|
||||
<TextBox x:Name="txtMobile" Grid.Row="6" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="7">省/市/区:</Label>
|
||||
<Grid Grid.Row="7" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="txtProvince" Grid.Row="0" Grid.Column="0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
<TextBox x:Name="txtCity" Grid.Row="0" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="2,0,2,25"/>
|
||||
<TextBox x:Name="txtCounty" Grid.Row="0" Grid.Column="2" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
</Grid>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="8">详细地址:</Label>
|
||||
<TextBox x:Name="txtDetailAddress" Grid.Row="8" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Button Grid.Row="9" Grid.Column="1" x:Name="btnAdd" Style="{StaticResource BasePageButtonStyle}" Click="btnAdd_Click"
|
||||
Margin="0,0,0,0" Content="添 加" MinWidth="48" Height="28" HorizontalAlignment="left" VerticalAlignment="Top" Padding="4"/>
|
||||
<Label x:Name="lblMsg" Foreground="{StaticResource PageWarningBrushCC}"></Label>
|
||||
</Grid>
|
||||
</Border>
|
||||
<userctrls:UcWindowBoxes x:Name="ucWindowBox" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,185 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Work._29Tools.BLL;
|
||||
|
||||
namespace _29WxOrderWpf.Windows.OrderWindows
|
||||
{
|
||||
/// <summary>
|
||||
/// TransitAfterSaleWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TransitAfterSaleWindow : BaseWindow
|
||||
{
|
||||
public oms_wei_order_item_info OrderItem { get; set; }
|
||||
|
||||
public TransitAfterSaleWindow(oms_wei_order_item_info orderItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (orderItem != null)
|
||||
OrderItem = orderItem;
|
||||
}
|
||||
|
||||
private void mainGrid_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void TransitAfterSaleWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
|
||||
{
|
||||
this.cmbWareHouse.Items.Add(warehouse.TransName);
|
||||
}
|
||||
|
||||
if (OrderItem != null)
|
||||
{
|
||||
this.cmbWareHouse.Text = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == OrderItem.ItemTransitOrder?.platform)?.TransName;
|
||||
this.txtExpressName.Text = OrderItem.ItemTransitOrder?.express_2_company;
|
||||
this.txtWarehouseWaybill.Text = OrderItem.ItemTransitOrder?.express_2_waybill;
|
||||
|
||||
if (OrderItem.ItemTransitOrderAfterSale != null)
|
||||
{
|
||||
btnAdd.IsEnabled = false;
|
||||
|
||||
this.txtUser.Text = OrderItem.ItemTransitOrderAfterSale.recipient_name;
|
||||
this.txtMobile.Text = OrderItem.ItemTransitOrderAfterSale.recipient_phone;
|
||||
this.txtDetailAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_detail_address;
|
||||
//this.txtAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_province + "/" + OrderItem.ItemTransitOrderAfterSale.refund_city + "/" + OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
this.txtProvince.Text = OrderItem.ItemTransitOrderAfterSale.refund_province;
|
||||
this.txtCity.Text = OrderItem.ItemTransitOrderAfterSale.refund_city;
|
||||
this.txtCounty.Text = OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
}
|
||||
}
|
||||
|
||||
if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
|
||||
{
|
||||
btnAdd.IsEnabled = false;
|
||||
//BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
|
||||
lblMsg.Content = "当前订单仓库状态不支持售后,请联系买家直接退回总店!";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
|
||||
{
|
||||
BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
|
||||
return;
|
||||
}
|
||||
|
||||
//http://localhost:8088/oms-api/external_procurement/createReturnPackage
|
||||
//{
|
||||
// "orderNo": "3737011320735026432",
|
||||
// "orderCode": "4600000167202606117621000767",
|
||||
// "refundProvince": "安徽省",
|
||||
// "refundCity": "合肥市",
|
||||
// "refundCounty": "瑶海区",
|
||||
// "refundDetailAddress": "某街道 1”,
|
||||
// "recipientName": "张三",
|
||||
// "recipientPhone": "13800138000"
|
||||
//} post(json)请求方式,如果使用客户端账户扣款增加一个参数account_user
|
||||
|
||||
JObject data = new JObject();
|
||||
data["orderNo"] = OrderItem.order_id;
|
||||
data["orderCode"] = OrderItem.ItemTransitOrder?.order_code;
|
||||
data["refundProvince"] = txtProvince.Text.Trim();
|
||||
data["refundCity"] = txtCity.Text.Trim();
|
||||
data["refundCounty"] = txtCounty.Text.Trim();
|
||||
data["refundDetailAddress"] = txtDetailAddress.Text.Trim();
|
||||
data["recipientName"] = txtUser.Text.Trim();
|
||||
data["recipientPhone"] = txtMobile.Text.Trim();
|
||||
data["account_user"] = BaseClass.UserName;
|
||||
data["accountUser"] = BaseClass.UserName;
|
||||
//data["platform"] = "WEISHOP";
|
||||
var getTransitAfterSaleUrl = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/createReturnPackage";
|
||||
var getTransitAfterSaleStr = JsonHelper.SerializeObject(data);
|
||||
var getTransitAfterSaleRst = HttpResponseWXBLL.e57PostResponse(getTransitAfterSaleUrl, getTransitAfterSaleStr, "");
|
||||
if (!getTransitAfterSaleRst.ParseToString().Contains("<code>200</code>") && !getTransitAfterSaleRst.ParseToString().Contains("<code>0</code>"))
|
||||
{
|
||||
string msg = BaseRegex.GetStringXml(ref getTransitAfterSaleRst, "msg");
|
||||
if (msg.IsNullOrEmpty())
|
||||
msg = getTransitAfterSaleRst;
|
||||
BaseMsgWindow.ShowError("中转售后添加失败,服务端返回 " + msg, "", this);
|
||||
}
|
||||
else
|
||||
{
|
||||
//<AjaxResult><msg>创建退货包裹成功</msg><code>0</code></AjaxResult>
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(OrderItem.order_id);
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
BaseMsgWindow.ShowInfo("添加退货包裹成功", "", this);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddressAnalysis_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var txt = txtAddressAnalysis.Text.Trim();
|
||||
txt = txt.Replace("\r", "").Replace("\n", "");
|
||||
|
||||
|
||||
// 定义座机号的正则表达式
|
||||
string landlinePattern = @"\d{3}-\d{8}|\d{4}-\d{7}";
|
||||
// 定义手机号的正则表达式
|
||||
string mobilePattern = @"1[3-9]\d{9}";
|
||||
|
||||
// 使用正则表达式匹配座机号和手机号
|
||||
Match landlineMatch = Regex.Match(txt, landlinePattern);
|
||||
Match mobileMatch = Regex.Match(txt, mobilePattern);
|
||||
|
||||
var phone = "";
|
||||
if (landlineMatch.Success)
|
||||
{
|
||||
phone = landlineMatch.Value;
|
||||
txt = txt.Replace(phone, " ");
|
||||
}
|
||||
if (mobileMatch.Success)
|
||||
{
|
||||
phone = mobileMatch.Value;
|
||||
txt = txt.Replace(phone, " ");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(phone))
|
||||
{
|
||||
txtMobile.Text = phone;
|
||||
}
|
||||
|
||||
var province = GlobalConfig.Divisions.FirstOrDefault(d => txt.Contains(d.name));
|
||||
if (province == null)
|
||||
return;
|
||||
txtProvince.Text = province.name;
|
||||
var city = province.children.FirstOrDefault(c => txt.Contains(c.name));
|
||||
if (city == null)
|
||||
return;
|
||||
txtCity.Text = city.name;
|
||||
var county = city.children.FirstOrDefault(c => txt.Contains(c.name));
|
||||
if (county == null)
|
||||
return;
|
||||
txtCounty.Text = county.name;
|
||||
txt = txt.Replace(county.name, " ").Replace(city.name, " ").Replace(province.name, " ");
|
||||
|
||||
var tArr = txt.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
|
||||
tArr = tArr.OrderBy(t => t.Length).ToArray();
|
||||
this.txtUser.Text = tArr.FirstOrDefault();
|
||||
this.txtDetailAddress.Text = string.Join("", tArr).Replace(this.txtUser.Text, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user