temu客户端上传功能 2.拼多多商品提取问题修复(25%)

This commit is contained in:
wule committed 2025-12-12 19:34:16 +08:00
1 parent 2bb124e2d7
commit 62465769fe
13 files changed
+402 -210

No files matched your search

@@ -34,6 +34,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdEditDetailForm));
this.panel2 = new System.Windows.Forms.Panel();
this.pnlCef = new System.Windows.Forms.Panel();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
@@ -47,6 +48,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label2 = new System.Windows.Forms.Label();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.ucPddSpecEdit2 = new TemuKJD.PDDForms.ProductSelectForms.UcPddSpecEdit();
this.panel4 = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
this.cmbSpec1 = new TemuKJD.UserComponent.UcComboBoxMutiSelect();
@@ -70,10 +72,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuImg = new System.Windows.Forms.DataGridViewImageColumn();
this.colEditSkuImg = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSkuSn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel5 = new System.Windows.Forms.Panel();
this.btnRestoreAll = new DevComponents.DotNetBar.PanelEx();
this.btnCancel = new DevComponents.DotNetBar.PanelEx();
this.btnSaveSkuLst = new DevComponents.DotNetBar.PanelEx();
this.pnlCef = new System.Windows.Forms.Panel();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -85,6 +87,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel1.SuspendLayout();
this.pnlSpec2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.panel4.SuspendLayout();
this.flowLayoutPanel4.SuspendLayout();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).BeginInit();
@@ -99,14 +102,21 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(1, 33);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1278, 666);
this.panel2.Size = new System.Drawing.Size(1278, 686);
this.panel2.TabIndex = 1;
//
// pnlCef
//
this.pnlCef.Location = new System.Drawing.Point(5, 7);
this.pnlCef.Name = "pnlCef";
this.pnlCef.Size = new System.Drawing.Size(78, 49);
this.pnlCef.TabIndex = 9;
//
// pbLoading
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(614, 6);
this.pbLoading.Location = new System.Drawing.Point(614, 16);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -118,7 +128,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer1.Location = new System.Drawing.Point(0, 62);
this.splitContainer1.Location = new System.Drawing.Point(0, 82);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
@@ -142,9 +152,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel1);
this.flowLayoutPanel3.Controls.Add(this.pnlSpec2);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel2);
this.flowLayoutPanel3.Controls.Add(this.label3);
this.flowLayoutPanel3.Controls.Add(this.panel4);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel4);
this.flowLayoutPanel3.Controls.Add(this.dgvDbProduct);
this.flowLayoutPanel3.Controls.Add(this.panel5);
this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 0);
@@ -158,8 +169,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec1.Controls.Add(this.btnAddSpec1);
this.pnlSpec1.Controls.Add(this.label1);
this.pnlSpec1.Location = new System.Drawing.Point(3, 3);
this.pnlSpec1.MinimumSize = new System.Drawing.Size(1250, 10);
this.pnlSpec1.Name = "pnlSpec1";
this.pnlSpec1.Size = new System.Drawing.Size(204, 23);
this.pnlSpec1.Size = new System.Drawing.Size(1250, 23);
this.pnlSpec1.TabIndex = 11;
//
// btnAddSpec1
@@ -203,12 +215,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.ucPddSpecEdit1);
this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 29);
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 29);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel1.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(1240, 10);
this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1240, 55);
this.flowLayoutPanel1.Size = new System.Drawing.Size(1250, 55);
this.flowLayoutPanel1.TabIndex = 0;
this.flowLayoutPanel1.Tag = "";
//
@@ -227,8 +239,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec2.Controls.Add(this.btnAddSpec2);
this.pnlSpec2.Controls.Add(this.label2);
this.pnlSpec2.Location = new System.Drawing.Point(3, 90);
this.pnlSpec2.MinimumSize = new System.Drawing.Size(1250, 10);
this.pnlSpec2.Name = "pnlSpec2";
this.pnlSpec2.Size = new System.Drawing.Size(204, 23);
this.pnlSpec2.Size = new System.Drawing.Size(1250, 23);
this.pnlSpec2.TabIndex = 12;
//
// btnAddSpec2
@@ -272,12 +285,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel2.AutoSize = true;
this.flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel2.Controls.Add(this.ucPddSpecEdit2);
this.flowLayoutPanel2.Location = new System.Drawing.Point(4, 116);
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 116);
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel2.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel2.MinimumSize = new System.Drawing.Size(1240, 10);
this.flowLayoutPanel2.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(1240, 55);
this.flowLayoutPanel2.Size = new System.Drawing.Size(1250, 55);
this.flowLayoutPanel2.TabIndex = 1;
//
// ucPddSpecEdit2
@@ -290,10 +303,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucPddSpecEdit2.Size = new System.Drawing.Size(295, 49);
this.ucPddSpecEdit2.TabIndex = 0;
//
// panel4
//
this.panel4.Controls.Add(this.label3);
this.panel4.Location = new System.Drawing.Point(3, 177);
this.panel4.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(1250, 23);
this.panel4.TabIndex = 14;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(5, 179);
this.label3.Location = new System.Drawing.Point(1, 3);
this.label3.Margin = new System.Windows.Forms.Padding(5, 5, 3, 3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 17);
@@ -305,9 +327,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel4.Controls.Add(this.cmbSpec1);
this.flowLayoutPanel4.Controls.Add(this.cmbSpec2);
this.flowLayoutPanel4.Controls.Add(this.panel3);
this.flowLayoutPanel4.Location = new System.Drawing.Point(3, 202);
this.flowLayoutPanel4.Location = new System.Drawing.Point(3, 203);
this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel4.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel4.Name = "flowLayoutPanel4";
this.flowLayoutPanel4.Size = new System.Drawing.Size(1242, 31);
this.flowLayoutPanel4.Size = new System.Drawing.Size(1250, 31);
this.flowLayoutPanel4.TabIndex = 13;
//
// cmbSpec1
@@ -454,11 +478,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuImg,
this.colEditSkuImg,
this.colSkuSn});
this.dgvDbProduct.Location = new System.Drawing.Point(5, 239);
this.dgvDbProduct.Margin = new System.Windows.Forms.Padding(5, 3, 3, 3);
this.dgvDbProduct.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvDbProduct.Location = new System.Drawing.Point(5, 237);
this.dgvDbProduct.Margin = new System.Windows.Forms.Padding(5, 0, 3, 3);
this.dgvDbProduct.Name = "dgvDbProduct";
this.dgvDbProduct.RowTemplate.Height = 23;
this.dgvDbProduct.Size = new System.Drawing.Size(1230, 586);
this.dgvDbProduct.Size = new System.Drawing.Size(1230, 600);
this.dgvDbProduct.TabIndex = 7;
this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick);
this.dgvDbProduct.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellValueChanged);
@@ -535,6 +560,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuSn.Name = "colSkuSn";
this.colSkuSn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// panel5
//
this.panel5.Location = new System.Drawing.Point(3, 843);
this.panel5.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(1250, 10);
this.panel5.TabIndex = 15;
//
// btnRestoreAll
//
this.btnRestoreAll.CanvasColor = System.Drawing.SystemColors.Control;
@@ -609,17 +642,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSaveSkuLst.Text = "保存";
this.btnSaveSkuLst.Click += new System.EventHandler(this.btnSaveSkuLst_Click);
//
// pnlCef
//
this.pnlCef.Location = new System.Drawing.Point(5, 7);
this.pnlCef.Name = "pnlCef";
this.pnlCef.Size = new System.Drawing.Size(78, 49);
this.pnlCef.TabIndex = 9;
//
// PDDDBProdEditDetailForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1280, 700);
this.ClientSize = new System.Drawing.Size(1280, 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")));
@@ -644,6 +670,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec2.PerformLayout();
this.flowLayoutPanel2.ResumeLayout(false);
this.flowLayoutPanel2.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.flowLayoutPanel4.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
@@ -695,5 +723,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuSn;
private DevComponents.DotNetBar.PanelEx btnRestoreAll;
private System.Windows.Forms.Panel pnlCef;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel5;
}
}
@@ -46,7 +46,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pbLoading.BringToFront();
this.pbLoading.Location = new Point(this.pbLoading.Location.X, 300);
this.ActiveControl = dgvDbProduct;
this.ActiveControl = btnAddSpec1; // dgvDbProduct;
this.dgvDbProduct.AddImgColumn("colSkuImg", "colSkuImgUrl");
flowLayoutPanel1.Controls.Clear();
flowLayoutPanel2.Controls.Clear();
@@ -351,6 +351,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return;
var newSpec1 = JsonHelper.DeserializeJsonToObject<spec_item>(JsonHelper.SerializeObject(spec));
// 防止spec名称重复
while (lstSkuEditItem.Any(s => s.spec.Any(sp => sp.spec_name == newSpec1.parent_name + this.addSpecIndex1)))
this.addSpecIndex1++;
newSpec1.spec_id = null;
newSpec1.spec_name = newSpec1.parent_name + this.addSpecIndex1;
AddSpec1(newSpec1);
@@ -377,6 +380,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
newSku.price = null;
newSku.thumb_url = null;
newSku.thumb_url_file_id = null;
newSku.thumb_md5 = null;
newSku.multi_price = null;
newSku.out_sku_sn = "";
if (this.lstSkuEditItem.All(s => s.spec.Count == 1))
@@ -396,6 +400,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return;
var newSpec2 = JsonHelper.DeserializeJsonToObject<spec_item>(JsonHelper.SerializeObject(spec));
// 防止spec名称重复
while (lstSkuEditItem.Any(s => s.spec.Any(sp => sp.spec_name == newSpec2.parent_name + this.addSpecIndex1)))
this.addSpecIndex1++;
newSpec2.spec_id = null;
newSpec2.spec_name = newSpec2.parent_name + this.addSpecIndex2;
AddSpec2(newSpec2);
@@ -698,6 +705,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void btnSaveSkuLst_Click(object sender, EventArgs e)
{
// 焦点移动到别的控件上自动更新表格内的数值
this.ActiveControl = btnSaveSkuLst;
if (this.lstSkuEditItem.Any(s => s.multi_price.ParseToDecimal() == 0 || s.price.ParseToDecimal() == 0))
{
BaseMsgForm.ShowError("价格不能为 0");
@@ -708,6 +718,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
BaseMsgForm.ShowError("单买价低于拼单价加 1 元");
return;
}
if (this.lstSkuEditItem.Any(s => s.thumb_url.IsNullOrEmpty() && s.thumb_md5.IsNullOrEmpty()))
{
BaseMsgForm.ShowError("sku图片不能为空");
return;
}
var url = BaseClass.BuildObjString("product/mdy_db_product");
var data = UserLogin.GetSignaturex() +
@@ -53,7 +53,6 @@
this.label8 = new System.Windows.Forms.Label();
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.btnTest = new DevComponents.DotNetBar.PanelEx();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -62,7 +61,6 @@
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.btnTest);
this.panel2.Controls.Add(this.btnEditDetail);
this.panel2.Controls.Add(this.btnSelect);
this.panel2.Controls.Add(this.buttonEx1);
@@ -371,30 +369,6 @@
this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// btnTest
//
this.btnTest.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnTest.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnTest.DisabledBackColor = System.Drawing.Color.Empty;
this.btnTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTest.Location = new System.Drawing.Point(317, 18);
this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(85, 26);
this.btnTest.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnTest.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnTest.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnTest.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnTest.Style.GradientAngle = 90;
this.btnTest.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnTest.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnTest.TabIndex = 654;
this.btnTest.Text = "测试";
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
//
// PDDDBProdEditForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -441,6 +415,5 @@
private UserControls.ButtonEx buttonEx1;
private UserControls.ButtonEx btnSelect;
private DevComponents.DotNetBar.PanelEx btnEditDetail;
private DevComponents.DotNetBar.PanelEx btnTest;
}
}
@@ -234,48 +234,5 @@ namespace TemuKJD.PDDForms.ProductSelectForms
PDDDBProdEditDetailForm editDetailForm = new PDDDBProdEditDetailForm(this.dbProd);
editDetailForm.ShowDialog();
}
private void btnTest_Click(object sender, EventArgs e)
{
string text = "";
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = false;
// 设置过滤条件,只显示文本文件
openFileDialog.Filter = "图片文件 (*.jpeg;*.jpg;*.png)|*.jpeg;*.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.Png);
byte[] imageBytes = memoryStream.ToArray();
imgBase64 = Convert.ToBase64String(imageBytes);
//imgBase64 = Convert.ToBase64String(imageBytes, Base64FormattingOptions.InsertLineBreaks);
}
string img_md5 = BaseClass.GetMd5(imgBase64);
}
catch (Exception ex)
{
//Console.WriteLine("An error occurred: " + ex.Message);
BaseMsgForm.ShowError("打开自定义图片失败 " + ex.Message);
return;
}
}
}
}
}
@@ -1,5 +1,6 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Param.PDDProdParam;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
using NaiBa.Util.Extension;
@@ -182,7 +183,21 @@ namespace TemuKJD.PDDForms.ShopForms
OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
return;
}
if (decoration == null)
//if (decoration != null && decoration_json.ParseToString().Length < 20)
//{
// try
// {
// var prod_detail_decoration_rst = GetPddProdDetail(sourceShop, sourceProdId.ToString(), commitId);
// }
// catch (Exception ex)
// {
// OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
// return;
// }
//}
if (decoration == null || decoration_json.ParseToString().Length < 20)
{
OnInfoReceived("商品获取失败!商品详情图获取失败!");
return;
@@ -607,6 +622,68 @@ namespace TemuKJD.PDDForms.ShopForms
}
return result;
}
private string GetPddProdOnShopDetail(ShopLoginInfo shop, string prodId, 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/glide/v2/mms/query/commit/on_shop/detail"; //获取详情图
//string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/detail";
//string body = @"{""goods_id"":" + prodId + "}";
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":""" + prodId + @"""}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, 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.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
/// <summary>
/// 保存商品详情图装修列表
/// gorse/mms/goods/decoration/commit/save
/// </summary>
/// <param name="shop"></param>
/// <param name="decoration"></param>
/// <param name="goodsId"></param>
/// <param name="commitId"></param>
/// <returns></returns>
private string save_decoration(ShopLoginInfo shop, PDDProdDecorationCommitParam decoration, 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/gorse/mms/goods/decoration/commit/save";
string body = @"{""goods_id"":" + goodsId + "}";
body = JsonHelper.SerializeObject(decoration);
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + goodsId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, 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.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string GetPddProdSizeSpec(ShopLoginInfo shop, string prodId, string commitId, string sizeSpecId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
@@ -658,6 +735,7 @@ namespace TemuKJD.PDDForms.ShopForms
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
string body = @"{""goods_commit_id"":" + commitId + @",""goods_id"":" + prodId + @"}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);