自动拍单逻辑优化
This commit is contained in:
1 parent
107bf82f97
commit
ec02e2a0e4
6 files changed
+107
-17
No files matched your search
@@ -217,7 +217,7 @@ namespace TemuKJD.ToolForms
|
||||
this.txtShopGoodsName.Text = orderItem.title;
|
||||
this.txtShopSpecName.Text = orderItem.sku_attr_str;
|
||||
this.txtShopOrderItemCnt.Text = orderItem.sku_cnt.ParseToString();
|
||||
this.txtShopOrderItemPrice.Text = (orderItem.real_price * 0.01m).ParseToString();
|
||||
this.txtShopOrderItemPrice.Text = (orderItem.real_price * 0.01m + orderItem.ItemOrder?.postage_price * 0.01m / orderItem.ItemOrder?.orderItems?.Count).ParseToString();
|
||||
|
||||
this.txtOrderId.Text = orderItem.order_id;
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
|
||||
@@ -420,7 +420,7 @@ namespace TemuKJD.ToolForms
|
||||
{
|
||||
await (Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(10000);
|
||||
Thread.Sleep(6000);
|
||||
if (!this.IsClose && this.Created)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
@@ -535,6 +535,17 @@ namespace TemuKJD.ToolForms
|
||||
var buyCnt = BaseRegex.GetIntJson(ref data, "goods_number");
|
||||
var buyPrice = BaseRegex.GetIntJson(ref data, "pay_price");
|
||||
|
||||
if (IsAutoBuy && GlobalConfig.AutoBuyConfig.IsLimitMinProfit)
|
||||
{
|
||||
var salePrice = orderItem.real_price * 0.01m + orderItem.ItemOrder?.postage_price * 0.01m / orderItem.ItemOrder?.orderItems?.Count;
|
||||
var profit = salePrice - buyPrice * 0.01m;
|
||||
var limitProfit = GlobalConfig.AutoBuyConfig.MinProfit * 0.01m;
|
||||
if (profit < limitProfit)
|
||||
{
|
||||
throw new Exception("拍单利润" + profit + "小于设定的数值 " + limitProfit + ",跳过当前订单");
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.Created)
|
||||
return;
|
||||
Invoke(new Action(() =>
|
||||
@@ -709,7 +720,7 @@ namespace TemuKJD.ToolForms
|
||||
ts2 = await EvaluateJsBuyTagNameAndInnerHtml("div", "输入支付密码");
|
||||
}
|
||||
Thread.Sleep(Randomx.GetId(500, 1000));
|
||||
foreach (var c in DataOpenSSL.DecryptString(GlobalConfig.AlipayPassword))
|
||||
foreach (var c in DataOpenSSL.DecryptString(GlobalConfig.AutoBuyConfig.AlipayPassword))
|
||||
{
|
||||
CEFBrowser.SimulateInputChar(host, c);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user