1可设置是否直发拍单 2优化订单取号状态判断逻辑
This commit is contained in:
1 parent
9789a4686f
commit
5b9ed01fa1
7 files changed
+125
-65
No files matched your search
@@ -31,7 +31,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
/// </summary>
|
||||
public partial class OrderListRowHeaderCtrl : UserControl
|
||||
{
|
||||
public DateTime LastRefreshTime = DateTime.Now;
|
||||
public static DateTime LastRefreshTime = DateTime.Now.AddSeconds(-5);
|
||||
|
||||
public OrderListRowHeaderCtrl()
|
||||
{
|
||||
|
||||
@@ -1,55 +1,78 @@
|
||||
<Window
|
||||
x:Class="_29WxOrderWpf.Ctrls.Settings.SettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.Settings"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.ViewModels"
|
||||
xmlns:wpf="WPFCommon"
|
||||
Title="设置"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowState="Normal"
|
||||
mc:Ignorable="d">
|
||||
<Border BorderBrush="#e8eaed" BorderThickness="1">
|
||||
<TabControl
|
||||
ItemContainerStyle="{StaticResource SideTabItem}"
|
||||
Style="{StaticResource SideTabControl}"
|
||||
TabStripPlacement="Left">
|
||||
x:Class="_29WxOrderWpf.Ctrls.Settings.SettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.Settings"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.ViewModels"
|
||||
xmlns:wpf="WPFCommon"
|
||||
Title="设置"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowState="Normal"
|
||||
mc:Ignorable="d">
|
||||
<Border BorderBrush="#e8eaed" BorderThickness="1">
|
||||
<TabControl
|
||||
ItemContainerStyle="{StaticResource SideTabItem}"
|
||||
Style="{StaticResource SideTabControl}"
|
||||
TabStripPlacement="Left">
|
||||
|
||||
<TabItem Header="发货">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="礼品单发送" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="超出6元自动改为礼品二(实物)" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
IsChecked="{Binding AutoSwitchGiftType}"
|
||||
IsEnabled="False"
|
||||
Opacity="0.5"
|
||||
Style="{StaticResource ToggleSwitch}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="拍单">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="直发拍单" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="允许直发拍单" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
IsChecked="{Binding SwitchEnableDirectBuy}"
|
||||
Style="{StaticResource ToggleSwitch}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ========== 外观 ========== -->
|
||||
<!--
|
||||
<TabItem Header="发货">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="礼品单发送" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="超出6元自动改为礼品二(实物)" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
IsChecked="{Binding AutoSwitchGiftType}"
|
||||
IsEnabled="False"
|
||||
Opacity="0.5"
|
||||
Style="{StaticResource ToggleSwitch}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ========== 外观 ========== -->
|
||||
<!--
|
||||
<TabItem Header="外观" Tag="🎨">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
@@ -114,8 +137,8 @@
|
||||
</TabItem>
|
||||
|
||||
-->
|
||||
<!-- ========== 账户 ========== -->
|
||||
<!--
|
||||
<!-- ========== 账户 ========== -->
|
||||
<!--
|
||||
<TabItem Header="账户" Tag="👤">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
@@ -161,8 +184,8 @@
|
||||
</TabItem>
|
||||
|
||||
-->
|
||||
<!-- ========== 隐私 ========== -->
|
||||
<!--
|
||||
<!-- ========== 隐私 ========== -->
|
||||
<!--
|
||||
<TabItem Header="隐私" Tag="🔒">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
@@ -212,8 +235,8 @@
|
||||
</TabItem>
|
||||
|
||||
-->
|
||||
<!-- ========== 关于 ========== -->
|
||||
<!--
|
||||
<!-- ========== 关于 ========== -->
|
||||
<!--
|
||||
<TabItem Header="关于" Tag="{StaticResource txt-table_stack_above}">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
@@ -251,6 +274,6 @@
|
||||
</StackPanel>
|
||||
</TabItem>-->
|
||||
|
||||
</TabControl>
|
||||
</Border>
|
||||
</TabControl>
|
||||
</Border>
|
||||
</Window>
|
||||
@@ -1,5 +1,6 @@
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Config;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
@@ -44,6 +45,15 @@ public partial class SettingsView : Window
|
||||
var setting = vm.ToConfig();
|
||||
BaseClass.Setting = setting;
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig(SettingViewModel.SettingFileName, JsonConvert.SerializeObject(setting));
|
||||
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -26,15 +26,22 @@ public class SettingViewModel : BindableBaseEx
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
public bool SwitchEnableDirectBuy
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
public void Assign(SettingConfig config)
|
||||
{
|
||||
AutoSwitchGiftType = config.AutoSwitchGiftType;
|
||||
SwitchEnableDirectBuy = config.SwitchEnableDirectBuy;
|
||||
}
|
||||
public SettingConfig ToConfig()
|
||||
{
|
||||
return new SettingConfig
|
||||
{
|
||||
AutoSwitchGiftType = AutoSwitchGiftType
|
||||
AutoSwitchGiftType = AutoSwitchGiftType,
|
||||
SwitchEnableDirectBuy = SwitchEnableDirectBuy,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,11 @@ public class SettingConfig
|
||||
/// </summary>
|
||||
public bool AutoSwitchGiftType { get; set; } = true;
|
||||
#endregion
|
||||
|
||||
#region 拍单
|
||||
/// <summary>
|
||||
/// 允许直发拍单
|
||||
/// </summary>
|
||||
public bool SwitchEnableDirectBuy { get; set; } = false;
|
||||
#endregion
|
||||
}
|
||||
@@ -1557,20 +1557,27 @@ namespace AllBase.Model.DBModel
|
||||
|
||||
// 直拍按钮
|
||||
BtnDirectBuyOrderVisibility = Visibility.Collapsed;
|
||||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||
{
|
||||
}
|
||||
else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||
if (BaseClass.Setting.SwitchEnableDirectBuy && this.ItemOrder?.status < 30)
|
||||
{
|
||||
//if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||
//{
|
||||
//}
|
||||
//else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||
//{
|
||||
if (_itemOrderIsWaitBuy == true && this.BuyGoodsBtnTxt != "关联拍单")
|
||||
BtnDirectBuyOrderVisibility = Visibility.Visible;
|
||||
if (_itemOrderIsAbnormal == true && this.refund_status <= 1)
|
||||
else if (_itemOrderIsAbnormal == true && this.refund_status <= 1)
|
||||
{
|
||||
//if (BtnAbnormalBtnVisibility == Visibility.Collapsed && (this.ItemOrder.out_order_no.IsNullOrEmpty() || this.ItemOrder.out_after_sale_status == "退款成功"))
|
||||
if (this.ItemOrder.out_order_no.IsNullOrEmpty() || this.ItemOrder.out_after_sale_status == "退款成功")
|
||||
BtnDirectBuyOrderVisibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
BtnDirectBuyOrderVisibility = Visibility.Collapsed;
|
||||
//}
|
||||
}
|
||||
else
|
||||
BtnDirectBuyOrderVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public string RefundStatusStr
|
||||
|
||||
@@ -121,9 +121,15 @@ public class oms_wei_order_item_transit_model : PropertyNotifyObject
|
||||
transitDetail.TransitStatus = "创建失败";
|
||||
else if (transitOrder.transfer_warehouse_status == 3)
|
||||
transitDetail.TransitStatus = "创建中";
|
||||
else if (transitOrder.transfer_warehouse_status == 4)
|
||||
transitDetail.TransitStatus = "取号失败";
|
||||
|
||||
// 中转仓入库状态 0: 未入库, 1: 已入库, 2: 已出库, 3: 拦截到仓
|
||||
if (transitOrder.pickup_time > DateTime.MinValue == false)
|
||||
if (transitOrder.transfer_warehouse_status == 4)
|
||||
transitDetail.WarehouseStatus = "取号失败";
|
||||
else if ((transitOrder.raw_message.ParseToString().Contains("取号异常") || transitOrder.raw_message.ParseToString().Contains("无法调用")) && transitOrder.transfer_warehouse_status != 1)
|
||||
transitDetail.WarehouseStatus = transitOrder.raw_message.Contains("超出派送范围") ? "取号异常(超区)" : "取号异常";
|
||||
else if (transitOrder.pickup_time > DateTime.MinValue == false)
|
||||
transitDetail.WarehouseStatus = "未取号";
|
||||
else if (transitOrder.warehouse_status == null || transitOrder.warehouse_status == 0)
|
||||
transitDetail.WarehouseStatus = "未入库";
|
||||
|
||||
Reference in new issue
Block a user