淘宝拍单优化

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

@@ -149,6 +149,16 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
set { this.SetValue(x => x.Address, value); }
}
public string txtShopNameVal
{
get { return this.GetValue(x => x.txtShopNameVal); }
set { this.SetValue(x => x.txtShopNameVal, value); }
}
public string txtOrderIdVal
{
get { return this.GetValue(x => x.txtOrderIdVal); }
set { this.SetValue(x => x.txtOrderIdVal, value); }
}
public string txtShopGoodsNameVal
{
get { return this.GetValue(x => x.txtShopGoodsNameVal); }
@@ -326,6 +336,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
ManualUpdateBuyOrderCommand = new DelegateCommand(ManualUpdateBuyOrder);
UpdateTransitWarehouseCommand = new DelegateCommand(UpdateTransitWarehouse);
this.txtShopNameVal = orderItem.Shop.ShopAccount;
this.txtOrderIdVal = orderItem.order_id;
this.txtShopSkuIdVal = orderItem.sku_id;
this.txtShopGoodsIdVal = orderItem.product_id;
this.txtSpuCodeVal = orderItem.out_product_id.IsNullOrEmpty() ? orderItem.product_id : orderItem.out_product_id;
@@ -472,21 +484,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
cookieLst = new List<Cookie>();
}
}
catch
catch (Exception ex)
{
}
// cef138必须init后方可设置或删除cookie
while (!CefWebBrowser.IsBrowserInitialized || !CefWebBrowser.GetBrowser().MainFrame.IsValid)
await Task.Delay(20);
WPFCEFBrowser.DeleteCookie(CefWebBrowser.GetCookieManager(null));
await Task.Delay(50);
await WPFCEFBrowser.DeleteCookieAsync(CefWebBrowser.GetCookieManager(null));
//cef 138 如果没有设置RequestContext 可能为空,直接getCookieManager
//await WPFCEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), CefWebBrowser.GetCookieManager(null));
foreach (var cook in cookieLst)
{
await WPFCEFBrowser.SetCookieAsync(cook.Domain.Trim('.'), cook.Name + "=" + cook.Value + ";", CefWebBrowser.GetCookieManager(null));
//t.Wait(5000);
}
//根据登录的具体店铺设置local storage
@@ -583,6 +594,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
// 点击 立即购买/领券购买
Thread.Sleep(Randomx.GetId(500, 1000));
await AutoClickBuyButton();
// 点击 管理地址(必出验证,暂时url直接跳转)
@@ -590,12 +602,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
// 自动修改地址 进入地址页面
Thread.Sleep(Randomx.GetId(500, 1000));
CefWebBrowser.Load("https://i.taobao.com/my_itaobao/receiver-address-pc");
CefWebBrowser.Load("https://i.taobao.com/my_itaobao/receiver-address-pc");
await AutoChangeAddress();
}
catch (Exception ex)
{
BaseMsgWindow.ShowError(ex.Message);
if (!ex.Message.ParseToString().Contains("无法访问已释放的对象"))
BaseMsgWindow.ShowError(ex.Message);
}
}
});
@@ -778,7 +791,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (jsRst != "success")
throw new Exception("管理地址按钮不存在!");
for (int i = 0; i < 10 && !Address.StartsWith("https://i.taobao.com/my_itaobao/receiver-address-pc"); i++)
for (int i = 0; i < 25 && !Address.StartsWith("https://i.taobao.com/my_itaobao/receiver-address-pc"); i++)
{
Thread.Sleep(500);
}
@@ -1189,7 +1202,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (jsRst == "success")
TransitErrorMsg = "";
}
catch
catch (Exception ex)
{
}
});
@@ -1224,7 +1237,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
catch (Exception ex)
{
}
});
}
@@ -1630,7 +1642,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
}
}
catch
catch (Exception ex)
{
}
}
@@ -1667,7 +1679,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
GlobalConfig.BuyMapList.RemoveAll(b => buyMapList.Any(map => b.spu_code == map.spu_code && b.sku_code == map.sku_code));
GlobalConfig.BuyMapList.AddRange(buyMapList);
}
catch
catch (Exception ex)
{
}
var tbBuyMap = buyMapList.FirstOrDefault(b => b.spu_code == upSpuCode && b.sku_code == upSkuCode && b.platform == "tb");
@@ -1820,7 +1832,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
code = xmlDoc["AjaxResult"]["code"].InnerText;
msg = xmlDoc["AjaxResult"]["msg"].InnerText;
}
catch
catch (Exception ex)
{
msg = exportRst.ParseToString();
}