淘宝拍单优化

This commit is contained in:
wule committed 2026-10-15 17:36:34 +08:00
1 parent ea14ad3af4
commit e7d22984df
12 files changed
+2233 -46

No files matched your search

@@ -517,14 +517,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
MainWindow.Instance.Dispatcher.Invoke(new Action(() =>
{
if (GlobalConfig.CurrentBuyPlatform == "pdd")
PddBuyOrder(orderItem, isAbnormalOrder, isAutoBuy);
//PddBuyOrder(orderItem, isAbnormalOrder, isAutoBuy);
PddBuyOrderWpf(orderItem, isAbnormalOrder, isAutoBuy);
else if (GlobalConfig.CurrentBuyPlatform == "tb")
TbBuyOrder(orderItem, isAbnormalOrder, isAutoBuy);
TbBuyOrderWpf(orderItem, isAbnormalOrder, isAutoBuy);
}));
});
}
public static void TbBuyOrder(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
public static void TbBuyOrderWpf(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
{
if (GlobalConfig.CurrentTaobaoBuyer == null)
{
@@ -578,6 +579,61 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
}
public static void PddBuyOrderWpf(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
{
if (GlobalConfig.CurrentPddBuyer == null)
{
BaseMsgWindow.ShowError("未选择买手!");
return;
}
PddBuyOrderCtrl pddBuyView = new PddBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem);
if (orderItem.PddBuyMap != null)
{
pddBuyView.ViewModel.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.PddBuyMap.map_sku_id +
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.PddBuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
"&page_from=101";
pddBuyView.ViewModel.IsAutoBuy = isAutoBuy;
}
else
{
pddBuyView.ViewModel.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";
pddBuyView.ViewModel.IsMappingGoods = true;
}
if (isAbnormalOrder)
pddBuyView.ViewModel.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
new DialogWindow()
{
Title = "买手拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick,
Content = pddBuyView,
//Height = System.Windows.Forms.SystemInformation.WorkingArea.Height - 80,
//Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - 80,
Width = SystemParameters.PrimaryScreenWidth < 1920 ? SystemParameters.PrimaryScreenWidth : SystemParameters.PrimaryScreenWidth * 90 / 100,
Height = SystemParameters.PrimaryScreenHeight * 90 / 100,
WindowStartupLocation = WindowStartupLocation.CenterScreen,
}.ShowDialog();
// 记录窗口内传出的是否继续自动拍单属性
OrderListCtrl.IsAutoBuy = pddBuyView.ViewModel.IsAutoBuy;
// 如果购买成功,修改供应商信息
if (pddBuyView.ViewModel.IsBuySuccess)
{
Task.Run(async () =>
{
if (orderItem.BuyGoodsBtnTxt == "云仓拍单" && !isAbnormalOrder) // 异常拍单不改变订单供应商
{
try
{
await SetSendOrderSupplier(orderItem, "wxfc630d60a1af6c6f", "29供货商");
}
catch (Exception ex)
{
BaseMsgWindow.ShowError(ex.Message);
}
}
});
}
}
public static void PddBuyOrder(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
{
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, GlobalConfig.CurrentPddBuyer, orderItem.PddBuyMap);