上货后参加20981活动

This commit is contained in:
wule committed 2025-09-23 09:25:31 +08:00
1 parent b868c718f0
commit 4fcfb2875a
25 files changed
+1379 -119

No files matched your search

+72 -2
View File
@@ -441,7 +441,77 @@ namespace TemuKJD.BLL
result = GetProxyHtml.ReadResponse(response);
return result;
}
public static string PDDPostResponseUpload(ShopLoginInfo shop, string _url, string _data, string referer, string boundary, string AntiContent = null)
{
if (string.IsNullOrEmpty(AntiContent))
AntiContent = "0apAfa5e-wCEXaTg0FNtNj4PklUKt0E_FNynruEIx9qGLdY6b5YUhnqi7QxYqQqi2Ugraphm85CrR0oU0XYn0dYX5dqXqXJnqg8npDTnpTJnpAaX9swaKE20Tbw_yKnoaXIXxHGB_IxWWlIXMnxghvniTodnXt2wcA7sxhbV_CEBcCez4H92maXI2d1qgoYswoG4Mf_ojlph0nGig8nqWzXqwTYh0j4W6jYs6PxHjXvJslpHyXjseoqZhfqdydn5_Jj0g2TPpCaGDgSgL1FT_lZPGmxIq9UXkPCQpBhPtTZaqGAq06gXkNxXZPrXO0gQ4SHl0bZSZth9LG_j0dKS54JX1PCPZM4XObhaxYjH0oMqm06oiXHYmpnOkTbo-z4QlrCxT43eEBgmrk8AvVbKI3FKz-FAL4pwdFveGf5c1JO_csO50lnqQNy9909u6zLUrFMiTy";
string rckk = "Z07QGtUzw1cgd58IPWnC1OAGCW9xcH1m";
string cookies = "";
try
{
var cookieLst = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(shop.Cookies);
foreach (var cook in cookieLst)
{
cookies += cook.Name + "=" + cook.Value + ";";
}
var rckkCookie = cookieLst.FirstOrDefault(c => c.Name == "rckk");
if (rckkCookie != null)
rckk = rckkCookie.Value;
}
catch { }
HttpWebResponse response = null;
string result;
try
{
string url = _url;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.KeepAlive = true;
request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36";
request.Headers.Add("ETag", rckk);
request.Headers.Add("sec-ch-ua", @"""Not;A=Brand"";v=""99"", ""Google Chrome"";v=""139"", ""Chromium"";v=""139""");
request.ContentType = "multipart/form-data; boundary=" + boundary;
request.Headers.Add("sec-ch-ua-mobile", @"?0");
request.Accept = "*/*";
request.Headers.Add("Origin", @"https://mms.pinduoduo.com");
request.Headers.Set(HttpRequestHeader.Cookie, cookies);
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;
string body = _data;
WriteMultipartBodyToRequest(request, body);
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException ex)
{
if (ex.Status == WebExceptionStatus.ProtocolError)
{
response = (HttpWebResponse)ex.Response;
result = GetProxyHtml.ReadResponse(response);
return result;
}
else return ex.Message;
}
catch (Exception e)
{
if (response != null) response.Close();
return e.Message;
}
result = GetProxyHtml.ReadResponse(response);
return result;
}
}
}
@@ -30,6 +30,8 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdEditNotesForm));
this.panel2 = new System.Windows.Forms.Panel();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.label9 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.txtFissionWords = new DevComponents.DotNetBar.Controls.TextBoxX();
this.txtEndWords = new System.Windows.Forms.TextBox();
@@ -48,13 +50,18 @@
this.label8 = new System.Windows.Forms.Label();
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.buttonEx1 = new TemuKJD.UserControls.ButtonEx();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.buttonEx1);
this.panel2.Controls.Add(this.pictureBox2);
this.panel2.Controls.Add(this.label9);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.txtFissionWords);
this.panel2.Controls.Add(this.txtEndWords);
@@ -79,10 +86,30 @@
this.panel2.Size = new System.Drawing.Size(464, 686);
this.panel2.TabIndex = 1;
//
// pictureBox2
//
this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.pictureBox2.Location = new System.Drawing.Point(165, 491);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(136, 136);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox2.TabIndex = 405;
this.pictureBox2.TabStop = false;
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(19, 496);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(68, 17);
this.label9.TabIndex = 404;
this.label9.Text = "SKU替换图";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(31, 391);
this.label7.Location = new System.Drawing.Point(31, 386);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(56, 17);
this.label7.TabIndex = 403;
@@ -105,10 +132,10 @@
this.txtFissionWords.Border.PaddingLeft = 2;
this.txtFissionWords.Border.PaddingRight = 2;
this.txtFissionWords.Border.PaddingTop = 2;
this.txtFissionWords.Location = new System.Drawing.Point(90, 391);
this.txtFissionWords.Location = new System.Drawing.Point(90, 386);
this.txtFissionWords.Multiline = true;
this.txtFissionWords.Name = "txtFissionWords";
this.txtFissionWords.Size = new System.Drawing.Size(337, 238);
this.txtFissionWords.Size = new System.Drawing.Size(337, 93);
this.txtFissionWords.TabIndex = 402;
this.txtFissionWords.WatermarkText = "一行一个";
//
@@ -116,7 +143,7 @@
//
this.txtEndWords.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtEndWords.Location = new System.Drawing.Point(291, 353);
this.txtEndWords.Location = new System.Drawing.Point(291, 348);
this.txtEndWords.Name = "txtEndWords";
this.txtEndWords.Size = new System.Drawing.Size(136, 23);
this.txtEndWords.TabIndex = 401;
@@ -124,7 +151,7 @@
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(233, 356);
this.label6.Location = new System.Drawing.Point(233, 351);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 17);
this.label6.TabIndex = 400;
@@ -132,7 +159,7 @@
//
// txtHeadWords
//
this.txtHeadWords.Location = new System.Drawing.Point(90, 353);
this.txtHeadWords.Location = new System.Drawing.Point(90, 348);
this.txtHeadWords.Name = "txtHeadWords";
this.txtHeadWords.Size = new System.Drawing.Size(136, 23);
this.txtHeadWords.TabIndex = 399;
@@ -140,7 +167,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(31, 356);
this.label5.Location = new System.Drawing.Point(31, 351);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 17);
this.label5.TabIndex = 398;
@@ -150,7 +177,7 @@
//
this.txtProductName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtProductName.Location = new System.Drawing.Point(90, 205);
this.txtProductName.Location = new System.Drawing.Point(90, 200);
this.txtProductName.Multiline = true;
this.txtProductName.Name = "txtProductName";
this.txtProductName.Size = new System.Drawing.Size(337, 46);
@@ -160,7 +187,7 @@
//
this.txtSkcId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtSkcId.Location = new System.Drawing.Point(291, 171);
this.txtSkcId.Location = new System.Drawing.Point(291, 166);
this.txtSkcId.Name = "txtSkcId";
this.txtSkcId.ReadOnly = true;
this.txtSkcId.Size = new System.Drawing.Size(136, 23);
@@ -168,7 +195,7 @@
//
// txtSpuId
//
this.txtSpuId.Location = new System.Drawing.Point(90, 171);
this.txtSpuId.Location = new System.Drawing.Point(90, 166);
this.txtSpuId.Name = "txtSpuId";
this.txtSpuId.ReadOnly = true;
this.txtSpuId.Size = new System.Drawing.Size(136, 23);
@@ -178,7 +205,7 @@
//
this.txtExtCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtExtCode.Location = new System.Drawing.Point(90, 262);
this.txtExtCode.Location = new System.Drawing.Point(90, 257);
this.txtExtCode.Name = "txtExtCode";
this.txtExtCode.Size = new System.Drawing.Size(337, 23);
this.txtExtCode.TabIndex = 394;
@@ -186,7 +213,7 @@
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(31, 265);
this.label4.Location = new System.Drawing.Point(31, 260);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(56, 17);
this.label4.TabIndex = 393;
@@ -195,7 +222,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(31, 209);
this.label3.Location = new System.Drawing.Point(31, 204);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 17);
this.label3.TabIndex = 392;
@@ -204,7 +231,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(233, 174);
this.label2.Location = new System.Drawing.Point(233, 169);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 17);
this.label2.TabIndex = 391;
@@ -213,7 +240,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(31, 174);
this.label1.Location = new System.Drawing.Point(31, 169);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 17);
this.label1.TabIndex = 390;
@@ -228,11 +255,12 @@
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 389;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(31, 296);
this.label8.Location = new System.Drawing.Point(31, 291);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(56, 17);
this.label8.TabIndex = 386;
@@ -255,7 +283,7 @@
this.txtNotes.Border.PaddingLeft = 2;
this.txtNotes.Border.PaddingRight = 2;
this.txtNotes.Border.PaddingTop = 2;
this.txtNotes.Location = new System.Drawing.Point(90, 296);
this.txtNotes.Location = new System.Drawing.Point(90, 291);
this.txtNotes.Multiline = true;
this.txtNotes.Name = "txtNotes";
this.txtNotes.Size = new System.Drawing.Size(337, 47);
@@ -278,20 +306,38 @@
this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// DbProductEditNotesForm
// buttonEx1
//
this.buttonEx1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonEx1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.buttonEx1.Cursor = System.Windows.Forms.Cursors.Hand;
this.buttonEx1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonEx1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonEx1.ForeColor = System.Drawing.Color.White;
this.buttonEx1.Location = new System.Drawing.Point(90, 491);
this.buttonEx1.Margin = new System.Windows.Forms.Padding(2);
this.buttonEx1.Name = "buttonEx1";
this.buttonEx1.Size = new System.Drawing.Size(70, 26);
this.buttonEx1.TabIndex = 406;
this.buttonEx1.Text = "上传图片";
this.buttonEx1.UseVisualStyleBackColor = false;
this.buttonEx1.Click += new System.EventHandler(this.buttonEx1_Click);
//
// PDDDBProdEditNotesForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(466, 720);
this.Controls.Add(this.panel2);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "DbProductEditNotesForm";
this.Name = "PDDDBProdEditNotesForm";
this.Text = "编辑商品备注/货号";
this.TitleText = "编辑商品备注/货号";
this.Load += new System.EventHandler(this.ProductSelectListForm_Load);
this.Controls.SetChildIndex(this.panel2, 0);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
@@ -318,5 +364,8 @@
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtHeadWords;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label label9;
private UserControls.ButtonEx buttonEx1;
}
}
@@ -12,6 +12,10 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using AllBase;
using Work;
using TemuKJD.ToolForms;
using Newtonsoft.Json.Linq;
using System.IO;
using Work.BLL.Tools;
namespace TemuKJD.PDDForms.ProductSelectForms
{
@@ -39,6 +43,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.txtFissionWords.Text = dbProd.fission_words;
this.txtHeadWords.Text = string.IsNullOrWhiteSpace(dbProd.head_words) ? "5-99个" : dbProd.head_words;
this.txtEndWords.Text = string.IsNullOrWhiteSpace(dbProd.end_words) ? "适合不同的搭配风格" : dbProd.end_words;
this.txtHeadWords.Text = dbProd.head_words;
this.txtEndWords.Text = dbProd.end_words;
var prodTmp = GetProductDetail(dbProd.id.ToString());
dbProd.sku_img_replace_base64 = prodTmp.sku_img_replace_base64;
if (!string.IsNullOrWhiteSpace(dbProd.sku_img_replace_base64))
this.pictureBox2.Image = Base64ChangeImgUrl.Base64ToImage(dbProd.sku_img_replace_base64); // Convert.FromBase64String(dbProd.sku_img_replace_base64);
}
}
@@ -73,5 +84,118 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.Close();
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
ShowImgForm imgFrom = new ShowImgForm(pictureBox1.ImageLocation);
imgFrom.ShowDialog();
}
public KJDDBProduct GetProductDetail(string prodDbId)
{
if (string.IsNullOrEmpty(prodDbId))
return new KJDDBProduct();
List<KJDDBProduct> list = new List<KJDDBProduct>();
var url = BaseClass.BuildObjString("product/get_product_detail_list");
var data = "";
data = UserLogin.GetSignaturex() + "&search_db_ids=" + prodDbId;
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"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
return null;
}
var jArr = JObject.Parse(html)["data"];
if (jArr.Count() == 0)
return null;
var sProd = JsonHelper.SerializeObject(jArr);
try
{
list = JsonHelper.DeserializeJsonToList<KJDDBProduct>(sProd);
var item = list.FirstOrDefault();
if (item == null)
item = new KJDDBProduct();
return item;
}
catch (Exception ex)
{
return null;
}
}
private void buttonEx1_Click(object sender, EventArgs e)
{
string text = "";
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = false;
// 设置过滤条件,只显示文本文件
openFileDialog.Filter = "图片文件 (*.jepg;*.jpg;*.png)|*.jepg;*.jpg;*.png|All files (*.*)|*.*";
// 显示对话框并获取结果
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
try
{
string filePath = openFileDialog.FileName;
//using (Image image = Image.FromFile(filePath))
//{
// // 现在你可以使用image对象进行各种操作,比如绘制、保存等
// //Console.WriteLine("Image loaded successfully.");
// this.pictureBox2.Image = image;
//}
Image image = Image.FromFile(filePath);
this.pictureBox2.Image = image;
string imgBase64 = "";
using (MemoryStream memoryStream = new MemoryStream())
{
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageBytes = memoryStream.ToArray();
imgBase64 = Convert.ToBase64String(imageBytes);
}
string img_md5 = BaseClass.GetMd5(imgBase64);
var url = BaseClass.BuildObjString("product/add_sku_img_replace");
var data = UserLogin.GetSignaturex() +
"&product_db_id=" + dbProd.id;
data += "&img_base64=" + imgBase64;
data += "&img_md5=" + img_md5;
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"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
BaseMsgForm.ShowError("商品备注编辑失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
}
else
{
dbProd.sku_img_replace_base64 = imgBase64;
dbProd.sku_img_replace_id = BaseRegex.GetIntJson(ref html, "sku_img_replace_id");
}
}
catch (Exception ex)
{
//Console.WriteLine("An error occurred: " + ex.Message);
BaseMsgForm.ShowError("打开自定义图片失败 " + ex.Message);
return;
}
}
}
private void pictureBox2_Click(object sender, EventArgs e)
{
ShowImgForm imgFrom = new ShowImgForm(pictureBox2.Image);
imgFrom.ShowDialog();
}
}
}
@@ -45,8 +45,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.lblNotes = new System.Windows.Forms.Label();
this.txtSPU = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtSKC = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.pnlEmpty = new DevComponents.DotNetBar.PanelEx();
this.btnSearch = new TemuKJD.UserControls.ButtonEx();
this.txtExtCode = new System.Windows.Forms.TextBox();
@@ -58,6 +56,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label6 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.txtSKC = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
@@ -71,6 +71,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_skc_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_cat_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_ext_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPriceText = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAddTimes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelectTotalCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -209,24 +210,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label5.TabIndex = 435;
this.label5.Text = "商品ID:";
//
// txtSKC
//
this.txtSKC.Location = new System.Drawing.Point(87, 80);
this.txtSKC.Name = "txtSKC";
this.txtSKC.Size = new System.Drawing.Size(90, 23);
this.txtSKC.TabIndex = 432;
this.txtSKC.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(54, 83);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 17);
this.label1.TabIndex = 433;
this.label1.Text = "SKC:";
this.label1.Visible = false;
//
// pnlEmpty
//
this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control;
@@ -359,6 +342,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pbLoading.TabIndex = 7;
this.pbLoading.TabStop = false;
//
// txtSKC
//
this.txtSKC.Location = new System.Drawing.Point(87, 80);
this.txtSKC.Name = "txtSKC";
this.txtSKC.Size = new System.Drawing.Size(90, 23);
this.txtSKC.TabIndex = 432;
this.txtSKC.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(54, 83);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 17);
this.label1.TabIndex = 433;
this.label1.Text = "SKC:";
this.label1.Visible = false;
//
// dgvDbProduct
//
this.dgvDbProduct.AllowUserToAddRows = false;
@@ -388,6 +389,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_skc_id,
this.col_cat_name,
this.col_ext_code,
this.colPriceText,
this.colAddTimes,
this.colSelectTotalCount,
this.col_notes,
@@ -509,6 +511,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_ext_code.Name = "col_ext_code";
this.col_ext_code.ReadOnly = true;
//
// colPriceText
//
this.colPriceText.FillWeight = 60F;
this.colPriceText.HeaderText = "母店价格";
this.colPriceText.Name = "colPriceText";
this.colPriceText.ReadOnly = true;
//
// colAddTimes
//
this.colAddTimes.FillWeight = 52F;
@@ -662,6 +671,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn col_skc_id;
private System.Windows.Forms.DataGridViewTextBoxColumn col_cat_name;
private System.Windows.Forms.DataGridViewTextBoxColumn col_ext_code;
private System.Windows.Forms.DataGridViewTextBoxColumn colPriceText;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTimes;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectTotalCount;
private System.Windows.Forms.DataGridViewTextBoxColumn col_notes;
@@ -49,6 +49,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.Columns["colHeadWords"].Visible = true;
this.dgvDbProduct.Columns["colEndWords"].Visible = true;
this.dgvDbProduct.Columns["colFissionWords"].Visible = true;
this.dgvDbProduct.Columns["colPriceText"].Visible = true;
//this.dgvDbProduct.Columns["col_notes"].Visible = true;
//this.lblNotes.Visible = true;
//this.txtNotes.Visible = true;
@@ -64,6 +65,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.Columns["colHeadWords"].Visible = false;
this.dgvDbProduct.Columns["colEndWords"].Visible = false;
this.dgvDbProduct.Columns["colFissionWords"].Visible = false;
this.dgvDbProduct.Columns["colPriceText"].Visible = false;
//this.dgvDbProduct.Columns["col_notes"].Visible = false;
//this.lblNotes.Visible = false;
//this.txtNotes.Visible = false;
@@ -140,6 +142,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
prod.skc_id,
prod.cat_name,
prod.ext_code,
prod.price_text,
prod.select_count,
prod.select_total_count,
prod.notes,
@@ -147,6 +147,9 @@
<metadata name="col_ext_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPriceText.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colAddTimes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -181,6 +181,7 @@
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 389;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// label8
//
@@ -208,14 +209,14 @@
this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// DbProductUserSelectEditNotesForm
// PDDDBProdUserSelectEditNotesForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(393, 580);
this.Controls.Add(this.panel2);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "DbProductUserSelectEditNotesForm";
this.Name = "PDDDBProdUserSelectEditNotesForm";
this.Text = "编辑上传备注";
this.TitleText = "编辑上传备注";
this.Load += new System.EventHandler(this.ProductSelectListForm_Load);
@@ -13,6 +13,7 @@ using System.Windows.Forms;
using AllBase;
using Work;
using TemuKJD.BLL;
using TemuKJD.ToolForms;
namespace TemuKJD.PDDForms.ProductSelectForms
{
@@ -100,5 +101,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
else
lblTextCount.ForeColor = Color.Gray;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
ShowImgForm imgFrom = new ShowImgForm(pictureBox1.ImageLocation);
imgFrom.ShowDialog();
}
}
}
@@ -30,13 +30,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.txtAddTimesFake = new System.Windows.Forms.TextBox();
this.chkActivity = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.label17 = new System.Windows.Forms.Label();
this.chkSizeSpec = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chkAddMorePriceFirst = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnClearDgv = new DevComponents.DotNetBar.PanelEx();
this.label14 = new System.Windows.Forms.Label();
@@ -130,7 +134,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.chkSizeSpec = new TemuKJD.UserComponent.UcCheckBox(this.components);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -187,6 +190,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx2.Controls.Add(this.txtAddTimesFake);
this.ucGroupBoxEx2.Controls.Add(this.chkActivity);
this.ucGroupBoxEx2.Controls.Add(this.label17);
this.ucGroupBoxEx2.Controls.Add(this.chkSizeSpec);
this.ucGroupBoxEx2.Controls.Add(this.chkAddMorePriceFirst);
this.ucGroupBoxEx2.Controls.Add(this.btnClearDgv);
@@ -213,10 +219,57 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx2.TabStop = false;
this.ucGroupBoxEx2.Text = "商品上传";
//
// txtAddTimesFake
//
this.txtAddTimesFake.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtAddTimesFake.Location = new System.Drawing.Point(694, 63);
this.txtAddTimesFake.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtAddTimesFake.Name = "txtAddTimesFake";
this.txtAddTimesFake.Size = new System.Drawing.Size(31, 23);
this.txtAddTimesFake.TabIndex = 645;
this.txtAddTimesFake.Text = "3";
//
// chkActivity
//
this.chkActivity.AutoSize = true;
this.chkActivity.Checked = true;
this.chkActivity.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkActivity.Location = new System.Drawing.Point(567, 64);
this.chkActivity.Name = "chkActivity";
this.chkActivity.Size = new System.Drawing.Size(135, 21);
this.chkActivity.TabIndex = 648;
this.chkActivity.Text = "参加活动并虚拟加价";
this.chkActivity.UseVisualStyleBackColor = true;
this.chkActivity.CheckedChanged += new System.EventHandler(this.chkActivity_CheckedChanged);
//
// label17
//
this.label17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(725, 66);
this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(20, 17);
this.label17.TabIndex = 647;
this.label17.Text = "倍";
//
// chkSizeSpec
//
this.chkSizeSpec.AutoSize = true;
this.chkSizeSpec.Checked = true;
this.chkSizeSpec.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSizeSpec.Location = new System.Drawing.Point(567, 87);
this.chkSizeSpec.Name = "chkSizeSpec";
this.chkSizeSpec.Size = new System.Drawing.Size(111, 21);
this.chkSizeSpec.TabIndex = 635;
this.chkSizeSpec.Text = "使用上家尺码表";
this.chkSizeSpec.UseVisualStyleBackColor = true;
this.chkSizeSpec.CheckedChanged += new System.EventHandler(this.chkSizeSpec_CheckedChanged);
//
// chkAddMorePriceFirst
//
this.chkAddMorePriceFirst.AutoSize = true;
this.chkAddMorePriceFirst.Location = new System.Drawing.Point(577, 111);
this.chkAddMorePriceFirst.Location = new System.Drawing.Point(567, 111);
this.chkAddMorePriceFirst.Name = "chkAddMorePriceFirst";
this.chkAddMorePriceFirst.Size = new System.Drawing.Size(111, 21);
this.chkAddMorePriceFirst.TabIndex = 625;
@@ -258,9 +311,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label14.Location = new System.Drawing.Point(317, 113);
this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(260, 17);
this.label14.Size = new System.Drawing.Size(248, 17);
this.label14.TabIndex = 599;
this.label14.Text = "说明:若未勾选或不满足阶梯加价,按默认加价";
this.label14.Text = "说明:阶梯加价未勾选或不满足,按默认加价";
//
// label15
//
@@ -738,18 +791,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle16.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -1167,18 +1220,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvSelectProduct.AllowUserToAddRows = false;
this.dgvSelectProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle18.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
this.dgvSelectProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvSelectProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle19.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvSelectProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
@@ -1298,8 +1351,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colProductName
//
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle20;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle5;
this.colProductName.HeaderText = "商品标题";
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
@@ -1466,19 +1519,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucSplitPage1.TabIndex = 675;
this.ucSplitPage1.TotalPage = 1;
//
// chkSizeSpec
//
this.chkSizeSpec.AutoSize = true;
this.chkSizeSpec.Checked = true;
this.chkSizeSpec.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSizeSpec.Location = new System.Drawing.Point(577, 87);
this.chkSizeSpec.Name = "chkSizeSpec";
this.chkSizeSpec.Size = new System.Drawing.Size(111, 21);
this.chkSizeSpec.TabIndex = 635;
this.chkSizeSpec.Text = "使用上家尺码表";
this.chkSizeSpec.UseVisualStyleBackColor = true;
this.chkSizeSpec.CheckedChanged += new System.EventHandler(this.chkSizeSpec_CheckedChanged);
//
// PDDDBProdUserSelectForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1567,7 +1607,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private UserComponent.UcGroupBoxEx ucGroupBoxEx2;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtAddMorePrice;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtAddTimes;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtStockNum;
@@ -1623,5 +1662,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
private UserComponent.UcCheckBox chkSizeSpec;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.TextBox txtAddTimesFake;
private System.Windows.Forms.Label label10;
private UserComponent.UcCheckBox chkActivity;
}
}
@@ -33,6 +33,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
bool isInit = false;
bool isActivityFake = true;
bool isChanceApi = false;
bool isUseUpperSizeSpec = true;
bool isAddMorePriceFirst = false;
@@ -108,6 +109,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucSplitPage1.PageChange += UcSplitPage1_PageChange;
isChanceApi = chkChance.Checked;
isActivityFake = chkActivity.Checked;
}
private void UcSplitPage1_PageChange(object obj)
@@ -920,7 +922,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
row.Cells["colDraftId"].Value = productDraftId; // 草稿箱id
row.Cells["colAddTime"].Value = DateTime.Now.ToString("yy-MM-dd HH:mm:ss");
row.Cells["colOpResult"].Value = (prod.status == "已上传" ? "已成功上传" : "已上传草稿箱" + (" " + error).TrimEnd(' ')) + " " + duration.ParseToInt() + "秒";
row.Cells["colOpResult"].Value = (prod.status == "已上传" ? "已成功上传" : "已上传草稿箱") + (" " + error).TrimEnd(' ') + " " + duration.ParseToInt() + "秒";
row.Cells["colMsg"].Value = prod.status;
}
}));
@@ -1240,7 +1242,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
prodParam.goods_name = prodInfo.detail.goods_name;
prodParam.goods_name_prefix = prodInfo.detail.goods_name_prefix;
prodParam.goods_pattern = prodInfo.detail.goods_pattern;
prodParam.goods_properties = new List<goods_property_param>(); // 商品属性,通过接口获取商品模板并做匹配
//prodParam.goods_properties = new List<goods_spec_property>(); // 商品属性,通过接口获取商品模板并做匹配
prodParam.goods_properties = new List<goods_spec_property_param>(); // 商品属性,通过接口获取商品模板并做匹配
//step1(共3个step)通过商品属性获取二级必填属性
foreach (var propInfo in prodInfo.property.goods_properties)
{
@@ -1322,7 +1325,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (propTemp == null)
continue;
var prop = new goods_property_param()
//var prop = new goods_property_param()
var prop = new goods_spec_property_param()
{
template_pid = propTemp.id,
template_module_id = prodCatTemplateInfo.modules.FirstOrDefault().id,
@@ -1343,7 +1347,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var contentOther = propTemp.values.content.FirstOrDefault(c => c.value == "其他");
if (contentOther != null)
{
var prop = new goods_property_param()
//var prop = new goods_property_param()
var prop = new goods_spec_property_param()
{
template_pid = propTemp.id,
template_module_id = prodCatTemplateInfo.modules.FirstOrDefault().id,
@@ -1524,6 +1529,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
}
//if(isActivity) // 如果是去报活动,把基础价格报到3倍以上
//{
// skuParam.multi_price = (skuInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
// if (isAddMorePriceFirst) // 先加后乘
// skuParam.multi_price = ((skuInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
// skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
//}
if (prodParam.market_price < skuParam.price + 1000)
{
@@ -1748,6 +1761,158 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
#region 生成一个fake商品提交参数,价格按照3倍上传,用于参加活动
string img_signature = "";
if (isActivityFake && 1 == 2)
{
var img_signature_rst = get_uploag_img_signature(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
if (!img_signature_rst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref img_signature_rst, "error_msg");
if (string.IsNullOrEmpty(error))
error = img_signature_rst;
return "获取上传图片密钥失败 " + error;
}
else
{
img_signature = BaseRegex.GetStringJson(ref img_signature_rst, "signature");
}
}
string fakeImgUrlDefault = "https://img.pddpic.com/mms-material-img/2025-09-22/72122dc1-56d8-4265-9212-5bf0edcf72d4.jpeg.a.jpeg";
//fakeImgUrlDefault = "https://img.pddpic.com/mms-goods-image/2025-09-21/4204dcd6-afe0-4090-94fc-a68bf70396da.jpeg.a.jpeg?imageView2/2/w/1700/q/85";
if (currentCount % 3 == 0)
fakeImgUrlDefault = "https://img.pddpic.com/mms-goods-image/2025-09-21/4204dcd6-afe0-4090-94fc-a68bf70396da.jpeg.a.jpeg";
else if (currentCount % 3 == 1)
fakeImgUrlDefault = "https://img.pddpic.com/mms-goods-image/2025-09-21/5ec7192b-3da3-4fc1-88fd-66493a5bc9cf.jpeg.a.jpeg";
else
fakeImgUrlDefault = "https://img.pddpic.com/open-gw/2025-08-13/97a2999c-0f60-47fb-a62f-21ecc0765cb9.jpeg";
string fakeImgUrl = fakeImgUrlDefault;
if (isActivityFake && 1==2)
{
string img_base64 = dbProd.sku_img_replace_base64;
if (string.IsNullOrEmpty(img_base64))
img_base64 = "/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBDAAgFBgcGBQgHBgcJCAgJDBMMDAsLDBgREg4THBgdHRsYGxofIywlHyEqIRobJjQnKi4vMTIxHiU2OjYwOiwwMTD/2wBDAQgJCQwKDBcMDBcwIBsgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDD/wAARCAMgAyADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoK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lxHzE2+gwT716f8ACTVjNo8tlK2Wt3yFLc7TXl8DxB5P7zYIVeldH8PL37F4qSNjhJ1I+9xntQgPbYpAe9TK46ZqhBIMDNW0IyCKCifNLmmginDFAAeelJz1xRnBoLc0wGDqTigkgU7Iz0pjDINADrb/AFZ+tLSW3+rP1paADGR0qtOMKcGppCQODVGe429RmgBbNWW3fd6Hk9axNJ/4/Zfr/WumU2xtS6yDbiuY0Y5u5D75qBnWW/3BUneo7c5QG Line truncated
byte[] imageBytes = Convert.FromBase64String(img_base64);
// 使用MemoryStream创建图片对象
using (MemoryStream ms = new MemoryStream(imageBytes))
{
Image image = Image.FromStream(ms);
// 保存图片到文件系统
image.Save("C:\\图片1.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
string boundary = "----WebKitFormBoundaryi5f9ydbgu8bo3yVD";
string body = @"------WebKitFormBoundaryi5f9ydbgu8bo3yVD
Content-Disposition: form-data; name=""upload_sign""
" + img_signature + @"
------WebKitFormBoundaryi5f9ydbgu8bo3yVD
Content-Disposition: form-data; name=""image""; filename=""图片1.jpg""
Content-Type: image/jpeg
<!>C:\图片1.jpg<!>
------WebKitFormBoundaryi5f9ydbgu8bo3yVD
Content-Disposition: form-data; name=""pic_operations""
{""rules"":[{""rule"":""imageMogr2/format/jpeg/quality/80|imageView2/2/w/2000/h/2000""}]}
------WebKitFormBoundaryi5f9ydbgu8bo3yVD--
";
Thread.Sleep(Randomx.GetId(5, 20));
var uploadImgRst = uploag_sku_img(shop, body, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, boundary);
if (!uploadImgRst.Contains("\"url\":\"https:"))
{
var error = BaseRegex.GetStringJson(ref uploadImgRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = uploadImgRst;
return "上传图片失败 " + error;
}
else
{
fakeImgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
}
}
fakeImgUrl = fakeImgUrlDefault;
var prodParamHighPrice = JsonHelper.DeserializeJsonToObject<PDDProductUploadParam>(JsonHelper.SerializeObject(prodParam));
prodParamHighPrice.skus = new List<sku_param>();
foreach (var skuInfo in prodInfo.detail.sku)
{
var skuParam = new sku_param()
{
id = skuInfo.id,
is_onsale = skuInfo.is_onsale,
limit_quantity = skuInfo.limit_quantity,
multi_price = (skuInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
out_sku_sn = skuInfo.out_sku_sn,
oversea_sku = skuInfo.oversea_sku,
price = (skuInfo.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
quantity_delta = txtStockNum.Text.Trim().ParseToInt(), //skuInfo.quantity,
shipment_limit_second_list = skuInfo.shipment_limit_second_list,
sku69_code = skuInfo.sku69_code,
sku_srv_templates = skuInfo.sku_srv_templates.ParseToString(),
spec = JsonHelper.DeserializeJsonToList<spec_param>(JsonHelper.SerializeObject(skuInfo.spec)),
thumb_url = skuInfo.thumb_url,
weight = skuInfo.weight,
length = skuInfo.length,
price_in_yuan = "", // 内部计算直接置空
multi_price_in_yuan = "", // 内部计算直接置空
pre_sale_time = skuInfo.pre_sale_time,
sku_id = skuInfo.sku_id,
thumb_url_file_id = skuInfo.thumb_url_file_id,
};
if (isAddMorePriceFirst) // 先加后乘
skuParam.multi_price = ((skuInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (prodParamHighPrice.market_price < skuParam.price + 1000)
{
prodParamHighPrice.market_price = skuParam.price + 1000;
prodParamHighPrice.market_price_in_yuan = (prodParamHighPrice.market_price * 0.01).ParseToString();
}
prodParamHighPrice.skus.Add(skuParam);
}
var prodParamHighPriceFakeSkuImg = JsonHelper.DeserializeJsonToObject<PDDProductUploadParam>(JsonHelper.SerializeObject(prodParam));
prodParamHighPriceFakeSkuImg.skus = new List<sku_param>();
foreach (var skuInfo in prodInfo.detail.sku)
{
var skuParam = new sku_param()
{
id = skuInfo.id,
is_onsale = skuInfo.is_onsale,
limit_quantity = skuInfo.limit_quantity,
multi_price = (skuInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
out_sku_sn = skuInfo.out_sku_sn,
oversea_sku = skuInfo.oversea_sku,
price = (skuInfo.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
quantity_delta = txtStockNum.Text.Trim().ParseToInt(), //skuInfo.quantity,
shipment_limit_second_list = skuInfo.shipment_limit_second_list,
sku69_code = skuInfo.sku69_code,
sku_srv_templates = skuInfo.sku_srv_templates.ParseToString(),
spec = JsonHelper.DeserializeJsonToList<spec_param>(JsonHelper.SerializeObject(skuInfo.spec)),
thumb_url = fakeImgUrl, //skuInfo.thumb_url,
weight = skuInfo.weight,
length = skuInfo.length,
price_in_yuan = "", // 内部计算直接置空
multi_price_in_yuan = "", // 内部计算直接置空
pre_sale_time = skuInfo.pre_sale_time,
sku_id = skuInfo.sku_id,
thumb_url_file_id = skuInfo.thumb_url_file_id,
};
if (isAddMorePriceFirst) // 先加后乘
skuParam.multi_price = ((skuInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (prodParamHighPriceFakeSkuImg.market_price < skuParam.price + 1000)
{
prodParamHighPriceFakeSkuImg.market_price = skuParam.price + 1000;
prodParamHighPriceFakeSkuImg.market_price_in_yuan = (prodParamHighPriceFakeSkuImg.market_price * 0.01).ParseToString();
}
prodParamHighPriceFakeSkuImg.skus.Add(skuParam);
}
#endregion
if (cell != null)
{
Invoke(new Action(() =>
@@ -1799,6 +1964,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (decoration_preview_html.Contains("\"success\":true"))
{
prodParam.decorationPreview = BaseRegex.GetStringJson(ref decoration_preview_html, "preview_url");
prodParamHighPriceFakeSkuImg.decorationPreview = prodParam.decorationPreview;
}
else
{
@@ -1809,7 +1975,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
Thread.Sleep(Randomx.GetId(20, 100));
var saveProdRst = save_goods_edit(shop, prodParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
var saveProdRst = "";
if (isActivityFake)
saveProdRst = save_goods_edit(shop, prodParamHighPriceFakeSkuImg, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), prodParamHighPriceFakeSkuImg.goods_commit_id);
else
saveProdRst = save_goods_edit(shop, prodParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
if (!saveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
@@ -1820,15 +1990,122 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Thread.Sleep(Randomx.GetId(20, 100));
//var str = JsonHelper.SerializeObject(prodParam);
var result = submit_goods_edit(shop, prodParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
if (!result.Contains("\"success\":true"))
var uploadRst = submit_goods_edit(shop, null, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
if (!uploadRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref result, "error_msg");
var error = BaseRegex.GetStringJson(ref uploadRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = result;
error = uploadRst;
return "上传失败 " + error;
}
//如果是活动报高价
if (isActivityFake)
{
string activityErr = "";
Thread.Sleep(Randomx.GetId(45000, 60000));
var activityRst1 = activity_goods_info(shop, prodParam.goods_id.ParseToString());
if (!activityRst1.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = saveProdRst;
activityErr = "上传失败2 981查询失败 " + error;
goto restoreSkuImg;
}
try
{
var jObj = JObject.Parse(activityRst1);
var jStr = JsonHelper.SerializeObject(jObj["result"]["result"]);
var pddActivitiInfo = (JsonHelper.DeserializeJsonToObject<PDDActivitiInfo>(jStr)?.theme_activity_quick_enroll_goods_render_form_list).FirstOrDefault();
foreach (var activitySku in pddActivitiInfo.activity_price_render.sku_activity_price_render_dtolist)
{
var sku = prodParam.skus.FirstOrDefault(s => s.sku_id == activitySku.sku_id);
{
if (sku != null && sku.multi_price > activitySku.suggest_price)
{
activityErr = "上传失败2 981价格更新失败";
goto restoreSkuImg;
}
}
}
PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam();
actSubmitParam.activity_id = 20981;
var goods_vo_item = new goods_vo_param();
actSubmitParam.goods_volist.Add(goods_vo_item);
goods_vo_item.goods_id = prodParam.goods_id;
foreach (var activitySku in pddActivitiInfo.activity_price_render.sku_activity_price_render_dtolist)
{
create_sku_vo_item sku_vo_item = new create_sku_vo_item();
sku_vo_item.sku_id = activitySku.sku_id;
sku_vo_item.sku_activity_price = activitySku.suggest_price;
sku_vo_item.sku_front_ctx_vo = new sku_front_ctx_vo_item()
{
filling_sku_price = activitySku.suggest_price,
gear_rule = activitySku.gear_rule,
require_price = activitySku.suggest_price,
};
goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item);
}
var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString());
if (!addActivityRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = addActivityRst;
activityErr = "上传失败2 981新建失败 " + error;
goto restoreSkuImg;
}
}
catch (Exception ex)
{
activityErr = "上传失败2 981查询/新建失败 " + ex.Message;
goto restoreSkuImg;
}
restoreSkuImg:
Thread.Sleep(Randomx.GetId(6000, 12000));
var getProdIdRst = get_prod_commit_id(shop, prodParamHighPrice.goods_id.ParseToString());
var newCommitId = BaseRegex.GetStringJson(ref getProdIdRst, "goods_commit_id");
prodParamHighPrice.goods_commit_id = newCommitId;
if (string.IsNullOrEmpty(newCommitId) || !saveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = saveProdRst;
return "上传失败2 获取commit_id失败" + error;
}
saveProdRst = save_goods_edit(shop, prodParamHighPrice, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, "edit");
if (!saveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = saveProdRst;
return "上传失败2 保存失败" + error;
}
Thread.Sleep(Randomx.GetId(20, 100));
//var str = JsonHelper.SerializeObject(prodParam);
uploadRst = submit_goods_edit(shop, null, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, "edit");
if (!uploadRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref uploadRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = uploadRst;
return "上传失败2 提交失败" + error;
}
if (!string.IsNullOrEmpty(activityErr))
return "上传失败2 " + activityErr;
}
return "{\"success\":true,\"draftId\":" + prodParam.goods_id + ",\"status\":\"已上传\"\"msg\":\"上传成功\"}";
}
@@ -1920,6 +2197,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
string url = "https://mms.pinduoduo.com/glide/v2/mms/edit/commit/create_by_sn";
string body = @"{""goods_id"":" + prodId + "}";
string refere = "https://mms.pinduoduo.com/goods/goods_list?msfrom=mms_sidenav";
if (isChanceApi)
{
refere = "https://mms.pinduoduo.com/goods/category?chance_tab=search";
}
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
@@ -2221,6 +2502,62 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return result;
}
private string get_uploag_img_signature(ShopLoginInfo shop, string goodsId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/galerie/business/get_signature";
string body = @"{""bucket_tag"":""mms-material-img""}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
"&goods_id=" + goodsId + "&sourcePage=goodsList";
if (isChanceApi)
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
"&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && (result.Contains("\\u975E\\u6CD5\\u8BF7\\u6C42") || result.Contains("网络繁忙,请不要频繁操作")); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string uploag_sku_img(ShopLoginInfo shop, string _body, string goodsId, string commitId, string boundary)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://file.pinduoduo.com/v3/store_image";
string body = _body;
//string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
// "&goods_id=" + goodsId + "&sourcePage=goodsList";
//if (isChanceApi)
// refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
// "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
string refere = "https://mms.pinduoduo.com/";
var result = HttpResponseBLL.PDDPostResponseUpload(shop, url, body, refere, boundary, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponseUpload(shop, url, body, refere, boundary, anti);
}
}
return result;
}
/// <summary>
/// 保存商品详情图装修列表
/// gorse/mms/goods/decoration/commit/save
@@ -2267,20 +2604,20 @@ namespace TemuKJD.PDDForms.ProductSelectForms
/// <param name="prodId"></param>
/// <param name="commitId"></param>
/// <returns></returns>
private string save_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId)
private string save_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId, string type="add")
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/glide/mms/goodsCommit/action/edit";
string body = JsonHelper.SerializeObject(prod);
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=category&id=" + commitId +
"&goods_id=" + prodId + "&sourcePage=goodsList";
if (isChanceApi)
{
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
// @"&goods_id=" + prodId + @"&chance_tab=hot_theme&sourcePage=goodsListTopButton_CHANCE";
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
@"&goods_id=" + prodId + @"&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
}
@@ -2308,7 +2645,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
/// <param name="prodId"></param>
/// <param name="commitId"></param>
/// <returns></returns>
private string submit_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId)
private string submit_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId, string type="add")
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
@@ -2317,13 +2654,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":" + prodId +
@",""is_onsale"":true,""third_type"":0,""if_allow_submit_mall_checking"":true,""crawlerInfo"":""" + anti + @"""}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=category&id=" + commitId +
"&goods_id=" + prodId + "&sourcePage=goodsList";
if (isChanceApi)
{
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
// @"&goods_id=" + prodId + @"&chance_tab=hot_theme&sourcePage=goodsListTopButton_CHANCE";
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
@"&goods_id=" + prodId + @"&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
}
@@ -2344,6 +2681,56 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return result;
}
private string activity_goods_info(ShopLoginInfo shop, string prodId, string activityId = "20981")
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/leekmms/quick_enroll/multi_activity/real_form_info";
string body = @"{""activity_id"":" + activityId + @",""page_number"":1,""page_size"":10,""goods_id_list"":[" + prodId + @"],""source_type"":""PROMO-OwnHome""}";
string refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=" + activityId + "&SourceType=PROMO-OwnHome";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && (result.Contains("当前请求频繁,请2小时后重试") || result.Contains("网络繁忙,请不要频繁操作") || result.Contains("您的店铺操作过于频繁,请稍后操作")); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string add_activity_goods(ShopLoginInfo shop, PDDActivitySubmitParam actSubmitParam, string prodId, string activityId = "20981")
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/lakemms/enrollV2";
string body = JsonHelper.SerializeObject(actSubmitParam);
string refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=" + activityId + "&SourceType=PROMO-OwnHome";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && (result.Contains("当前请求频繁,请2小时后重试") || result.Contains("网络繁忙,请不要频繁操作") || result.Contains("您的店铺操作过于频繁,请稍后操作")); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
@@ -2811,6 +3198,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
isUseUpperSizeSpec = chkSizeSpec.Checked;
}
private void chkActivity_CheckedChanged(object sender, EventArgs e)
{
isActivityFake = chkActivity.Checked;
}
}
public class AddPriceRule
+10
View File
@@ -29,6 +29,16 @@ namespace TemuKJD.ToolForms
}
}
public ShowImgForm(Image img)
{
InitializeComponent();
if (img != null)
{
this.pictureBox1.Image = img;
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();