1.Jit客户端功能 2.pdd活动报名新增及优化

This commit is contained in:
wule committed 2025-12-01 10:01:54 +08:00
1 parent e77914bafc
commit 480d8c2cd4
41 files changed
+5136 -2863

No files matched your search

@@ -30,13 +30,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
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();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.chk15996 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chk21365 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chk20981 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chk22347 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chkKeepChanceGoodsImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.pbSkuImg = new System.Windows.Forms.PictureBox();
this.label19 = new System.Windows.Forms.Label();
@@ -101,6 +106,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colRemaining = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.txtTest20981 = new System.Windows.Forms.TextBox();
this.btnTest20981 = new DevComponents.DotNetBar.PanelEx();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.dgvSelectProduct = new TemuKJD.UserComponent.DataGridViewEx();
@@ -175,7 +182,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer1.Size = new System.Drawing.Size(1350, 546);
this.splitContainer1.Size = new System.Drawing.Size(1584, 546);
this.splitContainer1.SplitterDistance = 140;
this.splitContainer1.TabIndex = 11;
//
@@ -186,6 +193,10 @@ 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.chk15996);
this.ucGroupBoxEx2.Controls.Add(this.chk21365);
this.ucGroupBoxEx2.Controls.Add(this.chk20981);
this.ucGroupBoxEx2.Controls.Add(this.chk22347);
this.ucGroupBoxEx2.Controls.Add(this.chkKeepChanceGoodsImg);
this.ucGroupBoxEx2.Controls.Add(this.pbSkuImg);
this.ucGroupBoxEx2.Controls.Add(this.label19);
@@ -218,17 +229,69 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx2.Controls.Add(this.lblLowPriceSkuImg);
this.ucGroupBoxEx2.Location = new System.Drawing.Point(476, 2);
this.ucGroupBoxEx2.Name = "ucGroupBoxEx2";
this.ucGroupBoxEx2.Size = new System.Drawing.Size(872, 140);
this.ucGroupBoxEx2.Size = new System.Drawing.Size(1106, 140);
this.ucGroupBoxEx2.TabIndex = 667;
this.ucGroupBoxEx2.TabStop = false;
this.ucGroupBoxEx2.Text = "商品上传";
//
// chk15996
//
this.chk15996.AutoSize = true;
this.chk15996.Checked = true;
this.chk15996.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk15996.Location = new System.Drawing.Point(727, 88);
this.chk15996.Name = "chk15996";
this.chk15996.Size = new System.Drawing.Size(62, 21);
this.chk15996.TabIndex = 682;
this.chk15996.Text = "15996";
this.chk15996.UseVisualStyleBackColor = true;
this.chk15996.CheckedChanged += new System.EventHandler(this.chkActivityDetail_CheckedChanged);
//
// chk21365
//
this.chk21365.AutoSize = true;
this.chk21365.Checked = true;
this.chk21365.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk21365.Location = new System.Drawing.Point(663, 88);
this.chk21365.Name = "chk21365";
this.chk21365.Size = new System.Drawing.Size(62, 21);
this.chk21365.TabIndex = 681;
this.chk21365.Text = "21365";
this.chk21365.UseVisualStyleBackColor = true;
this.chk21365.CheckedChanged += new System.EventHandler(this.chkActivityDetail_CheckedChanged);
//
// chk20981
//
this.chk20981.AutoSize = true;
this.chk20981.Checked = true;
this.chk20981.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk20981.Location = new System.Drawing.Point(599, 88);
this.chk20981.Name = "chk20981";
this.chk20981.Size = new System.Drawing.Size(62, 21);
this.chk20981.TabIndex = 680;
this.chk20981.Text = "20981";
this.chk20981.UseVisualStyleBackColor = true;
this.chk20981.CheckedChanged += new System.EventHandler(this.chkActivityDetail_CheckedChanged);
//
// chk22347
//
this.chk22347.AutoSize = true;
this.chk22347.Checked = true;
this.chk22347.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk22347.Location = new System.Drawing.Point(535, 88);
this.chk22347.Name = "chk22347";
this.chk22347.Size = new System.Drawing.Size(62, 21);
this.chk22347.TabIndex = 679;
this.chk22347.Text = "22347";
this.chk22347.UseVisualStyleBackColor = true;
this.chk22347.CheckedChanged += new System.EventHandler(this.chkActivityDetail_CheckedChanged);
//
// chkKeepChanceGoodsImg
//
this.chkKeepChanceGoodsImg.AutoSize = true;
this.chkKeepChanceGoodsImg.Checked = true;
this.chkKeepChanceGoodsImg.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkKeepChanceGoodsImg.Location = new System.Drawing.Point(535, 65);
this.chkKeepChanceGoodsImg.Location = new System.Drawing.Point(652, 42);
this.chkKeepChanceGoodsImg.Name = "chkKeepChanceGoodsImg";
this.chkKeepChanceGoodsImg.Size = new System.Drawing.Size(135, 21);
this.chkKeepChanceGoodsImg.TabIndex = 669;
@@ -293,7 +356,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// 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(662, 87);
this.txtAddTimesFake.Location = new System.Drawing.Point(662, 64);
this.txtAddTimesFake.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtAddTimesFake.Name = "txtAddTimesFake";
this.txtAddTimesFake.Size = new System.Drawing.Size(32, 23);
@@ -306,7 +369,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkActivity.AutoSize = true;
this.chkActivity.Checked = true;
this.chkActivity.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkActivity.Location = new System.Drawing.Point(535, 88);
this.chkActivity.Location = new System.Drawing.Point(535, 65);
this.chkActivity.Name = "chkActivity";
this.chkActivity.Size = new System.Drawing.Size(135, 21);
this.chkActivity.TabIndex = 648;
@@ -318,7 +381,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
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(693, 90);
this.label17.Location = new System.Drawing.Point(694, 67);
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);
@@ -355,7 +418,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnClearDgv.CanvasColor = System.Drawing.SystemColors.Control;
this.btnClearDgv.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClearDgv.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClearDgv.Location = new System.Drawing.Point(769, 92);
this.btnClearDgv.Location = new System.Drawing.Point(1003, 92);
this.btnClearDgv.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnClearDgv.Name = "btnClearDgv";
this.btnClearDgv.Size = new System.Drawing.Size(84, 23);
@@ -582,7 +645,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnStop.CanvasColor = System.Drawing.SystemColors.Control;
this.btnStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStop.DisabledBackColor = System.Drawing.Color.Empty;
this.btnStop.Location = new System.Drawing.Point(769, 62);
this.btnStop.Location = new System.Drawing.Point(1003, 62);
this.btnStop.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(84, 23);
@@ -609,7 +672,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnUpload.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnUpload.DisabledBackColor = System.Drawing.Color.Empty;
this.btnUpload.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpload.Location = new System.Drawing.Point(769, 32);
this.btnUpload.Location = new System.Drawing.Point(1003, 32);
this.btnUpload.Name = "btnUpload";
this.btnUpload.Size = new System.Drawing.Size(84, 23);
this.btnUpload.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -675,7 +738,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkChance.AutoSize = true;
this.chkChance.Checked = true;
this.chkChance.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkChance.Location = new System.Drawing.Point(683, 33);
this.chkChance.Location = new System.Drawing.Point(917, 33);
this.chkChance.Name = "chkChance";
this.chkChance.Size = new System.Drawing.Size(87, 21);
this.chkChance.TabIndex = 556;
@@ -976,7 +1039,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
this.splitContainer3.Size = new System.Drawing.Size(1350, 402);
this.splitContainer3.Size = new System.Drawing.Size(1584, 402);
this.splitContainer3.SplitterDistance = 372;
this.splitContainer3.TabIndex = 1;
//
@@ -994,11 +1057,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.txtTest20981);
this.splitContainer2.Panel2.Controls.Add(this.btnTest20981);
this.splitContainer2.Panel2.Controls.Add(this.pbLoading);
this.splitContainer2.Panel2.Controls.Add(this.panel1);
this.splitContainer2.Panel2.Controls.Add(this.dgvSelectProduct);
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
this.splitContainer2.Size = new System.Drawing.Size(1350, 372);
this.splitContainer2.Size = new System.Drawing.Size(1584, 372);
this.splitContainer2.SplitterDistance = 300;
this.splitContainer2.TabIndex = 0;
//
@@ -1006,18 +1071,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
this.dgvShop.AutoRowNumber = true;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
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;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -1122,11 +1188,47 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colMessage.Name = "colMessage";
this.colMessage.ReadOnly = true;
//
// txtTest20981
//
this.txtTest20981.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.txtTest20981.Location = new System.Drawing.Point(1057, 30);
this.txtTest20981.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtTest20981.Name = "txtTest20981";
this.txtTest20981.Size = new System.Drawing.Size(127, 23);
this.txtTest20981.TabIndex = 650;
this.txtTest20981.Visible = false;
//
// btnTest20981
//
this.btnTest20981.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnTest20981.CanvasColor = System.Drawing.SystemColors.Control;
this.btnTest20981.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnTest20981.DisabledBackColor = System.Drawing.Color.Empty;
this.btnTest20981.Location = new System.Drawing.Point(1188, 30);
this.btnTest20981.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnTest20981.Name = "btnTest20981";
this.btnTest20981.Size = new System.Drawing.Size(84, 23);
this.btnTest20981.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest20981.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnTest20981.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnTest20981.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnTest20981.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest20981.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnTest20981.Style.GradientAngle = 90;
this.btnTest20981.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest20981.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest20981.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest20981.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest20981.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnTest20981.TabIndex = 649;
this.btnTest20981.Text = "测试20981";
this.btnTest20981.Visible = false;
//
// 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(498, 161);
this.pbLoading.Location = new System.Drawing.Point(615, 161);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -1141,7 +1243,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Location = new System.Drawing.Point(36, 53);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(972, 286);
this.panel1.Size = new System.Drawing.Size(1206, 286);
this.panel1.TabIndex = 189;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
@@ -1149,18 +1251,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvSelectProduct.AllowUserToAddRows = false;
this.dgvSelectProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
this.dgvSelectProduct.AutoRowNumber = true;
this.dgvSelectProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvSelectProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
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;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.dgvSelectProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
@@ -1190,7 +1293,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvSelectProduct.Name = "dgvSelectProduct";
this.dgvSelectProduct.ReadOnly = true;
this.dgvSelectProduct.RowTemplate.Height = 23;
this.dgvSelectProduct.Size = new System.Drawing.Size(1042, 372);
this.dgvSelectProduct.Size = new System.Drawing.Size(1276, 372);
this.dgvSelectProduct.TabIndex = 187;
this.dgvSelectProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectProduct_CellContentClick);
this.dgvSelectProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvSelectProduct_Scroll);
@@ -1221,11 +1324,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colSupplierName
//
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle11;
this.colSupplierName.Frozen = true;
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colLogin
//
@@ -1300,12 +1404,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colProductName
//
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle12;
this.colProductName.HeaderText = "商品标题";
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
this.colProductName.Width = 220;
this.colProductName.Width = 160;
//
// colProductCat
//
@@ -1371,7 +1475,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colOpResult.HeaderText = "操作结果";
this.colOpResult.Name = "colOpResult";
this.colOpResult.ReadOnly = true;
this.colOpResult.Width = 200;
this.colOpResult.Width = 260;
//
// splitContainer4
//
@@ -1388,8 +1492,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
this.splitContainer4.Panel2.Controls.Add(this.panelEx1);
this.splitContainer4.Size = new System.Drawing.Size(1350, 26);
this.splitContainer4.SplitterDistance = 659;
this.splitContainer4.Size = new System.Drawing.Size(1584, 26);
this.splitContainer4.SplitterDistance = 893;
this.splitContainer4.TabIndex = 3;
//
// statusBar
@@ -1400,7 +1504,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(659, 26);
this.statusBar.Size = new System.Drawing.Size(893, 26);
this.statusBar.TabIndex = 2;
//
// btnClear
@@ -1457,7 +1561,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1350, 546);
this.ClientSize = new System.Drawing.Size(1584, 546);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "PDDDBProdUserSelectForm";
@@ -1485,6 +1589,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer3.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit();
@@ -1564,6 +1669,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private UserComponent.UcCheckBox chkKeepChanceGoodsImg;
private System.Windows.Forms.PictureBox pbSkuImg;
private System.Windows.Forms.Label lblLowPriceSkuImg;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.ComboBox cmbGroupFilter;
private DevComponents.DotNetBar.PanelEx btnClear;
private DevComponents.DotNetBar.PanelEx panelEx1;
private System.Windows.Forms.TextBox txtIdFilter;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cmbCateFilter;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.Label lblWaitToUp;
private System.Windows.Forms.TextBox txtTest20981;
private DevComponents.DotNetBar.PanelEx btnTest20981;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
@@ -1586,14 +1702,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewLinkColumn ColDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.ComboBox cmbGroupFilter;
private DevComponents.DotNetBar.PanelEx btnClear;
private DevComponents.DotNetBar.PanelEx panelEx1;
private System.Windows.Forms.TextBox txtIdFilter;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cmbCateFilter;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.Label lblWaitToUp;
private UserComponent.UcCheckBox chk15996;
private UserComponent.UcCheckBox chk21365;
private UserComponent.UcCheckBox chk20981;
private UserComponent.UcCheckBox chk22347;
}
}
@@ -33,13 +33,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
/// <summary>
/// 拖鞋
/// </summary>
public static string[] slippersCatName { get; set; } = new string[] { "洞洞鞋", "其他凉鞋", "包头拖", "人字拖", "一字拖", "居家鞋", "棉拖鞋", "网面鞋", "居家凉拖",
"沙滩凉鞋", "休闲凉鞋", "凉鞋", "运动拖鞋", "时装凉鞋", "男凉拖", "擦地拖鞋", "亚麻拖鞋", "休闲皮鞋", "T恤", "高帮棉鞋", "罗马凉鞋" };
public static string[] slippersCatName { get; set; } = new string[] { "洞洞鞋", "其他凉鞋", "包头拖", "人字拖", "一字拖", "居家鞋", "居家棉鞋", "棉拖鞋", "居家棉拖", "网面鞋",
"居家凉拖", "沙滩凉鞋", "休闲凉鞋", "凉鞋", "运动拖鞋", "时装凉鞋", "男凉拖", "擦地拖鞋", "亚麻拖鞋", "休闲皮鞋", "T恤", "高帮棉鞋", "罗马凉鞋" };
/// <summary>
/// 运动鞋/休闲鞋
/// </summary>
public static string[] sneakersCatName { get; set; } = new string[] { "运动休闲鞋", "布鞋", "帆布鞋", "单鞋", "板鞋/休闲鞋", "广场舞鞋", "板鞋", "乐福鞋", "健步鞋",
"跑步鞋", "棉鞋", "高帮休闲鞋", "网面鞋", "勃肯鞋/软木鞋", "包头拖", "足部磨砂", "老爹鞋", "工装鞋", "豆豆鞋", "汉服鞋" };
"跑步鞋", "棉鞋", "高帮休闲鞋", "网面鞋", "勃肯鞋/软木鞋", "包头拖", "足部磨砂", "老爹鞋", "工装鞋", "豆豆鞋", "汉服鞋", "雨鞋" };
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
public bool IsLoadComplate { get; set; } = false;
@@ -668,12 +668,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
Thread.Sleep(100);
}
while(currentShopList.Any(s => s.ShopId == randomShop.ShopId))
if (cancellationTokenSource.IsCancellationRequested)
break;
while (currentShopList.Any(s => s.ShopId == randomShop.ShopId))
{
Thread.Sleep(500);
randomShop = randomShopLst[Randomx.GetId(randomShopLst.Count)];
}
currentShopList.Add(randomShop);
if (cancellationTokenSource.IsCancellationRequested)
break;
if (lstTemuDBProductSelect.Count <= 0)
{
@@ -691,6 +696,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
currentShopList.Remove(randomShop);
continue;
}
if (cancellationTokenSource.IsCancellationRequested)
break;
lstTemuDBProductSelect.RemoveAt(0);
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_db_prod_upload_list", this.lstTemuDBProductSelect);
@@ -868,8 +875,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
continue;
}
if (cancellationTokenSource.IsCancellationRequested)
break;
//var prodDetailJson = GetHtml.UrlDecode(kjdDbProd.product_json);
result = UploadProduct(shop, kjdDbProd, prod, row.Cells["colOpResult"]); //将商品上传
result = UploadProduct(shop, kjdDbProd, prod, row.Cells["colOpResult"], startTime); //将商品上传
Invoke(new Action(() =>
{
row.Cells["colSkuFakeImgUrl"].Value = kjdDbProd.sku_img_replace_url;
@@ -946,6 +955,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
for (int i = 0; i < 200 && currentShopList.Count > 0; i++)
{
Thread.Sleep(1000);
if (cancellationTokenSource.IsCancellationRequested)
break;
}
Invoke(new Action(() =>
{
@@ -966,7 +977,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}));
}
string UploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell)
string UploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell, DateTime startTime)
{
if (shop == null || string.IsNullOrEmpty(shop.ShopId) || shop.LoginStatus != "登录成功")
{
@@ -2314,75 +2325,197 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}));
}
Thread.Sleep(Randomx.GetId(30000, 40000));
string activityErr = SignAcitvity(shop, prodParam);
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) || !getProdIdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref getProdIdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = getProdIdRst;
if (BaseClass.SaLevel != 1 && 1 != 1)
return "上传失败";
return "上传失败 校验上传失败 " + error;
}
foreach(var sku in prodParamHighPrice.skus)
{
sku.quantity_delta = 0;
}
saveProdRst = save_goods_edit(shop, prodParamHighPrice, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, isChanceApi, "edit");
if (!saveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = saveProdRst;
if (BaseClass.SaLevel != 1 && 1 != 1)
return "上传失败";
return "上传失败 保存失败 " + error;
}
Thread.Sleep(Randomx.GetId(20, 100));
//var str = JsonHelper.SerializeObject(prodParam);
uploadRst = submit_goods_edit(shop, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, isChanceApi, "edit");
if (!uploadRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref uploadRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = uploadRst;
if (BaseClass.SaLevel != 1 && 1 != 1)
return "上传失败";
return "上传失败 提交失败 " + error;
}
//Thread.Sleep(Randomx.GetId(4000, 8000));
if (!string.IsNullOrEmpty(activityErr))
{
return "已上传 " + activityErr;
}
var ta = Task.Run(() => SignActivityInTask(shop, prodParam, prodParamHighPrice, cell, startTime));
//ta.Wait();
}
return "{\"success\":true,\"draftId\":" + prodParam.goods_id + ",\"status\":\"已上传\",\"msg\":\"上传成功\"}";
}
public void SignActivityInTask(ShopLoginInfo shop, PDDProductUploadParam prodParam, PDDProductUploadParam prodParamHighPrice, DataGridViewCell cell, DateTime startTime)
{
Thread.Sleep(2000);
var endTime = DateTime.Now;
var timeSpan = endTime - startTime;
var duration = timeSpan.TotalSeconds;
if (cell != null)
{
Invoke(new Action(() =>
{
cell.Value = "商品已上传,进行后续操作中" + " " + duration.ParseToInt() + "秒";
}));
}
bool sign20981 = chk20981.Checked;
bool sign22347 = chk22347.Checked;
bool sign15996 = chk15996.Checked;
bool sign23165 = chk21365.Checked;
Thread.Sleep(Randomx.GetId(2000, 6000));
// 判断商品是否上架成功
var getProdRst1 = queryActivityGoodsEnabled(shop, prodParam.goods_id.ParseToString(), 22347, 0);
var getProdRst2 = queryActivityGoodsEnabled(shop, prodParam.goods_id.ParseToString(), 22347, 1);
var getProdRst3 = ""; // queryActivityGoodsEnabled(shop, prodParam.goods_id.ParseToString(), 20981, 0);
var getProdRst4 = ""; // queryActivityGoodsEnabled(shop, prodParam.goods_id.ParseToString(), 20981, 1);
if (!getProdRst1.Contains(prodParam.goods_id.ParseToString()) && !getProdRst2.Contains(prodParam.goods_id.ParseToString()) &&
!getProdRst3.Contains(prodParam.goods_id.ParseToString()) && !getProdRst4.Contains(prodParam.goods_id.ParseToString()))
{
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传错误,商品不存在" + " " + duration.ParseToInt() + "秒";
}));
}
return;
}
else if (chk22347.Checked)
{
// 如果报了直通车,判断商品自动加入直通车以后再放行(循环12次应该已加入,否则认为加入失败跳过)
for (int i = 0; i < 12 && !getProdRst2.Contains(prodParam.goods_id.ParseToString()); i++)
{
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "商品已上传,进行后续操作中" + " " + duration.ParseToInt() + "秒";
}));
}
Thread.Sleep(60 * 1000);
getProdRst2 = queryActivityGoodsEnabled(shop, prodParam.goods_id.ParseToString(), 22347, 1);
if (getProdRst2.Contains(prodParam.goods_id.ParseToString()))
{
}
}
}
string activityErr = SignActivity(shop, prodParam, sign22347, sign20981, sign23165, sign15996);
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) || !getProdIdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref getProdIdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = getProdIdRst;
//if (BaseClass.SaLevel != 1 && 1 != 1)
// return "上传失败";
//return "上传失败 校验上传失败 " + error;
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 校验上传失败 " + error + " " + duration.ParseToInt() + "秒";
}));
}
return;
}
foreach (var sku in prodParamHighPrice.skus)
{
sku.quantity_delta = 0;
}
var reSaveProdRst = save_goods_edit(shop, prodParamHighPrice, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, isChanceApi, "edit");
if (!reSaveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref reSaveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = reSaveProdRst;
//if (BaseClass.SaLevel != 1 && 1 != 1)
// return "上传失败";
//return "上传失败 保存失败 " + error;
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 保存失败 " + error + " " + duration.ParseToInt() + "秒";
}));
}
return;
}
Thread.Sleep(Randomx.GetId(20, 100));
//var str = JsonHelper.SerializeObject(prodParam);
var reUploadRst = submit_goods_edit(shop, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, isChanceApi, "edit");
if (!reUploadRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref reUploadRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = reUploadRst;
//if (BaseClass.SaLevel != 1 && 1 != 1)
// return "上传失败";
//return "上传失败 提交失败 " + error;
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 保存失败 " + error + " " + duration.ParseToInt() + "秒";
}));
}
return;
}
//Thread.Sleep(Randomx.GetId(4000, 8000));
if (!string.IsNullOrEmpty(activityErr))
{
//return "已上传 " + activityErr;
}
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
if (!string.IsNullOrEmpty(activityErr))
{
cell.Value = "已成功上传 " + activityErr + " " + duration.ParseToInt() + "秒";
}
else
{
cell.Value = "已成功上传" + " " + duration.ParseToInt() + "秒";
}
}));
}
}
/// <summary>
/// 20981 18586百万爆款 21365七折活动 23620临时活动 15996两件9块9活动(价格要求低于29.9元)
/// 所有活动: 22347直通车加权 20981长期报名入口 21365七折活动 15996两件9块9活动(价格要求低于29.9元) 18586百万爆款(需上架满一天) 23620临时活动(已结束)
/// </summary>
/// <param name="shop"></param>
/// <param name="prodParam"></param>
/// <returns></returns>
public string SignAcitvity(ShopLoginInfo shop, PDDProductUploadParam prodParam)
public string SignActivity(ShopLoginInfo shop, PDDProductUploadParam prodParam, bool sign22347 = true, bool sign20981 = true, bool sign21365 = true, bool sign15996 = true)
{
string activityErr = "";
//21365 7折活动
if (1 == 1)
if (1 == 1 && sign21365)
{
var activityRst2 = activity_goods_price_rule(shop, prodParam.goods_id.ParseToString(), 21365, 27);
if (!activityRst2.Contains("\"success\":true"))
@@ -2597,8 +2730,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
} //活动3
restoreSkuImg5:
//23620 临时活动
if (1 == 1)
//23620 临时活动 活动已结束,停止操作
if (1 == 2)
{
Thread.Sleep(Randomx.GetId(500, 1500));
var activityRst4 = activity_goods_price_rule(shop, prodParam.goods_id.ParseToString(), 23620, 27);
@@ -2705,108 +2838,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
} //活动4
restoreSkuImg4:
// 20981
if (1 == 1)
// 20981 长期活动
if (1 == 1 && sign20981)
{
Thread.Sleep(Randomx.GetId(500, 1500));
var activityRst1 = activity_goods_info(shop, prodParam.goods_id.ParseToString(), "20981");
if (!activityRst1.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref activityRst1, "error_msg");
if (string.IsNullOrEmpty(error))
error = activityRst1;
activityErr += "\r\n上传错误 981查询失败 " + error;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
goto restoreSkuImg1;
}
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();
if (pddActivitiInfo == null)
{
activityErr += "\r\n上传错误 981查询/新建失败 商品未提交成功或不满足参加活动条件";
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
goto restoreSkuImg1;
}
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);
var sku = prodParam.skus.FirstOrDefault(sk => string.Join(",", sk.spec.Select(s => s.spec_name)) == activitySku.sku_name);
if (sku == null || sku.multi_price > activitySku.suggest_price)
{
activityErr += "\r\n上传错误 981价格低于产品价 " + activitySku.suggest_price + " < " + sku.multi_price;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
goto restoreSkuImg1;
}
}
PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam();
actSubmitParam.activity_id = pddActivitiInfo.activity_id;
actSubmitParam.enroll_source_ctx.enroll_type = 34;
actSubmitParam.enroll_source_ctx.scene_full_coverage = "mmsActQuickEnrollMultiActivityRealTableV1";
actSubmitParam.enroll_source_ctx.source_type = "OwnHome_MultiActEnrollMMS";
actSubmitParam.enroll_source_ctx.scene_type = null;
var goods_vo_item = new goods_vo_param();
goods_vo_item.goods_id = prodParam.goods_id;
var skuSamePrice = prodParam.skus.Max(s => s.multi_price);
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);
var sku = prodParam.skus.FirstOrDefault(sk => string.Join(",", sk.spec.Select(s => s.spec_name)) == activitySku.sku_name);
if (sku == null)
{
activityErr += "\r\n上传错误 981价格sku未找到";
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
goto restoreSkuImg1;
}
create_sku_vo_param sku_vo_item = new create_sku_vo_param();
sku_vo_item.sku_id = activitySku.sku_id;
sku_vo_item.sku_activity_price = sku.multi_price; //skuSamePrice; //sku.multi_price; //activitySku.suggest_price;
sku_vo_item.sku_front_ctx_vo = new sku_front_ctx_vo_param()
{
filling_sku_price = sku.multi_price, //skuSamePrice, //sku.multi_price, //activitySku.suggest_price,
gear_rule = activitySku.gear_rule,
require_price = sku.multi_price, //skuSamePrice, //sku.multi_price, //activitySku.suggest_price,
};
goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item);
}
actSubmitParam.goods_volist.Add(goods_vo_item);
actSubmitParam.create_protocol_vo.need_create_cost_template = true;
var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 20981, 0);
var err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (!addActivityRst.Contains("\"success\":true") || !string.IsNullOrEmpty(err_msg))
{
var error = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = addActivityRst;
activityErr += "\r\n上传错误 981新建失败 " + error;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
goto restoreSkuImg1;
}
} // 活动1
catch (Exception ex)
{
activityErr += "\r\n上传错误 981查询/新建失败 " + ex.Message;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
goto restoreSkuImg1;
}
activityErr += SignActivity20981(shop, prodParam);
goto restoreSkuImg1;
}
restoreSkuImg1:
//15996 9块9 (价格要求低于29.9元)
if (1 == 1 && !prodParam.skus.Any(s => s.multi_price > 2990))
if (1 == 1 && sign15996 && !prodParam.skus.Any(s => s.multi_price > 2990))
{
Thread.Sleep(Randomx.GetId(500, 1500));
var activityRst3 = activity_goods_price_rule(shop, prodParam.goods_id.ParseToString(), 15996, 18);
@@ -2907,6 +2948,308 @@ namespace TemuKJD.PDDForms.ProductSelectForms
} //活动3
restoreSkuImg3:
// 22347 直通车加权
if (1 == 1 && sign22347)
{
activityErr += SignActivity22347(shop, prodParam);
}
return activityErr;
}
/// <summary>
/// 通过直接获取商品测试设置20981活动
/// </summary>
/// <param name="shop"></param>
/// <param name="prodInfo"></param>
/// <returns></returns>
string SignActivity20981Test(ShopLoginInfo shop, PDDProductInfo prodInfo)
{
decimal ratio = 0.33m;
var prodParam = new PDDProductUploadParam();
prodParam.goods_id = prodInfo.detail.goods_id;
prodParam.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 * ratio).ParseToInt(),
out_sku_sn = skuInfo.out_sku_sn,
oversea_sku = skuInfo.oversea_sku,
price = (skuInfo.price * ratio).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 (prodParam.market_price < skuParam.price + 1000)
{
prodParam.market_price = skuParam.price + 1000;
prodParam.market_price_in_yuan = (prodParam.market_price * 0.01).ParseToString();
}
prodParam.skus.Add(skuParam);
}
return SignActivity20981(shop, prodParam);
}
string SignActivity20981(ShopLoginInfo shop, PDDProductUploadParam prodParam)
{
string activityErr = "";
Thread.Sleep(Randomx.GetId(500, 1500));
var activityRst1 = activity_goods_info(shop, prodParam.goods_id.ParseToString(), "20981");
if (!activityRst1.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref activityRst1, "error_msg");
if (string.IsNullOrEmpty(error))
error = activityRst1;
activityErr += "\r\n上传错误 981查询失败 " + error;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
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();
if (pddActivitiInfo == null)
{
activityErr += "\r\n上传错误 981查询/新建失败 商品未提交成功或不满足参加活动条件";
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
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);
var sku = prodParam.skus.FirstOrDefault(sk => string.Join(",", sk.spec.Select(s => s.spec_name)) == activitySku.sku_name);
if (sku == null || sku.multi_price > activitySku.suggest_price)
{
activityErr += "\r\n上传错误 981价格低于产品价 " + activitySku.suggest_price + " < " + sku.multi_price;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
}
PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam();
actSubmitParam.activity_id = pddActivitiInfo.activity_id;
actSubmitParam.enroll_source_ctx.enroll_type = 34; //入口1
//actSubmitParam.enroll_source_ctx.enroll_type = 3; //入口2
actSubmitParam.enroll_source_ctx.scene_full_coverage = "mmsActQuickEnrollMultiActivityRealTableV1"; //入口1
//actSubmitParam.enroll_source_ctx.scene_full_coverage = "mmsActBatchEnrollV1"; //入口2
actSubmitParam.enroll_source_ctx.source_type = "OwnHome_MultiActEnrollMMS"; //入口1
//actSubmitParam.enroll_source_ctx.source_type = "MMSActicon"; //入口2
actSubmitParam.enroll_source_ctx.scene_type = null; //入口1
//actSubmitParam.enroll_source_ctx.scene_type = "ActivityCard"; //入口2
var goods_vo_item = new goods_vo_param();
goods_vo_item.goods_id = prodParam.goods_id;
var skuSamePrice = prodParam.skus.Max(s => s.multi_price);
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);
var sku = prodParam.skus.FirstOrDefault(sk => string.Join(",", sk.spec.Select(s => s.spec_name)) == activitySku.sku_name);
if (sku == null)
{
activityErr += "\r\n上传错误 981价格sku未找到";
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
create_sku_vo_param sku_vo_item = new create_sku_vo_param();
sku_vo_item.sku_id = activitySku.sku_id;
sku_vo_item.sku_activity_price = sku.multi_price; //skuSamePrice; //sku.multi_price; //activitySku.suggest_price;
sku_vo_item.sku_front_ctx_vo = new sku_front_ctx_vo_param()
{
filling_sku_price = sku.multi_price, //skuSamePrice, //sku.multi_price, //activitySku.suggest_price,
gear_rule = activitySku.gear_rule,
require_price = sku.multi_price, //skuSamePrice, //sku.multi_price, //activitySku.suggest_price,
};
goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item);
}
actSubmitParam.goods_volist.Add(goods_vo_item);
actSubmitParam.create_protocol_vo.need_create_cost_template = true;
if (pddActivitiInfo.need_goods_activity_price == true)
actSubmitParam.goods_volist.FirstOrDefault().view_confirmed_goods_protocol_vo.confirm_hit_cut_price = true;
//var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 20981, 0);
var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 20981, 27);
var err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (err_msg.ParseToString().Contains("报名该活动需要签署降价补差协议,立即前往链接签署"))
{
Invoke(new Action(() =>
{
PDDShopLoginForm loginForm = new PDDShopLoginForm(shop);
loginForm.openType = EnumOpenType.manage;
loginForm.InitUrl = err_msg.Substring(err_msg.IndexOf("https://")); //"https://mms.pinduoduo.com/mallcenter/signProtocol/21";
loginForm.ShowDialog();
}));
addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 20981, 27);
err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
}
if (!addActivityRst.Contains("\"success\":true") || !string.IsNullOrEmpty(err_msg))
{
var error = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = addActivityRst;
activityErr += "\r\n上传错误 981新建失败 " + error;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
} // 活动1
catch (Exception ex)
{
activityErr += "\r\n上传错误 981查询/新建失败 " + ex.Message;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
return activityErr;
}
string SignActivity22347(ShopLoginInfo shop, PDDProductUploadParam prodParam)
{
string activityErr = "";
Thread.Sleep(Randomx.GetId(500, 1500));
var activityRst2 = activity_goods_price_rule(shop, prodParam.goods_id.ParseToString(), 22347, 27);
if (!activityRst2.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref activityRst2, "error_msg");
if (string.IsNullOrEmpty(error))
error = activityRst2;
activityErr += "\r\n上传错误 347查询失败 " + error;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
try
{
var jObj = JObject.Parse(activityRst2);
var jStr = JsonHelper.SerializeObject(jObj["result"]);
var pddActivitiPriceInfo = JsonHelper.DeserializeJsonToObject<PDDActivitySuggestPriceInfo>(jStr);
var pddActivitiPriceProd = pddActivitiPriceInfo.enroll_goods_rule_vos.FirstOrDefault();
if (pddActivitiPriceProd == null)
{
activityErr += "\r\n上传错误 347查询/新建失败 商品未提交成功或不满足参加活动条件";
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
foreach (var activitySkuInfo in pddActivitiPriceProd.enroll_rule_param.enroll_goods_big_sale_price.sku_info_list)
{
//var sku = prodParam.skus.FirstOrDefault(s => s.sku_id == activitySku.sku_id);
var sku = prodParam.skus.FirstOrDefault(sk => string.Join(",", sk.spec.Select(s => s.spec_name)) == activitySkuInfo.spec_info_str);
if (sku == null || sku.multi_price > activitySkuInfo.require_price)
{
activityErr += "\r\n上传错误 347价格低于产品价 " + activitySkuInfo.require_price + " < " + sku.multi_price;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
}
PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam();
actSubmitParam.activity_id = pddActivitiPriceInfo.activity_id;
actSubmitParam.enroll_source_ctx.enroll_type = 3;
actSubmitParam.enroll_source_ctx.scene_full_coverage = "mmsActBatchEnrollV1";
actSubmitParam.enroll_source_ctx.source_type = null;
actSubmitParam.enroll_source_ctx.scene_type = null;
var goods_vo_item = new goods_vo_param();
goods_vo_item.goods_id = prodParam.goods_id;
var skuSamePrice = prodParam.skus.Max(s => s.multi_price);
foreach (var activitySkuInfo in pddActivitiPriceProd.enroll_rule_param.enroll_goods_big_sale_price.sku_info_list)
{
//var sku = prodParam.skus.FirstOrDefault(s => s.sku_id == activitySku.sku_id);
var sku = prodParam.skus.FirstOrDefault(sk => string.Join(",", sk.spec.Select(s => s.spec_name)) == activitySkuInfo.spec_info_str);
if (sku == null)
{
activityErr += "\r\n上传错误 347价格sku未找到";
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
create_sku_vo_param sku_vo_item = new create_sku_vo_param();
sku_vo_item.sku_id = activitySkuInfo.sku_id;
sku_vo_item.sku_activity_price = sku.multi_price; //skuSamePrice; //sku.multi_price; //activitySku.suggest_price;
sku_vo_item.sku_front_ctx_vo = new sku_front_ctx_vo_param()
{
filling_sku_price = sku.multi_price,
gear_rule = activitySkuInfo.gear_rule,
require_price = sku.multi_price,
filling_sku_price_gear_rule = activitySkuInfo.filling_sku_price_gear_rule,
};
goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item);
}
actSubmitParam.goods_volist.Add(goods_vo_item);
actSubmitParam.create_protocol_vo.need_create_cost_template = true;
//if (pddActivitiInfo.need_goods_activity_price == true)
actSubmitParam.goods_volist.FirstOrDefault().view_confirmed_goods_protocol_vo.confirm_hit_cut_price = true;
var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 22347, 27);
var err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (err_msg.ParseToString().Contains("报名该活动需要签署降价补差协议,立即前往链接签署"))
{
Invoke(new Action(() =>
{
PDDShopLoginForm loginForm = new PDDShopLoginForm(shop);
loginForm.openType = EnumOpenType.manage;
loginForm.InitUrl = err_msg.Substring(err_msg.IndexOf("https://")); //"https://mms.pinduoduo.com/mallcenter/signProtocol/21";
loginForm.ShowDialog();
}));
addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 22347, 27);
err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
}
if (!addActivityRst.Contains("\"success\":true") || !string.IsNullOrEmpty(err_msg))
{
var error = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = addActivityRst;
activityErr += "\r\n上传错误 347新建失败 " + error;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
} // 活动1
catch (Exception ex)
{
activityErr += "\r\n上传错误 347查询/新建失败 " + ex.Message;
if (BaseClass.SaLevel != 1 && 1 != 1)
activityErr = "上传错误";
//goto restoreSkuImg1;
return activityErr;
}
return activityErr;
}
@@ -3643,7 +3986,7 @@ Content-Disposition: form-data; name=""pic_operations""
}
/// <summary>
/// 20981
/// 查询活动商品 20981
/// </summary>
/// <param name="shop"></param>
/// <param name="prodId"></param>
@@ -3685,6 +4028,8 @@ Content-Disposition: form-data; name=""pic_operations""
string refere = "https://mms.pinduoduo.com/act/goods_price/confirm?activityId=" + activityId +
"&activityType=" + activityType + "&from=chooseGoods&SourceType=MMSActicon&SceneType=ActivityCard";
if (activityId == 22347)
refere = "https://mms.pinduoduo.com/act/goods_price/confirm?activityId=" + activityId + "&activityType=" + activityType + "&from=chooseGoods";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && (result.Contains("当前请求频繁,请2小时后重试") || result.Contains("网络繁忙,请不要频繁操作") || result.Contains("您的店铺操作过于频繁,请稍后操作")); i++)
@@ -3727,6 +4072,15 @@ Content-Disposition: form-data; name=""pic_operations""
return result;
}
/// <summary>
/// 设置活动
/// </summary>
/// <param name="shop"></param>
/// <param name="actSubmitParam"></param>
/// <param name="prodId"></param>
/// <param name="activityId"></param>
/// <param name="activityType"></param>
/// <returns></returns>
private string add_activity_goods(ShopLoginInfo shop, PDDActivitySubmitParam actSubmitParam, string prodId, int activityId, int activityType)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
@@ -3738,7 +4092,15 @@ Content-Disposition: form-data; name=""pic_operations""
string refere = "https://mms.pinduoduo.com/act/goods_price/confirm?activityId=" + activityId +
"&activityType=" + activityType + "&from=chooseGoods&SourceType=MMSActicon&SceneType=ActivityCard";
if (activityId == 20981)
refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=" + activityId + "&SourceType=PROMO-OwnHome";
{
//refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=" + activityId + "&SourceType=PROMO-OwnHome";
//入口1
refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=20981&activityType=27&SourceType=PROMO-OwnHome";
//入口2
//refere = "https://mms.pinduoduo.com/act/goods_price/confirm?activityId=20981&activityType=27&from=chooseGoods&SourceType=MMSActicon&SceneType=ActivityCard";
}
if (activityId == 22347)
refere = "https://mms.pinduoduo.com/act/goods_price/confirm?activityId=22347&activityType=27&from=chooseGoods";
if (activityId == 18586)
refere = "https://mms.pinduoduo.com/act/sign?id=18586&pyramidActivityId=7&SourceType=PROMO-Pyramid&SceneType=Pyramid";
@@ -3757,6 +4119,32 @@ Content-Disposition: form-data; name=""pic_operations""
return result;
}
private string queryActivityGoodsEnabled(ShopLoginInfo shop, string prodId, int activityId, int canUse = 1)
{
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/activity/query/eligible/goods/listV2";
string body = @"{""activity_id"":""" + activityId + @""",""page_number"":1,""page_size"":50,""query_goods_from_excel"":false,""eligible"":" + canUse +
@",""goods_id_list"":[" + prodId + "]}";
string refere = "https://mms.pinduoduo.com/act/choose_goods/v2?id=" + activityId + "&SourceType=MMSActicon&SceneType=ActivityCard&chooseGoodsType=0";
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)
{
@@ -4295,6 +4683,10 @@ Content-Disposition: form-data; name=""pic_operations""
private void chkActivity_CheckedChanged(object sender, EventArgs e)
{
isActivityFake = chkActivity.Checked;
if (chkActivity.Checked)
{
chk15996.Checked = chk20981.Checked = chk21365.Checked = chk22347.Checked = true;
}
if (IsLoadComplate)
{
pddUploadRule.IsSignActivity = chkActivity.Checked;
@@ -4413,6 +4805,12 @@ Content-Disposition: form-data; name=""pic_operations""
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_upload_rule", pddUploadRule);
}
}
private void chkActivityDetail_CheckedChanged(object sender, EventArgs e)
{
if (!chk15996.Checked && !chk20981.Checked && !chk21365.Checked && !chk22347.Checked)
chkActivity.Checked = false;
}
}
public class AddPriceRule
@@ -24,7 +24,7 @@ namespace TemuKJD.PDDForms.ShopForms
public delegate void InfoReceivedHandler(string information);
public event InfoReceivedHandler OnInfoReceived;
public string getProduct(string sProdId, string supplierId)
public string getProduct(string sProdId, string supplierId, PDDProductInfo prodInfo = null, bool notSaveDb = false)
{
var prodId = sProdId.ParseToLong();
if (prodId <= 0)
@@ -266,93 +266,101 @@ namespace TemuKJD.PDDForms.ShopForms
string product_json = "{\"detail\":" + detail_json + ",\"size\":" + size_json + ",\"decoration\":" + decoration_json +
",\"material3\":" + material3_json + ",\"material1\":" + material1_json + ",\"property\":" + property_json + "}";
string main_img = product.image_url;
if (string.IsNullOrEmpty(main_img))
main_img = product.hd_thumb_url;
if (string.IsNullOrEmpty(main_img))
main_img = product.thumb_url;
if (string.IsNullOrEmpty(main_img))
main_img = (product.galleries?.FirstOrDefault()?.url).ParseToString().Replace("https://", "http://");
var url = BaseClass.BuildObjString("product/add_product");
if (isExist)
{
bool isCover = false;
MainForm.instance.Invoke(new Action(() =>
{
var ok = BaseMsgForm.ShowConfirm("产品库内已存在相同id商品,是否更新?").DialogResult;
if (ok == DialogResult.OK)
isCover = true;
}));
if (isCover)
url = BaseClass.BuildObjString("product/mdy_product");
else
return;
}
var data = Work.UserLogin.GetSignaturex() +
"&from_shop_id=" + shop.ShopId +
"&spu_id=" + product.goods_id.ParseToString() +
"&skc_id=" + product.goods_id.ParseToString() +
"&price_text=" + product.sku.Min(s => s.multi_price).ParseToInt() * 0.01m + "-" + product.sku.Max(s => s.multi_price).ParseToInt() * 0.01m +
"&main_cat_id=" + (product.cat_ids?.FirstOrDefault(c => c != null)).ParseToString() +
"&main_cat_name=" + HttpUtility.UrlEncode((product.cats?.FirstOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
"&cat_id=" + (product.cat_id).ParseToString() +
"&cat_name=" + HttpUtility.UrlEncode((product.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
"&ext_code=" + HttpUtility.UrlEncode(product.out_goods_sn, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(product.goods_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(product_json, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(size_json, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(main_img, Encoding.UTF8);
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"))
if (notSaveDb)
{
string msg = "选品商品保存失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
//OnInfoReceived(msg);
MainForm.instance.Invoke(new Action(() =>
{
BaseMsgForm.ShowError(msg);
}));
prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(product_json);
}
else
{
//OnInfoReceived("选品商品保存成功!" + success_err_msg);
MainForm.instance.Invoke(new Action(() =>
string main_img = product.image_url;
if (string.IsNullOrEmpty(main_img))
main_img = product.hd_thumb_url;
if (string.IsNullOrEmpty(main_img))
main_img = product.thumb_url;
if (string.IsNullOrEmpty(main_img))
main_img = (product.galleries?.FirstOrDefault()?.url).ParseToString().Replace("https://", "http://");
var url = BaseClass.BuildObjString("product/add_product");
if (isExist)
{
BaseMsgForm.ShowInfo("选品商品保存成功!" + success_err_msg);
}));
bool isCover = false;
MainForm.instance.Invoke(new Action(() =>
{
var ok = BaseMsgForm.ShowConfirm("产品库内已存在相同id商品,是否更新?").DialogResult;
if (ok == DialogResult.OK)
isCover = true;
}));
if (isCover)
url = BaseClass.BuildObjString("product/mdy_product");
else
return;
}
var data = Work.UserLogin.GetSignaturex() +
"&from_shop_id=" + shop.ShopId +
"&spu_id=" + product.goods_id.ParseToString() +
"&skc_id=" + product.goods_id.ParseToString() +
"&price_text=" + product.sku.Min(s => s.multi_price).ParseToInt() * 0.01m + "-" + product.sku.Max(s => s.multi_price).ParseToInt() * 0.01m +
"&main_cat_id=" + (product.cat_ids?.FirstOrDefault(c => c != null)).ParseToString() +
"&main_cat_name=" + HttpUtility.UrlEncode((product.cats?.FirstOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
"&cat_id=" + (product.cat_id).ParseToString() +
"&cat_name=" + HttpUtility.UrlEncode((product.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
"&ext_code=" + HttpUtility.UrlEncode(product.out_goods_sn, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(product.goods_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(product_json, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(size_json, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(main_img, Encoding.UTF8);
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"))
{
string msg = "选品商品保存失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
//OnInfoReceived(msg);
MainForm.instance.Invoke(new Action(() =>
{
BaseMsgForm.ShowError(msg);
}));
}
else
{
//OnInfoReceived("选品商品保存成功!" + success_err_msg);
MainForm.instance.Invoke(new Action(() =>
{
BaseMsgForm.ShowInfo("选品商品保存成功!" + success_err_msg);
}));
}
//// 创建 SaveFileDialog 的实例
//SaveFileDialog saveFileDialog = new SaveFileDialog();
//// 单线程单元(STA)模式运行文件对话框,否则会报错。
//System.Threading.Thread InvokeThread = new System.Threading.Thread(new System.Threading.ThreadStart(()=> {
// // 设置对话框的属性
// saveFileDialog.Title = "保存商品";
// saveFileDialog.Filter = "商品文件 (*.prd)|*.prd|所有文件 (*.*)|*.*"; // 过滤文件类型
// saveFileDialog.FileName = product.productId.ParseToString(); // 默认文件名
// saveFileDialog.DefaultExt = "txt"; // 默认文件扩展名
// // 显示对话框并获取结果
// if (saveFileDialog.ShowDialog() == DialogResult.OK)
// {
// // 用户点击了“保存”按钮,此时可以获取文件的路径
// string filePath = saveFileDialog.FileName;
// // 在这里处理文件保存逻辑,例如写入数据到文件
// System.IO.File.WriteAllText(filePath, result);
// //BaseMsgForm.ShowInfo("商品保存成功!");
// }
//}));
//InvokeThread.SetApartmentState(System.Threading.ApartmentState.STA);
//InvokeThread.Start();
//InvokeThread.Join();
}
//// 创建 SaveFileDialog 的实例
//SaveFileDialog saveFileDialog = new SaveFileDialog();
//// 单线程单元(STA)模式运行文件对话框,否则会报错。
//System.Threading.Thread InvokeThread = new System.Threading.Thread(new System.Threading.ThreadStart(()=> {
// // 设置对话框的属性
// saveFileDialog.Title = "保存商品";
// saveFileDialog.Filter = "商品文件 (*.prd)|*.prd|所有文件 (*.*)|*.*"; // 过滤文件类型
// saveFileDialog.FileName = product.productId.ParseToString(); // 默认文件名
// saveFileDialog.DefaultExt = "txt"; // 默认文件扩展名
// // 显示对话框并获取结果
// if (saveFileDialog.ShowDialog() == DialogResult.OK)
// {
// // 用户点击了“保存”按钮,此时可以获取文件的路径
// string filePath = saveFileDialog.FileName;
// // 在这里处理文件保存逻辑,例如写入数据到文件
// System.IO.File.WriteAllText(filePath, result);
// //BaseMsgForm.ShowInfo("商品保存成功!");
// }
//}));
//InvokeThread.SetApartmentState(System.Threading.ApartmentState.STA);
//InvokeThread.Start();
//InvokeThread.Join();
}
catch (Exception ex)
{
@@ -1336,7 +1336,7 @@ function getElementWithText(sText)
sku.multi_price = (numMinPrice.Value * 100).ParseToInt();
sku.price = sku.multi_price + 100;
}
var result = prodUserSelectForm.SignAcitvity(shop, prodParam);
var result = prodUserSelectForm.SignActivity(shop, prodParam);
Invoke(new Action(() =>
{
btnSignActivity.Text = "一键报名活动";