sku文字特效尝试

This commit is contained in:
wule committed 2026-04-05 14:52:49 +08:00
1 parent b62deb2e99
commit cd0e96918b
28 files changed
+1587 -550

No files matched your search

@@ -50,6 +50,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucPddSpecEdit2 = new TemuKJD.PDDForms.ProductSelectForms.UcPddSpecEdit();
this.panel4 = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.panel6 = new System.Windows.Forms.Panel();
this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
this.cmbSpec1 = new TemuKJD.UserComponent.UcComboBoxMutiSelect();
this.cmbSpec2 = new TemuKJD.UserComponent.UcComboBoxMutiSelect();
@@ -62,21 +63,21 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.txtMultiPrice = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx();
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.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSkuId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSpec1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSpec2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMultiPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colStock = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSkuImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
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.panel6 = new System.Windows.Forms.Panel();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -89,10 +90,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.panel4.SuspendLayout();
this.panel6.SuspendLayout();
this.flowLayoutPanel4.SuspendLayout();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).BeginInit();
this.panel6.SuspendLayout();
this.SuspendLayout();
//
// panel2
@@ -324,6 +325,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label3.TabIndex = 9;
this.label3.Text = "SKU列表:";
//
// panel6
//
this.panel6.Controls.Add(this.flowLayoutPanel4);
this.panel6.Location = new System.Drawing.Point(3, 203);
this.panel6.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.panel6.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(1250, 30);
this.panel6.TabIndex = 15;
//
// flowLayoutPanel4
//
this.flowLayoutPanel4.Controls.Add(this.cmbSpec1);
@@ -483,6 +494,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSpec2,
this.colMultiPrice,
this.colPrice,
this.colStock,
this.colSkuImgUrl,
this.colSkuImg,
this.colEditSkuImg,
@@ -498,78 +510,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick);
this.dgvDbProduct.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellValueChanged);
//
// colSelect
//
this.colSelect.FillWeight = 26F;
this.colSelect.HeaderText = "选";
this.colSelect.Name = "colSelect";
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Visible = false;
//
// colSkuId
//
this.colSkuId.HeaderText = "sku编号";
this.colSkuId.Name = "colSkuId";
this.colSkuId.Visible = false;
//
// colSpec1
//
this.colSpec1.HeaderText = "属性1";
this.colSpec1.Name = "colSpec1";
this.colSpec1.ReadOnly = true;
//
// colSpec2
//
this.colSpec2.HeaderText = "属性2";
this.colSpec2.Name = "colSpec2";
this.colSpec2.ReadOnly = true;
//
// colMultiPrice
//
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colMultiPrice.DefaultCellStyle = dataGridViewCellStyle3;
this.colMultiPrice.HeaderText = "拼单价";
this.colMultiPrice.Name = "colMultiPrice";
this.colMultiPrice.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// colPrice
//
this.colPrice.HeaderText = "单买价";
this.colPrice.Name = "colPrice";
this.colPrice.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// colSkuImgUrl
//
this.colSkuImgUrl.HeaderText = "sku预览图路径";
this.colSkuImgUrl.Name = "colSkuImgUrl";
this.colSkuImgUrl.ReadOnly = true;
this.colSkuImgUrl.Visible = false;
//
// colSkuImg
//
this.colSkuImg.FillWeight = 35F;
this.colSkuImg.HeaderText = "sku预览图";
this.colSkuImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colSkuImg.Name = "colSkuImg";
this.colSkuImg.ReadOnly = true;
this.colSkuImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
//
// colEditSkuImg
//
this.colEditSkuImg.FillWeight = 20F;
this.colEditSkuImg.HeaderText = "编辑";
this.colEditSkuImg.Name = "colEditSkuImg";
this.colEditSkuImg.ReadOnly = true;
this.colEditSkuImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colEditSkuImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colSkuSn
//
this.colSkuSn.HeaderText = "规格编码";
this.colSkuSn.Name = "colSkuSn";
this.colSkuSn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// panel5
//
this.panel5.Location = new System.Drawing.Point(3, 842);
@@ -652,15 +592,83 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSaveSkuLst.Text = "保存";
this.btnSaveSkuLst.Click += new System.EventHandler(this.btnSaveSkuLst_Click);
//
// panel6
// colSelect
//
this.panel6.Controls.Add(this.flowLayoutPanel4);
this.panel6.Location = new System.Drawing.Point(3, 203);
this.panel6.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.panel6.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(1250, 30);
this.panel6.TabIndex = 15;
this.colSelect.FillWeight = 26F;
this.colSelect.HeaderText = "选";
this.colSelect.Name = "colSelect";
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Visible = false;
//
// colSkuId
//
this.colSkuId.HeaderText = "sku编号";
this.colSkuId.Name = "colSkuId";
this.colSkuId.Visible = false;
//
// colSpec1
//
this.colSpec1.HeaderText = "属性1";
this.colSpec1.Name = "colSpec1";
this.colSpec1.ReadOnly = true;
//
// colSpec2
//
this.colSpec2.HeaderText = "属性2";
this.colSpec2.Name = "colSpec2";
this.colSpec2.ReadOnly = true;
//
// colMultiPrice
//
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colMultiPrice.DefaultCellStyle = dataGridViewCellStyle3;
this.colMultiPrice.HeaderText = "拼单价";
this.colMultiPrice.Name = "colMultiPrice";
this.colMultiPrice.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// colPrice
//
this.colPrice.HeaderText = "单买价";
this.colPrice.Name = "colPrice";
this.colPrice.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// colStock
//
this.colStock.FillWeight = 21F;
this.colStock.HeaderText = "库存";
this.colStock.Name = "colStock";
//
// colSkuImgUrl
//
this.colSkuImgUrl.HeaderText = "sku预览图路径";
this.colSkuImgUrl.Name = "colSkuImgUrl";
this.colSkuImgUrl.ReadOnly = true;
this.colSkuImgUrl.Visible = false;
//
// colSkuImg
//
this.colSkuImg.FillWeight = 36F;
this.colSkuImg.HeaderText = "sku预览图";
this.colSkuImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colSkuImg.Name = "colSkuImg";
this.colSkuImg.ReadOnly = true;
this.colSkuImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
//
// colEditSkuImg
//
this.colEditSkuImg.FillWeight = 21F;
this.colEditSkuImg.HeaderText = "编辑";
this.colEditSkuImg.Name = "colEditSkuImg";
this.colEditSkuImg.ReadOnly = true;
this.colEditSkuImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colEditSkuImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colSkuSn
//
this.colSkuSn.HeaderText = "规格编码";
this.colSkuSn.Name = "colSkuSn";
this.colSkuSn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// PDDDBProdEditDetailForm
//
@@ -693,11 +701,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel2.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.panel6.ResumeLayout(false);
this.flowLayoutPanel4.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).EndInit();
this.panel6.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -732,21 +740,22 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.Panel pnlSpec2;
private DevComponents.DotNetBar.PanelEx btnAddSpec2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSpec1;
private System.Windows.Forms.DataGridViewTextBoxColumn colSpec2;
private System.Windows.Forms.DataGridViewTextBoxColumn colMultiPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colSkuImg;
private System.Windows.Forms.DataGridViewLinkColumn colEditSkuImg;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuSn;
private System.Windows.Forms.Panel pnlCef;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel5;
public DevComponents.DotNetBar.PanelEx btnSaveSkuLst;
public DevComponents.DotNetBar.PanelEx btnRestoreAll;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSpec1;
private System.Windows.Forms.DataGridViewTextBoxColumn colSpec2;
private System.Windows.Forms.DataGridViewTextBoxColumn colMultiPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colStock;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colSkuImg;
private System.Windows.Forms.DataGridViewLinkColumn colEditSkuImg;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuSn;
}
}
@@ -469,6 +469,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
skuEditItem.spec.Count > 1 ? skuEditItem.spec[1].spec_name : "",
skuEditItem.multi_price * 0.01m,
skuEditItem.price * 0.01m,
skuEditItem.quantity,
skuEditItem.thumb_url,
DataGridViewExtension.defaultBitmap,
"编辑",
@@ -135,6 +135,9 @@
<metadata name="colPrice.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colStock.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSkuImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -35,6 +35,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdImgListForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnAdd = new DevComponents.DotNetBar.PanelEx();
this.chkUpdateTag = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnSearch = new DevComponents.DotNetBar.PanelEx();
this.pnlEmpty = new DevComponents.DotNetBar.PanelEx();
@@ -43,9 +44,20 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbGroupFilter = new System.Windows.Forms.ComboBox();
this.lblGroupFilter = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.panel3 = new System.Windows.Forms.Panel();
this.btnCancel = new DevComponents.DotNetBar.PanelEx();
this.btnAddEdit = new DevComponents.DotNetBar.PanelEx();
this.txtEditType = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.cmbEditGroup = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtEditUrl = new System.Windows.Forms.TextBox();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.panel2 = new System.Windows.Forms.Panel();
this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colDbId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colImgMd5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -56,11 +68,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAddTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMdyTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colUpdate = new System.Windows.Forms.DataGridViewLinkColumn();
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSelectImg = new System.Windows.Forms.DataGridViewLinkColumn();
this.col_delete = new System.Windows.Forms.DataGridViewLinkColumn();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -69,6 +80,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).BeginInit();
this.SuspendLayout();
@@ -84,6 +96,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnAdd);
this.splitContainer1.Panel1.Controls.Add(this.chkUpdateTag);
this.splitContainer1.Panel1.Controls.Add(this.btnSearch);
this.splitContainer1.Panel1.Controls.Add(this.pnlEmpty);
@@ -99,13 +112,38 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer1.SplitterDistance = 53;
this.splitContainer1.TabIndex = 3;
//
// btnAdd
//
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAdd.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAdd.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAdd.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAdd.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAdd.Location = new System.Drawing.Point(907, 15);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(77, 25);
this.btnAdd.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAdd.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAdd.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAdd.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAdd.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAdd.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAdd.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAdd.Style.GradientAngle = 90;
this.btnAdd.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAdd.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAdd.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAdd.TabIndex = 681;
this.btnAdd.Text = "新增图片";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// chkUpdateTag
//
this.chkUpdateTag.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkUpdateTag.AutoSize = true;
this.chkUpdateTag.Checked = true;
this.chkUpdateTag.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkUpdateTag.Location = new System.Drawing.Point(870, 17);
this.chkUpdateTag.Location = new System.Drawing.Point(790, 17);
this.chkUpdateTag.Name = "chkUpdateTag";
this.chkUpdateTag.Size = new System.Drawing.Size(111, 21);
this.chkUpdateTag.TabIndex = 671;
@@ -208,6 +246,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.panel3);
this.splitContainer2.Panel1.Controls.Add(this.pbLoading);
this.splitContainer2.Panel1.Controls.Add(this.panel2);
this.splitContainer2.Panel1.Controls.Add(this.dgvDbProduct);
@@ -221,6 +260,124 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer2.SplitterDistance = 458;
this.splitContainer2.TabIndex = 0;
//
// panel3
//
this.panel3.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel3.Controls.Add(this.btnCancel);
this.panel3.Controls.Add(this.btnAddEdit);
this.panel3.Controls.Add(this.txtEditType);
this.panel3.Controls.Add(this.label4);
this.panel3.Controls.Add(this.cmbEditGroup);
this.panel3.Controls.Add(this.label3);
this.panel3.Controls.Add(this.label2);
this.panel3.Controls.Add(this.txtEditUrl);
this.panel3.Location = new System.Drawing.Point(604, 55);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(336, 364);
this.panel3.TabIndex = 9;
this.panel3.Visible = false;
//
// btnCancel
//
this.btnCancel.CanvasColor = System.Drawing.SystemColors.Control;
this.btnCancel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCancel.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCancel.Location = new System.Drawing.Point(179, 307);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(48, 25);
this.btnCancel.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnCancel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnCancel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnCancel.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnCancel.Style.GradientAngle = 90;
this.btnCancel.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnCancel.TabIndex = 692;
this.btnCancel.Text = "取消";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnAddEdit
//
this.btnAddEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAddEdit.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAddEdit.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAddEdit.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAddEdit.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddEdit.Location = new System.Drawing.Point(230, 307);
this.btnAddEdit.Name = "btnAddEdit";
this.btnAddEdit.Size = new System.Drawing.Size(48, 25);
this.btnAddEdit.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddEdit.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddEdit.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddEdit.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAddEdit.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAddEdit.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAddEdit.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAddEdit.Style.GradientAngle = 90;
this.btnAddEdit.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddEdit.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddEdit.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddEdit.TabIndex = 685;
this.btnAddEdit.Text = "新增";
this.btnAddEdit.Click += new System.EventHandler(this.btnAddEdit_Click);
//
// txtEditType
//
this.txtEditType.Location = new System.Drawing.Point(54, 257);
this.txtEditType.Name = "txtEditType";
this.txtEditType.Size = new System.Drawing.Size(224, 23);
this.txtEditType.TabIndex = 656;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(51, 236);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17);
this.label4.TabIndex = 655;
this.label4.Text = "分类:";
//
// cmbEditGroup
//
this.cmbEditGroup.FormattingEnabled = true;
this.cmbEditGroup.Location = new System.Drawing.Point(54, 184);
this.cmbEditGroup.Name = "cmbEditGroup";
this.cmbEditGroup.Size = new System.Drawing.Size(224, 25);
this.cmbEditGroup.TabIndex = 654;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(51, 164);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 643;
this.label3.Text = "分组:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(51, 27);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(68, 17);
this.label2.TabIndex = 642;
this.label2.Text = "图片路径:";
this.label2.Visible = false;
//
// txtEditUrl
//
this.txtEditUrl.Location = new System.Drawing.Point(54, 47);
this.txtEditUrl.Multiline = true;
this.txtEditUrl.Name = "txtEditUrl";
this.txtEditUrl.Size = new System.Drawing.Size(224, 88);
this.txtEditUrl.TabIndex = 0;
//
// pbLoading
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
@@ -239,7 +396,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
| System.Windows.Forms.AnchorStyles.Right)));
this.panel2.Location = new System.Drawing.Point(44, 55);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(921, 364);
this.panel2.Size = new System.Drawing.Size(273, 364);
this.panel2.TabIndex = 8;
//
// dgvDbProduct
@@ -248,6 +405,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvDbProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvDbProduct.AutoRowNumber = true;
this.dgvDbProduct.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvDbProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvDbProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -271,11 +429,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_notes,
this.colAddTime,
this.colMdyTime,
this.colUpdate,
this.colEdit,
this.colSelectImg,
this.col_delete});
this.dgvDbProduct.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvDbProduct.Location = new System.Drawing.Point(4, 0);
this.dgvDbProduct.MultiSelectCheckBox = true;
this.dgvDbProduct.Name = "dgvDbProduct";
this.dgvDbProduct.ReadOnly = true;
this.dgvDbProduct.RowTemplate.Height = 23;
@@ -283,6 +443,31 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.TabIndex = 6;
this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick);
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(641, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(362, 25);
this.ucSplitPage1.TabIndex = 6;
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
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(1003, 25);
this.statusBar.TabIndex = 5;
//
// colSelect
//
this.colSelect.FillWeight = 26F;
@@ -360,14 +545,21 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colMdyTime.Name = "colMdyTime";
this.colMdyTime.ReadOnly = true;
//
// colUpdate
//
this.colUpdate.FillWeight = 60F;
this.colUpdate.HeaderText = "替换图片";
this.colUpdate.Name = "colUpdate";
this.colUpdate.ReadOnly = true;
this.colUpdate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colUpdate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colEdit
//
this.colEdit.FillWeight = 60F;
this.colEdit.HeaderText = "更新图片";
this.colEdit.HeaderText = "编辑链接";
this.colEdit.Name = "colEdit";
this.colEdit.ReadOnly = true;
this.colEdit.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colEdit.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colSelectImg
//
@@ -384,32 +576,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_delete.HeaderText = "删除";
this.col_delete.Name = "col_delete";
this.col_delete.ReadOnly = true;
this.col_delete.Visible = false;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(641, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(362, 25);
this.ucSplitPage1.TabIndex = 6;
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
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(1003, 25);
this.statusBar.TabIndex = 5;
//
// PDDDBProdImgListForm
//
@@ -418,6 +584,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.Controls.Add(this.splitContainer1);
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.KeyPreview = true;
this.Name = "PDDDBProdImgListForm";
this.Text = "商品替换sku图";
this.TitleText = "商品替换sku图";
@@ -433,6 +600,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).EndInit();
this.ResumeLayout(false);
@@ -454,6 +623,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private UserControls.UcSplitPage ucSplitPage1;
private UserControls.StatusBarUserControl statusBar;
private System.Windows.Forms.Panel panel2;
private UserComponent.UcCheckBox chkUpdateTag;
private DevComponents.DotNetBar.PanelEx btnAdd;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cmbEditGroup;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtEditUrl;
private System.Windows.Forms.TextBox txtEditType;
private DevComponents.DotNetBar.PanelEx btnAddEdit;
private DevComponents.DotNetBar.PanelEx btnCancel;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colDbId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgMd5;
@@ -464,9 +644,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn col_notes;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewLinkColumn colUpdate;
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewLinkColumn colSelectImg;
private System.Windows.Forms.DataGridViewLinkColumn col_delete;
private UserComponent.UcCheckBox chkUpdateTag;
}
}
@@ -32,7 +32,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
InitializeComponent();
this.dgvDbProduct.Columns["colSelectImg"].Visible = false;
this.dgvDbProduct.Columns["colUpdate"].Visible = true;
this.dgvDbProduct.Columns["colEdit"].Visible = true;
btnAdd.Visible = true;
}
public PDDDBProdImgListForm(string type = "manage")
@@ -42,13 +44,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (type == "manage")
{
this.dgvDbProduct.Columns["colSelectImg"].Visible = false;
this.dgvDbProduct.Columns["colUpdate"].Visible = true;
this.dgvDbProduct.Columns["colEdit"].Visible = true;
btnAdd.Visible = true;
chkUpdateTag.Visible = true;
}
else
{
this.dgvDbProduct.Columns["colSelectImg"].Visible = true;
this.dgvDbProduct.Columns["colUpdate"].Visible = false;
this.dgvDbProduct.Columns["colEdit"].Visible = false;
btnAdd.Visible = false;
chkUpdateTag.Visible = false;
}
}
@@ -109,7 +115,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
skuImg.notes,
skuImg.add_time.ToString("yy-MM-dd HH:mm"),
skuImg.mdy_time.ToString("yy-MM-dd HH:mm"),
"更新图片",
"替换图片",
"编辑链接",
"选择",
"删除",
"认领");
@@ -198,26 +205,30 @@ namespace TemuKJD.PDDForms.ProductSelectForms
string headerText = dgvDbProduct.Columns[e.ColumnIndex].HeaderText;
var dbId = dgvDbProduct.Rows[e.RowIndex].Cells["colDbId"].Value.ParseToString();
var dbProductImg = lstProdSkuImg.FirstOrDefault(p => p.id.ToString() == dbId);
var row = dgvDbProduct.Rows[e.RowIndex];
switch (headerText)
{
case "删除":
//if (BaseMsgForm.ShowConfirm("确定删除商品吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
// return;
if (BaseMsgForm.ShowConfirm("确定删除吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
return;
//DeleteProduct(dbId);
break;
case "编辑/详情":
//PDDDBProdEditNotesForm editForm = new PDDDBProdEditNotesForm(dbProduct);
//editForm.ShowDialog();
//dgvDbProduct.Rows[e.RowIndex].Cells["col_notes"].Value = dbProduct.notes;
//dgvDbProduct.Rows[e.RowIndex].Cells["col_ext_code"].Value = dbProduct.ext_code;
//dgvDbProduct.Rows[e.RowIndex].Cells["colHeadWords"].Value = dbProduct.head_words;
//dgvDbProduct.Rows[e.RowIndex].Cells["colEndWords"].Value = dbProduct.end_words;
//dgvDbProduct.Rows[e.RowIndex].Cells["colFissionWords"].Value = dbProduct.fission_words;
//dgvDbProduct.Rows[e.RowIndex].Cells["col_product_name"].Value = dbProduct.product_name;
case "编辑图片":
case "编辑链接":
panel3.Visible = true;
panel3.Tag = dbProductImg;
txtEditUrl.Text = dbProductImg.img_url;
txtEditType.Text = dbProductImg.img_type;
cmbEditGroup.Text = dbProductImg.img_group;
btnAddEdit.Text = "编辑";
break;
case "更新图片":
case "替换图片":
//if (row.Cells["colImgType"].Value.ParseToString() != "混淆图" && row.Cells["colGroup"].Value.ParseToString() != "混淆图")
UploadImg(dbProductImg);
//else
// SaveImg(dbProductImg);
break;
case "选择图片":
SelectDbImgId = dbId.ParseToInt();
@@ -236,6 +247,78 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
public void SaveImg(ProdSkuImg skuImg, bool isMdy = true)
{
pbLoading.Visible = true;
Task.Run(() =>
{
try
{
var img_url = skuImg.img_url;
string getImgError;
if (!img_url.Contains("wst.wxapp.tc.qq.com"))
img_url = img_url.Replace("https://", "http://");
var image = GetHtml.GetUrlImg(img_url, out getImgError);
string imgBase64 = "";
string imgMd5 = "";
if (image != null)
{
using (MemoryStream memoryStream = new MemoryStream())
{
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageBytes = memoryStream.ToArray();
imgBase64 = Convert.ToBase64String(imageBytes);
}
imgMd5 = BaseClass.GetMd5(imgBase64);
}
var url = BaseClass.BuildObjString("product/add_sku_img_replace");
if (isMdy)
url = BaseClass.BuildObjString("product/mdy_sku_img_replace");
var data = UserLogin.GetSignaturex();
if (isMdy)
data += "&db_id=" + skuImg.id;
data += "&img_base64=" + imgBase64;
data += "&img_md5=" + imgMd5;
data += "&img_url=" + img_url;
data += "&img_type=" + skuImg.img_type;
data += "&img_group=" + skuImg.img_group;
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"))
{
Invoke(new Action(() =>
{
BaseMsgForm.ShowError("商品sku图片替换失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
pbLoading.Visible = false;
}));
return;
}
else
{
skuImg.img_base64 = imgBase64;
skuImg.img_md5 = imgMd5;
}
}
catch (Exception ex)
{
BaseMsgForm.ShowError("打开自定义图片失败 " + ex.Message);
return;
}
Invoke(new Action(() =>
{
pbLoading.Visible = false;
panel3.Visible = false;
SearchDbSkuImg(this.ucSplitPage1.CurrentPage);
}));
});
}
public void UploadImg(ProdSkuImg skuImg)
{
string text = "";
@@ -299,7 +382,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
string img_md5 = BaseClass.GetMd5(imgBase64);
string img_url = "";
var img = UploadProdSkuImg(shop, imgBase64, chkUpdateTag.Checked? "mms-material-img" : "mms-goods-image");
var img = UploadProdSkuImg(shop, imgBase64, chkUpdateTag.Checked ? "mms-material-img" : "mms-goods-image");
if (!img.Contains("\"url\":\"https:") && !img.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref img, "error_msg");
@@ -310,7 +393,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
BaseMsgForm.ShowError("上传sku图片失败 " + error);
pbLoading.Visible = false;
}));
return ;
return;
}
else
{
@@ -566,6 +649,42 @@ Content-Disposition: form-data; name=""pic_operations""
//{"success":true,"error_code":1000000,"error_msg":null,"result":{"id":81055859859,"url_id":0,"mall_id":248737110,"name":"微信图片_20250926210854_2100_1","extension":"jpeg","url":"https://img.pddpic.com/mms-goods-image/2025-10-13/b0cf6e00-77f8-4c1e-b620-ef05f602801c.jpeg.a.jpeg","size":76528,"create_time":1760320860,"update_time":1760320860,"file_type":"pic","extra_info":{"video_cover_url":null,"duration":null,"height":1000,"width":1000,"size":76528,"f20_url":null,"f30_url":null,"transcode_info_dtomap":null,"format":null,"audio_type":null,"transcode_f30_url":null,"md5":null,"vid":null},"is_deleted":0,"tool_source":null,"out_video_url":null,"fail_reason":null,"create_source":1,"check_status":1,"check_uid":null,"check_uname":null,"check_comment":null,"check_time":null,"mall_name":"球球小小店铺55","all_count":0,"used_count":0,"reject_count":0,"same_file_mall_info_list":null}}
return result;
}
private void btnAdd_Click(object sender, EventArgs e)
{
panel3.Visible = true;
txtEditUrl.Text = "";
txtEditType.Text = "";
cmbEditGroup.Text = "";
btnAddEdit.Text = "新增";
}
private void btnCancel_Click(object sender, EventArgs e)
{
panel3.Visible = false;
}
private void btnAddEdit_Click(object sender, EventArgs e)
{
//add_sku_img_replace
if (btnAddEdit.Text == "新增")
{
var skuImg = new ProdSkuImg() { img_group = cmbEditGroup.Text, img_url = txtEditUrl.Text.Trim(), img_type = txtEditType.Text.Trim() };
SaveImg(skuImg, false);
}
else
{
var skuImg = panel3.Tag as ProdSkuImg;
if (skuImg != null)
{
skuImg.img_group = cmbEditGroup.Text;
skuImg.img_url = txtEditUrl.Text.Trim();
skuImg.img_type = txtEditType.Text.Trim();
SaveImg(skuImg);
}
}
}
}
public class ProdSkuImg
@@ -147,6 +147,9 @@
<metadata name="colMdyTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUpdate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colEdit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -405,13 +405,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (cmbHasReturn.Text.Trim() == "是")
data += "&standby3=1";
data += "&problem_prod_data=1";
else if (cmbHasReturn.Text.Trim() == "否")
data += "&standby3=is null";
data += "&problem_prod_data=is null";
else if (cmbHasReturn.Text.Trim() == "回传未拉回")
data += "&standby3=2";
data += "&problem_prod_data=2";
else if (!string.IsNullOrEmpty(cmbHasReturn.Text.Trim()))
data += "&standby3=" + cmbHasReturn.Text.Trim();
data += "&problem_prod_data=" + cmbHasReturn.Text.Trim();
}));
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -1964,7 +1964,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
pbLoading.Visible = false;
BaseMsgForm.ShowInfo("操作完成!数据回传 " + prodList.Count() + " 条数据,成功 " + prodList.Where(p => p.standby3 == "2").Count() + " 条");
BaseMsgForm.ShowInfo("操作完成!数据回传 " + prodList.Count() + " 条数据,成功 " + prodList.Where(p => p.problem_prod_data == "2").Count() + " 条");
}));
}, cancellationTokenSource.Token);
}
@@ -1979,7 +1979,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在回传 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count + " 成功:" + dbProdLst.Where(p => p.standby3 == "2").Count();
this.statusBar.lblTaskStatus.Text = "正在回传 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count + " 成功:" + dbProdLst.Where(p => p.problem_prod_data == "2").Count();
}));
var dbProd = PDDDBProdEditForm.GetPddProductDetail(prod.id.ParseToString());
@@ -2012,7 +2012,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var url3 = BaseClass.BuildPDDObjString("product/mdy_product");
var data3 = Work.UserLogin.GetSignaturex() +
"&spu_id=" + dbProd.spu_id +
"&standby3=" + 2;
"&problem_prod_data=" + 2;
var html = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url3, data3);
@@ -2022,8 +2022,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
else
{
prod.standby3 = "2";
dbProd.standby3 = "2";
prod.problem_prod_data = "2";
dbProd.problem_prod_data = "2";
}
}
Thread.Sleep(100);
@@ -2060,7 +2060,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
pbLoading.Visible = false;
BaseMsgForm.ShowInfo("操作完成!拉回数据回传 " + prodList.Count() + " 条数据,成功 " + prodList.Where(p => p.standby3 == "1").Count() + " 条");
BaseMsgForm.ShowInfo("操作完成!拉回数据回传 " + prodList.Count() + " 条数据,成功 " + prodList.Where(p => p.problem_prod_data == "1").Count() + " 条");
}));
}, cancellationTokenSource.Token);
}
@@ -2075,7 +2075,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在拉回回传 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count + " 成功:" + dbProdLst.Where(p => p.standby3 == "1").Count();
this.statusBar.lblTaskStatus.Text = "正在拉回回传 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count + " 成功:" + dbProdLst.Where(p => p.problem_prod_data == "1").Count();
}));
var dbProd = PDDDBProdEditForm.GetPddProductDetail(prod.id.ParseToString());
var rst = new WxProdFormConverter().JstPddConvertToWxOutServer(dbProd);
@@ -2090,7 +2090,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
continue;
}
if (dbProd.standby3 != "2")
if (dbProd.problem_prod_data != "2")
{
//continue;
}
@@ -2191,11 +2191,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// var urlFail = BaseClass.BuildPDDObjString("product/mdy_product");
// var dataFail = Work.UserLogin.GetSignaturex() +
// "&spu_id=" + dbProd.spu_id +
// "&standby3=" + 3;
// "&problem_prod_data=" + 3;
// var htmlFail = GetHtml.PostUtf8(urlFail, dataFail);
// prod.standby3 = "1";
// dbProd.standby3 = "1";
// prod.problem_prod_data = "1";
// dbProd.problem_prod_data = "1";
// continue;
// }
//}
@@ -2206,7 +2206,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var urlFail = BaseClass.BuildPDDObjString("product/mdy_product");
var dataFail = Work.UserLogin.GetSignaturex() +
"&spu_id=" + dbProd.spu_id +
"&standby3=" + 5;
"&problem_prod_data=" + 5;
var htmlFail = GetHtml.PostUtf8(urlFail, dataFail);
continue;
}
@@ -2216,11 +2216,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var url3 = BaseClass.BuildPDDObjString("product/mdy_product");
var data3 = Work.UserLogin.GetSignaturex() +
"&spu_id=" + dbProd.spu_id;
//if (dbProd.standby3 == "5" || dbProd.standby3 == "6")
// data3 += "&standby3=" + 6;
//if (dbProd.problem_prod_data == "5" || dbProd.problem_prod_data == "6")
// data3 += "&problem_prod_data=" + 6;
//else
// data3 += "&standby3=" + 1;
data3 += "&standby3=" + 6;
// data3 += "&problem_prod_data=" + 1;
data3 += "&problem_prod_data=" + 6;
var html = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url3, data3);
@@ -2229,8 +2229,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
else
{
prod.standby3 = "1";
dbProd.standby3 = "1";
prod.problem_prod_data = "1";
dbProd.problem_prod_data = "1";
}
}
catch
@@ -39,7 +39,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = 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.label21 = new System.Windows.Forms.Label();
this.txtAlpha = new System.Windows.Forms.TextBox();
this.chkRandomCompanyProd = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.label13 = new System.Windows.Forms.Label();
this.txtAddShippingFeeTimes = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.btnApiUpload = new DevComponents.DotNetBar.PanelEx();
@@ -56,8 +61,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.txtUpgradeVersionName = new System.Windows.Forms.TextBox();
this.chkUpgradeVersion = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnStop = new DevComponents.DotNetBar.PanelEx();
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);
@@ -92,6 +95,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.lblLowPriceSkuImg = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.line1 = new DevComponents.DotNetBar.Controls.Line();
this.line2 = new DevComponents.DotNetBar.Controls.Line();
this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnProdDb = new DevComponents.DotNetBar.PanelEx();
this.chkSkipQualification = new TemuKJD.UserComponent.UcCheckBox(this.components);
@@ -219,7 +224,12 @@ 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.label21);
this.ucGroupBoxEx2.Controls.Add(this.txtAlpha);
this.ucGroupBoxEx2.Controls.Add(this.chkRandomCompanyProd);
this.ucGroupBoxEx2.Controls.Add(this.label13);
this.ucGroupBoxEx2.Controls.Add(this.txtAddShippingFeeTimes);
this.ucGroupBoxEx2.Controls.Add(this.label12);
this.ucGroupBoxEx2.Controls.Add(this.btnApiUpload);
@@ -236,8 +246,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx2.Controls.Add(this.txtUpgradeVersionName);
this.ucGroupBoxEx2.Controls.Add(this.chkUpgradeVersion);
this.ucGroupBoxEx2.Controls.Add(this.btnStop);
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);
@@ -268,6 +276,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx2.Controls.Add(this.lblLowPriceSkuImg);
this.ucGroupBoxEx2.Controls.Add(this.label15);
this.ucGroupBoxEx2.Controls.Add(this.label11);
this.ucGroupBoxEx2.Controls.Add(this.line1);
this.ucGroupBoxEx2.Controls.Add(this.line2);
this.ucGroupBoxEx2.Location = new System.Drawing.Point(459, 2);
this.ucGroupBoxEx2.Name = "ucGroupBoxEx2";
this.ucGroupBoxEx2.Size = new System.Drawing.Size(1110, 140);
@@ -275,11 +285,52 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx2.TabStop = false;
this.ucGroupBoxEx2.Text = "商品上传";
//
// chk15996
//
this.chk15996.AutoSize = true;
this.chk15996.Location = new System.Drawing.Point(697, 62);
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.Location = new System.Drawing.Point(642, 62);
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);
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(827, 40);
this.label21.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(19, 17);
this.label21.TabIndex = 823;
this.label21.Text = "%";
//
// txtAlpha
//
this.txtAlpha.Location = new System.Drawing.Point(794, 37);
this.txtAlpha.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtAlpha.Name = "txtAlpha";
this.txtAlpha.Size = new System.Drawing.Size(33, 23);
this.txtAlpha.TabIndex = 822;
this.txtAlpha.Text = "2";
//
// chkRandomCompanyProd
//
this.chkRandomCompanyProd.Checked = true;
this.chkRandomCompanyProd.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkRandomCompanyProd.Location = new System.Drawing.Point(846, 111);
this.chkRandomCompanyProd.Location = new System.Drawing.Point(920, 11);
this.chkRandomCompanyProd.Name = "chkRandomCompanyProd";
this.chkRandomCompanyProd.Size = new System.Drawing.Size(87, 21);
this.chkRandomCompanyProd.TabIndex = 808;
@@ -287,6 +338,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkRandomCompanyProd.UseVisualStyleBackColor = true;
this.chkRandomCompanyProd.Visible = false;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(703, 40);
this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(92, 17);
this.label13.TabIndex = 821;
this.label13.Text = "替换图不透明度";
//
// txtAddShippingFeeTimes
//
this.txtAddShippingFeeTimes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@@ -341,7 +402,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(1031, 81);
this.btnUpload.Location = new System.Drawing.Point(1031, 71);
this.btnUpload.Name = "btnUpload";
this.btnUpload.Size = new System.Drawing.Size(66, 23);
this.btnUpload.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -363,7 +424,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(992, 43);
this.label7.Location = new System.Drawing.Point(1003, 61);
this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(20, 17);
@@ -373,7 +434,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtWaitSeconds
//
this.txtWaitSeconds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.txtWaitSeconds.Location = new System.Drawing.Point(960, 40);
this.txtWaitSeconds.Location = new System.Drawing.Point(971, 58);
this.txtWaitSeconds.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtWaitSeconds.Name = "txtWaitSeconds";
this.txtWaitSeconds.Size = new System.Drawing.Size(32, 23);
@@ -385,7 +446,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(906, 43);
this.label6.Location = new System.Drawing.Point(917, 61);
this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 17);
@@ -397,7 +458,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkUseExtCodePrice.AutoSize = true;
this.chkUseExtCodePrice.Checked = true;
this.chkUseExtCodePrice.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkUseExtCodePrice.Location = new System.Drawing.Point(780, 22);
this.chkUseExtCodePrice.Location = new System.Drawing.Point(776, 11);
this.chkUseExtCodePrice.Name = "chkUseExtCodePrice";
this.chkUseExtCodePrice.Size = new System.Drawing.Size(147, 21);
this.chkUseExtCodePrice.TabIndex = 717;
@@ -408,7 +469,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// pbUpgradeVersion
//
this.pbUpgradeVersion.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbUpgradeVersion.Location = new System.Drawing.Point(853, 80);
this.pbUpgradeVersion.Location = new System.Drawing.Point(853, 86);
this.pbUpgradeVersion.Name = "pbUpgradeVersion";
this.pbUpgradeVersion.Size = new System.Drawing.Size(25, 25);
this.pbUpgradeVersion.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@@ -421,7 +482,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.lblUpgradeVersion.AutoSize = true;
this.lblUpgradeVersion.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblUpgradeVersion.ForeColor = System.Drawing.SystemColors.HotTrack;
this.lblUpgradeVersion.Location = new System.Drawing.Point(799, 84);
this.lblUpgradeVersion.Location = new System.Drawing.Point(799, 90);
this.lblUpgradeVersion.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblUpgradeVersion.Name = "lblUpgradeVersion";
this.lblUpgradeVersion.Size = new System.Drawing.Size(56, 17);
@@ -433,7 +494,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(782, 84);
this.label3.Location = new System.Drawing.Point(782, 90);
this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(20, 17);
@@ -443,7 +504,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtUpgradeVersionAddPrice
//
this.txtUpgradeVersionAddPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtUpgradeVersionAddPrice.Location = new System.Drawing.Point(751, 81);
this.txtUpgradeVersionAddPrice.Location = new System.Drawing.Point(751, 87);
this.txtUpgradeVersionAddPrice.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtUpgradeVersionAddPrice.Name = "txtUpgradeVersionAddPrice";
this.txtUpgradeVersionAddPrice.Size = new System.Drawing.Size(31, 23);
@@ -455,7 +516,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(695, 84);
this.label5.Location = new System.Drawing.Point(695, 90);
this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 17);
@@ -465,7 +526,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtUpgradeVersionName
//
this.txtUpgradeVersionName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtUpgradeVersionName.Location = new System.Drawing.Point(607, 81);
this.txtUpgradeVersionName.Location = new System.Drawing.Point(607, 87);
this.txtUpgradeVersionName.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtUpgradeVersionName.Name = "txtUpgradeVersionName";
this.txtUpgradeVersionName.Size = new System.Drawing.Size(88, 23);
@@ -476,7 +537,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// chkUpgradeVersion
//
this.chkUpgradeVersion.AutoSize = true;
this.chkUpgradeVersion.Location = new System.Drawing.Point(531, 82);
this.chkUpgradeVersion.Location = new System.Drawing.Point(531, 88);
this.chkUpgradeVersion.Name = "chkUpgradeVersion";
this.chkUpgradeVersion.Size = new System.Drawing.Size(83, 21);
this.chkUpgradeVersion.TabIndex = 692;
@@ -490,7 +551,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(1031, 110);
this.btnStop.Location = new System.Drawing.Point(1031, 102);
this.btnStop.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(66, 23);
@@ -510,32 +571,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnStop.Text = "停止上传";
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// chk15996
//
this.chk15996.AutoSize = true;
this.chk15996.Location = new System.Drawing.Point(870, 52);
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.Location = new System.Drawing.Point(815, 52);
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.Location = new System.Drawing.Point(760, 52);
this.chk20981.Location = new System.Drawing.Point(587, 62);
this.chk20981.Name = "chk20981";
this.chk20981.Size = new System.Drawing.Size(62, 21);
this.chk20981.TabIndex = 680;
@@ -546,7 +585,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// chk22347
//
this.chk22347.AutoSize = true;
this.chk22347.Location = new System.Drawing.Point(705, 52);
this.chk22347.Location = new System.Drawing.Point(531, 62);
this.chk22347.Name = "chk22347";
this.chk22347.Size = new System.Drawing.Size(62, 21);
this.chk22347.TabIndex = 679;
@@ -559,7 +598,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkKeepChanceGoodsImg.AutoSize = true;
this.chkKeepChanceGoodsImg.Checked = true;
this.chkKeepChanceGoodsImg.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkKeepChanceGoodsImg.Location = new System.Drawing.Point(642, 22);
this.chkKeepChanceGoodsImg.Location = new System.Drawing.Point(640, 11);
this.chkKeepChanceGoodsImg.Name = "chkKeepChanceGoodsImg";
this.chkKeepChanceGoodsImg.Size = new System.Drawing.Size(135, 21);
this.chkKeepChanceGoodsImg.TabIndex = 669;
@@ -570,7 +609,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// pbSkuImg
//
this.pbSkuImg.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbSkuImg.Location = new System.Drawing.Point(810, 109);
this.pbSkuImg.Location = new System.Drawing.Point(810, 111);
this.pbSkuImg.Name = "pbSkuImg";
this.pbSkuImg.Size = new System.Drawing.Size(25, 25);
this.pbSkuImg.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@@ -582,7 +621,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.label19.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(743, 113);
this.label19.Location = new System.Drawing.Point(743, 115);
this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(20, 17);
@@ -592,7 +631,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtLowPriceSkuPrice
//
this.txtLowPriceSkuPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtLowPriceSkuPrice.Location = new System.Drawing.Point(711, 110);
this.txtLowPriceSkuPrice.Location = new System.Drawing.Point(711, 112);
this.txtLowPriceSkuPrice.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtLowPriceSkuPrice.Name = "txtLowPriceSkuPrice";
this.txtLowPriceSkuPrice.Size = new System.Drawing.Size(32, 23);
@@ -603,7 +642,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtLowPriceSkuName
//
this.txtLowPriceSkuName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtLowPriceSkuName.Location = new System.Drawing.Point(607, 110);
this.txtLowPriceSkuName.Location = new System.Drawing.Point(607, 112);
this.txtLowPriceSkuName.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtLowPriceSkuName.Name = "txtLowPriceSkuName";
this.txtLowPriceSkuName.Size = new System.Drawing.Size(50, 23);
@@ -615,7 +654,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(657, 113);
this.label18.Location = new System.Drawing.Point(657, 115);
this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(56, 17);
@@ -625,7 +664,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(658, 51);
this.txtAddTimesFake.Location = new System.Drawing.Point(658, 37);
this.txtAddTimesFake.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtAddTimesFake.Name = "txtAddTimesFake";
this.txtAddTimesFake.Size = new System.Drawing.Size(26, 23);
@@ -636,7 +675,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// chkActivity
//
this.chkActivity.AutoSize = true;
this.chkActivity.Location = new System.Drawing.Point(531, 52);
this.chkActivity.Location = new System.Drawing.Point(531, 38);
this.chkActivity.Name = "chkActivity";
this.chkActivity.Size = new System.Drawing.Size(135, 21);
this.chkActivity.TabIndex = 648;
@@ -648,7 +687,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(684, 54);
this.label17.Location = new System.Drawing.Point(684, 40);
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);
@@ -660,7 +699,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkUpperSizeSpec.AutoSize = true;
this.chkUpperSizeSpec.Checked = true;
this.chkUpperSizeSpec.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkUpperSizeSpec.Location = new System.Drawing.Point(531, 22);
this.chkUpperSizeSpec.Location = new System.Drawing.Point(531, 11);
this.chkUpperSizeSpec.Name = "chkUpperSizeSpec";
this.chkUpperSizeSpec.Size = new System.Drawing.Size(111, 21);
this.chkUpperSizeSpec.TabIndex = 635;
@@ -685,7 +724,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(944, 110);
this.btnClearDgv.Location = new System.Drawing.Point(944, 102);
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);
@@ -929,12 +968,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// chkChance
//
this.chkChance.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkChance.AutoSize = true;
this.chkChance.Checked = true;
this.chkChance.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkChance.Location = new System.Drawing.Point(1020, 17);
this.chkChance.Location = new System.Drawing.Point(1024, 17);
this.chkChance.Name = "chkChance";
this.chkChance.Size = new System.Drawing.Size(87, 21);
this.chkChance.Size = new System.Drawing.Size(77, 21);
this.chkChance.TabIndex = 556;
this.chkChance.Text = "调用新接口";
this.chkChance.UseVisualStyleBackColor = true;
@@ -943,7 +981,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// chkLowPriceSku
//
this.chkLowPriceSku.AutoSize = true;
this.chkLowPriceSku.Location = new System.Drawing.Point(531, 111);
this.chkLowPriceSku.Location = new System.Drawing.Point(531, 112);
this.chkLowPriceSku.Name = "chkLowPriceSku";
this.chkLowPriceSku.Size = new System.Drawing.Size(83, 21);
this.chkLowPriceSku.TabIndex = 660;
@@ -956,7 +994,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.lblLowPriceSkuImg.AutoSize = true;
this.lblLowPriceSkuImg.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblLowPriceSkuImg.ForeColor = System.Drawing.SystemColors.HotTrack;
this.lblLowPriceSkuImg.Location = new System.Drawing.Point(760, 113);
this.lblLowPriceSkuImg.Location = new System.Drawing.Point(760, 115);
this.lblLowPriceSkuImg.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblLowPriceSkuImg.Name = "lblLowPriceSkuImg";
this.lblLowPriceSkuImg.Size = new System.Drawing.Size(52, 17);
@@ -986,6 +1024,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label11.TabIndex = 536;
this.label11.Text = "元,单买加";
//
// line1
//
this.line1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.line1.Location = new System.Drawing.Point(530, 29);
this.line1.Name = "line1";
this.line1.Size = new System.Drawing.Size(316, 10);
this.line1.TabIndex = 836;
this.line1.Text = "line1";
//
// line2
//
this.line2.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.line2.Location = new System.Drawing.Point(531, 79);
this.line2.Name = "line2";
this.line2.Size = new System.Drawing.Size(315, 10);
this.line2.TabIndex = 837;
this.line2.Text = "line2";
//
// ucGroupBoxEx4
//
this.ucGroupBoxEx4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -2073,5 +2129,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.PictureBox pbShopLoading;
private DevComponents.DotNetBar.PanelEx btnProdDb;
private UserComponent.UcCheckBox chkRandomCompanyProd;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.TextBox txtAlpha;
private System.Windows.Forms.Label label13;
private DevComponents.DotNetBar.Controls.Line line1;
private DevComponents.DotNetBar.Controls.Line line2;
}
}
@@ -28,6 +28,7 @@ using AllBase.Model.Param.PDDProdParam;
using CefSharp;
using TemuKJD.BLL.PddApi;
using TemuKJD.WXForms.ProductForms;
using System.Drawing.Imaging;
namespace TemuKJD.PDDForms.ProductSelectForms
{
@@ -6717,6 +6718,7 @@ Content-Type: image/jpeg
}, cancellationTokenSource.Token);
}
void GetShopAndUpProduct(CancellationToken token)
{
NaiBa.Util.ConcurrentList<ShopLoginInfo> currentUpShopLst = new NaiBa.Util.ConcurrentList<ShopLoginInfo>();
@@ -6996,6 +6998,41 @@ Content-Type: image/jpeg
var pddApi = new PddApi(shop);
#region 获取sku替换图
string fakeImgUrl;
Image fakeImg = null;
if (chkActivity.Checked)
{
var url = BaseClass.BuildObjString("product/get_sku_replace_img_list_random");
var data = "";
data = UserLogin.GetSignaturex() +
"&page=" + 1 +
"&page_size=" + 1;
data += "&in_img_type=混淆图";
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
}
else
{
try
{
JObject jObj = JObject.Parse(html);
fakeImgUrl = jObj["data"].FirstOrDefault().ParseToString();
string getImgError = "";
if (!fakeImgUrl.Contains("wst.wxapp.tc.qq.com"))
fakeImgUrl = fakeImgUrl.Replace("https://", "http://");
fakeImg = GetHtml.GetUrlImg(fakeImgUrl, out getImgError);
}
catch
{
}
}
}
#endregion
// 主图
int cnt = 0;
string carousel_gallery = "";
@@ -7009,7 +7046,12 @@ Content-Type: image/jpeg
}));
string errMsg = "";
var imgBase64 = WXForms.ProductForms.WXDBProdUploadForm.GetImgBase64ForApi(out errMsg, img.url, false, false);
var imgBase64 = "";
float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f;
if (chkActivity.Checked)
imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, fakeImg, pbUpgradeVersion.Image, alpha);
else
imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, null);
if (!string.IsNullOrEmpty(errMsg))
{
return "主图初始化失败 " + errMsg;
@@ -7026,6 +7068,8 @@ Content-Type: image/jpeg
return "主图上传失败 " + errMsg;
}
carousel_gallery += "\"" + BaseRegex.GetStringJson(ref pddUpImgApiRst, "image_url") + "\",";
//break;
}
pddApi.Data["carousel_gallery"] = "[" + carousel_gallery.Trim(',') + "]";
@@ -7070,7 +7114,13 @@ Content-Type: image/jpeg
}));
string errMsg = "";
var imgBase64 = WXForms.ProductForms.WXDBProdUploadForm.GetImgBase64ForApi(out errMsg, img.url, false, false);
var imgBase64 = "";
float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f;
if (chkActivity.Checked)
imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, fakeImg, null, alpha);
else
imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, null);
if (!string.IsNullOrEmpty(errMsg))
{
return "详情图初始化失败 " + errMsg;
@@ -7087,12 +7137,18 @@ Content-Type: image/jpeg
return "详情图上传失败 " + errMsg;
}
detail_gallery += "\"" + BaseRegex.GetStringJson(ref pddUpImgApiRst, "image_url") + "\",";
//break;
}
pddApi.Data["detail_gallery"] = "[" + detail_gallery.Trim(',') + "]";
if (!string.IsNullOrEmpty(prodInfo.detail.goods_desc))
pddApi.Data["goods_desc"] = prodInfo.detail.goods_desc;
pddApi.Data["goods_name"] = prodInfo.detail.goods_name;
if (chkActivity.Checked)
{
//pddApi.Data["goods_name"] = new string(("精品家用好物很好的产品" + prodInfo.detail.goods_name).ToArray().OrderBy(x => Randomx.GetId(999999)).Take(30).ToArray());
}
Invoke(new Action(() =>
{
@@ -7333,61 +7389,160 @@ Content-Type: image/jpeg
}
#endregion
#region 生成一组正常加价后的sku
var skuApiString = "";
long? minPrice = 99999999;
long? maxPrice = 0;
int marketPrice = prodInfo.detail.market_price.ParseToInt();
List<sku_item> addPriceSkuInfoLst = new List<sku_item>();
foreach (var sku in prodInfo.detail.sku)
#region 生成一组高倍率加价后的sku
List<sku_item> addPriceFakeSkuInfoLst = new List<sku_item>();
Dictionary<string, string> skuFakeSpecNameDic1 = new Dictionary<string, string>();
Dictionary<string, string> skuFakeSpecNameDic2 = new Dictionary<string, string>();
int marketPriceFake = prodInfo.detail.market_price.ParseToInt();
{
var skuInfo = JsonHelper.DeserializeJsonToObject<sku_item>(JsonHelper.SerializeObject(sku));
skuInfo.is_onsale = skuInfo.is_onsale != null ? skuInfo.is_onsale : 1;
skuInfo.limit_quantity = 999; // 只入参999
// 厂商直采的上家缺货则保持缺货。
if (skuInfo.quantity != 0)
skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt();
var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
skuInfo.multi_price = (new_multi_price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
//skuInfo.price = (sku.price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (isAddMorePriceFirst) // 先加后乘
skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimes.Text.Trim().ParseToDecimal()).ParseToInt();
skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
// 阶梯式加价,如果命中则按阶梯式加价进行
if (isStepAddPrice)
var maxPrice1 = 0;
foreach (var sku in prodInfo.detail.sku)
{
foreach (var addPrice in lstAddPriceRule)
var skuInfo = JsonHelper.DeserializeJsonToObject<sku_item>(JsonHelper.SerializeObject(sku));
skuInfo.is_onsale = skuInfo.is_onsale != null ? skuInfo.is_onsale : 1;
skuInfo.limit_quantity = 999; // 只入参999
// 厂商直采的上家缺货则保持缺货。
if (skuInfo.quantity != 0)
skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt();
var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
skuInfo.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
//skuInfo.price = (sku.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (isAddMorePriceFirst) // 先加后乘
skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (marketPriceFake < skuInfo.price + 1000)
{
if (new_multi_price > addPrice.MoreThanPrice * 100 && new_multi_price <= addPrice.LessThanPrice * 100)
marketPriceFake = skuInfo.price.ParseToInt() + 1000;
//pddApi.Data["market_price"] = marketPriceFake;
}
//skuInfo.spec[0].spec_name = "黑色" + Randomx.GetId(1000);
//if (Randomx.GetId(3) == 1)
// skuInfo.spec[0].spec_name = "白色" + Randomx.GetId(1000);
//if (Randomx.GetId(3) == 2)
// skuInfo.spec[0].spec_name = "蓝色" + Randomx.GetId(1000);
//if (skuInfo.spec.Count > 1)
// skuInfo.spec[1].spec_name = "" + (Math.Abs(skuInfo.spec[1].spec_name.GetHashCode()) % 251 + 50) + "个 人买过 " +
// (Math.Abs(BaseClass.GetMd5(skuInfo.spec[1].spec_name).GetHashCode()) % 9001 + 3000) + "件" + skuInfo.spec[1].spec_name;
//else
// skuInfo.spec[0].spec_name = "" + (Math.Abs(skuInfo.spec[0].spec_name.GetHashCode()) % 251 + 50) + "个 人买过 " +
// (Math.Abs(BaseClass.GetMd5(skuInfo.spec[0].spec_name).GetHashCode()) % 9001 + 3000) + "件" + skuInfo.spec[0].spec_name;
if (skuInfo.spec.Count == 1)
{
if(skuInfo.spec[0].parent_name != "规格" )
skuInfo.spec.Add(new spec_item() { parent_name = "规格", spec_name = "默认规格" });
else
skuInfo.spec.Add(new spec_item() { parent_name = "款式", spec_name = "默认款式" });
}
if (skuInfo.spec.Count > 0)
{
if (skuFakeSpecNameDic1.Keys.Contains(skuInfo.spec[0].spec_name))
skuInfo.spec[0].spec_name = skuFakeSpecNameDic1[skuInfo.spec[0].spec_name];
else
{
if (isAddMorePriceFirst) // 先加后乘
skuInfo.multi_price = ((new_multi_price + addPrice.AddMorePrice * 100) * addPrice.AddPriceTimes).ParseToInt();
else
skuInfo.multi_price = (new_multi_price * addPrice.AddPriceTimes + addPrice.AddMorePrice * 100).ParseToInt();
skuInfo.price = skuInfo.multi_price + Math.Max(100, addPrice.SinglePriceAdd * 100).ParseToInt(); ;
break;
skuFakeSpecNameDic1[skuInfo.spec[0].spec_name] = skuInfo.spec[0].parent_name + (skuFakeSpecNameDic1.Keys.Count + 1);
skuInfo.spec[0].spec_name = skuFakeSpecNameDic1[skuInfo.spec[0].spec_name];
}
}
if (skuInfo.spec.Count > 1)
{
if (skuFakeSpecNameDic2.Keys.Contains(skuInfo.spec[1].spec_name))
skuInfo.spec[1].spec_name = skuFakeSpecNameDic2[skuInfo.spec[1].spec_name];
else
{
skuFakeSpecNameDic2[skuInfo.spec[1].spec_name] = "" + Randomx.GetId(50, 301) + "个 人买过 " + Randomx.GetId(3000, 12001) + "件 " +
skuInfo.spec[1].parent_name + (skuFakeSpecNameDic2.Keys.Count + 1);
skuInfo.spec[1].spec_name = skuFakeSpecNameDic2[skuInfo.spec[1].spec_name];
}
}
}
// 聚水潭商品 加邮费×倍率 放前面
//skuInfo.multi_price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
//skuInfo.price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
if (marketPrice < skuInfo.price + 1000)
if (maxPrice1 < skuInfo.multi_price)
maxPrice1 = skuInfo.multi_price.ParseToInt();
addPriceFakeSkuInfoLst.Add(skuInfo);
//break;
}
foreach (var sk in addPriceFakeSkuInfoLst)
{
marketPrice = skuInfo.price.ParseToInt() + 1000;
pddApi.Data["market_price"] = marketPrice;
sk.multi_price = maxPrice1;
sk.price = maxPrice1 + 100;
}
addPriceSkuInfoLst.Add(skuInfo);
}
#endregion
#region 生成一组正常加价后的sku
List<sku_item> addPriceSkuInfoLst = new List<sku_item>();
int marketPrice = prodInfo.detail.market_price.ParseToInt();
{
foreach (var sku in prodInfo.detail.sku)
{
var skuInfo = JsonHelper.DeserializeJsonToObject<sku_item>(JsonHelper.SerializeObject(sku));
skuInfo.is_onsale = skuInfo.is_onsale != null ? skuInfo.is_onsale : 1;
skuInfo.limit_quantity = 999; // 只入参999
// 厂商直采的上家缺货则保持缺货。
if (skuInfo.quantity != 0)
skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt();
var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
skuInfo.multi_price = (new_multi_price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
//skuInfo.price = (sku.price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (isAddMorePriceFirst) // 先加后乘
skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimes.Text.Trim().ParseToDecimal()).ParseToInt();
skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
// 阶梯式加价,如果命中则按阶梯式加价进行
if (isStepAddPrice)
{
foreach (var addPrice in lstAddPriceRule)
{
if (new_multi_price > addPrice.MoreThanPrice * 100 && new_multi_price <= addPrice.LessThanPrice * 100)
{
if (isAddMorePriceFirst) // 先加后乘
skuInfo.multi_price = ((new_multi_price + addPrice.AddMorePrice * 100) * addPrice.AddPriceTimes).ParseToInt();
else
skuInfo.multi_price = (new_multi_price * addPrice.AddPriceTimes + addPrice.AddMorePrice * 100).ParseToInt();
skuInfo.price = skuInfo.multi_price + Math.Max(100, addPrice.SinglePriceAdd * 100).ParseToInt(); ;
break;
}
}
}
// 聚水潭商品 加邮费×倍率 放前面
//skuInfo.multi_price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
//skuInfo.price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
if (marketPrice < skuInfo.price + 1000)
{
marketPrice = skuInfo.price.ParseToInt() + 1000;
//pddApi.Data["market_price"] = marketPrice;
}
addPriceSkuInfoLst.Add(skuInfo);
}
}
#endregion
// 报活动加价
if (chkActivity.Checked)
{
marketPrice = marketPriceFake;
addPriceSkuInfoLst = addPriceFakeSkuInfoLst;
}
// 市场价
pddApi.Data["market_price"] = marketPrice;
// 生成属性规格id
if (dbProd.product_get_type_text == "厂商直采")
{
PddApi PddGoodsSpecGetApi = new PddApi(shop);
@@ -7432,7 +7587,10 @@ Content-Type: image/jpeg
{
}
if (parent_id == 0)
{
parent_id = specNameDic.ToList()[j].Key;
specInfo.parent_name = specNameDic.ToList()[j].Value;
}
specInfo.parent_id = parent_id;
if (specNameIdMapDic.Keys.Contains(specInfo.spec_name + specInfo.parent_name))
@@ -7459,6 +7617,9 @@ Content-Type: image/jpeg
}
}
var skuApiString = "";
long? minPrice = 99999999;
long? maxPrice = 0;
Dictionary<string, string> skuImgDic = new Dictionary<string, string>();
// 拼接sku,计算最高价格和最低价格
for (int i = 0; i < addPriceSkuInfoLst.Count; i++)
@@ -7477,14 +7638,26 @@ Content-Type: image/jpeg
spec = spec.Trim(',');
string thumb_url = "";
if (skuImgDic.ContainsKey(addPriceSkuInfoLst[i].thumb_url))
if (!chkActivity.Checked && skuImgDic.ContainsKey(addPriceSkuInfoLst[i].thumb_url)) // 高价加商品每个sku规格写在图片上,各不相同
{
thumb_url = skuImgDic[addPriceSkuInfoLst[i].thumb_url];
}
else
{
string errMsg = "";
var imgBase64 = WXForms.ProductForms.WXDBProdUploadForm.GetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, false, false);
var imgBase64 = "";
float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f;
if (chkActivity.Checked)
{
//skuFakeSpecNameDic1
var text1 = skuFakeSpecNameDic1.FirstOrDefault(s => s.Value == addPriceSkuInfoLst[i].spec[0].spec_name).Key;
var text2 = skuFakeSpecNameDic2.FirstOrDefault(s => s.Value == addPriceSkuInfoLst[i].spec[1].spec_name).Key.Replace("无规格", "").Replace("默认规格", "");
//imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, "到手 " + text1 + " " + text2);
imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, text1 + " " + text2);
//imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha);
}
else
imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url);
if (!string.IsNullOrEmpty(errMsg))
{
return "初始化Sku图片错误 " + errMsg;
@@ -7847,6 +8020,168 @@ Content-Type: image/jpeg
//foreach (var spec_prop in prodInfo.property.sku_properties) ...
}
public static string PddGetImgBase64ForApi(out string errorMsg, string img_url, Image fakeImg = null, Image imgUp = null, float alpha = 0.05f, string text = "", int imgWidth = 0, int imgHeight = 0)
{
errorMsg = "";
string imgBase64 = "";
//-------------------------------------------------------------------------------------------------------------------------------------
//生成图片base64字符串
string getImgError;
if (!img_url.Contains("wst.wxapp.tc.qq.com"))
img_url = img_url.Replace("https://", "http://");
var image = GetHtml.GetUrlImg(img_url, out getImgError);
if (image == null)
image = new Bitmap(800, 800);
if (imgWidth == 0 || imgHeight == 0)
{
imgWidth = image.Width;
imgHeight = image.Height;
}
var imageBg = new Bitmap(imgWidth, imgHeight);
if (image == null || !string.IsNullOrEmpty(getImgError))
{
errorMsg = "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"初始化图片上传失败 " + getImgError + "\"}";
return "";
}
try
{
using (Graphics g = Graphics.FromImage(imageBg))
{
int x = 0;
int y = 0;
if (!string.IsNullOrEmpty(text))
y = 60;
g.Clear(Color.White);
//if (fakeImg != null)
//{
// x = 30;
// y = -30;
// g.RotateTransform((float)3);
//}
//x = (0.25 * imageBg.Width).ParseToInt();
//y = (0.25 * imageBg.Height).ParseToInt();
g.DrawImage(image, new Rectangle(x, y, (imageBg.Width * 1.0).ParseToInt(), (imageBg.Height * 1.0).ParseToInt()), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
//if (fakeImg != null)
//{
// g.RotateTransform((float)-3);
//}
if (fakeImg != null)
{
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
ColorMatrix colorMatrix = new ColorMatrix();
colorMatrix.Matrix33 = alpha; //0.05f; // 0到1之间,1为完全不透明,0为完全透明
ImageAttributes attributes = new ImageAttributes();
attributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
g.DrawImage(fakeImg, new Rectangle(0, 0, imageBg.Width, imageBg.Height), 0, 0, fakeImg.Width, fakeImg.Height, GraphicsUnit.Pixel, attributes);
if (imgUp != null)
// 将升级版图片绘制到sku图片上
g.DrawImage(imgUp, new Rectangle(0, imageBg.Height / 2, imageBg.Width, imageBg.Height / 2), 0, 0, imgUp.Width, imgUp.Height, GraphicsUnit.Pixel);
if (!string.IsNullOrEmpty(text))
{
//var textBg = Properties.Resources.up_spec_text;
//g.DrawImage(textBg, new Rectangle(0, 0, imageBg.Width, imageBg.Height), 0, 0, textBg.Width, textBg.Height, GraphicsUnit.Pixel);
//var text1 = "";
//var deltaX = 80;
//var colors = new List<Color> { Color.Red, Color.Blue, Color.Green, Color.DarkBlue, Color.DarkOrange, Color.DarkRed};
//foreach(var t in text)
//{
// text1 = "" + t;
// //Font font = new Font("宋体", 20f * imageBg.Height / 800, FontStyle.Regular);
// //Font font = new Font("华文琥珀", 22f * imageBg.Height / 800, FontStyle.Regular);
// int fontSize = Randomx.GetId(17, 25) * imageBg.Height / 800;
// Font font = new Font("微软雅黑", fontSize, FontStyle.Bold);
// SizeF textSize = g.MeasureString(text1, font);
// Brush textBrush = Brushes.Black;
// //textBrush = new SolidBrush(Color.FromArgb(0, 0, 0));
// textBrush = new SolidBrush(colors[Randomx.GetId(colors.Count)]);
// g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
// //RectangleF rectF = new RectangleF(90, imageBg.Height * 728 / 800, imageBg.Width - 80, imageBg.Height - 80);
// int yPos = imageBg.Height * 728 / 800 + Randomx.GetId(16) - 8;
// RectangleF rectF = new RectangleF(deltaX, yPos, deltaX + textSize.Width, yPos + textSize.Height);
// g.DrawString(text1.Trim(), font, textBrush, rectF);
// font = new Font("微软雅黑", fontSize, FontStyle.Regular);
// textBrush = new SolidBrush(colors[Randomx.GetId(colors.Count)]);
// rectF = new RectangleF(deltaX, yPos, deltaX + textSize.Width / 2, yPos + textSize.Height);
// g.DrawString(text1.Trim(), font, textBrush, rectF);
// deltaX += textSize.Width.ParseToInt();
//}
var textBg = Properties.Resources.up_spec_text;
g.DrawImage(textBg, new Rectangle(0, 0, imageBg.Width, imageBg.Height), 0, 0, textBg.Width, textBg.Height, GraphicsUnit.Pixel);
var text1 = "";
var deltaX = 180 * imageBg.Width / 800;
var colors = new List<Color> { Color.Red, Color.Blue, Color.Green, Color.DarkBlue, Color.DarkOrange, Color.DarkRed };
var line = 0;
var textCount = 0;
foreach (var t in text)
{
text1 = "" + t;
textCount++;
//Font font = new Font("宋体", 20f * imageBg.Height / 800, FontStyle.Regular);
//Font font = new Font("华文琥珀", 22f * imageBg.Height / 800, FontStyle.Regular);
int lineHeight = 76;
int fontSize = Randomx.GetId(45, 50) * imageBg.Height / 800;
if (text.Length >= 15)
{
fontSize = Randomx.GetId(30, 35) * imageBg.Height / 800;
lineHeight = 50;
}
Font font = new Font("微软雅黑", fontSize, FontStyle.Bold);
SizeF textSize = g.MeasureString(text1, font);
Brush textBrush = Brushes.Black;
//textBrush = new SolidBrush(Color.FromArgb(0, 0, 0));
textBrush = new SolidBrush(colors[Randomx.GetId(colors.Count)]);
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
//RectangleF rectF = new RectangleF(90, imageBg.Height * 728 / 800, imageBg.Width - 80, imageBg.Height - 80);
int yPos = line * lineHeight * imageBg.Height / 800 + imageBg.Height * 8 / 800 + (Randomx.GetId(16) - 8) * imageBg.Height / 800;
RectangleF rectF = new RectangleF(deltaX, yPos, deltaX + textSize.Width, yPos + textSize.Height);
g.DrawString(text1.Trim(), font, textBrush, rectF);
font = new Font("微软雅黑", fontSize, FontStyle.Regular);
textBrush = new SolidBrush(colors[Randomx.GetId(colors.Count)]);
rectF = new RectangleF(deltaX, yPos, deltaX + textSize.Width / 2, yPos + textSize.Height);
g.DrawString(text1.Trim(), font, textBrush, rectF);
deltaX += textSize.Width.ParseToInt();
if (/*textCount == 2 ||*/ deltaX > imageBg.Width - 80 * imageBg.Width / 800)
{
deltaX = 180 * imageBg.Width / 800;
line++;
}
}
}
}
}
using (MemoryStream memoryStream = new MemoryStream())
{
imageBg.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageBytes = memoryStream.ToArray();
imgBase64 = Convert.ToBase64String(imageBytes);
return imgBase64;
}
}
catch (Exception ex)
{
errorMsg = "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"修改图片失败 " + ex.Message + "\"}";
return imgBase64;
}
}
int WaitUploadTime = 10;
private void txtWaitSeconds_TextChanged(object sender, EventArgs e)
{