淘宝拍单优化

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

+29 -23
View File
@@ -66,7 +66,7 @@ namespace TemuKJD.ToolForms
/// </summary>
public string BuyType { get; set; } = "transit";
public int MaxCloseAfterSecond { get; set; }
public int CloseAfterSecond { get; set; }
public string InitUrl = "";
public string BuyMapUrl = "";
@@ -135,12 +135,12 @@ namespace TemuKJD.ToolForms
GlobalConfig.BuyConfig.IsUseAppBalance = true;
if (IsAutoBuy)
MaxCloseAfterSecond = 60;
if (MaxCloseAfterSecond > 0)
CloseAfterSecond = 60;
if (CloseAfterSecond > 0)
{
Task.Run(() =>
{
Thread.Sleep(1000 * MaxCloseAfterSecond);
Thread.Sleep(1000 * CloseAfterSecond);
if (this.Created && IsAutoBuy)
{
Invoke(new Action(() =>
@@ -248,12 +248,7 @@ namespace TemuKJD.ToolForms
IsFormLoad = true;
}
private void Rb_CheckedChanged(object sender, EventArgs e)
{
transitWarehouse = (sender as RadioButton)?.Tag as TransitWarehouseParam;
}
/// <summary>
/// 自动登录店铺后台
/// </summary>
@@ -385,20 +380,26 @@ namespace TemuKJD.ToolForms
}
else if (BuyType == "direct" && orderItem?.ItemOrder?.AddressStr.Contains("******") == false)
{
var dvProvince = GlobalConfig.PddDivisions.FirstOrDefault(d => d.name == orderItem.ItemOrder.province_name);
var dvCity = dvProvince.children.FirstOrDefault(d => d.name == orderItem.ItemOrder.city_name);
var dvCounty = dvCity.children.FirstOrDefault(d => d.name == orderItem.ItemOrder.county_name);
try
{
var dvProvince = GlobalConfig.PddDivisions.FirstOrDefault(d => d.name == orderItem.ItemOrder.province_name);
var dvCity = dvProvince.children.FirstOrDefault(d => d.name == orderItem.ItemOrder.city_name);
var dvCounty = dvCity.children.FirstOrDefault(d => d.name == orderItem.ItemOrder.county_name);
JObject jObj = JsonHelper.JObjectParse(postData);
jObj["province_id"] = dvProvince.pdd_region_id;
jObj["city_id"] = dvCity.pdd_region_id;
jObj["district_id"] = dvCounty.pdd_region_id;
jObj["address"] = orderItem.ItemOrder.detail_info;
jObj["mobile"] = orderItem.ItemOrder.tel_number;
jObj["name"] = orderItem.ItemOrder.user_name;
postData = JsonHelper.SerializeObject(jObj);
request.PostData.Elements[0].Bytes = System.Text.Encoding.UTF8.GetBytes(postData);
Invoke(() => { this.pnlMask.Visible = false; });
JObject jObj = JsonHelper.JObjectParse(postData);
jObj["province_id"] = dvProvince.pdd_region_id;
jObj["city_id"] = dvCity.pdd_region_id;
jObj["district_id"] = dvCounty.pdd_region_id;
jObj["address"] = orderItem.ItemOrder.detail_info;
jObj["mobile"] = orderItem.ItemOrder.tel_number;
jObj["name"] = orderItem.ItemOrder.user_name;
postData = JsonHelper.SerializeObject(jObj);
request.PostData.Elements[0].Bytes = System.Text.Encoding.UTF8.GetBytes(postData);
Invoke(() => { this.pnlMask.Visible = false; });
}
catch
{
}
}
HasChangeAddress = true;
@@ -1891,5 +1892,10 @@ namespace TemuKJD.ToolForms
//System.Diagnostics.Debug.WriteLine($"清理子进程时发生异常: {ex}");
}
}
private void pictureBox5_Click(object sender, EventArgs e)
{
pnlMask.Visible = false;
}
}
}
+21 -1
View File
@@ -113,6 +113,7 @@
this.chkAutoChangeWarehouseAddress = new Work.UserComponents.UcCheckBox(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pnlMap = new System.Windows.Forms.Panel();
this.pictureBox5 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -120,6 +121,7 @@
this.splitContainer1.SuspendLayout();
this.pnlMsg.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
this.pnlMask.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
@@ -131,6 +133,7 @@
this.pnlBuy.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.pnlMap.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
this.SuspendLayout();
//
// pbCloseBase
@@ -171,7 +174,7 @@
this.pnlMsg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.pnlMsg.Controls.Add(this.pictureBox4);
this.pnlMsg.Controls.Add(this.lblErrMsg);
this.pnlMsg.Location = new System.Drawing.Point(47, 537);
this.pnlMsg.Location = new System.Drawing.Point(47, 538);
this.pnlMsg.Name = "pnlMsg";
this.pnlMsg.Size = new System.Drawing.Size(771, 100);
this.pnlMsg.TabIndex = 898;
@@ -208,6 +211,7 @@
// pnlMask
//
this.pnlMask.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlMask.Controls.Add(this.pictureBox5);
this.pnlMask.Cursor = System.Windows.Forms.Cursors.Hand;
this.pnlMask.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlMask.Dock = System.Windows.Forms.DockStyle.Top;
@@ -1210,6 +1214,19 @@
this.pnlMap.Size = new System.Drawing.Size(468, 203);
this.pnlMap.TabIndex = 871;
//
// pictureBox5
//
this.pictureBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.pictureBox5.Image = global::Work.Properties.Resources.close;
this.pictureBox5.Location = new System.Drawing.Point(829, 3);
this.pictureBox5.Name = "pictureBox5";
this.pictureBox5.Size = new System.Drawing.Size(32, 32);
this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox5.TabIndex = 898;
this.pictureBox5.TabStop = false;
this.pictureBox5.Click += new System.EventHandler(this.pictureBox5_Click);
//
// PddMobileBuyOrderForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1231,6 +1248,7 @@
this.splitContainer1.ResumeLayout(false);
this.pnlMsg.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
this.pnlMask.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel1.PerformLayout();
this.splitContainer2.Panel2.ResumeLayout(false);
@@ -1248,6 +1266,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.pnlMap.ResumeLayout(false);
this.pnlMap.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
this.ResumeLayout(false);
}
@@ -1338,5 +1357,6 @@
private System.Windows.Forms.Label lblErrMsg;
protected System.Windows.Forms.PictureBox pictureBox4;
private System.Windows.Forms.Panel pnlMsg;
protected System.Windows.Forms.PictureBox pictureBox5;
}
}