diff --git a/29WxOrderWpf/Converters/InverseVisibleToVisibilityConverter.cs b/29WxOrderWpf/Converters/InverseVisibleToVisibilityConverter.cs
new file mode 100644
index 0000000..9b37cc3
--- /dev/null
+++ b/29WxOrderWpf/Converters/InverseVisibleToVisibilityConverter.cs
@@ -0,0 +1,24 @@
+using NaiBa.Util.Extension;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace _29WxOrderWpf.Converters
+{
+ public class InverseVisibleToVisibilityConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return !value.ParseToBool() ? Visibility.Visible : Visibility.Collapsed;
+ }
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException(); // 单向绑定可不实现
+ }
+ }
+}
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml
index fd791a8..aec7499 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml
@@ -1,444 +1,1177 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
- 标题包含
-
-
- 标题不含
-
-
-
-
+
-
-
+
+
+
+
+ 标题包含
+
+
+ 标题不含
+
+
+
+
-
-
-
-
- 更新时间
-
-
- 成交时间
-
-
+
+
-
-
-
+
+
+
+
+ 更新时间
+
+
+ 成交时间
+
+
-
-
-
-
+
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ VerticalAlignment="Top">
+
+
+
+
+
+
+
+
+
+
+
+
+ 店铺备注包含
+
+
+ 软件备注包含
+
+
+ 店铺备注不含
+
+
+ 软件备注不含
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- 店铺备注包含
-
-
- 软件备注包含
-
-
- 店铺备注不含
-
-
- 软件备注不含
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs
index 41ae30e..d10e61a 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs
@@ -2,6 +2,7 @@
using _29WxOrderWpf.Common;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.Ctrls.Statistics;
+using _29WxOrderWpf.Services;
using _29WxOrderWpf.Utils;
using AllBase;
using AllBase.Extension;
@@ -11,11 +12,14 @@ using AllBase.Model.DBModel;
using AllBase.Model.Result;
using AllBase.Util;
using CefSharp.DevTools.Autofill;
+using CefSharp.DevTools.FedCm;
using NaiBa.Util.Extension;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Diagnostics;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Security.Policy;
@@ -30,11 +34,13 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
+using System.Xml;
using System.Xml.Linq;
using TemuKJD.ToolForms;
using Work;
using Work._29Tools.BLL;
using Work.BuyUsers;
+using static _29WxOrderWpf.Services.ShipGiftService;
using static System.Net.Mime.MediaTypeNames;
namespace _29WxOrderWpf.Ctrls.OrderCtrls
@@ -52,11 +58,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
public string strSearchAll = "";
public List lstFilterText { get; set; }
-
+ public ShipGiftService _shipGiftService { get; }
public OrderListCtrl()
{
InitializeComponent();
DataContext = this;
+ _shipGiftService = new ShipGiftService();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
@@ -129,6 +136,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
/// 按过滤条件读取读取服务端订单
public void GetOrder(string orderIds = "", bool filterGetCondition = false)
{
+ BottomMsg = "开始读取订单...";
+ StartProgress();
Dispatcher.Invoke(new Action(() =>
{
imgLoading.Visibility = Visibility.Visible;
@@ -378,6 +387,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (string.IsNullOrEmpty(orderIds))
hasReadOrder = true;
+ CompleteProgress();
+ BottomMsg = "订单读取完成";
Dispatcher.Invoke(new Action(() =>
{
imgLoading.Visibility = Visibility.Collapsed;
@@ -1308,7 +1319,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
private void TabItem_SizeChanged(object sender, SizeChangedEventArgs e)
{
var tabItems = this.tabOrderType.Items.Cast();
- wpFilter.Margin = new Thickness(tabItems.Sum(t => t.ActualWidth) + 18, wpFilter.Margin.Top, wpFilter.Margin.Right, wpFilter.Margin.Bottom);
Point position1 = txtFilterRemark.TranslatePoint(new Point(0, 0), gridOrderListCtrl);
Point position2 = txtFilterRemark.TranslatePoint(new Point(0, 0), wpFilter);
@@ -1452,7 +1462,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
int index = 0;
foreach (var tmpOrderItem in tmpOrderItems)
{
- Dispatcher.Invoke(new Action(() => { txtMsg.Text = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
+ Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
var pddOrderSn = "";
if (tmpOrderItem.ItemOrder?.OrderBuyType == "云仓")
@@ -1621,10 +1631,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
html3 = GetHtml.PostUtf8(url3, data3);
}
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
- Dispatcher.Invoke(new Action(() => { txtMsg.Text = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
+ Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
}
- Dispatcher.Invoke(new Action(() => { txtMsg.Text = "买手退货处理完成,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
+ Dispatcher.Invoke(new Action(() => { BottomMsg = "买手退货处理完成,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
});
}
@@ -1825,6 +1835,82 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
FilterOrders();
}
+
+ private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ e.Handled = true;
+ }
+
+ //private bool _IsShipGift;
+ //public bool IsShipGift
+ //{
+ // get => _IsShipGift;
+ // set => SetProperty(ref _IsShipGift, value);
+ //}
+
+ public ICommand MultipleShipGiftCommand => new AsyncDelegateCommand(MultipleShipGift);
+ ///
+ /// 批量发送礼品单
+ ///
+ ///
+ ///
+
+ private async Task MultipleShipGift()
+ {
+
+ try
+ {
+ var list = GlobalConfig.lstFilterOrder.Where(a => a.IsSelect).ToList();
+ int count = list.Count;
+ if (count == 0)
+ {
+ BaseMsgWindow.ShowError("请选取要发货的订单", "Error");
+ return;
+ }
+
+
+ GiftType giftType = GiftType._160;
+ if (cb_gift.SelectedIndex == 0)
+ {
+ giftType = GiftType._155;
+ }
+ else
+ {
+ giftType = GiftType._155;
+ }
+ int index = 1;
+ int sucessCount = 0;
+ int errorCount = 0;
+ foreach (oms_wei_order_info item in list)
+ {
+ var ret = await _shipGiftService.Send(item.order_id, giftType);
+ if (ret)
+ {
+ sucessCount++;
+ item.gift_order_status = 1;
+ this.FilterOneOrder(item, true);
+ }
+ else
+ {
+ errorCount++;
+ }
+
+ SetProgress(index, count);
+ BottomMsg = $"礼品单发送进度:{index}/{count}\t\t{item.orderItems.FirstOrDefault()?.title ?? ""}";
+ index++;
+ }
+
+ BottomMsg = $"礼品单发送完成 成功:{sucessCount} 失败:{errorCount} 总数:{count}";
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("礼品单发货失败\n" + ex.Message, "Error");
+ }
+ finally
+ {
+
+ }
+ }
}
public class OrderFilterConfig
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl_Property.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl_Property.cs
new file mode 100644
index 0000000..cde0ab6
--- /dev/null
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl_Property.cs
@@ -0,0 +1,181 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace _29WxOrderWpf.Ctrls.OrderCtrls;
+
+public partial class OrderListCtrl : INotifyPropertyChanged
+{
+ #region NotifayProperty
+ ///
+ /// Occurs when a property value changes.
+ ///
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ ///
+ /// Checks if a property already matches a desired value. Sets the property and
+ /// notifies listeners only when necessary.
+ ///
+ /// Type of the property.
+ /// Reference to a property with both getter and setter.
+ /// Desired value for the property.
+ /// Name of the property used to notify listeners. This
+ /// value is optional and can be provided automatically when invoked from compilers that
+ /// support CallerMemberName.
+ /// True if the value was changed, false if the existing value matched the
+ /// desired value.
+ protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null)
+ {
+ if (EqualityComparer.Default.Equals(storage, value)) return false;
+
+ storage = value;
+ RaisePropertyChanged(propertyName);
+
+ return true;
+ }
+
+ ///
+ /// Checks if a property already matches a desired value. Sets the property and
+ /// notifies listeners only when necessary.
+ ///
+ /// Type of the property.
+ /// Reference to a property with both getter and setter.
+ /// Desired value for the property.
+ /// Name of the property used to notify listeners. This
+ /// value is optional and can be provided automatically when invoked from compilers that
+ /// support CallerMemberName.
+ /// Action that is called after the property value has been changed.
+ /// True if the value was changed, false if the existing value matched the
+ /// desired value.
+ protected virtual bool SetProperty(ref T storage, T value, Action onChanged, [CallerMemberName] string propertyName = null)
+ {
+ if (EqualityComparer.Default.Equals(storage, value)) return false;
+
+ storage = value;
+ onChanged?.Invoke();
+ RaisePropertyChanged(propertyName);
+
+ return true;
+ }
+
+ ///
+ /// Raises this object's PropertyChanged event.
+ ///
+ /// Name of the property used to notify listeners. This
+ /// value is optional and can be provided automatically when invoked from compilers
+ /// that support .
+ protected void RaisePropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
+ }
+
+ ///
+ /// Raises this object's PropertyChanged event.
+ ///
+ /// The PropertyChangedEventArgs
+ protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
+ {
+ PropertyChanged?.Invoke(this, args);
+ }
+ #endregion
+
+
+ private string _bottomMsg = "";
+ public string BottomMsg
+ {
+ get => _bottomMsg;
+ set => SetProperty(ref _bottomMsg, value);
+ }
+
+ private double _progressValue;
+ public double ProgressValue
+ {
+ get => _progressValue;
+ set => SetProperty(ref _progressValue, value);
+ }
+
+ private double _progressMaximum = 100;
+ public double ProgressMaximum
+ {
+ get => _progressMaximum;
+ set => SetProperty(ref _progressMaximum, value);
+ }
+ public void SetProgress(int value, int maxValue)
+ {
+ StopUnknownTotalProgressTimer();
+ ProgressValue = value;
+ ProgressMaximum = maxValue;
+ }
+
+ #region 未知总数百分比模拟进度
+ private System.Threading.Timer _unknownTotalProgressTimer;
+ private DateTime _unknownTotalProgressStartTime;
+
+ ///
+ /// 开始未知总数的百分比模拟进度:80% 之前走得快,越到最后走得越慢,
+ /// 理论上永远走不到 95% 以上,直到调用 才会变成 100%。
+ ///
+ public void StartProgress()
+ {
+ StopUnknownTotalProgressTimer();
+ ProgressMaximum = 100;
+ ProgressValue = 0;
+ _unknownTotalProgressStartTime = DateTime.Now;
+ _unknownTotalProgressTimer = new System.Threading.Timer(_ => UpdateUnknownTotalProgress(), null, 0, 200);
+ }
+
+ ///
+ /// 结束进度:停止模拟,进度条立即变为 100%。
+ ///
+ public void CompleteProgress()
+ {
+ StopUnknownTotalProgressTimer();
+ ProgressMaximum = 100;
+ ProgressValue = 100;
+ }
+
+ private void UpdateUnknownTotalProgress()
+ {
+ try
+ {
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ var elapsed = (DateTime.Now - _unknownTotalProgressStartTime).TotalSeconds;
+ double progress;
+ if (elapsed <= 10)
+ {
+ // 前 10 秒内快速推进到 80%
+ progress = Math.Max(0, Math.Min(80, elapsed * 8));
+ }
+ else
+ {
+ // 超过 80% 后指数衰减越来越慢,渐近线为 95%,理论上永远走不到 95% 以上
+ progress = 95.0 - 15.0 * Math.Exp(-(elapsed - 10.0) / 20.0);
+ }
+ if (progress > 95) progress = 95;
+ ProgressValue = progress;
+ }));
+ }
+ catch
+ {
+ }
+ }
+
+ private void StopUnknownTotalProgressTimer()
+ {
+ if (_unknownTotalProgressTimer == null) return;
+ try
+ {
+ _unknownTotalProgressTimer.Dispose();
+ }
+ catch
+ {
+ }
+ _unknownTotalProgressTimer = null;
+ }
+ #endregion
+}
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml
index ab39602..a871b75 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml
@@ -4,59 +4,66 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
+ xmlns:conv="clr-namespace:_29WxOrderWpf.Converters"
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
mc:Ignorable="d" DataContextChanged="UserControl_DataContextChanged"
+ d:Background="White"
d:DesignHeight="220" d:DesignWidth="1200">
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- -->
+
-
-
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
+
-
-
+
-
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
+
-
-
-
-
+
+
-
-
-
-
-
+
+
-
-
-
-
+
+
-
-
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
+
-
-
-
+
-
-
-
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
-
+
-
-
-
-
-
+
+
+
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
+
-
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs
index 1af5f56..51add91 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs
@@ -1,4 +1,5 @@
using _29WxOrderWpf.BaseWindows;
+using _29WxOrderWpf.Common;
using _29WxOrderWpf.Converters;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.UserControls;
@@ -35,478 +36,479 @@ using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms;
using Work._29Tools.Forms.ToolForms;
using Work.BaseForms;
+using static _29WxOrderWpf.Services.ShipGiftService;
using static System.Net.WebRequestMethods;
namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
- ///
- /// OrderListRowItemCtrl.xaml 的交互逻辑
- ///
- public partial class OrderListRowItemCtrl : UserControl
- {
- public OrderListRowItemCtrl()
- {
- InitializeComponent();
- txtTransitOrderBuyerStr.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtTransitOrderNumStr_MouseLeftButtonUp), true);
- txtTransitOrderNumStr.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtTransitOrderNumStr_MouseLeftButtonUp), true);
- txtDirectBuyer.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtDirectOrderNumStr_MouseLeftButtonUp), true);
- txtDirectBuyerOrderNo.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtDirectOrderNumStr_MouseLeftButtonUp), true);
- txtRefundId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtRefundId_MouseLeftButtonUp), true);
+ ///
+ /// OrderListRowItemCtrl.xaml 的交互逻辑
+ ///
+ public partial class OrderListRowItemCtrl : UserControl
+ {
+ public OrderListRowItemCtrl()
+ {
+ InitializeComponent();
+ txtTransitOrderBuyerStr.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtTransitOrderNumStr_MouseLeftButtonUp), true);
+ txtTransitOrderNumStr.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtTransitOrderNumStr_MouseLeftButtonUp), true);
+ txtDirectBuyer.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtDirectOrderNumStr_MouseLeftButtonUp), true);
+ txtDirectBuyerOrderNo.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtDirectOrderNumStr_MouseLeftButtonUp), true);
+ txtRefundId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtRefundId_MouseLeftButtonUp), true);
- txtWarehouseStatus.AddHandler(TextBox.MouseEnterEvent, new MouseEventHandler(txtWarehouseStatus_MouseEnter), true);
- }
+ txtWarehouseStatus.AddHandler(TextBox.MouseEnterEvent, new MouseEventHandler(txtWarehouseStatus_MouseEnter), true);
+ }
- private void txtRefundId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- if(this.DataContext is oms_wei_order_item_info order_item)
- {
- var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order_item.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;
+ private void txtRefundId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order_item.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=" + order_item.ItemRefund.after_sale_order_id;
- }
- shopLoginForm.Show();
- }
- }
- }
+ {
+ shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/aftersale/detail?orderid=" + order_item.ItemRefund.after_sale_order_id;
+ }
+ shopLoginForm.Show();
+ }
+ }
+ }
- private async void btnSeeAddressDetail_Click(object sender, RoutedEventArgs e)
- {
- var orderItem = this.DataContext as oms_wei_order_item_info;
- if (orderItem == null)
- return;
- var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
- if (shop == null)
- return;
- ShowOrderAddress(shop, orderItem.order_id);
- }
+ private async void btnSeeAddressDetail_Click(object sender, RoutedEventArgs e)
+ {
+ var orderItem = this.DataContext as oms_wei_order_item_info;
+ if (orderItem == null)
+ return;
+ var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
+ if (shop == null)
+ return;
+ ShowOrderAddress(shop, orderItem.order_id);
+ }
- void ShowOrderAddress(ShopLoginInfo shop, string orderId, bool ShowErrorDialog = true)
- {
- //var rows = dgvOrder.Rows.Cast().Where(r => r.Cells["colOrderId"].Value.ParseToString() == orderId);
- var order = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == orderId);
- var deRst = "测试地址写入{\"code\"0}";
- deRst = decryptOrder(shop, orderId);
- if (deRst.Contains("\"code\":0"))
- {
- var url = BaseClass.Build29WxObjString("shop/wx_add_mdy_order_address");
- var data = UserLogin.GetSignaturex();
- data += "&shop_id=" + shop.ShopId;
- data += "&order_id=" + orderId;
- data += "&order_address=" + GetHtml.UrlEncodeUtf8(deRst);
- var html = GetHtml.PostUtf8(url, data);
- if (!html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (!html.Contains("\"code\":200"))
- {
- var errMsg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
- if (order != null)
- {
- this.Dispatcher.Invoke(new Action(() =>
- {
- GetDecryptOrder(deRst, order);
- GlobalConfig.DicDecryptOrderAddress[order.order_id] = order;
- if (ShowErrorDialog)
- BaseMsgWindow.ShowAnimateMessage("查看地址成功但保存到服务端失败:" + errMsg, "Error", 5);
- }));
- }
- }
- else
- {
- if (order != null)
- {
- this.Dispatcher.Invoke(new Action(() =>
- {
- GetDecryptOrder(deRst, order);
- GlobalConfig.DicDecryptOrderAddress[order.order_id] = order;
- BaseMsgWindow.ShowAnimateMessage("查看地址成功");
- }));
- }
- }
- }
- else
- {
- var error = BaseRegex.GetStringJsonByRegs(ref deRst, deRst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
- if (error.Contains("\"code\":17899002") || error.Contains("\"code\":10020123"))
- {
- if (error.Contains("\"code\":17899002"))
- error = "基于用户隐私保护,无法查看收货信息";
- if (error.Contains("\"code\":10020123"))
- error = "今日查看次数已用完";
- Dispatcher.Invoke(new Action(() =>
- {
- if (ShowErrorDialog)
- BaseMsgWindow.ShowAnimateMessage("查看地址失败:" + error, "Error", 5);
- }));
- }
- else
- {
- Dispatcher.Invoke(new Action(() =>
- {
- if (ShowErrorDialog)
- BaseMsgWindow.ShowAnimateMessage("查看地址失败:" + error, "Error", 5);
- }));
- }
- }
- }
- public string GetDecryptOrder(string sourceOrderAddressStr, oms_wei_order_info order)
- {
- //黄颖飞(4559),18466134204-4559,广西壮族自治区柳州市柳南区福柳宏都8-1-701 (拨打请输入分机号4559)
- var userName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "userName"); // 黄颖飞
- var extension = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "extension"); // 4559
- var virtualNumber = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "virtualNumber"); // 18466134204
- var provinceName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "provinceName"); // 广西壮族自治区
- var cityName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "cityName"); // 柳州市
- var countyName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "countyName"); // 柳南区
- var detailInfo = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "detailInfo"); // 福柳宏都8-1-701
- if (userName.IsNullOrEmpty() || extension.IsNullOrEmpty() || virtualNumber.IsNullOrEmpty() || provinceName.IsNullOrEmpty() || cityName.IsNullOrEmpty() ||
- countyName.IsNullOrEmpty() || detailInfo.IsNullOrEmpty())
- {
- return sourceOrderAddressStr;
- }
+ void ShowOrderAddress(ShopLoginInfo shop, string orderId, bool ShowErrorDialog = true)
+ {
+ //var rows = dgvOrder.Rows.Cast().Where(r => r.Cells["colOrderId"].Value.ParseToString() == orderId);
+ var order = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == orderId);
+ var deRst = "测试地址写入{\"code\"0}";
+ deRst = decryptOrder(shop, orderId);
+ if (deRst.Contains("\"code\":0"))
+ {
+ var url = BaseClass.Build29WxObjString("shop/wx_add_mdy_order_address");
+ var data = UserLogin.GetSignaturex();
+ data += "&shop_id=" + shop.ShopId;
+ data += "&order_id=" + orderId;
+ data += "&order_address=" + GetHtml.UrlEncodeUtf8(deRst);
+ var html = GetHtml.PostUtf8(url, data);
+ if (!html.Contains("\"code\":200"))
+ html = GetHtml.PostUtf8(url, data);
+ if (!html.Contains("\"code\":200"))
+ {
+ var errMsg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
+ if (order != null)
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ {
+ GetDecryptOrder(deRst, order);
+ GlobalConfig.DicDecryptOrderAddress[order.order_id] = order;
+ if (ShowErrorDialog)
+ BaseMsgWindow.ShowAnimateMessage("查看地址成功但保存到服务端失败:" + errMsg, "Error", 5);
+ }));
+ }
+ }
+ else
+ {
+ if (order != null)
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ {
+ GetDecryptOrder(deRst, order);
+ GlobalConfig.DicDecryptOrderAddress[order.order_id] = order;
+ BaseMsgWindow.ShowAnimateMessage("查看地址成功");
+ }));
+ }
+ }
+ }
+ else
+ {
+ var error = BaseRegex.GetStringJsonByRegs(ref deRst, deRst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
+ if (error.Contains("\"code\":17899002") || error.Contains("\"code\":10020123"))
+ {
+ if (error.Contains("\"code\":17899002"))
+ error = "基于用户隐私保护,无法查看收货信息";
+ if (error.Contains("\"code\":10020123"))
+ error = "今日查看次数已用完";
+ Dispatcher.Invoke(new Action(() =>
+ {
+ if (ShowErrorDialog)
+ BaseMsgWindow.ShowAnimateMessage("查看地址失败:" + error, "Error", 5);
+ }));
+ }
+ else
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ if (ShowErrorDialog)
+ BaseMsgWindow.ShowAnimateMessage("查看地址失败:" + error, "Error", 5);
+ }));
+ }
+ }
+ }
+ public string GetDecryptOrder(string sourceOrderAddressStr, oms_wei_order_info order)
+ {
+ //黄颖飞(4559),18466134204-4559,广西壮族自治区柳州市柳南区福柳宏都8-1-701 (拨打请输入分机号4559)
+ var userName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "userName"); // 黄颖飞
+ var extension = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "extension"); // 4559
+ var virtualNumber = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "virtualNumber"); // 18466134204
+ var provinceName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "provinceName"); // 广西壮族自治区
+ var cityName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "cityName"); // 柳州市
+ var countyName = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "countyName"); // 柳南区
+ var detailInfo = BaseRegex.GetStringJson(ref sourceOrderAddressStr, "detailInfo"); // 福柳宏都8-1-701
+ if (userName.IsNullOrEmpty() || extension.IsNullOrEmpty() || virtualNumber.IsNullOrEmpty() || provinceName.IsNullOrEmpty() || cityName.IsNullOrEmpty() ||
+ countyName.IsNullOrEmpty() || detailInfo.IsNullOrEmpty())
+ {
+ return sourceOrderAddressStr;
+ }
- order.user_name = userName + "(" + extension + ")";
- order.tel_number = virtualNumber;
- order.tel_number_ext_info = extension;
- order.province_name = provinceName;
- order.city_name = cityName;
- order.county_name = countyName;
- order.detail_info = detailInfo;
+ order.user_name = userName + "(" + extension + ")";
+ order.tel_number = virtualNumber;
+ order.tel_number_ext_info = extension;
+ order.province_name = provinceName;
+ order.city_name = cityName;
+ order.county_name = countyName;
+ order.detail_info = detailInfo;
- //return userName + "(" + extension + ")," + virtualNumber + "-" + extension + "," + provinceName + cityName + countyName + detailInfo + "(拨打请输入分机号" + extension + ")";
- order.AddressStr = userName + "(" + extension + ")" + "," + virtualNumber + "," + provinceName + cityName + countyName + detailInfo;
- return order.AddressStr;
- }
+ //return userName + "(" + extension + ")," + virtualNumber + "-" + extension + "," + provinceName + cityName + countyName + detailInfo + "(拨打请输入分机号" + extension + ")";
+ order.AddressStr = userName + "(" + extension + ")" + "," + virtualNumber + "," + provinceName + cityName + countyName + detailInfo;
+ return order.AddressStr;
+ }
- public static string decryptOrder(ShopLoginInfo shop, string orderId)
- {
- string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/common/cgi/decryptOrder?token=&lang=zh_CN";
- string body = @"{""id"":""" + orderId + @"""}";
+ public static string decryptOrder(ShopLoginInfo shop, string orderId)
+ {
+ string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/common/cgi/decryptOrder?token=&lang=zh_CN";
+ string body = @"{""id"":""" + orderId + @"""}";
- string refere = "https://store.weixin.qq.com/shop/order/list";
- var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
- return result;
- }
+ string refere = "https://store.weixin.qq.com/shop/order/list";
+ var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
+ return result;
+ }
- private void btnGetRefundAddress_Click(object sender, RoutedEventArgs e)
- {
- var order = this.DataContext as oms_wei_order_item_info;
- if (order == null)
- return;
- }
+ private void btnGetRefundAddress_Click(object sender, RoutedEventArgs e)
+ {
+ var order = this.DataContext as oms_wei_order_item_info;
+ if (order == null)
+ return;
+ }
- private void CheckBox_Click(object sender, RoutedEventArgs e)
- {
+ private void CheckBox_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;
+ 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;
- }
+ 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;
- }
- }
- }
+ 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 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;
+ 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 (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;
+ 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;
- }
- }
- }
+ 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 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)
- {
- BuyOrder();
- }
+ private void btnBuyOrder_Click(object sender, RoutedEventArgs e)
+ {
+ BuyOrder();
+ }
- public void BuyOrder(bool isAbnormalOrder = false)
- {
- var orderItem = this.DataContext as oms_wei_order_item_info;
- if (orderItem == null)
- {
- BaseMsgWindow.ShowError("订单信息为空");
- return;
- }
- if (GlobalConfig.CurrentPddBuyer == null)
- {
- BaseMsgWindow.ShowError("请选择买手号");
- return;
- }
- if (orderItem.ItemOrder.orderItems.Count > 1)
- {
- BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
- return;
- }
+ public void BuyOrder(bool isAbnormalOrder = false)
+ {
+ var orderItem = this.DataContext as oms_wei_order_item_info;
+ if (orderItem == null)
+ {
+ BaseMsgWindow.ShowError("订单信息为空");
+ return;
+ }
+ if (GlobalConfig.CurrentPddBuyer == null)
+ {
+ BaseMsgWindow.ShowError("请选择买手号");
+ return;
+ }
+ if (orderItem.ItemOrder.orderItems.Count > 1)
+ {
+ BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
+ return;
+ }
- if (!GetIsAbnormalOrderRebuy(orderItem) && GlobalConfig.lstOrder.Any(o => o.orderItems
- .Any(oi => oi.ItemTransitOrder?.order_no == orderItem.order_id && oi.ItemTransitOrder?.order_sku_id == orderItem.sku_id)))
- {
- MainWindow.Instance.orderListCtrl.FilterOneOrder(orderItem.ItemOrder);
- BaseMsgWindow.ShowError("已存在中转拍单信息,请核对后再拍单");
- return;
- }
+ if (!GetIsAbnormalOrderRebuy(orderItem) && GlobalConfig.lstOrder.Any(o => o.orderItems
+ .Any(oi => oi.ItemTransitOrder?.order_no == orderItem.order_id && oi.ItemTransitOrder?.order_sku_id == orderItem.sku_id)))
+ {
+ MainWindow.Instance.orderListCtrl.FilterOneOrder(orderItem.ItemOrder);
+ BaseMsgWindow.ShowError("已存在中转拍单信息,请核对后再拍单");
+ return;
+ }
- btnBuyOrder.Cursor = Cursors.Wait;
- btnBuyOrder.IsEnabled = false;
- Task.Run(() =>
- {
- Thread.Sleep(2000);
- Dispatcher.Invoke(new Action(() => { btnBuyOrder.IsEnabled = true; }));
- });
- 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;
+ btnBuyOrder.Cursor = Cursors.Wait;
+ btnBuyOrder.IsEnabled = false;
+ Task.Run(() =>
+ {
+ Thread.Sleep(2000);
+ Dispatcher.Invoke(new Action(() => { btnBuyOrder.IsEnabled = true; }));
+ });
+ 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 (!isAbnormalOrder && orderItem.ItemTransitOrder != null)
- {
- // 正常单有未作废订单的,不可再拍单
- BaseMsgWindow.ShowAnimateMessage("该订单已有采购记录", "Error", 5);
- return;
- }
- if (isAbnormalOrder && (orderItem.ItemOrder.status <= 21 || orderItem.ItemTransitOrder == null || orderItem.ItemTransitOrder.refund_status != "买手退款成功"))
- {
- // 异常单不是被拼多多买家秒退的且已取号的,不可异常重拍
- BaseMsgWindow.ShowAnimateMessage("该异常单不符合重拍条件", "Error", 5);
- return;
- }
+ if (!isAbnormalOrder && orderItem.ItemTransitOrder != null)
+ {
+ // 正常单有未作废订单的,不可再拍单
+ BaseMsgWindow.ShowAnimateMessage("该订单已有采购记录", "Error", 5);
+ return;
+ }
+ if (isAbnormalOrder && (orderItem.ItemOrder.status <= 21 || orderItem.ItemTransitOrder == null || orderItem.ItemTransitOrder.refund_status != "买手退款成功"))
+ {
+ // 异常单不是被拼多多买家秒退的且已取号的,不可异常重拍
+ BaseMsgWindow.ShowAnimateMessage("该异常单不符合重拍条件", "Error", 5);
+ return;
+ }
- // 如果是退款单,弹出退款窗口
- if (CheckIsRefund(orderItem))
- return;
+ // 如果是退款单,弹出退款窗口
+ if (CheckIsRefund(orderItem))
+ return;
- // 拍单前检测买手号是否在线
- if (GlobalConfig.CurrentPddBuyer.status == "在线")
- {
- PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
- }
- if (GlobalConfig.CurrentPddBuyer.status != "在线")
- {
- Dispatcher.Invoke(new Action(() =>
- {
- BaseMsgWindow.ShowError("买手号掉线");
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- return;
- }
+ // 拍单前检测买手号是否在线
+ if (GlobalConfig.CurrentPddBuyer.status == "在线")
+ {
+ PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
+ }
+ if (GlobalConfig.CurrentPddBuyer.status != "在线")
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ BaseMsgWindow.ShowError("买手号掉线");
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ return;
+ }
- orderRetry:
- // 拍单前查询账户余额
- if (!isAbnormalOrder)
- {
- if (GlobalConfig.BuyConfig.IsUseAppBalance)
- {
- if (BaseClass.Balance < 10)
- {
- Dispatcher.Invoke(new Action(() =>
- {
- 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(() =>
- {
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- GlobalConfig.BuyConfig.IsUseAppBalance = true;
- StartUp.SaveBuyConfig();
- BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
- goto orderRetry;
- }
- if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
- {
- try
- {
- var erpMs = JsonHelper.DeserializeJsonToList(JsonHelper.JObjectParse(html)["data"].ParseToString());
- var erpM = erpMs.FirstOrDefault();
- if (erpM == null)
- {
- Dispatcher.Invoke(new Action(() =>
- {
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- GlobalConfig.BuyConfig.IsUseAppBalance = true;
- StartUp.SaveBuyConfig();
- BaseMsgWindow.ShowError("未找到店铺账户!自动切换为快递余额拍单。");
- goto orderRetry;
- }
+ orderRetry:
+ // 拍单前查询账户余额
+ if (!isAbnormalOrder)
+ {
+ if (GlobalConfig.BuyConfig.IsUseAppBalance)
+ {
+ if (BaseClass.Balance < 10)
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ 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(() =>
+ {
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ GlobalConfig.BuyConfig.IsUseAppBalance = true;
+ StartUp.SaveBuyConfig();
+ BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
+ goto orderRetry;
+ }
+ if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
+ {
+ try
+ {
+ var erpMs = JsonHelper.DeserializeJsonToList(JsonHelper.JObjectParse(html)["data"].ParseToString());
+ var erpM = erpMs.FirstOrDefault();
+ if (erpM == null)
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ GlobalConfig.BuyConfig.IsUseAppBalance = true;
+ StartUp.SaveBuyConfig();
+ BaseMsgWindow.ShowError("未找到店铺账户!自动切换为快递余额拍单。");
+ goto orderRetry;
+ }
- var balance = erpM.balance.ParseToDecimal();
- if (balance < 10)
- {
- Dispatcher.Invoke(new Action(() =>
- {
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- GlobalConfig.BuyConfig.IsUseAppBalance = true;
- StartUp.SaveBuyConfig();
- BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,自动切换为快递余额拍单。");
- goto orderRetry;
- }
- }
- catch
- {
- Dispatcher.Invoke(new Action(() =>
- {
- BaseMsgWindow.ShowError("拍单校验出错,请稍后重试");
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- return;
- }
- }
- }
- }
+ var balance = erpM.balance.ParseToDecimal();
+ if (balance < 10)
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ GlobalConfig.BuyConfig.IsUseAppBalance = true;
+ StartUp.SaveBuyConfig();
+ BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,自动切换为快递余额拍单。");
+ goto orderRetry;
+ }
+ }
+ catch
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ BaseMsgWindow.ShowError("拍单校验出错,请稍后重试");
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ return;
+ }
+ }
+ }
+ }
- if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
- {
- if (orderItem.Shop != null)
- {
- WXShopLoginForm shopLoginForm = new WXShopLoginForm(orderItem.Shop);
- shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
- shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
- shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/supply/consignmentOrderList";
- shopLoginForm.IsGetSupplierPage = true;
- shopLoginForm.ShowDialog();
+ if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
+ {
+ if (orderItem.Shop != null)
+ {
+ WXShopLoginForm shopLoginForm = new WXShopLoginForm(orderItem.Shop);
+ shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
+ shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/supply/consignmentOrderList";
+ shopLoginForm.IsGetSupplierPage = true;
+ shopLoginForm.ShowDialog();
- // 不是立即生效的,不用立即刷新
- //var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
- //if (!is29SupplierRst.Contains("\"code\":0"))
- // is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
- //if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
- //{
- // orderItem.Shop.Is29Supplier = true;
- //}
- //else
- //{
- // ShopBLL.CheckShopLogin(orderItem.Shop);
- // orderItem.Shop.Is29Supplier = false;
- //}
- //foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
- //{
- // // 更新代发管理情况
- // foreach (var o in order.orderItems)
- // Dispatcher.Invoke(new Action(() => { o.UpdateOrderItemBuyButton(); }));
- //}
- }
- Dispatcher.Invoke(new Action(() =>
- {
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- return;
- }
+ // 不是立即生效的,不用立即刷新
+ //var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
+ //if (!is29SupplierRst.Contains("\"code\":0"))
+ // is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
+ //if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
+ //{
+ // orderItem.Shop.Is29Supplier = true;
+ //}
+ //else
+ //{
+ // ShopBLL.CheckShopLogin(orderItem.Shop);
+ // orderItem.Shop.Is29Supplier = false;
+ //}
+ //foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
+ //{
+ // // 更新代发管理情况
+ // foreach (var o in order.orderItems)
+ // Dispatcher.Invoke(new Action(() => { o.UpdateOrderItemBuyButton(); }));
+ //}
+ }
+ Dispatcher.Invoke(new Action(() =>
+ {
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ return;
+ }
// Api检测是否加入代发
if (orderItem.BuyGoodsBtnTxt == "云仓拍单" && !isAbnormalOrder)
@@ -552,658 +554,658 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// orderItem.Shop.Is29Supplier = true;
//}
- // 掉线提示重登
- if (orderItem.Shop?.LoginStatus != "登录成功")
- {
- foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
- {
- // 更新代发管理情况
- foreach (var oi in ord.orderItems)
- Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
- }
- Dispatcher.Invoke(new Action(() =>
- {
- BaseMsgWindow.ShowError("请登录店铺");
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- return;
- }
+ // 掉线提示重登
+ if (orderItem.Shop?.LoginStatus != "登录成功")
+ {
+ foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
+ {
+ // 更新代发管理情况
+ foreach (var oi in ord.orderItems)
+ Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
+ }
+ Dispatcher.Invoke(new Action(() =>
+ {
+ BaseMsgWindow.ShowError("请登录店铺");
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ return;
+ }
- //BaseMsgWindow.ShowAnimateMessage("触发成功!" + DateTime.Now.ParseToString(), "Msg", 5);
- //return;
+ //BaseMsgWindow.ShowAnimateMessage("触发成功!" + DateTime.Now.ParseToString(), "Msg", 5);
+ //return;
- // 打开拍单窗口
- Dispatcher.Invoke(new Action(() =>
- {
- btnBuyOrder.Cursor = Cursors.Hand;
+ // 打开拍单窗口
+ Dispatcher.Invoke(new Action(() =>
+ {
+ btnBuyOrder.Cursor = Cursors.Hand;
- PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
- orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
+ PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
+ orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
- buyOrderForm.TitleText = "买手拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
+ buyOrderForm.TitleText = "买手拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
- // 未关联拍单的跳到所有订单页面
- buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html"; //"?type=0&comment_tab=1&combine_orders=1&main_orders=1&refer_page_name=personal&refer_page_id=10001_1782219035613_a9ulipk4k3&refer_page_sn=10001";
- buyOrderForm.pnlBuy.Visible = false;
+ // 未关联拍单的跳到所有订单页面
+ buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html"; //"?type=0&comment_tab=1&combine_orders=1&main_orders=1&refer_page_name=personal&refer_page_id=10001_1782219035613_a9ulipk4k3&refer_page_sn=10001";
+ buyOrderForm.pnlBuy.Visible = false;
- // 已有拍单关联的跳的到订单确认界面
- if (orderItem.BuyMap != null)
- {
- //buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
- // "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + +orderItem.sku_cnt +
- // "&page_from=101&detail_id=" + Randomx.GetNumber(11) + "&_oak_rcto=YW" +
- // Randomx.GetWordNumber("JvLXvJ8Fx9mUIW34yn103TOlATJGk5PaZshD6pY1bsVrsIjWdxWwjCoNX3IGT".Length) + "_VWkP5_q-1QNqGg" +
- // "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
- // "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
+ // 已有拍单关联的跳的到订单确认界面
+ if (orderItem.BuyMap != null)
+ {
+ //buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
+ // "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + +orderItem.sku_cnt +
+ // "&page_from=101&detail_id=" + Randomx.GetNumber(11) + "&_oak_rcto=YW" +
+ // Randomx.GetWordNumber("JvLXvJ8Fx9mUIW34yn103TOlATJGk5PaZshD6pY1bsVrsIjWdxWwjCoNX3IGT".Length) + "_VWkP5_q-1QNqGg" +
+ // "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
+ // "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
- buyOrderForm.ShowBuyMask = true;
- buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
- "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
- "&page_from=101";
+ buyOrderForm.ShowBuyMask = true;
+ buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
+ "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
+ "&page_from=101";
- //buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
- // "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
- // "&page_from=0&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail&refer_page_id=10014_" +
- // BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10014";
+ //buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
+ // "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
+ // "&page_from=0&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail&refer_page_id=10014_" +
+ // BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10014";
- buyOrderForm.pnlBuy.Visible = true;
- buyOrderForm.pnlMap.Visible = false;
- }
- if (isAbnormalOrder)
- buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
- buyOrderForm.ShowDialog();
- }));
- });
- }
+ buyOrderForm.pnlBuy.Visible = true;
+ buyOrderForm.pnlMap.Visible = false;
+ }
+ if (isAbnormalOrder)
+ buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
+ buyOrderForm.ShowDialog();
+ }));
+ });
+ }
- private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info order_item)
- {
- //btnBuyOrder.Content = "关联拍单";
+ private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ //btnBuyOrder.Content = "关联拍单";
- // 显示预估利润
- //if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
- // txtProfitForecast.Visibility = Visibility.Visible;
+ // 显示预估利润
+ //if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
+ // txtProfitForecast.Visibility = Visibility.Visible;
- // 绑定时即刻生效,无需再次手动调用
- //order_item.UpdateOrderItemBuyButton();
+ // 绑定时即刻生效,无需再次手动调用
+ //order_item.UpdateOrderItemBuyButton();
- Task.Run(() =>
- {
- // 异步加载图片防止卡顿
- // 缩略图在有的电脑上无法显示
- //BitmapImage bImg = ImageUrlToBitmapImageConverter.LoadImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient=");
- BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(order_item.thumb_img);
- Thread.Sleep(Randomx.GetId(1000));
- Dispatcher.Invoke(new Action(() =>
- {
- imgOrderItem.Source = bImg;
- }));
- });
+ Task.Run(() =>
+ {
+ // 异步加载图片防止卡顿
+ // 缩略图在有的电脑上无法显示
+ //BitmapImage bImg = ImageUrlToBitmapImageConverter.LoadImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient=");
+ BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(order_item.thumb_img);
+ Thread.Sleep(Randomx.GetId(1000));
+ Dispatcher.Invoke(new Action(() =>
+ {
+ imgOrderItem.Source = bImg;
+ }));
+ });
- // 作废重拍
- if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
- {
- btnVoidTransitOrder.Visibility = Visibility.Visible;
- }
- else
- {
- btnVoidTransitOrder.Visibility = Visibility.Collapsed;
- }
+ // 作废重拍
+ if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
+ {
+ btnVoidTransitOrder.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ btnVoidTransitOrder.Visibility = Visibility.Collapsed;
+ }
- // 异常重拍
- if (GetIsAbnormalOrderRebuy(order_item))
- {
- btnAbnormalOrderRebuy.Visibility = Visibility.Visible;
- }
- else
- {
- btnAbnormalOrderRebuy.Visibility = Visibility.Collapsed;
- }
+ // 异常重拍
+ if (GetIsAbnormalOrderRebuy(order_item))
+ {
+ btnAbnormalOrderRebuy.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ btnAbnormalOrderRebuy.Visibility = Visibility.Collapsed;
+ }
- // 待采购不显示所有采购信息状态(否则会显示作废订单状态)
- if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购"))
- {
- //wpBuyAccount.Visibility = Visibility.Collapsed;
- //wpBuyOrderId.Visibility = Visibility.Collapsed;
- //wpBuyTime.Visibility = Visibility.Collapsed;
- //wpTransitWaybillStatus.Visibility = Visibility.Collapsed;
- //wpTransitBuyerRefundStatus.Visibility = Visibility.Collapsed;
+ // 待采购不显示所有采购信息状态(否则会显示作废订单状态)
+ if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购"))
+ {
+ //wpBuyAccount.Visibility = Visibility.Collapsed;
+ //wpBuyOrderId.Visibility = Visibility.Collapsed;
+ //wpBuyTime.Visibility = Visibility.Collapsed;
+ //wpTransitWaybillStatus.Visibility = Visibility.Collapsed;
+ //wpTransitBuyerRefundStatus.Visibility = Visibility.Collapsed;
- wpBuyAccount.Opacity = 0.5;
- wpBuyOrderId.Opacity = 0.5;
- wpBuyTime.Opacity = 0.5;
- wpTransitWaybillStatus.Opacity = 0.5;
- wpTransitBuyerRefundStatus.Opacity = 0.5;
- }
- }
- }
+ wpBuyAccount.Opacity = 0.5;
+ wpBuyOrderId.Opacity = 0.5;
+ wpBuyTime.Opacity = 0.5;
+ wpTransitWaybillStatus.Opacity = 0.5;
+ wpTransitBuyerRefundStatus.Opacity = 0.5;
+ }
+ }
+ }
- ///
- /// 判断中转仓订单是否可以异常重拍
- ///
- ///
- ///
- bool GetIsAbnormalOrderRebuy(oms_wei_order_item_info order_item)
- {
- // 不是异常单的不可异常重拍
- if (order_item?.ItemOrder?.isAbnormal != true)
- return false;
- // 买手未退款的,中转正式取号以后的,不可异常重拍
- if (order_item.ItemTransitOrder?.refund_status != "买手退款成功" ||
- order_item.WarehouseWaybillStatusStr == "中转已取号" || order_item.WarehouseWaybillStatusStr == "中转已入库" || order_item.WarehouseWaybillStatusStr == "中转已出库")
- return false;
- // 已正式取号的,不可异常重拍
- if (order_item.ItemTransitOrder?.pre_allocated_order_no == 1 || order_item.ItemTransitOrder?.pre_allocated_order_no == 3)
- return false;
- // 仓库异常的异常单不可异常重拍
- List rawMsgKeyWords = new List { "取号异常", "无法调用" };
- if (rawMsgKeyWords.Any(k => (order_item.ItemTransitOrderWithVoid?.raw_message).ParseToString().Contains(k)) && order_item.ItemTransitOrderWithVoid?.transfer_warehouse_status != 1)
- return false;
+ ///
+ /// 判断中转仓订单是否可以异常重拍
+ ///
+ ///
+ ///
+ bool GetIsAbnormalOrderRebuy(oms_wei_order_item_info order_item)
+ {
+ // 不是异常单的不可异常重拍
+ if (order_item?.ItemOrder?.isAbnormal != true)
+ return false;
+ // 买手未退款的,中转正式取号以后的,不可异常重拍
+ if (order_item.ItemTransitOrder?.refund_status != "买手退款成功" ||
+ order_item.WarehouseWaybillStatusStr == "中转已取号" || order_item.WarehouseWaybillStatusStr == "中转已入库" || order_item.WarehouseWaybillStatusStr == "中转已出库")
+ return false;
+ // 已正式取号的,不可异常重拍
+ if (order_item.ItemTransitOrder?.pre_allocated_order_no == 1 || order_item.ItemTransitOrder?.pre_allocated_order_no == 3)
+ return false;
+ // 仓库异常的异常单不可异常重拍
+ List rawMsgKeyWords = new List { "取号异常", "无法调用" };
+ if (rawMsgKeyWords.Any(k => (order_item.ItemTransitOrderWithVoid?.raw_message).ParseToString().Contains(k)) && order_item.ItemTransitOrderWithVoid?.transfer_warehouse_status != 1)
+ return false;
- return true;
- }
+ return true;
+ }
- private void txtTransitOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- var buyerName = txtTransitOrderBuyerStr.Text.Split(':').LastOrDefault();
- var outOrderId = txtTransitOrderNumStr.Text.Split(':').LastOrDefault();
- if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
- {
- return;
- }
- var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_name == buyerName);
- if (buyer == null)
- {
- BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
- return;
- }
- //GlobalConfig.CurrentPddBuyer = buyer;
+ private void txtTransitOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ var buyerName = txtTransitOrderBuyerStr.Text.Split(':').LastOrDefault();
+ var outOrderId = txtTransitOrderNumStr.Text.Split(':').LastOrDefault();
+ if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
+ {
+ return;
+ }
+ var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_name == buyerName);
+ if (buyer == null)
+ {
+ BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
+ return;
+ }
+ //GlobalConfig.CurrentPddBuyer = buyer;
- var url = "";
- if (buyer != null)
- {
- if (sender == txtTransitOrderBuyerStr)
- url = "https://mobile.yangkeduo.com/index.html";
- else
- url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
- "&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
- }
+ var url = "";
+ if (buyer != null)
+ {
+ if (sender == txtTransitOrderBuyerStr)
+ url = "https://mobile.yangkeduo.com/index.html";
+ else
+ url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
+ "&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
+ }
- var orderItem = this.DataContext as oms_wei_order_item_info;
- if (orderItem == null)
- {
- BaseMsgWindow.ShowError("订单信息为空");
- return;
- }
- // 拍单的时候检测一下买手号
- if (buyer.status == "在线")
- {
- PddMobileLoginForm.CheckBuyerLogin(buyer);
- }
- if (buyer.status != "在线")
- {
- BaseMsgWindow.ShowError("买手号掉线");
- return;
- }
+ var orderItem = this.DataContext as oms_wei_order_item_info;
+ if (orderItem == null)
+ {
+ BaseMsgWindow.ShowError("订单信息为空");
+ return;
+ }
+ // 拍单的时候检测一下买手号
+ if (buyer.status == "在线")
+ {
+ PddMobileLoginForm.CheckBuyerLogin(buyer);
+ }
+ if (buyer.status != "在线")
+ {
+ BaseMsgWindow.ShowError("买手号掉线");
+ return;
+ }
- PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
- orderItem, buyer, orderItem.BuyMap);
- buyOrderForm.TitleText = "订单查看 - 当前买手 " + buyer.buyer_nick;
+ PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
+ orderItem, buyer, orderItem.BuyMap);
+ buyOrderForm.TitleText = "订单查看 - 当前买手 " + buyer.buyer_nick;
- //所有订单页面
- buyOrderForm.InitUrl = url;
- buyOrderForm.pnlBuy.Visible = false;
+ //所有订单页面
+ buyOrderForm.InitUrl = url;
+ buyOrderForm.pnlBuy.Visible = false;
- //已有拍单关联的控制界面显示隐藏
- if (orderItem.BuyMap != null)
- {
- buyOrderForm.pnlBuy.Visible = true;
- buyOrderForm.pnlMap.Visible = false;
- }
- buyOrderForm.ShowDialog();
- }
+ //已有拍单关联的控制界面显示隐藏
+ if (orderItem.BuyMap != null)
+ {
+ buyOrderForm.pnlBuy.Visible = true;
+ buyOrderForm.pnlMap.Visible = false;
+ }
+ buyOrderForm.ShowDialog();
+ }
- private void txtDirectOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- var buyerName = txtDirectBuyer.Text.Split(':').LastOrDefault();
- var outOrderId = txtDirectBuyerOrderNo.Text.Split(':').LastOrDefault();
- if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
- {
- return;
- }
- var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_name == buyerName);
- if (buyer == null)
- {
- BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
- return;
- }
- //GlobalConfig.CurrentPddBuyer = buyer;
+ private void txtDirectOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ var buyerName = txtDirectBuyer.Text.Split(':').LastOrDefault();
+ var outOrderId = txtDirectBuyerOrderNo.Text.Split(':').LastOrDefault();
+ if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
+ {
+ return;
+ }
+ var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_name == buyerName);
+ if (buyer == null)
+ {
+ BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
+ return;
+ }
+ //GlobalConfig.CurrentPddBuyer = buyer;
- var url = "";
- if (buyer != null)
- {
- if (sender == txtDirectBuyer)
- url = "https://mobile.yangkeduo.com/index.html";
- else
- url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
- "&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
- }
+ var url = "";
+ if (buyer != null)
+ {
+ if (sender == txtDirectBuyer)
+ url = "https://mobile.yangkeduo.com/index.html";
+ else
+ url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
+ "&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
+ }
- var orderItem = this.DataContext as oms_wei_order_item_info;
- if (orderItem == null)
- {
- BaseMsgWindow.ShowError("订单信息为空");
- return;
- }
- // 拍单的时候检测一下买手号
- if (buyer.status == "在线")
- {
- PddMobileLoginForm.CheckBuyerLogin(buyer);
- }
- if (buyer.status != "在线")
- {
- BaseMsgWindow.ShowError("买手号掉线");
- return;
- }
+ var orderItem = this.DataContext as oms_wei_order_item_info;
+ if (orderItem == null)
+ {
+ BaseMsgWindow.ShowError("订单信息为空");
+ return;
+ }
+ // 拍单的时候检测一下买手号
+ if (buyer.status == "在线")
+ {
+ PddMobileLoginForm.CheckBuyerLogin(buyer);
+ }
+ if (buyer.status != "在线")
+ {
+ BaseMsgWindow.ShowError("买手号掉线");
+ return;
+ }
- //PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, buyer, orderItem.BuyMap);
- PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(null, null, orderItem, buyer, orderItem.BuyMap);
- buyOrderForm.BuyType = "direct";
- buyOrderForm.TitleText = "直发订单查看 - 当前买手 " + buyer.buyer_nick;
+ //PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, buyer, orderItem.BuyMap);
+ PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(null, null, orderItem, buyer, orderItem.BuyMap);
+ buyOrderForm.BuyType = "direct";
+ buyOrderForm.TitleText = "直发订单查看 - 当前买手 " + buyer.buyer_nick;
- //所有订单页面
- buyOrderForm.InitUrl = url;
- buyOrderForm.pnlBuy.Visible = false;
+ //所有订单页面
+ buyOrderForm.InitUrl = url;
+ buyOrderForm.pnlBuy.Visible = false;
- //已有拍单关联的控制界面显示隐藏
- if (orderItem.BuyMap != null)
- {
- buyOrderForm.pnlBuy.Visible = true;
- buyOrderForm.pnlMap.Visible = false;
- }
- buyOrderForm.ShowDialog();
- }
+ //已有拍单关联的控制界面显示隐藏
+ if (orderItem.BuyMap != null)
+ {
+ buyOrderForm.pnlBuy.Visible = true;
+ buyOrderForm.pnlMap.Visible = false;
+ }
+ buyOrderForm.ShowDialog();
+ }
- private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
- try
- {
- Clipboard.SetDataObject(orderItem.ItemTransitOrderWithVoid.out_order_no);
- BaseMsgWindow.ShowAnimateMessage("复制成功");
- }
- catch (Exception ex)
- {
- BaseMsgWindow.ShowError("复制失败 " + ex.Message);
- }
- }
- }
+ private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
+ try
+ {
+ Clipboard.SetDataObject(orderItem.ItemTransitOrderWithVoid.out_order_no);
+ BaseMsgWindow.ShowAnimateMessage("复制成功");
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("复制失败 " + ex.Message);
+ }
+ }
+ }
- private void pathRefundId_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info order_item)
- {
- try
- {
- Clipboard.SetDataObject(order_item.ItemRefund.after_sale_order_id);
- BaseMsgWindow.ShowAnimateMessage("复制成功");
- }
- catch (Exception ex)
- {
- BaseMsgWindow.ShowError("复制失败 " + ex.Message);
- }
- }
- }
+ private void pathRefundId_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ try
+ {
+ Clipboard.SetDataObject(order_item.ItemRefund.after_sale_order_id);
+ BaseMsgWindow.ShowAnimateMessage("复制成功");
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("复制失败 " + ex.Message);
+ }
+ }
+ }
- private void imgOrderItem_MouseEnter(object sender, MouseEventArgs e)
- {
+ private void imgOrderItem_MouseEnter(object sender, MouseEventArgs e)
+ {
- }
+ }
- private void imgOrderItem_MouseLeave(object sender, MouseEventArgs e)
- {
+ private void imgOrderItem_MouseLeave(object sender, MouseEventArgs e)
+ {
- }
+ }
- private void imgOrderItem_MouseDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
- ShowImgForm imgFrom = new ShowImgForm(orderItem.thumb_img);
- imgFrom.ShowDialog();
- }
- }
+ private void imgOrderItem_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
+ ShowImgForm imgFrom = new ShowImgForm(orderItem.thumb_img);
+ imgFrom.ShowDialog();
+ }
+ }
- private async void btnVoidTransitOrder_Click(object sender, RoutedEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
- VoidOrder(orderItem);
- }
- }
+ private async void btnVoidTransitOrder_Click(object sender, RoutedEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
+ VoidOrder(orderItem);
+ }
+ }
- ///
- /// 作废中转仓订单
- ///
- ///
- ///
- /// 作废前是否更新服务端订单状态
- public static async void VoidOrder(oms_wei_order_item_info orderItem, bool isSilent = false, bool UpdateOrderBeforeVoid = true)
- {
- // 作废前查询订单状态
- var orderId = orderItem.order_id;
- var skuId = orderItem.sku_id;
- await Task.Run(() =>
- {
- if(UpdateOrderBeforeVoid)
- MainWindow.Instance.orderListCtrl.GetOrder(orderId);
+ ///
+ /// 作废中转仓订单
+ ///
+ ///
+ ///
+ /// 作废前是否更新服务端订单状态
+ public static async void VoidOrder(oms_wei_order_item_info orderItem, bool isSilent = false, bool UpdateOrderBeforeVoid = true)
+ {
+ // 作废前查询订单状态
+ var orderId = orderItem.order_id;
+ var skuId = orderItem.sku_id;
+ await Task.Run(() =>
+ {
+ if (UpdateOrderBeforeVoid)
+ 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)
- {
- if (!isSilent)
- BaseMsgWindow.ShowError("订单查询失败,请重试");
- return;
- }
- if (orderItem.ItemTransitOrder == null)
- {
- if (!isSilent)
- BaseMsgWindow.ShowError("要作废的中转订单不存在,请确认后重试");
- return;
- }
+ 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)
+ {
+ if (!isSilent)
+ BaseMsgWindow.ShowError("订单查询失败,请重试");
+ return;
+ }
+ if (orderItem.ItemTransitOrder == null)
+ {
+ if (!isSilent)
+ BaseMsgWindow.ShowError("要作废的中转订单不存在,请确认后重试");
+ return;
+ }
- bool noBuyer = false;
- var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_name == orderItem?.ItemTransitOrder?.buyer_account);
- if (buyer == null)
- {
- if (!isSilent)
- if (BaseMsgWindow.ShowConfirm("拍单买手不存在,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
- return;
- noBuyer = true;
- }
+ bool noBuyer = false;
+ var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_name == orderItem?.ItemTransitOrder?.buyer_account);
+ if (buyer == null)
+ {
+ if (!isSilent)
+ if (BaseMsgWindow.ShowConfirm("拍单买手不存在,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
+ return;
+ noBuyer = true;
+ }
- // 检测一下买手号
- if (GlobalConfig.CurrentPddBuyer.status == "在线")
- {
- await Task.Run(() =>
- {
- PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
- });
- }
- if (GlobalConfig.CurrentPddBuyer.status != "在线")
- {
- if (!isSilent)
- if (BaseMsgWindow.ShowConfirm("买手号掉线,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
- return;
- noBuyer = true;
- }
+ // 检测一下买手号
+ if (GlobalConfig.CurrentPddBuyer.status == "在线")
+ {
+ await Task.Run(() =>
+ {
+ PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
+ });
+ }
+ if (GlobalConfig.CurrentPddBuyer.status != "在线")
+ {
+ if (!isSilent)
+ if (BaseMsgWindow.ShowConfirm("买手号掉线,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
+ return;
+ noBuyer = true;
+ }
- if (!noBuyer)
- {
- PddBuyerOrderLiteInfo order = null;
- MainWindow.Instance.Dispatcher.Invoke(new Action(() => { }));
- order = PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite.FirstOrDefault(o => o.order_sn == orderItem.ItemTransitOrder.out_order_no);
- if (order == null)
- order = new PddBuyerOrderLiteInfo()
- {
- order_status_prompt = "待发货",
- order_amount = orderItem.ItemTransitOrder.out_amount,
- order_sn = orderItem.ItemTransitOrder.out_order_no
- };
- PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite.Add(order);
- var pddAfterRst = PDDBuyerOrderReadCtrl.SimPddAfterSale(buyer, order);
- if (pddAfterRst.Contains("\"after_sales_status\":1") || pddAfterRst.Contains("该订单已全额退款") || pddAfterRst.Contains("订单未付款"))
- {
- // 保存退款成功状态
- order.order_status_prompt = pddAfterRst.Contains("订单未付款") ? "订单未付款" : "退款成功";
- // 中转仓订单买手号售后信息 存到服务端
- var refundRst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(order);
- if (refundRst.Contains("0") || refundRst.Contains("200"))
- {
- order.sendStatus = "退款成功 买手退款信息更新成功";
- }
- else
- {
- var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
- order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
- }
- NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite);
- }
- else
- {
- if (!isSilent)
- if (BaseMsgWindow.ShowConfirm("买手退款失败,点击确定直接作废中转单并手动取消买手单,点击取消稍候重试").DialogResult != true)
- return;
- }
- }
+ if (!noBuyer)
+ {
+ PddBuyerOrderLiteInfo order = null;
+ MainWindow.Instance.Dispatcher.Invoke(new Action(() => { }));
+ order = PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite.FirstOrDefault(o => o.order_sn == orderItem.ItemTransitOrder.out_order_no);
+ if (order == null)
+ order = new PddBuyerOrderLiteInfo()
+ {
+ order_status_prompt = "待发货",
+ order_amount = orderItem.ItemTransitOrder.out_amount,
+ order_sn = orderItem.ItemTransitOrder.out_order_no
+ };
+ PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite.Add(order);
+ var pddAfterRst = PDDBuyerOrderReadCtrl.SimPddAfterSale(buyer, order);
+ if (pddAfterRst.Contains("\"after_sales_status\":1") || pddAfterRst.Contains("该订单已全额退款") || pddAfterRst.Contains("订单未付款"))
+ {
+ // 保存退款成功状态
+ order.order_status_prompt = pddAfterRst.Contains("订单未付款") ? "订单未付款" : "退款成功";
+ // 中转仓订单买手号售后信息 存到服务端
+ var refundRst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(order);
+ if (refundRst.Contains("0") || refundRst.Contains("200"))
+ {
+ order.sendStatus = "退款成功 买手退款信息更新成功";
+ }
+ else
+ {
+ var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
+ order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
+ }
+ NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite);
+ }
+ else
+ {
+ if (!isSilent)
+ if (BaseMsgWindow.ShowConfirm("买手退款失败,点击确定直接作废中转单并手动取消买手单,点击取消稍候重试").DialogResult != true)
+ return;
+ }
+ }
- //订单作废接口(作废重拍)
- //postman request POST 'http://localhost:8088/oms-api/external_procurement/discardOrder' \
- // --header 'Content-Type: application/json' \
- // --body '{
- // "orderNo":"12334534534",
- // "outOrderNo":"12312312"
- //}' 成功返回code:0 失败返回code:1
+ //订单作废接口(作废重拍)
+ //postman request POST 'http://localhost:8088/oms-api/external_procurement/discardOrder' \
+ // --header 'Content-Type: application/json' \
+ // --body '{
+ // "orderNo":"12334534534",
+ // "outOrderNo":"12312312"
+ //}' 成功返回code:0 失败返回code:1
- string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
- var data2 = new JObject();
- data2["orderNo"] = orderItem.order_id;
- data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
- //data2["outOrderNo"] = orderItem.ItemTransitOrder.order_code;
- var dataStr2 = JsonHelper.SerializeObject(data2);
- var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
- if (discardRst.Contains("0") || discardRst.Contains("200"))
- {
- //MainWindow.Instance.orderListCtrl.GetOrder(orderId);
- #region 立即更新订单
- orderItem.ItemTransitOrder.order_void_status = 1;
- orderItem.SetOrderItemTextProperty();
- #endregion
+ string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
+ var data2 = new JObject();
+ data2["orderNo"] = orderItem.order_id;
+ data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
+ //data2["outOrderNo"] = orderItem.ItemTransitOrder.order_code;
+ var dataStr2 = JsonHelper.SerializeObject(data2);
+ var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
+ if (discardRst.Contains("0") || discardRst.Contains("200"))
+ {
+ //MainWindow.Instance.orderListCtrl.GetOrder(orderId);
+ #region 立即更新订单
+ orderItem.ItemTransitOrder.order_void_status = 1;
+ orderItem.SetOrderItemTextProperty();
+ #endregion
- #region 重新过滤订单
- MainWindow.Instance.orderListCtrl.FilterOrders();
- if (!isSilent)
- BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
- #endregion
+ #region 重新过滤订单
+ MainWindow.Instance.orderListCtrl.FilterOrders();
+ if (!isSilent)
+ BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
+ #endregion
- #region 更新拍单余额
- StartUp.UpdateBalance();
- #endregion
- }
- else
- {
- var msg = BaseRegex.GetStringXml(ref discardRst, "msg");
- if (!isSilent)
- BaseMsgWindow.ShowInfo("订单作废失败,服务端返回 " + msg);
- }
- }
+ #region 更新拍单余额
+ StartUp.UpdateBalance();
+ #endregion
+ }
+ else
+ {
+ var msg = BaseRegex.GetStringXml(ref discardRst, "msg");
+ if (!isSilent)
+ BaseMsgWindow.ShowInfo("订单作废失败,服务端返回 " + msg);
+ }
+ }
- private void txtWarehouseStatus_MouseEnter(object sender, MouseEventArgs e)
- {
- if (txtWarehouseStatus.ToolTip == null)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
- if (orderItem.ItemTransitOrderWithVoid.raw_message != null && orderItem.ItemTransitOrderWithVoid.raw_message.Contains("取号异常"))
- this.txtWarehouseStatus.ToolTip = orderItem.ItemTransitOrderWithVoid.raw_message;
- }
- }
- }
+ private void txtWarehouseStatus_MouseEnter(object sender, MouseEventArgs e)
+ {
+ if (txtWarehouseStatus.ToolTip == null)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
+ if (orderItem.ItemTransitOrderWithVoid.raw_message != null && orderItem.ItemTransitOrderWithVoid.raw_message.Contains("取号异常"))
+ this.txtWarehouseStatus.ToolTip = orderItem.ItemTransitOrderWithVoid.raw_message;
+ }
+ }
+ }
- private void btnAddEditTransitWarehouseReject_Click(object sender, RoutedEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
+ private void btnAddEditTransitWarehouseReject_Click(object sender, RoutedEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
orderItem.ItemTransitOrders = OrderListCtrl.GetTransitWarehouseList(orderItem.order_id);
orderItem.PddBuyerOrders = OrderListCtrl.GetPddBuyerOrders(orderItem.order_id);
OrderListCtrl.InitOrderItemObservableProp(orderItem);
if (orderItem.ItemTransitOrder?.warehouse_status == 2)
- {
- BaseMsgWindow.ShowError("商品已出库,请选择退回中转仓!");
- return;
- }
- if (string.IsNullOrEmpty(orderItem.PddBuyerOrder?.order_sn))
- {
- BaseMsgWindow.ShowError("商品未出单,请直接去拼多多买手申请退款");
- return;
- }
+ {
+ BaseMsgWindow.ShowError("商品已出库,请选择退回中转仓!");
+ return;
+ }
+ if (string.IsNullOrEmpty(orderItem.PddBuyerOrder?.order_sn))
+ {
+ BaseMsgWindow.ShowError("商品未出单,请直接去拼多多买手申请退款");
+ return;
+ }
if (orderItem.ItemTransitOrder?.has_reject == 1)
{
return;
}
- // 中转仓拒收(已产生物流)
- string url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/orders/rejectApply";
- var dataObj = new JObject();
- dataObj["orderCode"] = orderItem.ItemTransitOrder?.order_code;
- dataObj["orderId"] = orderItem.order_id;
- dataObj["logisticsExpressCode"] = orderItem.PddBuyerOrder?.order_sn;
- var data = JsonHelper.SerializeObject(dataObj);
- var html = HttpResponseWXBLL.e57PostResponse(url, data, "");
- int rejectStatus = 0;
- if (html.Contains("0") || html.Contains("200"))
- {
- rejectStatus = 1;
- BaseMsgWindow.ShowAnimateMessage("申请成功", "Msg", 3);
- }
- else
- {
- rejectStatus = 2;
- var err = BaseRegex.GetStringXmlByRegs(ref html, "msg");
- BaseMsgWindow.ShowAnimateMessage("申请失败", "Error", 3);
- }
- url = BaseClass.Build29WxObjString("order/wx_update_transit_order_reject_status");
- data = UserLogin.GetSignaturex();
- data += "&order_no=" + orderItem.order_id;
- data += "&order_sku_id=" + orderItem.sku_id;
- data += "&has_reject=" + rejectStatus;
- html = GetHtml.PostUtf8(url, data);
+ // 中转仓拒收(已产生物流)
+ string url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/orders/rejectApply";
+ var dataObj = new JObject();
+ dataObj["orderCode"] = orderItem.ItemTransitOrder?.order_code;
+ dataObj["orderId"] = orderItem.order_id;
+ dataObj["logisticsExpressCode"] = orderItem.PddBuyerOrder?.order_sn;
+ var data = JsonHelper.SerializeObject(dataObj);
+ var html = HttpResponseWXBLL.e57PostResponse(url, data, "");
+ int rejectStatus = 0;
+ if (html.Contains("0") || html.Contains("200"))
+ {
+ rejectStatus = 1;
+ BaseMsgWindow.ShowAnimateMessage("申请成功", "Msg", 3);
+ }
+ else
+ {
+ rejectStatus = 2;
+ var err = BaseRegex.GetStringXmlByRegs(ref html, "msg");
+ BaseMsgWindow.ShowAnimateMessage("申请失败", "Error", 3);
+ }
+ url = BaseClass.Build29WxObjString("order/wx_update_transit_order_reject_status");
+ data = UserLogin.GetSignaturex();
+ data += "&order_no=" + orderItem.order_id;
+ data += "&order_sku_id=" + orderItem.sku_id;
+ data += "&has_reject=" + rejectStatus;
+ html = GetHtml.PostUtf8(url, data);
orderItem.ItemTransitOrderWithVoid.has_reject = rejectStatus;
OrderListCtrl.InitOrderItemObservableProp(orderItem);
}
- }
- private void btnAddEditTransitWarehouseAfterSale_Click(object sender, RoutedEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
- if (orderItem.ItemTransitOrder?.warehouse_status != 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
- {
- BaseMsgWindow.ShowError("商品未出库,请选择中转仓拒收!");
- return;
- }
- TransitAfterSaleWindow transitAfterSaleWindow = new TransitAfterSaleWindow(orderItem);
- transitAfterSaleWindow.ShowDialog();
- }
- }
+ }
+ private void btnAddEditTransitWarehouseAfterSale_Click(object sender, RoutedEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
+ if (orderItem.ItemTransitOrder?.warehouse_status != 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
+ {
+ BaseMsgWindow.ShowError("商品未出库,请选择中转仓拒收!");
+ return;
+ }
+ TransitAfterSaleWindow transitAfterSaleWindow = new TransitAfterSaleWindow(orderItem);
+ transitAfterSaleWindow.ShowDialog();
+ }
+ }
- private void btnAbnormalOrderRebuy_Click(object sender, RoutedEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info orderItem)
- {
- if (orderItem.ItemOrder.status > 21 && orderItem.ItemTransitOrder != null && orderItem.ItemTransitOrder.refund_status == "买手退款成功")
- BuyOrder(true);
- }
- }
+ private void btnAbnormalOrderRebuy_Click(object sender, RoutedEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info orderItem)
+ {
+ if (orderItem.ItemOrder.status > 21 && orderItem.ItemTransitOrder != null && orderItem.ItemTransitOrder.refund_status == "买手退款成功")
+ BuyOrder(true);
+ }
+ }
- private void pathBuyerAfterSaleAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info order_item)
- {
- try
- {
- Clipboard.SetDataObject(order_item.PddBuyerAfterSaleAddressStr);
- BaseMsgWindow.ShowAnimateMessage("复制成功");
- }
- catch (Exception ex)
- {
- BaseMsgWindow.ShowError("复制失败 " + ex.Message);
- }
- }
- }
+ private void pathBuyerAfterSaleAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ try
+ {
+ Clipboard.SetDataObject(order_item.PddBuyerAfterSaleAddressStr);
+ BaseMsgWindow.ShowAnimateMessage("复制成功");
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("复制失败 " + ex.Message);
+ }
+ }
+ }
- private void pathCopyAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info order_item)
- {
- try
- {
- Clipboard.SetDataObject((order_item.ItemOrder?.AddressStr).ParseToString());
- BaseMsgWindow.ShowAnimateMessage("复制成功");
- }
- catch (Exception ex)
- {
- BaseMsgWindow.ShowError("复制失败 " + ex.Message);
- }
- }
- }
+ private void pathCopyAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ try
+ {
+ Clipboard.SetDataObject((order_item.ItemOrder?.AddressStr).ParseToString());
+ BaseMsgWindow.ShowAnimateMessage("复制成功");
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("复制失败 " + ex.Message);
+ }
+ }
+ }
- private void btnDirectBuyOrder_Click(object sender, RoutedEventArgs e)
- {
- directBuyOrder();
- }
+ private void btnDirectBuyOrder_Click(object sender, RoutedEventArgs e)
+ {
+ directBuyOrder();
+ }
- void directBuyOrder()
- {
- var orderItem = this.DataContext as oms_wei_order_item_info;
- if (orderItem == null)
- {
- BaseMsgWindow.ShowError("订单信息为空");
- return;
- }
- if (GlobalConfig.CurrentPddBuyer == null)
- {
- BaseMsgWindow.ShowError("请选择买手号");
- return;
- }
- if (/*orderItem.sku_cnt > 1 ||*/ orderItem.ItemOrder.orderItems.Count > 1)
- {
- //BaseMsgWindow.ShowError("多子单或多件商品订单中转仓暂不支持");
- BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
- return;
- }
+ void directBuyOrder()
+ {
+ var orderItem = this.DataContext as oms_wei_order_item_info;
+ if (orderItem == null)
+ {
+ BaseMsgWindow.ShowError("订单信息为空");
+ return;
+ }
+ if (GlobalConfig.CurrentPddBuyer == null)
+ {
+ BaseMsgWindow.ShowError("请选择买手号");
+ return;
+ }
+ if (/*orderItem.sku_cnt > 1 ||*/ orderItem.ItemOrder.orderItems.Count > 1)
+ {
+ //BaseMsgWindow.ShowError("多子单或多件商品订单中转仓暂不支持");
+ BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
+ return;
+ }
- btnBuyOrder.Cursor = Cursors.Wait;
- btnBuyOrder.IsEnabled = false;
- Task.Run(() =>
- {
- Thread.Sleep(2000);
- Dispatcher.Invoke(new Action(() => { btnBuyOrder.IsEnabled = true; }));
- });
- 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;
+ btnBuyOrder.Cursor = Cursors.Wait;
+ btnBuyOrder.IsEnabled = false;
+ Task.Run(() =>
+ {
+ Thread.Sleep(2000);
+ Dispatcher.Invoke(new Action(() => { btnBuyOrder.IsEnabled = true; }));
+ });
+ 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.ItemOrder.out_order_no.IsNullOrEmpty() && orderItem.ItemOrder.out_after_sale_status != "退款成功")
- {
- // 外采单已存在的,不可再拍单
- BaseMsgWindow.ShowAnimateMessage("该订单已有直发采购记录", "Error", 5);
- return;
- }
+ if (!orderItem.ItemOrder.out_order_no.IsNullOrEmpty() && orderItem.ItemOrder.out_after_sale_status != "退款成功")
+ {
+ // 外采单已存在的,不可再拍单
+ BaseMsgWindow.ShowAnimateMessage("该订单已有直发采购记录", "Error", 5);
+ return;
+ }
- // 如果是退款单,弹出退款窗口
- if (CheckIsRefund(orderItem))
- return;
+ // 如果是退款单,弹出退款窗口
+ if (CheckIsRefund(orderItem))
+ return;
// 查询订单是否在代发货中,如果代发需要取消代发
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(orderItem.Shop, orderItem.order_id, 100);
@@ -1227,117 +1229,117 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 检测买手号是否掉线
if (GlobalConfig.CurrentPddBuyer.status == "在线")
- {
- PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
- }
- if (GlobalConfig.CurrentPddBuyer.status != "在线")
- {
- Dispatcher.Invoke(new Action(() =>
- {
- BaseMsgWindow.ShowError("买手号掉线");
- btnBuyOrder.Cursor = Cursors.Hand;
- }));
- return;
- }
+ {
+ PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
+ }
+ if (GlobalConfig.CurrentPddBuyer.status != "在线")
+ {
+ Dispatcher.Invoke(new Action(() =>
+ {
+ BaseMsgWindow.ShowError("买手号掉线");
+ btnBuyOrder.Cursor = Cursors.Hand;
+ }));
+ return;
+ }
- // 打开拍单窗口
- Dispatcher.Invoke(new Action(() =>
- {
- btnBuyOrder.Cursor = Cursors.Hand;
+ // 打开拍单窗口
+ Dispatcher.Invoke(new Action(() =>
+ {
+ btnBuyOrder.Cursor = Cursors.Hand;
- PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
- orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
+ PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
+ orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
- buyOrderForm.TitleText = "买手直发拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
- buyOrderForm.BuyType = "direct";
+ buyOrderForm.TitleText = "买手直发拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
+ buyOrderForm.BuyType = "direct";
- // 未关联拍单的跳到所有订单页面
- buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html";
- //https://mobile.yangkeduo.com/order.html?order_sn=260729-663591339661688
- if (orderItem.ItemTransitOrderWithVoid != null)
- buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order.html?order_sn=" + orderItem.ItemTransitOrderWithVoid.out_order_no;
+ // 未关联拍单的跳到所有订单页面
+ buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html";
+ //https://mobile.yangkeduo.com/order.html?order_sn=260729-663591339661688
+ if (orderItem.ItemTransitOrderWithVoid != null)
+ buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order.html?order_sn=" + orderItem.ItemTransitOrderWithVoid.out_order_no;
- buyOrderForm.pnlBuy.Visible = false;
+ buyOrderForm.pnlBuy.Visible = false;
- // 已有拍单关联的跳的到订单确认界面
- if (orderItem.BuyMap != null)
- {
- buyOrderForm.ShowBuyMask = true;
- buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
- "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
- "&page_from=101";
+ // 已有拍单关联的跳的到订单确认界面
+ if (orderItem.BuyMap != null)
+ {
+ buyOrderForm.ShowBuyMask = true;
+ buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
+ "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
+ "&page_from=101";
- buyOrderForm.pnlBuy.Visible = true;
- buyOrderForm.pnlMap.Visible = false;
- }
- buyOrderForm.ShowDialog();
- }));
- });
- }
+ buyOrderForm.pnlBuy.Visible = true;
+ buyOrderForm.pnlMap.Visible = false;
+ }
+ buyOrderForm.ShowDialog();
+ }));
+ });
+ }
- bool CheckIsRefund(oms_wei_order_item_info orderItem)
- {
- 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 true;
- }
- return false;
- }
+ bool CheckIsRefund(oms_wei_order_item_info orderItem)
+ {
+ 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 true;
+ }
+ return false;
+ }
- private void PathCopyDirectBuyerOrderNo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info order_item)
- {
- try
- {
- Clipboard.SetDataObject((order_item.ItemOrder?.out_order_no).ParseToString());
- BaseMsgWindow.ShowAnimateMessage("复制成功");
- }
- catch (Exception ex)
- {
- BaseMsgWindow.ShowError("复制失败 " + ex.Message);
- }
- }
- }
+ private void PathCopyDirectBuyerOrderNo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ try
+ {
+ Clipboard.SetDataObject((order_item.ItemOrder?.out_order_no).ParseToString());
+ BaseMsgWindow.ShowAnimateMessage("复制成功");
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("复制失败 " + ex.Message);
+ }
+ }
+ }
- private void pathCopyProdName_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
+ private void pathCopyProdName_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
- }
+ }
- private void pathCopyRefundAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (this.DataContext is oms_wei_order_item_info order_item)
- {
- try
- {
- Clipboard.SetDataObject(order_item.RefundAddressStr.ParseToString());
- BaseMsgWindow.ShowAnimateMessage("复制成功");
- }
- catch (Exception ex)
- {
- BaseMsgWindow.ShowError("复制失败 " + ex.Message);
- }
- }
- }
+ private void pathCopyRefundAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (this.DataContext is oms_wei_order_item_info order_item)
+ {
+ try
+ {
+ Clipboard.SetDataObject(order_item.RefundAddressStr.ParseToString());
+ BaseMsgWindow.ShowAnimateMessage("复制成功");
+ }
+ catch (Exception ex)
+ {
+ BaseMsgWindow.ShowError("复制失败 " + ex.Message);
+ }
+ }
+ }
private void btnReturnOrder_Click(object sender, RoutedEventArgs e)
{
@@ -1356,5 +1358,57 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
TransitReturnOrderWindow.instance.Show();
}
}
+
+
+
+
+ private void btn_ShipGiftCommand(object sender, RoutedEventArgs e)
+ {
+
+ btnShipGift.IsEnabled = false;
+ var orderItem = this.DataContext as oms_wei_order_item_info;
+ if (orderItem == null)
+ return;
+
+ GiftType giftType = GiftType._160;
+ if (MainWindow.Instance.orderListCtrl.cb_gift.SelectedIndex == 0)
+ {
+ giftType = GiftType._155;
+ }
+ else
+ {
+ giftType = GiftType._155;
+ }
+ Task.Run(async () =>
+ {
+ try
+ {
+ var ret = await MainWindow.Instance.orderListCtrl._shipGiftService.Send(orderItem.order_id, giftType);
+ if (ret)
+ {
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ orderItem.ItemOrder.gift_order_status = 1;
+ MainWindow.Instance.orderListCtrl.FilterOneOrder(orderItem.ItemOrder, true);
+ });
+ }
+ }
+ catch (Exception ex)
+ {
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ BaseMsgWindow.ShowError("礼品单发货失败\n" + ex.Message ?? "未知错误", "Error");
+ });
+ }
+ finally
+ {
+ btnShipGift.IsEnabled = true;
+ }
+
+ });
+ }
+
}
}
+
+
diff --git a/29WxOrderWpf/Services/ShipGiftService.cs b/29WxOrderWpf/Services/ShipGiftService.cs
new file mode 100644
index 0000000..ddcec31
--- /dev/null
+++ b/29WxOrderWpf/Services/ShipGiftService.cs
@@ -0,0 +1,87 @@
+using AllBase;
+using AllBase.Helper;
+using CefSharp.DevTools.FedCm;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+using Work._29Tools.BLL;
+
+namespace _29WxOrderWpf.Services;
+
+///
+/// 礼物单服务
+///
+///
+public class ShipGiftService
+{
+ public enum GiftType
+ {
+ _155 = 2,
+ _160 = 5
+ }
+ public async Task Send(string orderId, GiftType giftType)
+ {
+ var item = GlobalConfig.lstFilterOrder.FirstOrDefault(a => a.order_id == orderId);
+ if (item == null) return false;
+
+ decimal giftAmount = 1.6m;
+ if (giftType == GiftType._155)
+ {
+ giftAmount = 1.55m;
+ }
+ decimal amount = giftAmount + BaseClass.OemGiftAmount;
+
+
+ string province = item.province_name;
+ string city = item.city_name;
+
+ if (city == "深圳市")
+ {
+ amount += 0.60m;
+ }
+ else if (city == "北京市")
+ {
+ amount += 1.00m;
+ }
+ else if (city == "上海市")
+ {
+ amount += 0.60m;
+ }
+ else if (province.Contains("新疆") || province.Contains("西藏"))
+ {
+ amount += 12.15m;
+ }
+
+ string data = JsonConvert.SerializeObject(new
+ {
+ platformCode = "WEISHOP",
+ orderIds = new List { orderId },
+ userId = BaseClass.UserId,
+ userName = BaseClass.UserName,
+ giftOrderType = (int)giftType,
+ amount = amount * 100,
+ oemAmount = BaseClass.OemGiftAmount * 100
+ });
+ Debug.WriteLine($"礼品单:{data}");
+ string ret = await HttpResponseWXBLL.e57PostResponseAsync("https://po.e57.cn//prod-api/api/oms-api/gift/order/deliveryFor29Erp", data, "");
+ XmlDocument doc = new XmlDocument();
+ doc.LoadXml(ret);
+
+ //使用 Newtonsoft.Json 进行转换
+ string jsonText = JsonConvert.SerializeXmlNode(doc);
+ JObject jsonObject = JObject.Parse(jsonText);
+ int code = jsonObject["AjaxResult"]?["code"]?.Value() ?? 0;
+ string msg = jsonObject["AjaxResult"]?["msg"]?.Value() ?? "";
+ if (code == 200 && msg.ToUpper() == "SUCCESS")
+ {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index 3ae5133..fe27136 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -16,186 +16,190 @@ using System.Windows.Forms;
namespace AllBase
{
- public static class BaseClass
- {
- #region oem贴牌参数
- public static string OemId { get; set; } = "";
- public static string OemName { get; set; } = "";
- public static bool IsOemOwner { get; set; } = false;
- public static string AgentName { get; set; } = "";
- public static string AgentCode { get; set; } = "";
- public static bool IsShowRegister { get; set; } = true;
- public static bool IsShowOpenAccount { get; set; } = true;
- #endregion
+ public static class BaseClass
+ {
+ #region oem贴牌参数
+ public static string OemId { get; set; } = "";
+ public static string OemName { get; set; } = "";
+ public static bool IsOemOwner { get; set; } = false;
+ public static string AgentName { get; set; } = "";
+ public static string AgentCode { get; set; } = "";
+ public static bool IsShowRegister { get; set; } = true;
+ public static bool IsShowOpenAccount { get; set; } = true;
+ ///
+ /// 礼品单价格
+ ///
+ public static decimal OemGiftAmount { get; set; } = 0;
+ #endregion
- ///
- /// 版本ID
- ///
+ ///
+ /// 版本ID
+ ///
- public static int VersionCount = 229;
+ public static int VersionCount = 229;
- public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
- public static string DebugUrl { get; set; } = "http://localhost:9000";
+ public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
+ public static string DebugUrl { get; set; } = "http://localhost:9000";
- ///
- /// 版本号
- ///
- public static string Varsion = (VersionCount / 100.0).ToString("f2");
+ ///
+ /// 版本号
+ ///
+ public static string Varsion = (VersionCount / 100.0).ToString("f2");
- public static bool isUseSimGetOrder = false;
- ///
- /// 是否开启模拟解密
- ///
- public static bool isUseSimGetRealAddress = false;
+ public static bool isUseSimGetOrder = false;
+ ///
+ /// 是否开启模拟解密
+ ///
+ public static bool isUseSimGetRealAddress = false;
- ///
- /// 当前使用的路由
- ///
- public static string routeInUse = "buy_order_api";
+ ///
+ /// 当前使用的路由
+ ///
+ public static string routeInUse = "buy_order_api";
- public static string ApiUrl { get; set; } = "http://xiaohuomao.nai8.net"; //"http://xiaohuomao.nai8.net";//"http://192.168.8.191"; //" "http://192.168.8.191" http://ddapi.nai8.net:29999";
- public static bool UserApi { get; set; } = true;
- public static string PddUid = "";
- public static string TaoBaoUid = "";
- public static string ALUid = "";
- public static string Jxsid = "";
+ public static string ApiUrl { get; set; } = "http://xiaohuomao.nai8.net"; //"http://xiaohuomao.nai8.net";//"http://192.168.8.191"; //" "http://192.168.8.191" http://ddapi.nai8.net:29999";
+ public static bool UserApi { get; set; } = true;
+ public static string PddUid = "";
+ public static string TaoBaoUid = "";
+ public static string ALUid = "";
+ public static string Jxsid = "";
- ///
- /// 代理版本号
- ///
- public static int oem_version = 0;
+ ///
+ /// 代理版本号
+ ///
+ public static int oem_version = 0;
- public static string ProgramName = "29供应链-微信小店订单管理";
- public static string ProgromLogo = "";
- public static string ProgromLogoIco = "";
- public static string ToolName = "29供应链-微信小店订单管理工具";
- //public static string MainPath = "douyin";
- public static string MainPath = "29wx";
- public static string ServiceQQ = "569588500";
- public static Image LoginImage = null;
- public static Image LogoImage = null;
- public static Icon Ico = null;
- public static int bili = 5;
- public static FontFamily font = null;//字体
- public static IntPtr pati;
- ///
- /// IP地址和名称
- ///
- public static string IPAddress = "127.0.0.1";
- public static string IPAddressName = "127.0.0.1";
+ public static string ProgramName = "29供应链-微信小店订单管理";
+ public static string ProgromLogo = "";
+ public static string ProgromLogoIco = "";
+ public static string ToolName = "29供应链-微信小店订单管理工具";
+ //public static string MainPath = "douyin";
+ public static string MainPath = "29wx";
+ public static string ServiceQQ = "569588500";
+ public static Image LoginImage = null;
+ public static Image LogoImage = null;
+ public static Icon Ico = null;
+ public static int bili = 5;
+ public static FontFamily font = null;//字体
+ public static IntPtr pati;
+ ///
+ /// IP地址和名称
+ ///
+ public static string IPAddress = "127.0.0.1";
+ public static string IPAddressName = "127.0.0.1";
- ///
- /// 是否操作总公司
- ///
- public static bool IsMainCompany = false;
- public static bool IsBuyer = false;
- ///
- /// 外部版本开启拼多多
- ///
- public static bool IsPinduoduo = false;
- public static bool IsJinBao = false;
- public static bool IsTaoKe = false;
- public static bool IsPinbaobao = false;
- public static bool IsXiaoNaiNiu = false;
- public static bool IsJingXi = false;
- public static bool SafeModel = false;
- public static string AlimamaDomain = "";
- public static string AlimamaPid = "";
- //public static string ClientId = "9558f920cf77403bb475243fe44482ad";
- public static string ApiKey = "a55ef8306263e335d3c0d332a94c9dbc24347cc1";
- public static List ClientIdx = new List();
+ ///
+ /// 是否操作总公司
+ ///
+ public static bool IsMainCompany = false;
+ public static bool IsBuyer = false;
+ ///
+ /// 外部版本开启拼多多
+ ///
+ public static bool IsPinduoduo = false;
+ public static bool IsJinBao = false;
+ public static bool IsTaoKe = false;
+ public static bool IsPinbaobao = false;
+ public static bool IsXiaoNaiNiu = false;
+ public static bool IsJingXi = false;
+ public static bool SafeModel = false;
+ public static string AlimamaDomain = "";
+ public static string AlimamaPid = "";
+ //public static string ClientId = "9558f920cf77403bb475243fe44482ad";
+ public static string ApiKey = "a55ef8306263e335d3c0d332a94c9dbc24347cc1";
+ public static List ClientIdx = new List();
- ///
- /// 启用新版签名验证算法
- ///
- public static bool NewSignatureAuth = true;
+ ///
+ /// 启用新版签名验证算法
+ ///
+ public static bool NewSignatureAuth = true;
- public static Dictionary serverDic = new Dictionary();//存放服务地址
+ public static Dictionary serverDic = new Dictionary();//存放服务地址
- //public static string ServerUrl = "http://psbx.9u99.com/index.php?s=/";
- public static string PXServerUrl = "http://px.jindouduo.com/";//螃蟹工具
- public static string NbAssistantUrl = "http://nbzlw.e57.cn/";//奶爸助理
+ //public static string ServerUrl = "http://psbx.9u99.com/index.php?s=/";
+ public static string PXServerUrl = "http://px.jindouduo.com/";//螃蟹工具
+ public static string NbAssistantUrl = "http://nbzlw.e57.cn/";//奶爸助理
- public static string TutuGateUrlx = "http://tt.deifei.cn/";//途途上货助手
- public static string MicrowoodUrlx = "http://dd.pinsubao.com/";//微木REP
- public static string BullUrlx = "http://wdt.qimake.cn/";//蛮牛工具
- public static string MicrowoodOrderUrlx = "http://wnm.pinsubao.com/";//微木订单
- public static string OrderGoldUrlx = "http://dianjin.6nt.cn/";//点金工具箱
- public static string KaiDaToolUrlx = "http://kd.qimake.cn/";//凯达工具
- public static string JfGjUrlx = "http://jfgj.qixiaoker.com/";//飓风管家
- public static string JfDeliverUrlx = "http://jffh.qixiaoker.com/";//飓风发货
+ public static string TutuGateUrlx = "http://tt.deifei.cn/";//途途上货助手
+ public static string MicrowoodUrlx = "http://dd.pinsubao.com/";//微木REP
+ public static string BullUrlx = "http://wdt.qimake.cn/";//蛮牛工具
+ public static string MicrowoodOrderUrlx = "http://wnm.pinsubao.com/";//微木订单
+ public static string OrderGoldUrlx = "http://dianjin.6nt.cn/";//点金工具箱
+ public static string KaiDaToolUrlx = "http://kd.qimake.cn/";//凯达工具
+ public static string JfGjUrlx = "http://jfgj.qixiaoker.com/";//飓风管家
+ public static string JfDeliverUrlx = "http://jffh.qixiaoker.com/";//飓风发货
- public static string TaoBaoLoginUrl = "https://login.taobao.com/member/login.jhtml";
+ public static string TaoBaoLoginUrl = "https://login.taobao.com/member/login.jhtml";
- // public static string AL1688LoginUrl = "https://work.1688.com/home/buyer.htm?_path_=buyer2017Base/2017buyerbase_trade/buyList&spm=a262jm.9273823.wkalibar.d8.5d884aadnN1j9G";
+ // public static string AL1688LoginUrl = "https://work.1688.com/home/buyer.htm?_path_=buyer2017Base/2017buyerbase_trade/buyList&spm=a262jm.9273823.wkalibar.d8.5d884aadnN1j9G";
- public static string PddMobileUrl = "https://yangkeduo.com/";
- public static string PddMobileUrlx = "http://yangkeduo.com/";
+ public static string PddMobileUrl = "https://yangkeduo.com/";
+ public static string PddMobileUrlx = "http://yangkeduo.com/";
- public static string duoduojinbaoURL = "";
- public static string taobaolianmengURL = "";
+ public static string duoduojinbaoURL = "";
+ public static string taobaolianmengURL = "";
- #region 设置参数
- ///
- /// 是否读取佣金 0是读取 1不读取
- ///
- public static int is_read_commission=0;
+ #region 设置参数
+ ///
+ /// 是否读取佣金 0是读取 1不读取
+ ///
+ public static int is_read_commission = 0;
- #endregion
+ #endregion
- ///
- /// 店铺子账号字典
- ///
- public static Dictionary dousubaccountDic = new Dictionary();
- public static int readOrderTime = 0;
+ ///
+ /// 店铺子账号字典
+ ///
+ public static Dictionary dousubaccountDic = new Dictionary();
+ public static int readOrderTime = 0;
- ///
- /// 巨量百应用户cookies
- ///
- public static string baiyincookies = "";
- ///
- /// 订单开始时间
- ///
- public static DateTime OrderBeginTime = DateTime.Now.AddDays(-60);
- ///
- /// 用于判断唯一性
- ///
- public static Dictionary Products = new Dictionary();
- ///
- /// 用于循环输出
- ///
- public static List ProductUse = new List();
- ///
- /// 进度条矩阵
- ///
- public static Dictionary ProcessList = new Dictionary();
- ///
- /// 上传过的
- ///
- public static List ProductIds = new List();
- //public static int MaxValue, MinValue, ThisValue;
- public static bool GetProductsSuccess = false;
+ ///
+ /// 巨量百应用户cookies
+ ///
+ public static string baiyincookies = "";
+ ///
+ /// 订单开始时间
+ ///
+ public static DateTime OrderBeginTime = DateTime.Now.AddDays(-60);
+ ///
+ /// 用于判断唯一性
+ ///
+ public static Dictionary Products = new Dictionary();
+ ///
+ /// 用于循环输出
+ ///
+ public static List ProductUse = new List();
+ ///
+ /// 进度条矩阵
+ ///
+ public static Dictionary ProcessList = new Dictionary();
+ ///
+ /// 上传过的
+ ///
+ public static List ProductIds = new List();
+ //public static int MaxValue, MinValue, ThisValue;
+ public static bool GetProductsSuccess = false;
- public static bool SetProductView = false;
- public static int TempSecond = 86400;
- ///
- /// 订单监控延迟
- ///
- public static int OrderStep = 5;
- public static int RankPage = 3;
- ///
- /// 采集最低销量
- ///
- public static int MinSales = 0;
- public static int MinPercent = 0;
- public static int MinLevel = 0;
- public static int Points { get; set; }
- ///
- /// 店铺充值月费
- ///
- public static int ShopPointsPerMonth { get; set; } = 30;
+ public static bool SetProductView = false;
+ public static int TempSecond = 86400;
+ ///
+ /// 订单监控延迟
+ ///
+ public static int OrderStep = 5;
+ public static int RankPage = 3;
+ ///
+ /// 采集最低销量
+ ///
+ public static int MinSales = 0;
+ public static int MinPercent = 0;
+ public static int MinLevel = 0;
+ public static int Points { get; set; }
+ ///
+ /// 店铺充值月费
+ ///
+ public static int ShopPointsPerMonth { get; set; } = 30;
public static decimal RechargeAmountTotal { get; set; } = 0;
public static decimal Balance { get; set; } = 0;
public static decimal PostagePerOrder { get; set; } = 2.2m;
@@ -203,924 +207,924 @@ namespace AllBase
public static decimal RefundPostagePerOrder { get; set; } = 2.5m;
public static decimal RefundPostagePerOrderDiff { get { return Math.Max(0, RefundPostagePerOrder - 2.5m); } }
public static int AlimamaPageCount = 0;
- public static bool CloudTitle = false;
- public static bool CloudBrand = false;
- public static bool CloudSellerNick = false;
- public static bool CloudProduct = false;
- public static bool ImageSheild = true;
- ///
- /// 内部版
- ///
- public static bool InSideVersion = false;
- public static decimal MaxPrice = 0;
- public static decimal MinPrice = 0;
- public static decimal MinBackMoney = 0;
- public static decimal Price = 5;
- public static int TimeOut = 45;
- public static int ThreadCount = 3;
- public static int MainCatId = 0;
- public static int GroupId = 0;
- ///
- /// 所在企业ID
- ///
- public static int CompanyId = 0;
- ///
- /// 企业名称
- ///
- public static string CompanyName = "";
- ///
- /// 到期时间
- ///
- public static string EndDate = "";
- ///
- /// 图片API
- ///
- public static string LoginApiUrl = ServerUrl;
- public static string ImageApiUrl = "https://new.qixiaoke.com/index.php?obj=api/image";
- //public static string LoginApiUrl = "http://order.qixiaoke.com/";//"http://192.168.8.9:8080/";
- //public static string LoginApiUrl = "http://127.0.0.1:81/";
- public static string BigDataApiUrl = "http://bigdata.qixiaoke.com/";
- public static string UserAgentUrl = LoginApiUrl + "userAgent.php";
- public static string GateApi = "";
- public static string ExpressSite = "http://www.1064kk.com/";
- public static string NewExpSite = "http://xinfen.xmby.tech/";
+ public static bool CloudTitle = false;
+ public static bool CloudBrand = false;
+ public static bool CloudSellerNick = false;
+ public static bool CloudProduct = false;
+ public static bool ImageSheild = true;
+ ///
+ /// 内部版
+ ///
+ public static bool InSideVersion = false;
+ public static decimal MaxPrice = 0;
+ public static decimal MinPrice = 0;
+ public static decimal MinBackMoney = 0;
+ public static decimal Price = 5;
+ public static int TimeOut = 45;
+ public static int ThreadCount = 3;
+ public static int MainCatId = 0;
+ public static int GroupId = 0;
+ ///
+ /// 所在企业ID
+ ///
+ public static int CompanyId = 0;
+ ///
+ /// 企业名称
+ ///
+ public static string CompanyName = "";
+ ///
+ /// 到期时间
+ ///
+ public static string EndDate = "";
+ ///
+ /// 图片API
+ ///
+ public static string LoginApiUrl = ServerUrl;
+ public static string ImageApiUrl = "https://new.qixiaoke.com/index.php?obj=api/image";
+ //public static string LoginApiUrl = "http://order.qixiaoke.com/";//"http://192.168.8.9:8080/";
+ //public static string LoginApiUrl = "http://127.0.0.1:81/";
+ public static string BigDataApiUrl = "http://bigdata.qixiaoke.com/";
+ public static string UserAgentUrl = LoginApiUrl + "userAgent.php";
+ public static string GateApi = "";
+ public static string ExpressSite = "http://www.1064kk.com/";
+ public static string NewExpSite = "http://xinfen.xmby.tech/";
- public static string QqGroupNum = "";
- public static string QqGroupUrl = "";
- public static string WechatUrl = "";
- public static string IeUrlShow = "";
- public static string JinBaoJump = "";
-
- ///
- /// 店铺旺旺名
- ///
- public static string ShopName = "";
- public static string ShopId = "";
- ///
- /// 拼多多店铺ID
- ///
- public static int MallId = 0;
- public static int ReceiverId = 0;
- //public static string TbTokenUrl = "";
- public static string NewCookies = "";
- public static bool MustGetShopInfo = false;
- public static bool MustGetFormAlive = false;
- public static string ChromeChatHtml = "";
- public static string ChromeUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- public static string PddShopChromeUserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.4.45 Safari/537.36 PddWorkbench-Online PddBrowser pdd_windows_version/2.6.0.26";
- public static string ChromeCookies = "";
- public static string ChromeJinBaoCookies = "";
- public static string ChromeTbLmCookies = "";
- public static string ChromeJdLmCookies = "";
+ public static string QqGroupNum = "";
+ public static string QqGroupUrl = "";
+ public static string WechatUrl = "";
+ public static string IeUrlShow = "";
+ public static string JinBaoJump = "";
- public static string OrderId = "";//限制的订单
- public static string PayMobile = "";//当前买手账号
- public static bool SlideFormIsClose = true;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体)
+ ///
+ /// 店铺旺旺名
+ ///
+ public static string ShopName = "";
+ public static string ShopId = "";
+ ///
+ /// 拼多多店铺ID
+ ///
+ public static int MallId = 0;
+ public static int ReceiverId = 0;
+ //public static string TbTokenUrl = "";
+ public static string NewCookies = "";
+ public static bool MustGetShopInfo = false;
+ public static bool MustGetFormAlive = false;
+ public static string ChromeChatHtml = "";
+ public static string ChromeUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ public static string PddShopChromeUserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.4.45 Safari/537.36 PddWorkbench-Online PddBrowser pdd_windows_version/2.6.0.26";
+ public static string ChromeCookies = "";
+ public static string ChromeJinBaoCookies = "";
+ public static string ChromeTbLmCookies = "";
+ public static string ChromeJdLmCookies = "";
- //针对淘宝模拟接口限制
- public static bool SlideIsClose = false;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体)
- public static bool SlideCookiesReplace = false;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体)
- public static string SlideUrl = "";//限制的url
- public static string x5Sec = "";
+ public static string OrderId = "";//限制的订单
+ public static string PayMobile = "";//当前买手账号
+ public static bool SlideFormIsClose = true;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体)
- //针对淘宝cef限制
- public static string SlideUrlx = "";//限制的url
- public static string x5Secx = "";
+ //针对淘宝模拟接口限制
+ public static bool SlideIsClose = false;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体)
+ public static bool SlideCookiesReplace = false;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体)
+ public static string SlideUrl = "";//限制的url
+ public static string x5Sec = "";
- public static string loadUrl = "";//限制的买手号订单列表
- public static string verify_auth_token = "";
- public static string verify_auth_token_prodetails = "";
- public static bool isverfiy_finish = true;
- //public static bool startGetRefundOrder = false;
+ //针对淘宝cef限制
+ public static string SlideUrlx = "";//限制的url
+ public static string x5Secx = "";
- public static bool IsUpdateExp = false;//修改物流
- public static bool IsBuyEmptyBagSuccess = true;//购买空包是否成功标识
- public static string EmptyBagType = "LPD";//快递网类型
- public static string EmptyBagExp = "";//快递单快递
+ public static string loadUrl = "";//限制的买手号订单列表
+ public static string verify_auth_token = "";
+ public static string verify_auth_token_prodetails = "";
+ public static bool isverfiy_finish = true;
+ //public static bool startGetRefundOrder = false;
- public static string SendErrorExpTime = "11";//发错误单的开始时间
- public static string UpdateErrorExpTime = "10";//修改错误单的开始时间
- public static bool PhonePay = true;//是否通过手机端购买
- public static bool IsFinishSpellOrder = true;//是否已完成拼团--一键拼团使用
- //public static bool IsFinishBuyOrder = true;//是否已完成拍单--连续拍单使用
- public static string payPwd = "";//支付密码
- public static bool IsRandomBuyer = false;//是否随机买手号
+ public static bool IsUpdateExp = false;//修改物流
+ public static bool IsBuyEmptyBagSuccess = true;//购买空包是否成功标识
+ public static string EmptyBagType = "LPD";//快递网类型
+ public static string EmptyBagExp = "";//快递单快递
- public static int sendOrderMin =5;//发货初始倒计时分钟
- public static int sendOrderSecond = 60;//发货倒计时秒
+ public static string SendErrorExpTime = "11";//发错误单的开始时间
+ public static string UpdateErrorExpTime = "10";//修改错误单的开始时间
+ public static bool PhonePay = true;//是否通过手机端购买
+ public static bool IsFinishSpellOrder = true;//是否已完成拼团--一键拼团使用
+ //public static bool IsFinishBuyOrder = true;//是否已完成拍单--连续拍单使用
+ public static string payPwd = "";//支付密码
+ public static bool IsRandomBuyer = false;//是否随机买手号
- public static int StartReadOrderMin = 8;//读取订单倒计时分钟
- public static int StartReadOrderSecond = 10;//读取订单倒计时秒
+ public static int sendOrderMin = 5;//发货初始倒计时分钟
+ public static int sendOrderSecond = 60;//发货倒计时秒
- public static bool IsCloudBuyOrder = false;//云拍单(拼多多批发,多买手)
- public static bool IsFactory = false; // 是否工厂模式
- public static bool IsContinueBuy = false;//是否连续拍单
- public static string DuoduoJinbaoUrl = "";//手动填写的多多进宝推广url
- public static string DuoduoJinbaoDefaultUrl = "";//多多进宝推广url 默认
- public static bool IsLoadDdJinBao = false;//拍单时是否用多多进宝的url
- public static bool IsUpdateMobile = true;//是否修改收货人的手机号
- public static string AntiContent = "";//发货用
- public static bool AfterSaleTip = false;//售后提醒--默认关闭
- public static bool IsFilterWord = true;//自动回复过滤违禁词--默认开启
- public static string FilterWord = "";//过滤的违禁词
- public static bool AutoReply = false;//客服集成是否自动回复
- public static bool IsCustomService = false;//是否开启客服集成--默认关闭
- public static bool IsOrderManage = true;//是否开启订单管理
- public static bool NewCusSystem = false;//是否新方式的客服集成
- public static bool IsSearchSame = true;//是否开启搜同款功能
- public static bool IsOpenSound = false;//是否开启声音提醒
- public static int AfterSaleTime = 30;//读取售后单的时间--默认30天
- public static int WorkOrderTime = 30;//读取工单的时间--默认30天
- public static bool IsLoginFinish = false;//是否登录完成
- public static bool sOenVideoGuidance = true;//是否有视频指南
- public static int UpdChoice = 1;//防滥发修改选项 1:都修改 2:不修改手机号
- public static bool isOpenPangxie = false;//是否开启螃蟹
- public static bool isEasyOrder = false;//开启分批发货
- public static bool LoseMoneyNoBuy = true;//亏本单不拍 默认开启
- public static bool IsImgShow = true;//是否显示规格图 默认开启
- public static bool IsAutoSend = true;//是否拼多多自动发货 默认开启
- public static bool IsAutoSendTb = true;//是否淘宝自动发货 默认开启
+ public static int StartReadOrderMin = 8;//读取订单倒计时分钟
+ public static int StartReadOrderSecond = 10;//读取订单倒计时秒
- public static bool IsLoadByDefaultWeb = true;//是否通过电脑默认自身的浏览器打开商品详情 默认开启
- public static bool isHljArear = false;//是否是黑龙江地区 默认关闭
- public static bool testtb = true;//测试淘宝
- public static bool IsSaveNote = false;//是否保存后台备注
- public static bool IsAutoApplyRefund = false;//是否自动去上家申请退款
- public static bool IsRefund = false;//店铺自动同意退款 退款后买手去上家退款
- public static bool IsHasReceipt = false;//是否开启已有揽收信息再发货
- public static bool TbLimitShow = true;//开启时淘宝买手号限制时自定弹框
- public static bool DesSwitch = false;//是否开启随机解密方式 默认关闭 以服务端为准
- public static int DesRsvTypeRate = 5;//开启RSV解密方式比例 默认50% 以服务端为准
- public static bool SendSet = false;//开启发货时间设置开关
- public static int SendTime = 13;//开启发货时间设置
- public static bool SwitchBuyer = false;//点击拍单订单详情自动切换买手号 默认关闭
- public static int ModeType = 0;//查看拍单订单详情方式 默认模式一
- public static int GetTbExpressModeType = 0;//获取淘宝物流详情方式 默认模式一
+ public static bool IsCloudBuyOrder = false;//云拍单(拼多多批发,多买手)
+ public static bool IsFactory = false; // 是否工厂模式
+ public static bool IsContinueBuy = false;//是否连续拍单
+ public static string DuoduoJinbaoUrl = "";//手动填写的多多进宝推广url
+ public static string DuoduoJinbaoDefaultUrl = "";//多多进宝推广url 默认
+ public static bool IsLoadDdJinBao = false;//拍单时是否用多多进宝的url
+ public static bool IsUpdateMobile = true;//是否修改收货人的手机号
+ public static string AntiContent = "";//发货用
+ public static bool AfterSaleTip = false;//售后提醒--默认关闭
+ public static bool IsFilterWord = true;//自动回复过滤违禁词--默认开启
+ public static string FilterWord = "";//过滤的违禁词
+ public static bool AutoReply = false;//客服集成是否自动回复
+ public static bool IsCustomService = false;//是否开启客服集成--默认关闭
+ public static bool IsOrderManage = true;//是否开启订单管理
+ public static bool NewCusSystem = false;//是否新方式的客服集成
+ public static bool IsSearchSame = true;//是否开启搜同款功能
+ public static bool IsOpenSound = false;//是否开启声音提醒
+ public static int AfterSaleTime = 30;//读取售后单的时间--默认30天
+ public static int WorkOrderTime = 30;//读取工单的时间--默认30天
+ public static bool IsLoginFinish = false;//是否登录完成
+ public static bool sOenVideoGuidance = true;//是否有视频指南
+ public static int UpdChoice = 1;//防滥发修改选项 1:都修改 2:不修改手机号
+ public static bool isOpenPangxie = false;//是否开启螃蟹
+ public static bool isEasyOrder = false;//开启分批发货
+ public static bool LoseMoneyNoBuy = true;//亏本单不拍 默认开启
+ public static bool IsImgShow = true;//是否显示规格图 默认开启
+ public static bool IsAutoSend = true;//是否拼多多自动发货 默认开启
+ public static bool IsAutoSendTb = true;//是否淘宝自动发货 默认开启
- public static int GetOrderPice = 0;//设置不读单的金额
+ public static bool IsLoadByDefaultWeb = true;//是否通过电脑默认自身的浏览器打开商品详情 默认开启
+ public static bool isHljArear = false;//是否是黑龙江地区 默认关闭
+ public static bool testtb = true;//测试淘宝
+ public static bool IsSaveNote = false;//是否保存后台备注
+ public static bool IsAutoApplyRefund = false;//是否自动去上家申请退款
+ public static bool IsRefund = false;//店铺自动同意退款 退款后买手去上家退款
+ public static bool IsHasReceipt = false;//是否开启已有揽收信息再发货
+ public static bool TbLimitShow = true;//开启时淘宝买手号限制时自定弹框
+ public static bool DesSwitch = false;//是否开启随机解密方式 默认关闭 以服务端为准
+ public static int DesRsvTypeRate = 5;//开启RSV解密方式比例 默认50% 以服务端为准
+ public static bool SendSet = false;//开启发货时间设置开关
+ public static int SendTime = 13;//开启发货时间设置
+ public static bool SwitchBuyer = false;//点击拍单订单详情自动切换买手号 默认关闭
+ public static int ModeType = 0;//查看拍单订单详情方式 默认模式一
+ public static int GetTbExpressModeType = 0;//获取淘宝物流详情方式 默认模式一
- public static int OrderDisplay = 0;//0全部 1单 2双 订单显示
+ public static int GetOrderPice = 0;//设置不读单的金额
+
+ public static int OrderDisplay = 0;//0全部 1单 2双 订单显示
- #region 防滥发设置
- public static string AddressDetailFormat = "";
- public static string MobileFormat = "";
+ #region 防滥发设置
+ public static string AddressDetailFormat = "";
+ public static string MobileFormat = "";
- public static string Address_add = "拨打姓名后括号的电话";//拍单时追加地址的后面
- public static bool Address_Add_Specialword = false;
- public static long Mobile_Change;
+ public static string Address_add = "拨打姓名后括号的电话";//拍单时追加地址的后面
+ public static bool Address_Add_Specialword = false;
+ public static long Mobile_Change;
- #region 新版泛滥发设置
- public static string OwerSetMobile;//自定义拍单号码
- public static bool SpecCodeName;//名字加特殊字符
- public static bool AddRealMobile;//添加真实号码
- #endregion
+ #region 新版泛滥发设置
+ public static string OwerSetMobile;//自定义拍单号码
+ public static bool SpecCodeName;//名字加特殊字符
+ public static bool AddRealMobile;//添加真实号码
+ #endregion
- #endregion
+ #endregion
- ///
- /// 所有店铺的clientId token的过期时间
- ///
- public static Dictionary ShopTokenTime = new Dictionary();
+ ///
+ /// 所有店铺的clientId token的过期时间
+ ///
+ public static Dictionary ShopTokenTime = new Dictionary();
- ///
- /// 当前所有cookies
- ///
- public static Dictionary> CookiesAll = new Dictionary>();
- ///
- /// 当前所有cookies对应字符串
- ///
- public static Dictionary CookiesAllString = new Dictionary();
+ ///
+ /// 当前所有cookies
+ ///
+ public static Dictionary> CookiesAll = new Dictionary>();
+ ///
+ /// 当前所有cookies对应字符串
+ ///
+ public static Dictionary CookiesAllString = new Dictionary();
- ///
- /// API接口是否可用
- ///
- public static bool ApiCanUse = false;
- ///
- /// 启用昨日订单
- ///
- public static bool OrderYesterday = false;
- ///
- /// 店铺名
- ///
- public static string ShopNameString = "";
- ///
- /// 店铺网址
- ///
- public static string ShopUrl = "";
- ///
- /// 1:正在获取token,2:结束,3:执行,0:空闲
- ///
- //public static int TbTokenGeting = 0;
- ///
- /// 代理列表
- ///
- public static List Proxy = new List();
- ///
- /// 标题中不能包含的词
- ///
- public static List CantTitleKeywords = new List();
- ///
- /// 不能使用的分类
- ///
- public static List CantCatId = new List();
- ///
- /// 不能使用的标题
- ///
- public static List CantTitle = new List();
- ///
- /// 不能使用的品牌
- ///
- public static List CantBrand = new List();
+ ///
+ /// API接口是否可用
+ ///
+ public static bool ApiCanUse = false;
+ ///
+ /// 启用昨日订单
+ ///
+ public static bool OrderYesterday = false;
+ ///
+ /// 店铺名
+ ///
+ public static string ShopNameString = "";
+ ///
+ /// 店铺网址
+ ///
+ public static string ShopUrl = "";
+ ///
+ /// 1:正在获取token,2:结束,3:执行,0:空闲
+ ///
+ //public static int TbTokenGeting = 0;
+ ///
+ /// 代理列表
+ ///
+ public static List Proxy = new List();
+ ///
+ /// 标题中不能包含的词
+ ///
+ public static List CantTitleKeywords = new List();
+ ///
+ /// 不能使用的分类
+ ///
+ public static List CantCatId = new List();
+ ///
+ /// 不能使用的标题
+ ///
+ public static List CantTitle = new List();
+ ///
+ /// 不能使用的品牌
+ ///
+ public static List CantBrand = new List();
- public static string HadNoteId = "";
- ///
- /// 网址正则
- ///
- public static string LinkRegex = @"]*href[\s]*=[\s]*[""']{0,1}([^\s^>^""^']*)[^>]*>(.*?)";
- ///
- /// 网址正则
- ///
- public static string LinkRegexOut = @"]*href[\s]*=[\s]*[""']{0,1}(http[s]*://[^\s^>^""^']*)[^>]*>(.*?)";
- ///
- /// Api对接密码
- ///
- public static string ApiKeyword = "xiaojun&find_gold_cat";
- ///
- /// 接口缓存信息
- ///
- public static string UserAgent = null;
- ///
- /// 接口缓存信息
- ///
- public static string ViewCode = null;
- ///
- /// 百度权重缓存信息
- ///
- public static string ViewCodex = null;
- ///
- /// 是否暂停
- ///
- public static bool IsStop = false;
- ///
- /// 是否测试
- ///
- public static bool IsTest = false;
- ///
- /// 是否正在执行
- ///
- public static bool IsRunning = false;
- ///
- /// 权重更新时间
- ///
- public static int TimeBaiduRank = 0;
- ///
- /// 排名更新时间
- ///
- public static int TimeKeywordRank = 0;
- ///
- /// 时间差
- ///
- public static int TimeDifferent = 0;
- ///
- /// 硬件信息
- ///
- public static string MacInfo = "";
- ///
- /// 注册用户名
- ///
- public static string UserName = "";
- ///
- /// 注册昵称
- ///
- public static string NickName = "";
- ///
- /// 注册用户名
- ///
- public static int UserId = 0;
- ///
- /// 注册用户名
- ///
- public static int UserKey = 0;
- ///
- /// 注册用户名
- ///
- public static int SiteBuildThreadCount = 0;
- ///
- /// 注册用户名
- ///
- public static int UserVersion = 0;
- ///
- /// 注册用户名
- ///
- public static string UserVersionString = "";
- ///
- /// 注册密码
- ///
- public static string PassWord = "";
- ///
- /// 间隔时间
- ///
- public static int WaitTime = 300;
+ public static string HadNoteId = "";
+ ///
+ /// 网址正则
+ ///
+ public static string LinkRegex = @"]*href[\s]*=[\s]*[""']{0,1}([^\s^>^""^']*)[^>]*>(.*?)";
+ ///
+ /// 网址正则
+ ///
+ public static string LinkRegexOut = @"]*href[\s]*=[\s]*[""']{0,1}(http[s]*://[^\s^>^""^']*)[^>]*>(.*?)";
+ ///
+ /// Api对接密码
+ ///
+ public static string ApiKeyword = "xiaojun&find_gold_cat";
+ ///
+ /// 接口缓存信息
+ ///
+ public static string UserAgent = null;
+ ///
+ /// 接口缓存信息
+ ///
+ public static string ViewCode = null;
+ ///
+ /// 百度权重缓存信息
+ ///
+ public static string ViewCodex = null;
+ ///
+ /// 是否暂停
+ ///
+ public static bool IsStop = false;
+ ///
+ /// 是否测试
+ ///
+ public static bool IsTest = false;
+ ///
+ /// 是否正在执行
+ ///
+ public static bool IsRunning = false;
+ ///
+ /// 权重更新时间
+ ///
+ public static int TimeBaiduRank = 0;
+ ///
+ /// 排名更新时间
+ ///
+ public static int TimeKeywordRank = 0;
+ ///
+ /// 时间差
+ ///
+ public static int TimeDifferent = 0;
+ ///
+ /// 硬件信息
+ ///
+ public static string MacInfo = "";
+ ///
+ /// 注册用户名
+ ///
+ public static string UserName = "";
+ ///
+ /// 注册昵称
+ ///
+ public static string NickName = "";
+ ///
+ /// 注册用户名
+ ///
+ public static int UserId = 0;
+ ///
+ /// 注册用户名
+ ///
+ public static int UserKey = 0;
+ ///
+ /// 注册用户名
+ ///
+ public static int SiteBuildThreadCount = 0;
+ ///
+ /// 注册用户名
+ ///
+ public static int UserVersion = 0;
+ ///
+ /// 注册用户名
+ ///
+ public static string UserVersionString = "";
+ ///
+ /// 注册密码
+ ///
+ public static string PassWord = "";
+ ///
+ /// 间隔时间
+ ///
+ public static int WaitTime = 300;
- ///
- /// 注册密码
- ///
- public static string LogPatch = "";
+ ///
+ /// 注册密码
+ ///
+ public static string LogPatch = "";
- public static bool Remember = false;
- public static bool AutoLogin = false;
+ public static bool Remember = false;
+ public static bool AutoLogin = false;
- ///
- /// 拼多多防滥发
- ///
- public static bool PreveSpam = false;
- ///
- /// 获取数据库链接
- ///
- ///
- //public static string GetDataString()
- //{
- // if (IsMysqlDataBase)
- // {
- // return "Max Pool Size = 512;Database='" + DataBase + "';Data Source='" + DataIp +
- // "';Port=3306;User Id='" + DataUser + "';Password='" + DataPass + "';Charset=gbk;";
- // }
- // return "server=" + DataIp + ";database=" + DataBase + ";uid=" + DataUser + ";pwd=" + DataPass;
+ ///
+ /// 拼多多防滥发
+ ///
+ public static bool PreveSpam = false;
+ ///
+ /// 获取数据库链接
+ ///
+ ///
+ //public static string GetDataString()
+ //{
+ // if (IsMysqlDataBase)
+ // {
+ // return "Max Pool Size = 512;Database='" + DataBase + "';Data Source='" + DataIp +
+ // "';Port=3306;User Id='" + DataUser + "';Password='" + DataPass + "';Charset=gbk;";
+ // }
+ // return "server=" + DataIp + ";database=" + DataBase + ";uid=" + DataUser + ";pwd=" + DataPass;
- //}
+ //}
- ///
- /// 接口程序
- ///
- public static List ApiList = new List();
- ///
- /// 国内代理列表
- ///
- public static List ProxyIn = new List();
- ///
- /// 美国代理列表
- ///
- public static List ProxyOut = new List();
- ///
- /// 美国代理列表
- ///
- public static List ProxyHttps = new List();
- ///
- /// 指数代理列表
- ///
- public static List IpChangeList = new List();
+ ///
+ /// 接口程序
+ ///
+ public static List ApiList = new List();
+ ///
+ /// 国内代理列表
+ ///
+ public static List ProxyIn = new List();
+ ///
+ /// 美国代理列表
+ ///
+ public static List ProxyOut = new List();
+ ///
+ /// 美国代理列表
+ ///
+ public static List ProxyHttps = new List();
+ ///
+ /// 指数代理列表
+ ///
+ public static List IpChangeList = new List();
- ///
- /// CPU使用率
- ///
- public static int CpuUser = 0;
- ///
- /// CPU温度
- ///
- public static int CpuTemperature = 0;
- ///
- /// 数据库正在执行线程数
- ///
- public static int DataUpdateThread = 0;
+ ///
+ /// CPU使用率
+ ///
+ public static int CpuUser = 0;
+ ///
+ /// CPU温度
+ ///
+ public static int CpuTemperature = 0;
+ ///
+ /// 数据库正在执行线程数
+ ///
+ public static int DataUpdateThread = 0;
- public static string PassWordBak { get; set; }
- public static string Mobile { get; set; }
- public static string ParentAuthority { get; set; }
- public static string ForbiddenPage { get; set; }
- public static string UserAuthority { get; set; }
- public static string ParentUserName { get; set; }
- 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 string PassWordBak { get; set; }
+ public static string Mobile { get; set; }
+ public static string ParentAuthority { get; set; }
+ public static string ForbiddenPage { get; set; }
+ public static string UserAuthority { get; set; }
+ public static string ParentUserName { get; set; }
+ public static string MainUserName { get { return string.IsNullOrEmpty(ParentUserName) ? UserName : ParentUserName; } }
+ public static int SaLevel { get; set; }
+ public static bool IsLoginSuccess { get; set; }
- ///
- /// CPU使用率更新线程
- ///
- public static void UpdateCpuThread()
- {
- PerformanceCounter CpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
- int i;
- double all;
- while (true)
- {
- all = 0;
- for (i = 1; i < 6; i++)
- {
- all += CpuCounter.NextValue();
- Thread.Sleep(50);
- }
- CpuUser = (int)all / i;
- }
- }
+ ///
+ /// CPU使用率更新线程
+ ///
+ public static void UpdateCpuThread()
+ {
+ PerformanceCounter CpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
+ int i;
+ double all;
+ while (true)
+ {
+ all = 0;
+ for (i = 1; i < 6; i++)
+ {
+ all += CpuCounter.NextValue();
+ Thread.Sleep(50);
+ }
+ CpuUser = (int)all / i;
+ }
+ }
- ///
- /// DateTime时间格式转换为Unix时间戳格式
- ///
- ///
- ///
- public static int ConvertDateTimeInt(DateTime time)
- {
- System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
- return (int)(time - startTime).TotalSeconds;
- }
+ ///
+ /// DateTime时间格式转换为Unix时间戳格式
+ ///
+ ///
+ ///
+ public static int ConvertDateTimeInt(DateTime time)
+ {
+ System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
+ return (int)(time - startTime).TotalSeconds;
+ }
- ///
- /// DateTime时间格式转换为Unix时间戳格式 13位
- ///
- ///
- ///
- public static long ConvertDateTimeLong(DateTime time)
+ ///
+ /// DateTime时间格式转换为Unix时间戳格式 13位
+ ///
+ ///
+ ///
+ public static long ConvertDateTimeLong(DateTime time)
{
//TimeSpan ts = time - new DateTime(1970, 1, 1, 0, 0, 0, 0);
TimeSpan ts = time - TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
return Convert.ToInt64(ts.TotalMilliseconds);
- }
+ }
- ///
- /// C#格式时间转换为Unix时间戳(秒)
- ///
- ///
- ///
- public static int DateTimeToTimestampSeconds(DateTime time)
- {
- System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
- return (int)(time - startTime).TotalSeconds;
- }
+ ///
+ /// C#格式时间转换为Unix时间戳(秒)
+ ///
+ ///
+ ///
+ public static int DateTimeToTimestampSeconds(DateTime time)
+ {
+ System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
+ return (int)(time - startTime).TotalSeconds;
+ }
- ///
- /// C#格式时间转换为Unix时间戳(毫秒)
- ///
- ///
- ///
- public static long DateTimeToTimestampMilliseconds(DateTime time)
- {
- System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
- return (long)(time - startTime).TotalMilliseconds;
- }
+ ///
+ /// C#格式时间转换为Unix时间戳(毫秒)
+ ///
+ ///
+ ///
+ public static long DateTimeToTimestampMilliseconds(DateTime time)
+ {
+ System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
+ return (long)(time - startTime).TotalMilliseconds;
+ }
- ///
- /// 计算字节长度
- ///
- ///
- ///
- public static int GetCharLength(string word)
- {
- if (string.IsNullOrEmpty(word))
- return 0;
- return Encoding.GetEncoding("gbk").GetBytes(word).Length;
- }
+ ///
+ /// 计算字节长度
+ ///
+ ///
+ ///
+ public static int GetCharLength(string word)
+ {
+ if (string.IsNullOrEmpty(word))
+ return 0;
+ return Encoding.GetEncoding("gbk").GetBytes(word).Length;
+ }
- ///
- /// 时间戳转为C#格式时间
- ///
- ///
- ///
- public static DateTime StampToDateTime(int timeStamp)
- {
- DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
- long lTime = long.Parse(timeStamp + "0000000");
- TimeSpan toNow = new TimeSpan(lTime);
- return dateTimeStart.Add(toNow);
- }
+ ///
+ /// 时间戳转为C#格式时间
+ ///
+ ///
+ ///
+ public static DateTime StampToDateTime(int timeStamp)
+ {
+ DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
+ long lTime = long.Parse(timeStamp + "0000000");
+ TimeSpan toNow = new TimeSpan(lTime);
+ return dateTimeStart.Add(toNow);
+ }
- ///
- /// 时间戳转为C#格式时间
- ///
- ///
- ///
- public static DateTime StampToDateTimex(long timeStamp)
- {
- DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
- long lTime = long.Parse(timeStamp + "0000");
- TimeSpan toNow = new TimeSpan(lTime);
- return dateTimeStart.Add(toNow);
- }
+ ///
+ /// 时间戳转为C#格式时间
+ ///
+ ///
+ ///
+ public static DateTime StampToDateTimex(long timeStamp)
+ {
+ DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
+ long lTime = long.Parse(timeStamp + "0000");
+ TimeSpan toNow = new TimeSpan(lTime);
+ return dateTimeStart.Add(toNow);
+ }
- ///
- /// 设置粘贴板
- ///
- ///
- public static void SetClipboard(string message)
- {
- try
- {
- Clipboard.SetDataObject(message);
- }
- catch
- {
- }
- }
- ///
- /// 获取服务器的精准时间
- ///
- ///
- public static DateTime GetServerTimeString()
- {
- int time = GetTime();
- DateTime t = StampToDateTime(time);
- return t;
- }
- ///
- /// 获取绝对时间
- ///
- ///
- public static int GetTime()
- {
- return ConvertDateTimeInt(DateTime.Now) + TimeDifferent;
- }
- ///
- /// 获取绝对时间
- ///
- ///
- public static int GetTime(DateTime t)
- {
- return ConvertDateTimeInt(t) + TimeDifferent;
- }
- ///
- /// MD5加密
- ///
- ///
- ///
- public static string GetMd5(string instring)
- {
- byte[] result = Encoding.UTF8.GetBytes(instring.Trim());
- MD5 md5 = new MD5CryptoServiceProvider();
- byte[] output = md5.ComputeHash(result);
- return BitConverter.ToString(output).Replace("-", "");
- }
- ///
- /// MD5加密
- ///
- ///
- public static string GetMd5(byte[] result)
- {
- MD5 md5 = new MD5CryptoServiceProvider();
- byte[] output = md5.ComputeHash(result);
- return BitConverter.ToString(output).Replace("-", "");
- }
+ ///
+ /// 设置粘贴板
+ ///
+ ///
+ public static void SetClipboard(string message)
+ {
+ try
+ {
+ Clipboard.SetDataObject(message);
+ }
+ catch
+ {
+ }
+ }
+ ///
+ /// 获取服务器的精准时间
+ ///
+ ///
+ public static DateTime GetServerTimeString()
+ {
+ int time = GetTime();
+ DateTime t = StampToDateTime(time);
+ return t;
+ }
+ ///
+ /// 获取绝对时间
+ ///
+ ///
+ public static int GetTime()
+ {
+ return ConvertDateTimeInt(DateTime.Now) + TimeDifferent;
+ }
+ ///
+ /// 获取绝对时间
+ ///
+ ///
+ public static int GetTime(DateTime t)
+ {
+ return ConvertDateTimeInt(t) + TimeDifferent;
+ }
+ ///
+ /// MD5加密
+ ///
+ ///
+ ///
+ public static string GetMd5(string instring)
+ {
+ byte[] result = Encoding.UTF8.GetBytes(instring.Trim());
+ MD5 md5 = new MD5CryptoServiceProvider();
+ byte[] output = md5.ComputeHash(result);
+ return BitConverter.ToString(output).Replace("-", "");
+ }
+ ///
+ /// MD5加密
+ ///
+ ///
+ public static string GetMd5(byte[] result)
+ {
+ MD5 md5 = new MD5CryptoServiceProvider();
+ byte[] output = md5.ComputeHash(result);
+ return BitConverter.ToString(output).Replace("-", "");
+ }
- ///
- /// MD5加密
- ///
- ///
- public static long GetLong(byte[] result)
- {
- return
- Convert.ToInt64(
- BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(result), 4,
- 8).Replace("-", ""), 16);
- }
+ ///
+ /// MD5加密
+ ///
+ ///
+ public static long GetLong(byte[] result)
+ {
+ return
+ Convert.ToInt64(
+ BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(result), 4,
+ 8).Replace("-", ""), 16);
+ }
- ///
- /// MD5 16位加密转long
- ///
- ///
- ///
- public static long GetLong(string url)
- {
- if (string.IsNullOrEmpty(url))
- return 0;
- return Convert.ToInt64(BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(url)), 4, 8).Replace("-", ""), 16);
- }
+ ///
+ /// MD5 16位加密转long
+ ///
+ ///
+ ///
+ public static long GetLong(string url)
+ {
+ if (string.IsNullOrEmpty(url))
+ return 0;
+ return Convert.ToInt64(BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(url)), 4, 8).Replace("-", ""), 16);
+ }
- ///
- /// 获取文件MD5值
- ///
- ///
- ///
- public static string GetFileMd5(string FilePath)
- {
- try
- {
- FileStream get_file = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
- System.Security.Cryptography.MD5CryptoServiceProvider get_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
- byte[] hash_byte = get_md5.ComputeHash(get_file);
- string resule = System.BitConverter.ToString(hash_byte);
- resule = resule.Replace("-", "");
- get_file.Close();
- return resule;
- }
- catch (Exception e)
- {
- return e.ToString();
- }
- }
+ ///
+ /// 获取文件MD5值
+ ///
+ ///
+ ///
+ public static string GetFileMd5(string FilePath)
+ {
+ try
+ {
+ FileStream get_file = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
+ System.Security.Cryptography.MD5CryptoServiceProvider get_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
+ byte[] hash_byte = get_md5.ComputeHash(get_file);
+ string resule = System.BitConverter.ToString(hash_byte);
+ resule = resule.Replace("-", "");
+ get_file.Close();
+ return resule;
+ }
+ catch (Exception e)
+ {
+ return e.ToString();
+ }
+ }
- ///
- /// 签名算法
- ///
- /// 随机数
- /// 加密签名结果
- public static string Encryption(int s)
- {
- string ss = s.ToString();
- if (ss.Length > 8)
- {
- ss = ss.Substring(ss.Length - 8);
- s = int.Parse(ss);
- if (s < 100000000)
- s += 100000000;
- }
- byte[] kb = Encoding.ASCII.GetBytes(s.ToString());
- double y = s * 1.8061825125;
- y += 4852095.48659959;
- y += kb[3] * 943579.486548;
- y += kb[7] + 4889894.30184;
- byte[] k = Encoding.ASCII.GetBytes(y.ToString());
- y -= 458735.48548;
- y -= k[6] * 458720.454545;
- y -= k[2] * 5447826.96889;
- byte[] k1 = Encoding.ASCII.GetBytes(y.ToString());
- y += 34779810.2455;
- y -= k1[1] * 57942.0564845;
- y -= k1[5] * 1548.487866;
- string c = ((int)y).ToString();
- return GetMd5(c); //返回签名的MD5结果
- }
- ///
- /// 生成OBJ路径
- ///
- ///
- ///
- public static string BuildObjString(string file)
- {
- if (IsJingXi)
- return LoginApiUrl + "index.php?obj=jingxi/" + file;
- if (IsXiaoNaiNiu)
- return LoginApiUrl + "index.php?obj=littlecow/" + file;
- if (IsPinbaobao)
- return LoginApiUrl + "index.php?obj=pinbaobao/" + file;
- if (IsBuyer)
- return LoginApiUrl + "index.php?obj=findgoldcat_buyer/" + file;
- if (IsMainCompany)
- return LoginApiUrl + "index.php?obj=findgoldcat_main/" + file;
- return LoginApiUrl + "index.php?obj=findgoldcat/" + file;
- }
+ ///
+ /// 签名算法
+ ///
+ /// 随机数
+ /// 加密签名结果
+ public static string Encryption(int s)
+ {
+ string ss = s.ToString();
+ if (ss.Length > 8)
+ {
+ ss = ss.Substring(ss.Length - 8);
+ s = int.Parse(ss);
+ if (s < 100000000)
+ s += 100000000;
+ }
+ byte[] kb = Encoding.ASCII.GetBytes(s.ToString());
+ double y = s * 1.8061825125;
+ y += 4852095.48659959;
+ y += kb[3] * 943579.486548;
+ y += kb[7] + 4889894.30184;
+ byte[] k = Encoding.ASCII.GetBytes(y.ToString());
+ y -= 458735.48548;
+ y -= k[6] * 458720.454545;
+ y -= k[2] * 5447826.96889;
+ byte[] k1 = Encoding.ASCII.GetBytes(y.ToString());
+ y += 34779810.2455;
+ y -= k1[1] * 57942.0564845;
+ y -= k1[5] * 1548.487866;
+ string c = ((int)y).ToString();
+ return GetMd5(c); //返回签名的MD5结果
+ }
+ ///
+ /// 生成OBJ路径
+ ///
+ ///
+ ///
+ public static string BuildObjString(string file)
+ {
+ if (IsJingXi)
+ return LoginApiUrl + "index.php?obj=jingxi/" + file;
+ if (IsXiaoNaiNiu)
+ return LoginApiUrl + "index.php?obj=littlecow/" + file;
+ if (IsPinbaobao)
+ return LoginApiUrl + "index.php?obj=pinbaobao/" + file;
+ if (IsBuyer)
+ return LoginApiUrl + "index.php?obj=findgoldcat_buyer/" + file;
+ if (IsMainCompany)
+ return LoginApiUrl + "index.php?obj=findgoldcat_main/" + file;
+ return LoginApiUrl + "index.php?obj=findgoldcat/" + file;
+ }
- public static string DouYinBuildObjString(string file)
- {
- return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file;
- }
+ public static string DouYinBuildObjString(string file)
+ {
+ return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file;
+ }
- public static string BuildDefaultObjString(string file, bool IsLoginDef = false)
- {
- return LoginApiUrl + "/" + file + "?obj=" + "/" + file;
- }
+ public static string BuildDefaultObjString(string file, bool IsLoginDef = false)
+ {
+ return LoginApiUrl + "/" + file + "?obj=" + "/" + file;
+ }
- public static string Build29WxObjString(string file, bool IsLoginDef = false)
- {
- return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file;
- }
- public static string Build29PDDObjString(string file, bool IsLoginDef = false)
- {
- return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file;
- }
+ public static string Build29WxObjString(string file, bool IsLoginDef = false)
+ {
+ return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file;
+ }
+ public static string Build29PDDObjString(string file, bool IsLoginDef = false)
+ {
+ return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file;
+ }
- ///
- /// 返回固定字节长度
- ///
- ///
- ///
- ///
- public static string SubCharLength(string word, int len)
- {
- if (string.IsNullOrEmpty(word))
- return word;
- word = word.Trim();
- word = word.Replace("..", ".").Replace("..", ".");
- word = word.Replace(" ", " ").Replace(" ", " ");
- if (GetCharLength(word) <= len)
- return word;
- while (GetCharLength(word) > len)
- {
- word = word.Substring(0, word.Length - 1);
- }
- return word;
- }
- }
+ ///
+ /// 返回固定字节长度
+ ///
+ ///
+ ///
+ ///
+ public static string SubCharLength(string word, int len)
+ {
+ if (string.IsNullOrEmpty(word))
+ return word;
+ word = word.Trim();
+ word = word.Replace("..", ".").Replace("..", ".");
+ word = word.Replace(" ", " ").Replace(" ", " ");
+ if (GetCharLength(word) <= len)
+ return word;
+ while (GetCharLength(word) > len)
+ {
+ word = word.Substring(0, word.Length - 1);
+ }
+ return word;
+ }
+ }
- public class KeyValueBase
- {
- public KeyValueBase(string key, string value)
- {
- Key = key;
- Value = value;
- }
+ public class KeyValueBase
+ {
+ public KeyValueBase(string key, string value)
+ {
+ Key = key;
+ Value = value;
+ }
- public string Key;
- public string Value;
- ///
- /// 店铺ID
- ///
- public string Id = "";
- public string CatName = "";
- }
+ public string Key;
+ public string Value;
+ ///
+ /// 店铺ID
+ ///
+ public string Id = "";
+ public string CatName = "";
+ }
- public class BuyOrderTemp
- {
- public string ShopName;//店铺名称
- public string OrderId;//客户单号
- public string BuyOrderId;//拍单单号
- public string BuyUser;//拍单账户
- public string BuyTime;//拍单账户
- public string PayAccountZFB;//拍单支付宝账户
- }
+ public class BuyOrderTemp
+ {
+ public string ShopName;//店铺名称
+ public string OrderId;//客户单号
+ public string BuyOrderId;//拍单单号
+ public string BuyUser;//拍单账户
+ public string BuyTime;//拍单账户
+ public string PayAccountZFB;//拍单支付宝账户
+ }
- public class KeyValuesBase
- {
- public KeyValuesBase(string key, string value1)
- {
- Key = key;
- Value1 = value1;
- }
- public KeyValuesBase(string key, string value1, string value2, string value3)
- {
- Key = key;
- Value1 = value1;
- Value2 = value2;
- Value3 = value3;
- }
- public KeyValuesBase(string key, string value1, string value2)
- {
- Key = key;
- Value1 = value1;
- Value2 = value2;
- }
+ public class KeyValuesBase
+ {
+ public KeyValuesBase(string key, string value1)
+ {
+ Key = key;
+ Value1 = value1;
+ }
+ public KeyValuesBase(string key, string value1, string value2, string value3)
+ {
+ Key = key;
+ Value1 = value1;
+ Value2 = value2;
+ Value3 = value3;
+ }
+ public KeyValuesBase(string key, string value1, string value2)
+ {
+ Key = key;
+ Value1 = value1;
+ Value2 = value2;
+ }
- public string Key;
- public string Value1;
- public string Value2;
- public string Value3;
+ public string Key;
+ public string Value1;
+ public string Value2;
+ public string Value3;
- public int Rank = 0;
- }
+ public int Rank = 0;
+ }
- public class CatProudctBase
- {
- public int CatId = 0;
- public Dictionary Products = new Dictionary();
- }
+ public class CatProudctBase
+ {
+ public int CatId = 0;
+ public Dictionary Products = new Dictionary();
+ }
- public class MarketProductBase
- {
- public string ProductId = "";
- public string Title = "";
- public string CatIds = "";
- public string Image = "";
- public string CampaignId = "";
- public string Token = "";
- }
+ public class MarketProductBase
+ {
+ public string ProductId = "";
+ public string Title = "";
+ public string CatIds = "";
+ public string Image = "";
+ public string CampaignId = "";
+ public string Token = "";
+ }
- public class ProcessBase
- {
- public int Min = 0;
- public int Max = 0;
- public int Value = 0;
- }
+ public class ProcessBase
+ {
+ public int Min = 0;
+ public int Max = 0;
+ public int Value = 0;
+ }
- public class ProductBase
- {
- public long Id;
- public long UpId;
- public string Title;
- public string OuterId;
- public decimal Price;
- public bool HadFastCar = false;
- ///
- /// 需要上传
- ///
- public bool MustUpdate = false;
- }
- public class ProductCollectBase
- {
- ///
- /// 更新SKU是否成功
- ///
- public bool UpdateSuccess = false;
- public long id = 0;
- public int cat_id = 0;
- public int main_cid = 0;
- public string main_cat_name = "";
- public int mall_id = 0;
- public int cat1 = 0;
- public int cat2 = 0;
- public int cat3 = 0;
- public int cat4 = 0;
- public long from_id = 0;
- public int from_shop_id = 0;
- public int from_cat_id = 0;
- public int from_site_id = 0;
- public int item_weight = 1;
- public int saleCount = 0;
- public int num = 0;
- public decimal price = -1;
- public decimal before_price = -1;
- public decimal discount = -1;
- public decimal discountPrice = -1;
- public decimal onlinePrice = -1;
- public decimal market_price = 0;
- public int shopAddPercent = 0;
- public decimal shopAddPriceMin = 0;
- public decimal shopAddPriceMax = 0;
- public string image = "";
- public string image_path = "";
- public string image_from_url = "";
- public string from_name = "";
- public string name = "";
- public string name_share = "";
- public string content_pinduoduo = "";
- public string hd_thumb_url_pinduoduo = "";
- public string thumb_url_pinduoduo = "";
- public int cost_template_id_pinduoduo = 0;
- public string name_shot = "";
- public List Prop = new List();
- public List Props = new List();
- public List Packs = new List();
- public List SkuMaps = new List();
- public List Images = new List();
- public string sell_pt = "";
- public string from_url = "";
- public string from_shop_name = "";
- public string item_size = "";
- public string city = "";
- public string state = "";
- public string content = "";
- public string from = "";
- public string from_title = "";
- public string message = "";
- ///
- /// 邮费
- ///
- public decimal express_price = 0;
- public long nameMd5 = 0;
- public long upShopId = 0;
- public ProductCollectBase Clone()
- {
- string html = JsonHelper.SerializeObject(this);
- ProductCollectBase tp = JsonHelper.DeserializeJsonToObject(html);
- return tp;
- }
- }
+ public class ProductBase
+ {
+ public long Id;
+ public long UpId;
+ public string Title;
+ public string OuterId;
+ public decimal Price;
+ public bool HadFastCar = false;
+ ///
+ /// 需要上传
+ ///
+ public bool MustUpdate = false;
+ }
+ public class ProductCollectBase
+ {
+ ///
+ /// 更新SKU是否成功
+ ///
+ public bool UpdateSuccess = false;
+ public long id = 0;
+ public int cat_id = 0;
+ public int main_cid = 0;
+ public string main_cat_name = "";
+ public int mall_id = 0;
+ public int cat1 = 0;
+ public int cat2 = 0;
+ public int cat3 = 0;
+ public int cat4 = 0;
+ public long from_id = 0;
+ public int from_shop_id = 0;
+ public int from_cat_id = 0;
+ public int from_site_id = 0;
+ public int item_weight = 1;
+ public int saleCount = 0;
+ public int num = 0;
+ public decimal price = -1;
+ public decimal before_price = -1;
+ public decimal discount = -1;
+ public decimal discountPrice = -1;
+ public decimal onlinePrice = -1;
+ public decimal market_price = 0;
+ public int shopAddPercent = 0;
+ public decimal shopAddPriceMin = 0;
+ public decimal shopAddPriceMax = 0;
+ public string image = "";
+ public string image_path = "";
+ public string image_from_url = "";
+ public string from_name = "";
+ public string name = "";
+ public string name_share = "";
+ public string content_pinduoduo = "";
+ public string hd_thumb_url_pinduoduo = "";
+ public string thumb_url_pinduoduo = "";
+ public int cost_template_id_pinduoduo = 0;
+ public string name_shot = "";
+ public List Prop = new List();
+ public List Props = new List();
+ public List Packs = new List();
+ public List SkuMaps = new List();
+ public List Images = new List();
+ public string sell_pt = "";
+ public string from_url = "";
+ public string from_shop_name = "";
+ public string item_size = "";
+ public string city = "";
+ public string state = "";
+ public string content = "";
+ public string from = "";
+ public string from_title = "";
+ public string message = "";
+ ///
+ /// 邮费
+ ///
+ public decimal express_price = 0;
+ public long nameMd5 = 0;
+ public long upShopId = 0;
+ public ProductCollectBase Clone()
+ {
+ string html = JsonHelper.SerializeObject(this);
+ ProductCollectBase tp = JsonHelper.DeserializeJsonToObject(html);
+ return tp;
+ }
+ }
- public class PropBase
- {
- public long id;
- public string name = "";
- public string pinduoduo_name = "";
- public string pinduoduo_id = "";
- public int sort = 0;
- public List Values = new List();
- }
+ public class PropBase
+ {
+ public long id;
+ public string name = "";
+ public string pinduoduo_name = "";
+ public string pinduoduo_id = "";
+ public int sort = 0;
+ public List Values = new List();
+ }
- public class PropValueBase
- {
- public string value = "";
- public string name = "";
- public string id = "";
- public string image = "";
- public string image_path = "";
- public string image_from_url = "";
- //public string image_pinduoduo_url = "";
- public int number = 0;
- //public decimal pinduoduo_price = 0;
- public string name_pinduoduo = "";
- }
+ public class PropValueBase
+ {
+ public string value = "";
+ public string name = "";
+ public string id = "";
+ public string image = "";
+ public string image_path = "";
+ public string image_from_url = "";
+ //public string image_pinduoduo_url = "";
+ public int number = 0;
+ //public decimal pinduoduo_price = 0;
+ public string name_pinduoduo = "";
+ }
- public class PackBase
- {
- public string name = "";
- public string value_count = "";
- public int sort = 0;
- }
+ public class PackBase
+ {
+ public string name = "";
+ public string value_count = "";
+ public int sort = 0;
+ }
- public class SkuMapBase
- {
- public long id = 0;
- public string name = "";
- public decimal price = 0;
- public decimal before_price = 0;
- public decimal no_group_price = 0;
- public decimal new_price = 0;
- public int number = 0;
- public int sale_count = 0;
- public decimal online_price = 0;
- public string prop_image = "";
- public string pinduoduo_image = "";
- public string size = "";
- public string sizename = "";
- public string spec_pinduoduo = "";
- }
+ public class SkuMapBase
+ {
+ public long id = 0;
+ public string name = "";
+ public decimal price = 0;
+ public decimal before_price = 0;
+ public decimal no_group_price = 0;
+ public decimal new_price = 0;
+ public int number = 0;
+ public int sale_count = 0;
+ public decimal online_price = 0;
+ public string prop_image = "";
+ public string pinduoduo_image = "";
+ public string size = "";
+ public string sizename = "";
+ public string spec_pinduoduo = "";
+ }
- public class ReceiveAddress
- {
- public string Provincial;
+ public class ReceiveAddress
+ {
+ public string Provincial;
- public string City;
+ public string City;
- public string Area;
- }
+ public string Area;
+ }
}
diff --git a/AllBase/Model/DBModel/oms_wei_order_info.cs b/AllBase/Model/DBModel/oms_wei_order_info.cs
index 009fc25..5fc6546 100644
--- a/AllBase/Model/DBModel/oms_wei_order_info.cs
+++ b/AllBase/Model/DBModel/oms_wei_order_info.cs
@@ -31,17 +31,6 @@ namespace AllBase.Model.DBModel
public ObservableCollection orderItems { get; set; } = new ObservableCollection();
- public oms_wei_order_item_info order_item1 { get { return orderItems?.Count > 0 ? orderItems[0] : null; } }
- public oms_wei_order_item_info order_item2 { get { return orderItems?.Count > 1 ? orderItems[1] : null; } }
- public oms_wei_order_item_info order_item3 { get { return orderItems?.Count > 2 ? orderItems[2] : null; } }
- public oms_wei_order_item_info order_item4 { get { return orderItems?.Count > 3 ? orderItems[3] : null; } }
- public oms_wei_order_item_info order_item5 { get { return orderItems?.Count > 4 ? orderItems[4] : null; } }
- public Visibility order_item1_visibility { get { return order_item1 == null ? Visibility.Collapsed : Visibility.Visible; } }
- public Visibility order_item2_visibility { get { return order_item2 == null ? Visibility.Collapsed : Visibility.Visible; } }
- public Visibility order_item3_visibility { get { return order_item3 == null ? Visibility.Collapsed : Visibility.Visible; } }
- public Visibility order_item4_visibility { get { return order_item4 == null ? Visibility.Collapsed : Visibility.Visible; } }
- public Visibility order_item5_visibility { get { return order_item5 == null ? Visibility.Collapsed : Visibility.Visible; } }
-
public ObservableCollection refundItems { get; set; } = new ObservableCollection();
///
diff --git a/Work/_29Tools/BLL/HttpResponseWXBLL.cs b/Work/_29Tools/BLL/HttpResponseWXBLL.cs
index c7c63be..58114f5 100644
--- a/Work/_29Tools/BLL/HttpResponseWXBLL.cs
+++ b/Work/_29Tools/BLL/HttpResponseWXBLL.cs
@@ -12,727 +12,824 @@ using System.Threading.Tasks;
namespace Work._29Tools.BLL
{
- public class HttpResponseWXBLL
- {
- //Assistant
- public static string WeiXinAssistantPostResponse(ShopLoginInfo shop, string _url, string _data, string referer)
- {
- string biz_magic = "";
- string talent_magic = "";
- string cookies = "";
- try
- {
- var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
- if (cookieLst == null)
- cookieLst = new List();
- foreach (var cook in cookieLst)
- {
- cookies += cook.Name + "=" + cook.Value + ";";
- }
- //var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
- //if (bizMagicCookie != null)
- // biz_magic = bizMagicCookie.Value;
- var talentMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "talent_magic");
- if (talentMagicCookie != null)
- talent_magic = talentMagicCookie.Value;
- }
- catch { }
+ public class HttpResponseWXBLL
+ {
+ //Assistant
+ public static string WeiXinAssistantPostResponse(ShopLoginInfo shop, string _url, string _data, string referer)
+ {
+ string biz_magic = "";
+ string talent_magic = "";
+ string cookies = "";
+ try
+ {
+ var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
+ if (cookieLst == null)
+ cookieLst = new List();
+ foreach (var cook in cookieLst)
+ {
+ cookies += cook.Name + "=" + cook.Value + ";";
+ }
+ //var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
+ //if (bizMagicCookie != null)
+ // biz_magic = bizMagicCookie.Value;
+ var talentMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "talent_magic");
+ if (talentMagicCookie != null)
+ talent_magic = talentMagicCookie.Value;
+ }
+ catch { }
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.KeepAlive = true;
- request.Headers.Add("wecom_magic", @"");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("supplier_magic", @"");
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("potter-scene", @"weixinShop");
- request.Headers.Add("biz_magic", "");
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "application/json, text/plain, */*";
- request.Headers.Add("talent_magic", talent_magic);
- request.ContentType = "application/json";
- request.Headers.Add("mcn_magic", @"");
- request.Headers.Add("Origin", @"https://store.weixin.qq.com");
- request.Headers.Add("Sec-Fetch-Site", @"same-origin");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- request.Referer = referer;
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6");
- request.Headers.Set(HttpRequestHeader.Cookie, cookies);
+ request.KeepAlive = true;
+ request.Headers.Add("wecom_magic", @"");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("supplier_magic", @"");
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("potter-scene", @"weixinShop");
+ request.Headers.Add("biz_magic", "");
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "application/json, text/plain, */*";
+ request.Headers.Add("talent_magic", talent_magic);
+ request.ContentType = "application/json";
+ request.Headers.Add("mcn_magic", @"");
+ request.Headers.Add("Origin", @"https://store.weixin.qq.com");
+ request.Headers.Add("Sec-Fetch-Site", @"same-origin");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6");
+ request.Headers.Set(HttpRequestHeader.Cookie, cookies);
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _data;
- byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
- request.ContentLength = postBytes.Length;
- Stream stream = request.GetRequestStream();
- stream.Write(postBytes, 0, postBytes.Length);
- stream.Close();
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string WeiXinPostResponse(ShopLoginInfo shop, string _url, string _data, string referer)
- {
- string biz_magic = "";
- string cookies = "";
- try
- {
- var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
- if (cookieLst == null)
- cookieLst = new List();
- foreach (var cook in cookieLst)
- {
- cookies += cook.Name + "=" + cook.Value + ";";
- }
- var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
- if (bizMagicCookie != null)
- biz_magic = bizMagicCookie.Value;
- }
- catch { }
+ public static string WeiXinPostResponse(ShopLoginInfo shop, string _url, string _data, string referer)
+ {
+ string biz_magic = "";
+ string cookies = "";
+ try
+ {
+ var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
+ if (cookieLst == null)
+ cookieLst = new List();
+ foreach (var cook in cookieLst)
+ {
+ cookies += cook.Name + "=" + cook.Value + ";";
+ }
+ var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
+ if (bizMagicCookie != null)
+ biz_magic = bizMagicCookie.Value;
+ }
+ catch { }
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.KeepAlive = true;
- request.Headers.Add("wecom_magic", @"");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("supplier_magic", @"");
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("potter-scene", @"weixinShop");
- request.Headers.Add("biz_magic", biz_magic);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "application/json, text/plain, */*";
- request.Headers.Add("talent_magic", @"");
- request.ContentType = "application/json";
- request.Headers.Add("mcn_magic", @"");
- request.Headers.Add("Origin", @"https://store.weixin.qq.com");
- request.Headers.Add("Sec-Fetch-Site", @"same-origin");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- request.Referer = referer;
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6");
- request.Headers.Set(HttpRequestHeader.Cookie, cookies);
+ request.KeepAlive = true;
+ request.Headers.Add("wecom_magic", @"");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("supplier_magic", @"");
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("potter-scene", @"weixinShop");
+ request.Headers.Add("biz_magic", biz_magic);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "application/json, text/plain, */*";
+ request.Headers.Add("talent_magic", @"");
+ request.ContentType = "application/json";
+ request.Headers.Add("mcn_magic", @"");
+ request.Headers.Add("Origin", @"https://store.weixin.qq.com");
+ request.Headers.Add("Sec-Fetch-Site", @"same-origin");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6");
+ request.Headers.Set(HttpRequestHeader.Cookie, cookies);
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _data;
- byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
- request.ContentLength = postBytes.Length;
- Stream stream = request.GetRequestStream();
- stream.Write(postBytes, 0, postBytes.Length);
- stream.Close();
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string WeiXinTalentOpenKfPostResponse(ShopLoginInfo shop, string _url, string _data, string referer)
- {
- string biz_magic = "";
- string cookies = "";
- try
- {
- var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
- if (cookieLst == null)
- cookieLst = new List();
- foreach (var cook in cookieLst)
- {
- cookies += cook.Name + "=" + cook.Value + ";";
- }
- var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
- if (bizMagicCookie != null)
- biz_magic = bizMagicCookie.Value;
- }
- catch { }
+ public static string WeiXinTalentOpenKfPostResponse(ShopLoginInfo shop, string _url, string _data, string referer)
+ {
+ string biz_magic = "";
+ string cookies = "";
+ try
+ {
+ var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
+ if (cookieLst == null)
+ cookieLst = new List();
+ foreach (var cook in cookieLst)
+ {
+ cookies += cook.Name + "=" + cook.Value + ";";
+ }
+ var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
+ if (bizMagicCookie != null)
+ biz_magic = bizMagicCookie.Value;
+ }
+ catch { }
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.KeepAlive = true;
- request.Headers.Add("wecom_magic", @"");
- request.Headers.Add("user_scene", @"1002");
- request.Headers.Add("kf_scene", @"6");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("supplier_magic", @"");
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("potter-scene", @"weixinShop");
- request.Headers.Add("biz_magic", biz_magic);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "application/json, text/plain, */*";
- request.Headers.Add("talent_magic", @"");
- request.ContentType = "application/json";
- request.Headers.Add("logistics_magic", @"");
- request.Headers.Add("mcn_magic", @"");
- request.Headers.Add("Origin", @"https://store.weixin.qq.com");
- request.Headers.Add("Sec-Fetch-Site", @"same-origin");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- request.Referer = referer;
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6");
- request.Headers.Set(HttpRequestHeader.Cookie, cookies);
+ request.KeepAlive = true;
+ request.Headers.Add("wecom_magic", @"");
+ request.Headers.Add("user_scene", @"1002");
+ request.Headers.Add("kf_scene", @"6");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("supplier_magic", @"");
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("potter-scene", @"weixinShop");
+ request.Headers.Add("biz_magic", biz_magic);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "application/json, text/plain, */*";
+ request.Headers.Add("talent_magic", @"");
+ request.ContentType = "application/json";
+ request.Headers.Add("logistics_magic", @"");
+ request.Headers.Add("mcn_magic", @"");
+ request.Headers.Add("Origin", @"https://store.weixin.qq.com");
+ request.Headers.Add("Sec-Fetch-Site", @"same-origin");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6");
+ request.Headers.Set(HttpRequestHeader.Cookie, cookies);
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _data;
- byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
- request.ContentLength = postBytes.Length;
- Stream stream = request.GetRequestStream();
- stream.Write(postBytes, 0, postBytes.Length);
- stream.Close();
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string WeiXinImgPostResponse(ShopLoginInfo shop, string _url, string _data, string dis_k, long dis_t, string ext, string referer = "https://store.weixin.qq.com/")
- {
- string biz_magic = "";
- string cookies = "";
- try
- {
- var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
- if (cookieLst == null)
- cookieLst = new List();
- foreach (var cook in cookieLst)
- {
- cookies += cook.Name + "=" + cook.Value + ";";
- }
- var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
- if (bizMagicCookie != null)
- biz_magic = bizMagicCookie.Value;
- }
- catch { }
+ public static string WeiXinImgPostResponse(ShopLoginInfo shop, string _url, string _data, string dis_k, long dis_t, string ext, string referer = "https://store.weixin.qq.com/")
+ {
+ string biz_magic = "";
+ string cookies = "";
+ try
+ {
+ var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
+ if (cookieLst == null)
+ cookieLst = new List();
+ foreach (var cook in cookieLst)
+ {
+ cookies += cook.Name + "=" + cook.Value + ";";
+ }
+ var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
+ if (bizMagicCookie != null)
+ biz_magic = bizMagicCookie.Value;
+ }
+ catch { }
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.KeepAlive = true;
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("X-Requested-With", @"XMLHttpRequest");
- //request.Headers.Add("X-Arguments", @"dis_k=9974f70b8c9e17952a3bf6aa7b0fcfee84d976d5&dis_t=1767868679&ext=1b37ffc79cfe7&apptype=160&filetype=20304&openid=ouBgG2b2iqWytVlHHK0lhZvMBf2o&groupid=0&taskid=c9059d06-383e-460e-86e6-a0cb134016a9");
- request.Headers.Add("X-Arguments", @"dis_k=" + dis_k + @"&dis_t=" + dis_t + @"&ext=" + ext + @"&apptype=160&filetype=20304&openid=" + shop.openid + @"&groupid=0&taskid=" + Guid.NewGuid().ToString());
- request.Accept = "application/json, text/plain, */*";
- request.ContentType = "application/json";
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Headers.Add("Origin", @"https://store.weixin.qq.com");
- request.Headers.Add("Sec-Fetch-Site", @"same-site");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- request.Referer = referer;
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.KeepAlive = true;
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("X-Requested-With", @"XMLHttpRequest");
+ //request.Headers.Add("X-Arguments", @"dis_k=9974f70b8c9e17952a3bf6aa7b0fcfee84d976d5&dis_t=1767868679&ext=1b37ffc79cfe7&apptype=160&filetype=20304&openid=ouBgG2b2iqWytVlHHK0lhZvMBf2o&groupid=0&taskid=c9059d06-383e-460e-86e6-a0cb134016a9");
+ request.Headers.Add("X-Arguments", @"dis_k=" + dis_k + @"&dis_t=" + dis_t + @"&ext=" + ext + @"&apptype=160&filetype=20304&openid=" + shop.openid + @"&groupid=0&taskid=" + Guid.NewGuid().ToString());
+ request.Accept = "application/json, text/plain, */*";
+ request.ContentType = "application/json";
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Headers.Add("Origin", @"https://store.weixin.qq.com");
+ request.Headers.Add("Sec-Fetch-Site", @"same-site");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _data;
- byte[] postBytes = Convert.FromBase64String(body);
- request.ContentLength = postBytes.Length;
- Stream stream = request.GetRequestStream();
- stream.Write(postBytes, 0, postBytes.Length);
- stream.Close();
+ string body = _data;
+ byte[] postBytes = Convert.FromBase64String(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string WeiXinUploadResponse(ShopLoginInfo shop, string _url, string _body, string boundaryStr, string referer)
- {
+ public static string WeiXinUploadResponse(ShopLoginInfo shop, string _url, string _body, string boundaryStr, string referer)
+ {
- string biz_magic = "";
- string cookies = "";
- try
- {
- var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
- if (cookieLst == null)
- cookieLst = new List();
- foreach (var cook in cookieLst)
- {
- if (cook.Name.StartsWith("biz"))
- cookies += cook.Name + "=" + cook.Value + ";";
- }
- var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
- if (bizMagicCookie != null)
- biz_magic = bizMagicCookie.Value;
- }
- catch { }
+ string biz_magic = "";
+ string cookies = "";
+ try
+ {
+ var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
+ if (cookieLst == null)
+ cookieLst = new List();
+ foreach (var cook in cookieLst)
+ {
+ if (cook.Name.StartsWith("biz"))
+ cookies += cook.Name + "=" + cook.Value + ";";
+ }
+ var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
+ if (bizMagicCookie != null)
+ biz_magic = bizMagicCookie.Value;
+ }
+ catch { }
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.Headers.Add("wecom_magic", @"");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("supplier_magic", @"");
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("potter-scene", @"weixinShop");
- request.Headers.Add("biz_magic", biz_magic);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "application/json, text/plain, */*";
- request.Headers.Add("talent_magic", @"");
- request.ContentType = "multipart/form-data; boundary=" + boundaryStr;
- request.Headers.Add("mcn_magic", @"");
- request.Headers.Add("Origin", @"https://store.weixin.qq.com");
- request.Headers.Set(HttpRequestHeader.Cookie, cookies);
- request.Headers.Add("Sec-Fetch-Site", @"same-origin");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- request.Referer = referer; //"https://store.weixin.qq.com/shop/goods/entry";
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Headers.Add("wecom_magic", @"");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("supplier_magic", @"");
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("potter-scene", @"weixinShop");
+ request.Headers.Add("biz_magic", biz_magic);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "application/json, text/plain, */*";
+ request.Headers.Add("talent_magic", @"");
+ request.ContentType = "multipart/form-data; boundary=" + boundaryStr;
+ request.Headers.Add("mcn_magic", @"");
+ request.Headers.Add("Origin", @"https://store.weixin.qq.com");
+ request.Headers.Set(HttpRequestHeader.Cookie, cookies);
+ request.Headers.Add("Sec-Fetch-Site", @"same-origin");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ request.Referer = referer; //"https://store.weixin.qq.com/shop/goods/entry";
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _body;
- HttpResponseBLL.WriteMultipartBodyToRequest(request, body);
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ string body = _body;
+ HttpResponseBLL.WriteMultipartBodyToRequest(request, body);
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string WeiXinGetResponse(ShopLoginInfo shop, string _url, string referer = "", bool isGetDocument = false)
- {
- string biz_magic = "";
- string cookies = "";
- try
- {
- var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
- if (cookieLst == null)
- cookieLst = new List();
- foreach (var cook in cookieLst)
- {
- if (cook.Name.StartsWith("biz"))
- cookies += cook.Name + "=" + cook.Value + ";";
- }
- var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
- if (bizMagicCookie != null)
- biz_magic = bizMagicCookie.Value;
- }
- catch { }
+ public static string WeiXinGetResponse(ShopLoginInfo shop, string _url, string referer = "", bool isGetDocument = false)
+ {
+ string biz_magic = "";
+ string cookies = "";
+ try
+ {
+ var cookieLst = JsonHelper.DeserializeJsonToList(shop?.Cookies.ParseToString());
+ if (cookieLst == null)
+ cookieLst = new List();
+ foreach (var cook in cookieLst)
+ {
+ if (cook.Name.StartsWith("biz"))
+ cookies += cook.Name + "=" + cook.Value + ";";
+ }
+ var bizMagicCookie = cookieLst.FirstOrDefault(c => c.Name == "biz_magic");
+ if (bizMagicCookie != null)
+ biz_magic = bizMagicCookie.Value;
+ }
+ catch { }
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.KeepAlive = true;
- if (isGetDocument)
- {
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("Upgrade-Insecure-Requests", @"1");
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
- request.Headers.Set(HttpRequestHeader.Cookie, cookies);
- request.Headers.Add("Sec-Fetch-Site", @"none");
- request.Headers.Add("Sec-Fetch-Mode", @"navigate");
- request.Headers.Add("Sec-Fetch-User", @"?1");
- request.Headers.Add("Sec-Fetch-Dest", @"document");
- }
- else
- {
- request.Headers.Add("wecom_magic", @"");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("supplier_magic", @"");
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("potter-scene", @"weixinShop");
- request.Headers.Add("biz_magic",biz_magic);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "application/json, text/plain, */*";
- request.Headers.Add("talent_magic", @"");
- request.Headers.Add("mcn_magic", @"");
- request.Headers.Set(HttpRequestHeader.Cookie, cookies);
- request.Headers.Add("Sec-Fetch-Site", @"same-origin");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- request.Referer = referer;
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- }
+ request.KeepAlive = true;
+ if (isGetDocument)
+ {
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("Upgrade-Insecure-Requests", @"1");
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
+ request.Headers.Set(HttpRequestHeader.Cookie, cookies);
+ request.Headers.Add("Sec-Fetch-Site", @"none");
+ request.Headers.Add("Sec-Fetch-Mode", @"navigate");
+ request.Headers.Add("Sec-Fetch-User", @"?1");
+ request.Headers.Add("Sec-Fetch-Dest", @"document");
+ }
+ else
+ {
+ request.Headers.Add("wecom_magic", @"");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("supplier_magic", @"");
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("potter-scene", @"weixinShop");
+ request.Headers.Add("biz_magic", biz_magic);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "application/json, text/plain, */*";
+ request.Headers.Add("talent_magic", @"");
+ request.Headers.Add("mcn_magic", @"");
+ request.Headers.Set(HttpRequestHeader.Cookie, cookies);
+ request.Headers.Add("Sec-Fetch-Site", @"same-origin");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ }
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string kdniaoPostResponse(string _url, string _data, string referer, Dictionary reqDic, string kdnAuth = null, string kdnAuthKey = "Auth")
- {
- HttpWebResponse response = null;
- string result;
- try
- {
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(_url);
+ public static string kdniaoPostResponse(string _url, string _data, string referer, Dictionary reqDic, string kdnAuth = null, string kdnAuthKey = "Auth")
+ {
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(_url);
- request.KeepAlive = true;
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- //request.Headers.Add("kdnAuth", @"62993d99a28947aaadd6b79427929562");
- //request.Headers.Add("kdnAuth", kdnAuth);
- //request.Headers.Add("Auth", kdnAuth);
- //request.Headers.Add(kdnAuthKey, kdnAuth);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
- request.Accept = "application/json, text/javascript, */*; q=0.01";
- request.ContentType = "application/x-www-form-urlencoded";
- request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("Origin", @"https://56.kdniao.com");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- request.Headers.Add("Sec-Fetch-Site", @"same-site");
- request.Headers.Add("Sec-Fetch-Mode", @"cors");
- request.Headers.Add("Sec-Fetch-Dest", @"empty");
- foreach (var key in reqDic.Keys)
- {
- if (request.Headers.AllKeys.Contains(key))
- continue;
+ request.KeepAlive = true;
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ //request.Headers.Add("kdnAuth", @"62993d99a28947aaadd6b79427929562");
+ //request.Headers.Add("kdnAuth", kdnAuth);
+ //request.Headers.Add("Auth", kdnAuth);
+ //request.Headers.Add(kdnAuthKey, kdnAuth);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+ request.Accept = "application/json, text/javascript, */*; q=0.01";
+ request.ContentType = "application/x-www-form-urlencoded";
+ request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("Origin", @"https://56.kdniao.com");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Headers.Add("Sec-Fetch-Site", @"same-site");
+ request.Headers.Add("Sec-Fetch-Mode", @"cors");
+ request.Headers.Add("Sec-Fetch-Dest", @"empty");
+ foreach (var key in reqDic.Keys)
+ {
+ if (request.Headers.AllKeys.Contains(key))
+ continue;
- request.Headers.Add(key, reqDic[key].ParseToString());
- }
+ request.Headers.Add(key, reqDic[key].ParseToString());
+ }
- request.Referer = referer;
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _data;
- byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
- request.ContentLength = postBytes.Length;
- Stream stream = request.GetRequestStream();
- stream.Write(postBytes, 0, postBytes.Length);
- stream.Close();
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
- public static string sAuthorization = "";
+ public static string sAuthorization = "";
- public static string e57PostResponse(string _url, string _data, string referer, string Authorization = null)
- {
- //if (string.IsNullOrEmpty(Authorization)) Authorization = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ3YmRlOGNlLWY5MDUtNDIzOS05M2VjLWZiN2U3MjRmOTY0NiJ9.vwxhj3t4zTDdBQTyfVjcKr-0Oma8-VtPDzE2LVkw4A4aWftncY1ikXgEhGwoYHn9E7yOnhS_Pb7FfzgecTqqHA";
+ public static string e57PostResponse(string _url, string _data, string referer)
+ {
+ //if (string.IsNullOrEmpty(Authorization)) Authorization = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ3YmRlOGNlLWY5MDUtNDIzOS05M2VjLWZiN2U3MjRmOTY0NiJ9.vwxhj3t4zTDdBQTyfVjcKr-0Oma8-VtPDzE2LVkw4A4aWftncY1ikXgEhGwoYHn9E7yOnhS_Pb7FfzgecTqqHA";
- bool isRetry = false;
- if (string.IsNullOrEmpty(sAuthorization))
- {
- var url3 = BaseClass.Build29WxObjString("user/get_e57_authorization");
- var data3 = UserLogin.GetSignaturex();
- var html3 = GetHtml.PostUtf8(url3, data3);
- if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
- html3 = GetHtml.PostUtf8(url3, data3);
- sAuthorization = BaseRegex.GetStringJson(ref html3, "authorization");
- }
+ bool isRetry = false;
+ if (string.IsNullOrEmpty(sAuthorization))
+ {
+ var url3 = BaseClass.Build29WxObjString("user/get_e57_authorization");
+ var data3 = UserLogin.GetSignaturex();
+ var html3 = GetHtml.PostUtf8(url3, data3);
+ if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
+ html3 = GetHtml.PostUtf8(url3, data3);
+ sAuthorization = BaseRegex.GetStringJson(ref html3, "authorization");
+ }
- Retry:
+ Retry:
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
- HttpWebRequest request;
- if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
- {
- ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
- ServicePointManager.SecurityProtocol =
- ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
- request = WebRequest.Create(url) as HttpWebRequest;
- request.ProtocolVersion = HttpVersion.Version10;
- }
- else
- request = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request;
+ if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
+ {
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
+ ServicePointManager.SecurityProtocol =
+ ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+ request = WebRequest.Create(url) as HttpWebRequest;
+ request.ProtocolVersion = HttpVersion.Version10;
+ }
+ else
+ request = (HttpWebRequest)WebRequest.Create(url);
- request.KeepAlive = true;
- //request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
- //request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36";
- request.ContentType = "application/json";
- //request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"; //request.Accept = "*/*";
- //request.Referer = referer;
- //request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
- //request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- request.Headers.Add("sec-ch-ua", @"""Not(A:Brand"";v=""8"", ""Chromium"";v=""144"", ""Google Chrome"";v=""144""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("Upgrade-Insecure-Requests", @"1");
- request.Headers.Add("Authorization", "Bearer " + sAuthorization);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
- request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
- request.Headers.Add("Sec-Fetch-Site", @"none");
- request.Headers.Add("Sec-Fetch-Mode", @"navigate");
- request.Headers.Add("Sec-Fetch-User", @"?1");
- request.Headers.Add("Sec-Fetch-Dest", @"document");
- request.Headers.Set(HttpRequestHeader.Cookie, "Admin-Token=" + sAuthorization);
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- request.Proxy = null;
+ request.KeepAlive = true;
+ //request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
+ //request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36";
+ request.ContentType = "application/json";
+ //request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"; //request.Accept = "*/*";
+ //request.Referer = referer;
+ //request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ //request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Headers.Add("sec-ch-ua", @"""Not(A:Brand"";v=""8"", ""Chromium"";v=""144"", ""Google Chrome"";v=""144""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("Upgrade-Insecure-Requests", @"1");
+ request.Headers.Add("Authorization", "Bearer " + sAuthorization);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
+ request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
+ request.Headers.Add("Sec-Fetch-Site", @"none");
+ request.Headers.Add("Sec-Fetch-Mode", @"navigate");
+ request.Headers.Add("Sec-Fetch-User", @"?1");
+ request.Headers.Add("Sec-Fetch-Dest", @"document");
+ request.Headers.Set(HttpRequestHeader.Cookie, "Admin-Token=" + sAuthorization);
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Proxy = null;
- request.Method = "POST";
- request.ServicePoint.Expect100Continue = false;
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
- string body = _data;
- byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
- request.ContentLength = postBytes.Length;
- Stream stream = request.GetRequestStream();
- stream.Write(postBytes, 0, postBytes.Length);
- stream.Close();
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- if (result.Contains("没有Authorization") && !isRetry)
- {
- isRetry = true;
- sAuthorization = "";
- goto Retry;
- }
- return result;
- }
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ if (result.Contains("没有Authorization") && !isRetry)
+ {
+ isRetry = true;
+ sAuthorization = "";
+ goto Retry;
+ }
+ return result;
+ }
- public static string e57GetResponse(string _url, string referer)
- {
- bool isRetry = false;
- if (string.IsNullOrEmpty(sAuthorization))
- {
- var url3 = BaseClass.Build29WxObjString("user/get_e57_authorization");
- var data3 = UserLogin.GetSignaturex();
- var html3 = GetHtml.PostUtf8(url3, data3);
- if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
- html3 = GetHtml.PostUtf8(url3, data3);
- sAuthorization = BaseRegex.GetStringJson(ref html3, "authorization");
- }
- Retry:
+ public static async Task e57PostResponseAsync(string _url, string _data, string referer)
+ {
+ await Task.Delay(2000);
+ return await Task.FromResult("SUCCESS200");
+ //if (string.IsNullOrEmpty(Authorization)) Authorization = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ3YmRlOGNlLWY5MDUtNDIzOS05M2VjLWZiN2U3MjRmOTY0NiJ9.vwxhj3t4zTDdBQTyfVjcKr-0Oma8-VtPDzE2LVkw4A4aWftncY1ikXgEhGwoYHn9E7yOnhS_Pb7FfzgecTqqHA";
- HttpWebResponse response = null;
- string result;
- try
- {
- string url = _url;
+ bool isRetry = false;
+ if (string.IsNullOrEmpty(sAuthorization))
+ {
+ var url3 = BaseClass.Build29WxObjString("user/get_e57_authorization");
+ var data3 = UserLogin.GetSignaturex();
+ var html3 = GetHtml.PostUtf8(url3, data3);
+ if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
+ html3 = GetHtml.PostUtf8(url3, data3);
+ sAuthorization = BaseRegex.GetStringJson(ref html3, "authorization");
+ }
- HttpWebRequest request;
- if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
- {
- ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
- ServicePointManager.SecurityProtocol =
- ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
- request = WebRequest.Create(url) as HttpWebRequest;
- request.ProtocolVersion = HttpVersion.Version10;
- }
- else
- request = (HttpWebRequest)WebRequest.Create(url);
+ Retry:
- request.KeepAlive = true;
- request.Headers.Add("sec-ch-ua", @"""Not(A:Brand"";v=""8"", ""Chromium"";v=""144"", ""Google Chrome"";v=""144""");
- request.Headers.Add("sec-ch-ua-mobile", @"?0");
- request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
- request.Headers.Add("Upgrade-Insecure-Requests", @"1");
- request.Headers.Add("Authorization", "Bearer " + sAuthorization);
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
- request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
- request.Headers.Add("Sec-Fetch-Site", @"none");
- request.Headers.Add("Sec-Fetch-Mode", @"navigate");
- request.Headers.Add("Sec-Fetch-User", @"?1");
- request.Headers.Add("Sec-Fetch-Dest", @"document");
- request.Headers.Set(HttpRequestHeader.Cookie, "Admin-Token=" + sAuthorization);
- request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
- request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
- request.Proxy = null;
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request;
+ if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
+ {
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
+ ServicePointManager.SecurityProtocol =
+ ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+ request = WebRequest.Create(url) as HttpWebRequest;
+ request.ProtocolVersion = HttpVersion.Version10;
+ }
+ else
+ request = (HttpWebRequest)WebRequest.Create(url);
- response = (HttpWebResponse)request.GetResponse();
- }
- catch (WebException ex)
- {
- if (ex.Status == WebExceptionStatus.ProtocolError)
- {
- response = (HttpWebResponse)ex.Response;
- result = HttpResponseBLL.ReadResponse(response);
- return result;
- }
- else return ex.Message;
- }
- catch (Exception e)
- {
- if (response != null) response.Close();
- return e.Message;
- }
- result = HttpResponseBLL.ReadResponse(response);
- if (result.Contains("没有Authorization") && !isRetry)
- {
- isRetry = true;
- sAuthorization = "";
- goto Retry;
- }
- return result;
- }
- }
+ request.KeepAlive = true;
+ //request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
+ //request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36";
+ request.ContentType = "application/json";
+ //request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"; //request.Accept = "*/*";
+ //request.Referer = referer;
+ //request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ //request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Headers.Add("sec-ch-ua", @"""Not(A:Brand"";v=""8"", ""Chromium"";v=""144"", ""Google Chrome"";v=""144""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("Upgrade-Insecure-Requests", @"1");
+ request.Headers.Add("Authorization", "Bearer " + sAuthorization);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
+ request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
+ request.Headers.Add("Sec-Fetch-Site", @"none");
+ request.Headers.Add("Sec-Fetch-Mode", @"navigate");
+ request.Headers.Add("Sec-Fetch-User", @"?1");
+ request.Headers.Add("Sec-Fetch-Dest", @"document");
+ request.Headers.Set(HttpRequestHeader.Cookie, "Admin-Token=" + sAuthorization);
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Proxy = null;
+
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
+
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = await request.GetRequestStreamAsync();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
+
+ response = (HttpWebResponse)await request.GetResponseAsync();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ if (result.Contains("没有Authorization") && !isRetry)
+ {
+ isRetry = true;
+ sAuthorization = "";
+ goto Retry;
+ }
+ return result;
+ }
+
+ public static string e57GetResponse(string _url, string referer)
+ {
+ bool isRetry = false;
+ if (string.IsNullOrEmpty(sAuthorization))
+ {
+ var url3 = BaseClass.Build29WxObjString("user/get_e57_authorization");
+ var data3 = UserLogin.GetSignaturex();
+ var html3 = GetHtml.PostUtf8(url3, data3);
+ if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
+ html3 = GetHtml.PostUtf8(url3, data3);
+ sAuthorization = BaseRegex.GetStringJson(ref html3, "authorization");
+ }
+ Retry:
+
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+
+ HttpWebRequest request;
+ if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
+ {
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
+ ServicePointManager.SecurityProtocol =
+ ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+ request = WebRequest.Create(url) as HttpWebRequest;
+ request.ProtocolVersion = HttpVersion.Version10;
+ }
+ else
+ request = (HttpWebRequest)WebRequest.Create(url);
+
+ request.KeepAlive = true;
+ request.Headers.Add("sec-ch-ua", @"""Not(A:Brand"";v=""8"", ""Chromium"";v=""144"", ""Google Chrome"";v=""144""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("Upgrade-Insecure-Requests", @"1");
+ request.Headers.Add("Authorization", "Bearer " + sAuthorization);
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
+ request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
+ request.Headers.Add("Sec-Fetch-Site", @"none");
+ request.Headers.Add("Sec-Fetch-Mode", @"navigate");
+ request.Headers.Add("Sec-Fetch-User", @"?1");
+ request.Headers.Add("Sec-Fetch-Dest", @"document");
+ request.Headers.Set(HttpRequestHeader.Cookie, "Admin-Token=" + sAuthorization);
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+ request.Proxy = null;
+
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = HttpResponseBLL.ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = HttpResponseBLL.ReadResponse(response);
+ if (result.Contains("没有Authorization") && !isRetry)
+ {
+ isRetry = true;
+ sAuthorization = "";
+ goto Retry;
+ }
+ return result;
+ }
+ }
}