diff --git a/29WxOrderWpf/App.xaml b/29WxOrderWpf/App.xaml
index e1b9953..d3fae9d 100644
--- a/29WxOrderWpf/App.xaml
+++ b/29WxOrderWpf/App.xaml
@@ -35,6 +35,7 @@
+
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml
index 84741f1..ece4d20 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml
@@ -10,6 +10,7 @@
xmlns:usercontrols="clr-namespace:_29WxOrderWpf.UserControls"
xmlns:utils="clr-namespace:_29WxOrderWpf.Utils"
xmlns:wpf="WPFCommon"
+ d:DataContext="{d:DesignInstance Type=local:OrderListCtrl}"
d:DesignHeight="450"
d:DesignWidth="1560"
Loaded="Window_Loaded"
diff --git a/29WxOrderWpf/Ctrls/Settings/SettingsView.xaml b/29WxOrderWpf/Ctrls/Settings/SettingsView.xaml
new file mode 100644
index 0000000..f39d44c
--- /dev/null
+++ b/29WxOrderWpf/Ctrls/Settings/SettingsView.xaml
@@ -0,0 +1,252 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/Ctrls/Settings/SettingsView.xaml.cs b/29WxOrderWpf/Ctrls/Settings/SettingsView.xaml.cs
new file mode 100644
index 0000000..df5200a
--- /dev/null
+++ b/29WxOrderWpf/Ctrls/Settings/SettingsView.xaml.cs
@@ -0,0 +1,57 @@
+using _29WxOrderWpf.ViewModels;
+using AllBase;
+using AllBase.Model.Config;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using Work.BaseForms;
+
+namespace _29WxOrderWpf.Ctrls.Settings;
+
+///
+/// SettingsView.xaml 的交互逻辑
+///
+public partial class SettingsView : Window
+{
+ private SettingViewModel vm;
+ public SettingsView()
+ {
+ InitializeComponent();
+ vm = new SettingViewModel();
+ this.DataContext = vm;
+ this.Loaded += SettingsView_Loaded;
+ this.Closed += SettingsView_Closed;
+ }
+ private void SettingsView_Loaded(object sender, RoutedEventArgs e)
+ {
+ var setting = NaiBa.Util.Helper.ConfigHelper.LoadConfig(SettingViewModel.SettingFileName);
+ if (setting == null) setting = new SettingConfig();
+ vm.Assign(setting);
+ }
+ private void SettingsView_Closed(object sender, EventArgs e)
+ {
+ try
+ {
+ var setting = vm.ToConfig();
+ BaseClass.Setting = setting;
+ NaiBa.Util.Helper.ConfigHelper.SaveConfig(SettingViewModel.SettingFileName, JsonConvert.SerializeObject(setting));
+ }
+ catch (Exception ex)
+ {
+ BaseMsgForm.ShowError("配置保存错误");
+ }
+ }
+
+
+}
diff --git a/29WxOrderWpf/MainWindow.xaml b/29WxOrderWpf/MainWindow.xaml
index b3e51c2..d20b081 100644
--- a/29WxOrderWpf/MainWindow.xaml
+++ b/29WxOrderWpf/MainWindow.xaml
@@ -34,8 +34,9 @@
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
+ MaxBoxVisibility="Visible" />
-
+
-public class ShipGiftService: SingleInstance
+public class ShipGiftService : SingleInstance
{
public enum GiftType
{
@@ -42,6 +42,11 @@ public class ShipGiftService: SingleInstance
{
giftAmount = 1.55m;
}
+
+ if (BaseClass.Setting.AutoSwitchGiftType && (item.product_price ?? 0) > 6 * 1000)
+ {
+ giftAmount = 1.6m;
+ }
decimal amount = giftAmount + BaseClass.OemGiftAmount;
@@ -78,6 +83,6 @@ public class ShipGiftService: SingleInstance
var ret = await _api.SendShipGift([orderId], (int)giftType, amount, BaseClass.OemGiftAmount);
return ret;
-
+
}
}
diff --git a/29WxOrderWpf/Styles/TabControlStyle.xaml b/29WxOrderWpf/Styles/TabControlStyle.xaml
new file mode 100644
index 0000000..6e053f7
--- /dev/null
+++ b/29WxOrderWpf/Styles/TabControlStyle.xaml
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/29WxOrderWpf/ViewModels/SettingViewModel.cs b/29WxOrderWpf/ViewModels/SettingViewModel.cs
new file mode 100644
index 0000000..52fb485
--- /dev/null
+++ b/29WxOrderWpf/ViewModels/SettingViewModel.cs
@@ -0,0 +1,40 @@
+using AllBase.Model.Config;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WPFCommon.Models;
+
+namespace _29WxOrderWpf.ViewModels;
+
+public class SettingViewModel : BindableBaseEx
+{
+ public const string SettingFileName = "setting";
+ public SettingViewModel()
+ {
+ }
+ /// 版本号
+ public string Version
+ {
+ get => GetValue();
+ private set => SetValue(value);
+ }
+
+ public bool AutoSwitchGiftType
+ {
+ get => GetValue();
+ set => SetValue(value);
+ }
+ public void Assign(SettingConfig config)
+ {
+ AutoSwitchGiftType = config.AutoSwitchGiftType;
+ }
+ public SettingConfig ToConfig()
+ {
+ return new SettingConfig
+ {
+ AutoSwitchGiftType = AutoSwitchGiftType
+ };
+ }
+}
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index e3d8f3d..0386fc8 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -4,6 +4,7 @@
* 2012-5-9
*/
using AllBase.DouYinModel.Result;
+using AllBase.Model.Config;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -600,7 +601,7 @@ namespace AllBase
public static string MainUserName { get { return string.IsNullOrEmpty(ParentUserName) ? UserName : ParentUserName; } }
public static int SaLevel { get; set; }
public static bool IsLoginSuccess { get; set; }
-
+ public static SettingConfig Setting { get; set; }
///
/// CPU使用率更新线程
///
diff --git a/AllBase/Model/Config/SettingConfig.cs b/AllBase/Model/Config/SettingConfig.cs
new file mode 100644
index 0000000..20bd746
--- /dev/null
+++ b/AllBase/Model/Config/SettingConfig.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AllBase.Model.Config;
+
+public class SettingConfig
+{
+ #region 发货
+ ///
+ /// 自动切换礼物类型
+ /// 超出6元
+ ///
+ public bool AutoSwitchGiftType { get; set; } = true;
+ #endregion
+}