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

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

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ namespace AllBase
/// <summary> /// <summary>
/// 版本ID /// 版本ID
/// </summary> /// </summary>
public static int VersionCount = 723; public static int VersionCount = 725;
//public static int VersionCount = 613; //public static int VersionCount = 613;
/// <summary> /// <summary>
+1 -1
View File
@@ -109,7 +109,7 @@ namespace TemuKJD.KJDForms.AdminForms
SetForm(dbPriceMarkUpForm.Value); SetForm(dbPriceMarkUpForm.Value);
break; break;
case "认领待上传": case "认领待上传":
dbProductSelectListManageForm.Value.IsClientJit = false; dbProductSelectListManageForm.Value.ClientMode = DbProductSelectListManageForm.EnumClientMode.Admin;
SetForm(dbProductSelectListManageForm.Value); SetForm(dbProductSelectListManageForm.Value);
break; break;
case "库存上传": case "库存上传":
+1 -1
View File
@@ -62,7 +62,7 @@ namespace TemuKJD.KJDForms.JITForms
SetForm(dbProductListForm.Value); SetForm(dbProductListForm.Value);
break; break;
case "JIT商品上传": case "JIT商品上传":
dDbProductSelectListManageForm.Value.IsClientJit = true; dDbProductSelectListManageForm.Value.ClientMode = DbProductSelectListManageForm.EnumClientMode.ClientJit;
SetForm(dDbProductSelectListManageForm.Value); SetForm(dDbProductSelectListManageForm.Value);
break; break;
case "JIT商品核价": case "JIT商品核价":
+16 -8
View File
@@ -35,8 +35,10 @@
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("加入发货台"); System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("加入发货台");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("设置进货价"); System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("设置进货价");
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("商品认领"); System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("商品认领");
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("库存上传"); System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("库存记录");
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] { System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("商品上传");
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("库存上传");
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] {
treeNode1, treeNode1,
treeNode2, treeNode2,
treeNode3, treeNode3,
@@ -44,7 +46,9 @@
treeNode5, treeNode5,
treeNode6, treeNode6,
treeNode7, treeNode7,
treeNode8}); treeNode8,
treeNode9,
treeNode10});
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
@@ -149,12 +153,16 @@
treeNode6.Text = "设置进货价"; treeNode6.Text = "设置进货价";
treeNode7.Name = "商品认领"; treeNode7.Name = "商品认领";
treeNode7.Text = "商品认领"; treeNode7.Text = "商品认领";
treeNode8.Name = "库存上传"; treeNode8.Name = "库存记录";
treeNode8.Text = "库存上传"; treeNode8.Text = "库存记录";
treeNode9.Name = "商品管理"; treeNode9.Name = "商品上传";
treeNode9.Text = "商品管理"; treeNode9.Text = "商品上传";
treeNode10.Name = "库存上传";
treeNode10.Text = "库存上传";
treeNode11.Name = "商品管理";
treeNode11.Text = "商品管理";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode9}); treeNode11});
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tv.Size = new System.Drawing.Size(140, 521); this.tv.Size = new System.Drawing.Size(140, 521);
this.tv.TabIndex = 1; this.tv.TabIndex = 1;
+20 -8
View File
@@ -29,6 +29,9 @@ namespace TemuKJD.KJDForms.ProductForms
public Lazy<TemuAdsForm> temuAdsForm = new Lazy<TemuAdsForm>(); public Lazy<TemuAdsForm> temuAdsForm = new Lazy<TemuAdsForm>();
public Lazy<JoinDeliveryForm> joinDeliveryFrom = new Lazy<JoinDeliveryForm>(); public Lazy<JoinDeliveryForm> joinDeliveryFrom = new Lazy<JoinDeliveryForm>();
public Lazy<DbProductSelectListManageForm> productSelectListManageForm = new Lazy<DbProductSelectListManageForm>();
public Lazy<ProductThirdSelectListManageForm> productThirdSelectListManageForm = new Lazy<ProductThirdSelectListManageForm>();
public ProductForm() public ProductForm()
{ {
InitializeComponent(); InitializeComponent();
@@ -75,11 +78,11 @@ namespace TemuKJD.KJDForms.ProductForms
//如果是一级菜单,不做任何动作 //如果是一级菜单,不做任何动作
if (e.Node.Parent == null) return; if (e.Node.Parent == null) return;
new Thread(() => //new Thread(() =>
{ //{
Thread.Sleep(200); //Thread.Sleep(200);
Invoke(new Action(() => //Invoke(new Action(() =>
{ //{
switch (e.Node.Name) switch (e.Node.Name)
{ {
case "备货管理": case "备货管理":
@@ -103,12 +106,21 @@ namespace TemuKJD.KJDForms.ProductForms
case "商品认领": case "商品认领":
SetForm(userSelectDbProductForm.Value); SetForm(userSelectDbProductForm.Value);
break; break;
case "库存上传": case "库存记录":
SetForm(userSelectThirdProductForm.Value); SetForm(userSelectThirdProductForm.Value);
break; break;
case "商品上传":
productSelectListManageForm.Value.ClientMode = DbProductSelectListManageForm.EnumClientMode.Client;
SetForm(productSelectListManageForm.Value);
break;
case "库存上传":
productThirdSelectListManageForm.Value.ClientMode = ProductThirdSelectListManageForm.EnumClientMode.Client;
SetForm(productThirdSelectListManageForm.Value);
break;
} }
})); //}));
}).Start(); //}).Start();
} }
public void SetTvSelect(string name) public void SetTvSelect(string name)
@@ -34,7 +34,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{ {
public partial class DbProductSelectListManageForm : LRBaseForm public partial class DbProductSelectListManageForm : LRBaseForm
{ {
public bool IsClientJit { get; set; } = false; public enum EnumClientMode
{
Admin,
Client,
ClientJit,
}
public EnumClientMode ClientMode { get; set; } = EnumClientMode.Admin;
public CancellationTokenSource cancellationTokenSource { get; set; } = null; public CancellationTokenSource cancellationTokenSource { get; set; } = null;
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" }; List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
@@ -154,7 +161,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//ucSplitPage1.cmbPageSize.Items.Remove("1000"); //ucSplitPage1.cmbPageSize.Items.Remove("1000");
} }
if (BaseClass.SaLevel == 1 && !IsClientJit) if (BaseClass.SaLevel == 1 && ClientMode == EnumClientMode.Admin)
{ {
dgvSelectProduct.Columns["colSubSaNick"].Visible = true; dgvSelectProduct.Columns["colSubSaNick"].Visible = true;
chkShowDel.Visible = true; chkShowDel.Visible = true;
@@ -168,7 +175,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//chkSkuRandomPrice.Checked = true; //chkSkuRandomPrice.Checked = true;
} }
if (IsClientJit) if (ClientMode != EnumClientMode.Admin)
{ {
chkShowDel.Visible = true; chkShowDel.Visible = true;
btnReFission.Visible = true; btnReFission.Visible = true;
@@ -210,7 +217,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
} }
else else
{ {
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
{ {
foreach (DataGridViewRow row in dgvSelectProduct.Rows) foreach (DataGridViewRow row in dgvSelectProduct.Rows)
{ {
@@ -330,7 +337,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
dgvSelectProduct.Rows[rowIndex].Height = 60; dgvSelectProduct.Rows[rowIndex].Height = 60;
displayLoginStatusColor(dgvSelectProduct.Rows[rowIndex].Cells["colLogin"], dgvSelectProduct.Rows[rowIndex].Cells["colLogin"].Value.ParseToString()); displayLoginStatusColor(dgvSelectProduct.Rows[rowIndex].Cells["colLogin"], dgvSelectProduct.Rows[rowIndex].Cells["colLogin"].Value.ParseToString());
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
{ {
var clientShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == prodSelect.shop_id); var clientShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == prodSelect.shop_id);
if (clientShop == null || clientShop.jit_expire_time.IsNullOrEmpty() || clientShop.jit_expire_time < DateTime.Now.Date) if (clientShop == null || clientShop.jit_expire_time.IsNullOrEmpty() || clientShop.jit_expire_time < DateTime.Now.Date)
@@ -358,6 +365,9 @@ namespace TemuKJD.KJDForms.ProductSelectForms
pageCount = 1; pageCount = 1;
var url = BaseClass.BuildObjString("product/admin_get_user_select_product_list"); var url = BaseClass.BuildObjString("product/admin_get_user_select_product_list");
if (ClientMode != EnumClientMode.Admin)
url = BaseClass.BuildObjString("product/get_user_select_product_list");
var data = ""; var data = "";
Invoke(new Action(() => Invoke(new Action(() =>
{ {
@@ -378,8 +388,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
data += "&operate_sub_sa_name=" + BaseClass.UserName; data += "&operate_sub_sa_name=" + BaseClass.UserName;
if (chkNoSubSa.Checked) if (chkNoSubSa.Checked)
data += "&no_sub_sa=true"; data += "&no_sub_sa=true";
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
data += "&is_client_jit=true"; data += "&is_client_jit=true";
if (ClientMode != EnumClientMode.Admin)
{
string shopIds = string.Join(",", GlobalConfig.ShopLoginList.Where(s => !s.ShopId.IsNullOrEmpty()).Select(s => s.ShopId).Distinct()) ?? "default";
data += "&shop_ids=" + shopIds;
}
})); }));
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -440,7 +455,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var shopId = dgvSelectProduct.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString(); var shopId = dgvSelectProduct.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString();
var draftId = dgvSelectProduct.Rows[e.RowIndex].Cells["colDraftId"].Value.ParseToString(); var draftId = dgvSelectProduct.Rows[e.RowIndex].Cells["colDraftId"].Value.ParseToString();
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
{ {
var clientShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); var clientShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (clientShop == null || clientShop.jit_expire_time.IsNullOrEmpty() || clientShop.jit_expire_time < DateTime.Now.Date) if (clientShop == null || clientShop.jit_expire_time.IsNullOrEmpty() || clientShop.jit_expire_time < DateTime.Now.Date)
@@ -463,7 +478,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
break; break;
case "编辑备注": case "编辑备注":
DbProductSelectEditNotesForm editForm = new DbProductSelectEditNotesForm(dbSelectProduct); DbProductSelectEditNotesForm editForm = new DbProductSelectEditNotesForm(dbSelectProduct);
editForm.IsClientJit = this.IsClientJit; editForm.IsClientJit = (ClientMode == EnumClientMode.ClientJit);
editForm.ShowDialog(); editForm.ShowDialog();
dgvSelectProduct.Rows[e.RowIndex].Cells["colNotes"].Value = dbSelectProduct.notes; dgvSelectProduct.Rows[e.RowIndex].Cells["colNotes"].Value = dbSelectProduct.notes;
dgvSelectProduct.Rows[e.RowIndex].Cells["colUserNotes"].Value = dbSelectProduct.user_notes; dgvSelectProduct.Rows[e.RowIndex].Cells["colUserNotes"].Value = dbSelectProduct.user_notes;
@@ -483,7 +498,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
// 查看map映射列表 // 查看map映射列表
var url = BaseClass.BuildObjString("product/get_select_prod_db_id_map_draft_id_list"); var url = BaseClass.BuildObjString("product/get_select_prod_db_id_map_draft_id_list");
var data = UserLogin.GetSignaturex() + "&select_db_id=" + dbId; var data = UserLogin.GetSignaturex() + "&select_db_id=" + dbId;
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
data += "&is_client_jit=true"; data += "&is_client_jit=true";
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
@@ -522,7 +537,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
if (flag) if (flag)
{ {
if (!IsClientJit) if (ClientMode == EnumClientMode.Admin)
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
@@ -550,7 +565,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
case "进店": case "进店":
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
if (!IsClientJit) if (ClientMode == EnumClientMode.Admin)
{ {
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft"; //adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
@@ -574,7 +589,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
// 登录店铺 // 登录店铺
if (!IsClientJit) if (ClientMode == EnumClientMode.Admin)
{ {
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.login; shopLoginForm.openType = EnumOpenType.login;
@@ -673,7 +688,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var url = BaseClass.BuildObjString("product/del_select_product"); var url = BaseClass.BuildObjString("product/del_select_product");
var data = UserLogin.GetSignaturex() + var data = UserLogin.GetSignaturex() +
"&db_id=" + dbId; "&db_id=" + dbId;
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
data += "&is_client_jit=true"; data += "&is_client_jit=true";
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -696,11 +711,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
ShopLoginInfo GetShop(string shopId) ShopLoginInfo GetShop(string shopId)
{ {
ShopLoginInfo shop; ShopLoginInfo shop;
if (IsClientJit) if (ClientMode == EnumClientMode.Admin)
{
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
}
else
{ {
shop = shopLst.FirstOrDefault(s => s.ShopId == shopId); shop = shopLst.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null) if (shop == null)
@@ -708,6 +719,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
shop = AdminGetServerShop(shopId); shop = AdminGetServerShop(shopId);
} }
} }
else
{
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
}
if (shop == null) if (shop == null)
{ {
shop = new ShopLoginInfo() { ShopId = shopId }; shop = new ShopLoginInfo() { ShopId = shopId };
@@ -867,7 +882,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var empty_data = UserLogin.GetSignaturex() + var empty_data = UserLogin.GetSignaturex() +
"&db_id=" + prod.id + "&db_id=" + prod.id +
"&status=已清除"; "&status=已清除";
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
empty_data += "&is_client_jit=true"; empty_data += "&is_client_jit=true";
GetHtml.PostUtf8(empty_url, empty_data); GetHtml.PostUtf8(empty_url, empty_data);
} }
@@ -890,7 +905,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
if (result.Contains("登录过期") || result.Contains("Invalid Login State")) if (result.Contains("登录过期") || result.Contains("Invalid Login State"))
{ {
if (!IsClientJit) if (ClientMode == EnumClientMode.Admin)
AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false); AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
else else
ShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false); ShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
@@ -929,7 +944,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
"&up_spu_id=" + prod.spu_id + "&up_spu_id=" + prod.spu_id +
"&shop_id=" + prod.shop_id + "&shop_id=" + prod.shop_id +
"&status=" + prod.status; "&status=" + prod.status;
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
data += "&is_client_jit=true"; data += "&is_client_jit=true";
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
@@ -3375,7 +3390,7 @@ Content-Disposition: form-data; name=""sign""
var empty_data = UserLogin.GetSignaturex() + var empty_data = UserLogin.GetSignaturex() +
"&db_id=" + prod.id + "&db_id=" + prod.id +
"&status=已清除"; "&status=已清除";
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
empty_data += "&is_client_jit=true"; empty_data += "&is_client_jit=true";
GetHtml.PostUtf8(empty_url, empty_data); GetHtml.PostUtf8(empty_url, empty_data);
} }
@@ -3397,7 +3412,7 @@ Content-Disposition: form-data; name=""sign""
var data = UserLogin.GetSignaturex() + var data = UserLogin.GetSignaturex() +
"&db_id=" + prod.id; "&db_id=" + prod.id;
data += "&fission_product_name=" + GetHtml.UrlEncodeUtf8(fissionProductName.Trim()); data += "&fission_product_name=" + GetHtml.UrlEncodeUtf8(fissionProductName.Trim());
if (IsClientJit) if (ClientMode == EnumClientMode.ClientJit)
data += "&is_client_jit=true"; data += "&is_client_jit=true";
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -3641,7 +3656,7 @@ Content-Disposition: form-data; name=""sign""
case "已上传商品ID": case "已上传商品ID":
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
if (!IsClientJit) if (ClientMode == EnumClientMode.Admin)
{ {
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" + //adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
@@ -110,7 +110,7 @@
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.txtProdName = new System.Windows.Forms.TextBox(); this.txtProdName = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label(); this.lblUserNotes = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox(); this.pbLoading = new System.Windows.Forms.PictureBox();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
@@ -1035,7 +1035,7 @@
this.tableLayoutPanel1.Controls.Add(this.label3, 10, 0); this.tableLayoutPanel1.Controls.Add(this.label3, 10, 0);
this.tableLayoutPanel1.Controls.Add(this.label4, 12, 0); this.tableLayoutPanel1.Controls.Add(this.label4, 12, 0);
this.tableLayoutPanel1.Controls.Add(this.txtProdName, 11, 0); this.tableLayoutPanel1.Controls.Add(this.txtProdName, 11, 0);
this.tableLayoutPanel1.Controls.Add(this.label12, 18, 0); this.tableLayoutPanel1.Controls.Add(this.lblUserNotes, 18, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(2, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(2, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowCount = 2;
@@ -1254,16 +1254,16 @@
this.txtProdName.Size = new System.Drawing.Size(61, 23); this.txtProdName.Size = new System.Drawing.Size(61, 23);
this.txtProdName.TabIndex = 427; this.txtProdName.TabIndex = 427;
// //
// label12 // lblUserNotes
// //
this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.lblUserNotes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label12.AutoSize = true; this.lblUserNotes.AutoSize = true;
this.label12.Location = new System.Drawing.Point(952, 12); this.lblUserNotes.Location = new System.Drawing.Point(952, 12);
this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.lblUserNotes.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label12.Name = "label12"; this.lblUserNotes.Name = "lblUserNotes";
this.label12.Size = new System.Drawing.Size(56, 17); this.lblUserNotes.Size = new System.Drawing.Size(56, 17);
this.label12.TabIndex = 460; this.lblUserNotes.TabIndex = 460;
this.label12.Text = "用户备注"; this.lblUserNotes.Text = "用户备注";
// //
// splitContainer2 // splitContainer2
// //
@@ -1809,7 +1809,7 @@
private System.Windows.Forms.NumericUpDown numSkuRandomPrice; private System.Windows.Forms.NumericUpDown numSkuRandomPrice;
private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label11;
private UserComponent.UcCheckBox chkUploadProd; private UserComponent.UcCheckBox chkUploadProd;
private System.Windows.Forms.Label label12; private System.Windows.Forms.Label lblUserNotes;
private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label13;
private System.Windows.Forms.ComboBox cmbUserNotes; private System.Windows.Forms.ComboBox cmbUserNotes;
private System.Windows.Forms.ComboBox cmbNotes; private System.Windows.Forms.ComboBox cmbNotes;
@@ -36,6 +36,15 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
/// </summary> /// </summary>
public partial class ProductThirdSelectListManageForm : LRBaseForm public partial class ProductThirdSelectListManageForm : LRBaseForm
{ {
public enum EnumClientMode
{
Admin,
Client,
ClientJit,
}
public EnumClientMode ClientMode { get; set; } = EnumClientMode.Admin;
public CancellationTokenSource cancellationTokenSource { get; set; } = null; public CancellationTokenSource cancellationTokenSource { get; set; } = null;
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" }; List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
@@ -80,6 +89,34 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
ucSplitPage1.IsShowPageSize = true; // 可调整分页 ucSplitPage1.IsShowPageSize = true; // 可调整分页
tableLayoutPanel1.Width -= 86; tableLayoutPanel1.Width -= 86;
} }
if (ClientMode != EnumClientMode.Admin)
{
chkShowDel.Visible = true;
pbFissionSetting.Visible = true;
btnReFission.Visible = true;
cmbUserNotes.Visible = false;
lblUserNotes.Visible = false;
colUserNotes.Visible = false;
ucSplitPage1.IsShowPageSize = true;
var columnStyles = tableLayoutPanel1.ColumnStyles.Cast<ColumnStyle>().ToList();
columnStyles[columnStyles.Count - 1].SizeType = SizeType.Absolute;
columnStyles[columnStyles.Count - 1].Width = 0;
columnStyles[columnStyles.Count - 2].SizeType = SizeType.Absolute;
columnStyles[columnStyles.Count - 2].Width = 0;
int colsWidth = 0;
foreach (DataGridViewColumn col in dgvSelectProduct.Columns)
{
if (col.Visible)
{
colsWidth += col.Width;
}
}
if (dgvSelectProduct.Width - colsWidth - dgvSelectProduct.RowHeadersWidth > 0)
{
colOpResult.Width += dgvSelectProduct.Width - colsWidth - dgvSelectProduct.RowHeadersWidth;
}
}
} }
bool isFirst = true; bool isFirst = true;
@@ -249,6 +286,9 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
pageCount = 1; pageCount = 1;
var url = BaseClass.BuildObjString("product_third/admin_get_user_select_product_list"); var url = BaseClass.BuildObjString("product_third/admin_get_user_select_product_list");
if (ClientMode != EnumClientMode.Admin)
url = BaseClass.BuildObjString("product_third/get_user_select_product_list");
var data = ""; var data = "";
Invoke(new Action(() => Invoke(new Action(() =>
{ {
@@ -269,6 +309,11 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
data += "&operate_sub_sa_name=" + BaseClass.UserName; data += "&operate_sub_sa_name=" + BaseClass.UserName;
if (chkNoSubSa.Checked) if (chkNoSubSa.Checked)
data += "&no_sub_sa=true"; data += "&no_sub_sa=true";
if (ClientMode != EnumClientMode.Admin)
{
string shopIds = string.Join(",", GlobalConfig.ShopLoginList.Where(s => !s.ShopId.IsNullOrEmpty()).Select(s => s.ShopId).Distinct()) ?? "default";
data += "&shop_ids=" + shopIds;
}
})); }));
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -405,6 +450,8 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
if (flag) if (flag)
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
if (ClientMode == EnumClientMode.Admin)
{
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" + //adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" + adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
@@ -413,11 +460,24 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
adminLoginForm.WindowState = FormWindowState.Maximized; adminLoginForm.WindowState = FormWindowState.Maximized;
adminLoginForm.ShowDialog(); adminLoginForm.ShowDialog();
} }
else
{
ShopLoginForm loginForm = new ShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
loginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
draftId + "&from=productDraftList";
loginForm.openType = EnumOpenType.manage;
loginForm.WindowState = FormWindowState.Maximized;
loginForm.ShowDialog();
}
}
} }
break; break;
case "进店": case "进店":
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
if (ClientMode == EnumClientMode.Admin)
{
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft"; //adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/draft"; adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/draft";
@@ -425,15 +485,35 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
adminLoginForm.WindowState = FormWindowState.Maximized; adminLoginForm.WindowState = FormWindowState.Maximized;
adminLoginForm.ShowDialog(); adminLoginForm.ShowDialog();
} }
else
{
ShopLoginForm loginForm = new ShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
loginForm.InitUrl = "https://agentseller.temu.com/goods/draft";
loginForm.openType = EnumOpenType.manage;
loginForm.WindowState = FormWindowState.Maximized;
loginForm.ShowDialog();
}
}
break; break;
case "登录": case "登录":
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
// 登录店铺 // 登录店铺
if (ClientMode == EnumClientMode.Admin)
{
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.login; shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.SaveComplete += ShopLoginForm_SaveComplete; shopLoginForm.SaveComplete += ShopLoginForm_SaveComplete;
shopLoginForm.ShowDialog(); shopLoginForm.ShowDialog();
}
else
{
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.SaveComplete += ShopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
}
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows) foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
{ {
if (row.Cells["colSupplierId"].Value.ParseToString() == shop.ShopId) if (row.Cells["colSupplierId"].Value.ParseToString() == shop.ShopId)
@@ -552,17 +632,25 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
ShopLoginInfo GetShop(string shopId) ShopLoginInfo GetShop(string shopId)
{ {
var shop = shopLst.FirstOrDefault(s => s.ShopId == shopId); ShopLoginInfo shop;
if (ClientMode == EnumClientMode.Admin)
{
shop = shopLst.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null) if (shop == null)
{ {
shop = GetServerShopById(shopId); shop = GetServerShopById(shopId);
}
}
else
{
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
}
if (shop == null) if (shop == null)
{ {
shop = new ShopLoginInfo() { ShopId = shopId }; shop = new ShopLoginInfo() { ShopId = shopId };
shop.LoginStatus = "不存在"; shop.LoginStatus = "不存在";
} }
shopLst.Add(shop); shopLst.Add(shop);
}
return shop; return shop;
} }
@@ -732,7 +820,10 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
if (result.Contains("登录过期") || result.Contains("Invalid Login State")) if (result.Contains("登录过期") || result.Contains("Invalid Login State"))
{ {
if (ClientMode == EnumClientMode.Admin)
AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false); AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
else
ShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -2041,6 +2132,8 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
case "已上传商品ID": case "已上传商品ID":
{ {
var shop = GetShop(shopId); var shop = GetShop(shopId);
if (ClientMode == EnumClientMode.Admin)
{
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" + //adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" + adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
@@ -2049,6 +2142,17 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
adminLoginForm.WindowState = FormWindowState.Maximized; adminLoginForm.WindowState = FormWindowState.Maximized;
adminLoginForm.ShowDialog(); adminLoginForm.ShowDialog();
} }
else
{
ShopLoginForm loginForm = new ShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
loginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
draftId + "&from=productDraftList";
loginForm.openType = EnumOpenType.manage;
loginForm.WindowState = FormWindowState.Maximized;
loginForm.ShowDialog();
}
}
break; break;
default: default:
break; break;
@@ -34,6 +34,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdEditDetailForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdEditDetailForm));
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.pnlCef = new System.Windows.Forms.Panel();
this.pbLoading = new System.Windows.Forms.PictureBox(); this.pbLoading = new System.Windows.Forms.PictureBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
@@ -47,6 +48,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.ucPddSpecEdit2 = new TemuKJD.PDDForms.ProductSelectForms.UcPddSpecEdit(); this.ucPddSpecEdit2 = new TemuKJD.PDDForms.ProductSelectForms.UcPddSpecEdit();
this.panel4 = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
this.cmbSpec1 = new TemuKJD.UserComponent.UcComboBoxMutiSelect(); this.cmbSpec1 = new TemuKJD.UserComponent.UcComboBoxMutiSelect();
@@ -70,10 +72,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuImg = new System.Windows.Forms.DataGridViewImageColumn(); this.colSkuImg = new System.Windows.Forms.DataGridViewImageColumn();
this.colEditSkuImg = new System.Windows.Forms.DataGridViewLinkColumn(); this.colEditSkuImg = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSkuSn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colSkuSn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel5 = new System.Windows.Forms.Panel();
this.btnRestoreAll = new DevComponents.DotNetBar.PanelEx(); this.btnRestoreAll = new DevComponents.DotNetBar.PanelEx();
this.btnCancel = new DevComponents.DotNetBar.PanelEx(); this.btnCancel = new DevComponents.DotNetBar.PanelEx();
this.btnSaveSkuLst = new DevComponents.DotNetBar.PanelEx(); this.btnSaveSkuLst = new DevComponents.DotNetBar.PanelEx();
this.pnlCef = new System.Windows.Forms.Panel();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -85,6 +87,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();
this.pnlSpec2.SuspendLayout(); this.pnlSpec2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout(); this.flowLayoutPanel2.SuspendLayout();
this.panel4.SuspendLayout();
this.flowLayoutPanel4.SuspendLayout(); this.flowLayoutPanel4.SuspendLayout();
this.panel3.SuspendLayout(); this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).BeginInit();
@@ -99,14 +102,21 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(1, 33); this.panel2.Location = new System.Drawing.Point(1, 33);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1278, 666); this.panel2.Size = new System.Drawing.Size(1278, 686);
this.panel2.TabIndex = 1; this.panel2.TabIndex = 1;
// //
// pnlCef
//
this.pnlCef.Location = new System.Drawing.Point(5, 7);
this.pnlCef.Name = "pnlCef";
this.pnlCef.Size = new System.Drawing.Size(78, 49);
this.pnlCef.TabIndex = 9;
//
// pbLoading // pbLoading
// //
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None; this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue; this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(614, 6); this.pbLoading.Location = new System.Drawing.Point(614, 16);
this.pbLoading.Name = "pbLoading"; this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50); this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -118,7 +128,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// //
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Bottom; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer1.Location = new System.Drawing.Point(0, 62); this.splitContainer1.Location = new System.Drawing.Point(0, 82);
this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
// //
@@ -142,9 +152,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel1); this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel1);
this.flowLayoutPanel3.Controls.Add(this.pnlSpec2); this.flowLayoutPanel3.Controls.Add(this.pnlSpec2);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel2); this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel2);
this.flowLayoutPanel3.Controls.Add(this.label3); this.flowLayoutPanel3.Controls.Add(this.panel4);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel4); this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel4);
this.flowLayoutPanel3.Controls.Add(this.dgvDbProduct); this.flowLayoutPanel3.Controls.Add(this.dgvDbProduct);
this.flowLayoutPanel3.Controls.Add(this.panel5);
this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 0);
@@ -158,8 +169,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec1.Controls.Add(this.btnAddSpec1); this.pnlSpec1.Controls.Add(this.btnAddSpec1);
this.pnlSpec1.Controls.Add(this.label1); this.pnlSpec1.Controls.Add(this.label1);
this.pnlSpec1.Location = new System.Drawing.Point(3, 3); this.pnlSpec1.Location = new System.Drawing.Point(3, 3);
this.pnlSpec1.MinimumSize = new System.Drawing.Size(1250, 10);
this.pnlSpec1.Name = "pnlSpec1"; this.pnlSpec1.Name = "pnlSpec1";
this.pnlSpec1.Size = new System.Drawing.Size(204, 23); this.pnlSpec1.Size = new System.Drawing.Size(1250, 23);
this.pnlSpec1.TabIndex = 11; this.pnlSpec1.TabIndex = 11;
// //
// btnAddSpec1 // btnAddSpec1
@@ -203,12 +215,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel1.AutoSize = true; this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.ucPddSpecEdit1); this.flowLayoutPanel1.Controls.Add(this.ucPddSpecEdit1);
this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 29); this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 29);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel1.MaximumSize = new System.Drawing.Size(1240, 9999); this.flowLayoutPanel1.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(1240, 10); this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1240, 55); this.flowLayoutPanel1.Size = new System.Drawing.Size(1250, 55);
this.flowLayoutPanel1.TabIndex = 0; this.flowLayoutPanel1.TabIndex = 0;
this.flowLayoutPanel1.Tag = ""; this.flowLayoutPanel1.Tag = "";
// //
@@ -227,8 +239,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec2.Controls.Add(this.btnAddSpec2); this.pnlSpec2.Controls.Add(this.btnAddSpec2);
this.pnlSpec2.Controls.Add(this.label2); this.pnlSpec2.Controls.Add(this.label2);
this.pnlSpec2.Location = new System.Drawing.Point(3, 90); this.pnlSpec2.Location = new System.Drawing.Point(3, 90);
this.pnlSpec2.MinimumSize = new System.Drawing.Size(1250, 10);
this.pnlSpec2.Name = "pnlSpec2"; this.pnlSpec2.Name = "pnlSpec2";
this.pnlSpec2.Size = new System.Drawing.Size(204, 23); this.pnlSpec2.Size = new System.Drawing.Size(1250, 23);
this.pnlSpec2.TabIndex = 12; this.pnlSpec2.TabIndex = 12;
// //
// btnAddSpec2 // btnAddSpec2
@@ -272,12 +285,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel2.AutoSize = true; this.flowLayoutPanel2.AutoSize = true;
this.flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel2.Controls.Add(this.ucPddSpecEdit2); this.flowLayoutPanel2.Controls.Add(this.ucPddSpecEdit2);
this.flowLayoutPanel2.Location = new System.Drawing.Point(4, 116); this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 116);
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel2.MaximumSize = new System.Drawing.Size(1240, 9999); this.flowLayoutPanel2.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel2.MinimumSize = new System.Drawing.Size(1240, 10); this.flowLayoutPanel2.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(1240, 55); this.flowLayoutPanel2.Size = new System.Drawing.Size(1250, 55);
this.flowLayoutPanel2.TabIndex = 1; this.flowLayoutPanel2.TabIndex = 1;
// //
// ucPddSpecEdit2 // ucPddSpecEdit2
@@ -290,10 +303,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucPddSpecEdit2.Size = new System.Drawing.Size(295, 49); this.ucPddSpecEdit2.Size = new System.Drawing.Size(295, 49);
this.ucPddSpecEdit2.TabIndex = 0; this.ucPddSpecEdit2.TabIndex = 0;
// //
// panel4
//
this.panel4.Controls.Add(this.label3);
this.panel4.Location = new System.Drawing.Point(3, 177);
this.panel4.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(1250, 23);
this.panel4.TabIndex = 14;
//
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(5, 179); this.label3.Location = new System.Drawing.Point(1, 3);
this.label3.Margin = new System.Windows.Forms.Padding(5, 5, 3, 3); this.label3.Margin = new System.Windows.Forms.Padding(5, 5, 3, 3);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 17); this.label3.Size = new System.Drawing.Size(68, 17);
@@ -305,9 +327,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel4.Controls.Add(this.cmbSpec1); this.flowLayoutPanel4.Controls.Add(this.cmbSpec1);
this.flowLayoutPanel4.Controls.Add(this.cmbSpec2); this.flowLayoutPanel4.Controls.Add(this.cmbSpec2);
this.flowLayoutPanel4.Controls.Add(this.panel3); this.flowLayoutPanel4.Controls.Add(this.panel3);
this.flowLayoutPanel4.Location = new System.Drawing.Point(3, 202); this.flowLayoutPanel4.Location = new System.Drawing.Point(3, 203);
this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel4.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel4.Name = "flowLayoutPanel4"; this.flowLayoutPanel4.Name = "flowLayoutPanel4";
this.flowLayoutPanel4.Size = new System.Drawing.Size(1242, 31); this.flowLayoutPanel4.Size = new System.Drawing.Size(1250, 31);
this.flowLayoutPanel4.TabIndex = 13; this.flowLayoutPanel4.TabIndex = 13;
// //
// cmbSpec1 // cmbSpec1
@@ -454,11 +478,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuImg, this.colSkuImg,
this.colEditSkuImg, this.colEditSkuImg,
this.colSkuSn}); this.colSkuSn});
this.dgvDbProduct.Location = new System.Drawing.Point(5, 239); this.dgvDbProduct.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvDbProduct.Margin = new System.Windows.Forms.Padding(5, 3, 3, 3); this.dgvDbProduct.Location = new System.Drawing.Point(5, 237);
this.dgvDbProduct.Margin = new System.Windows.Forms.Padding(5, 0, 3, 3);
this.dgvDbProduct.Name = "dgvDbProduct"; this.dgvDbProduct.Name = "dgvDbProduct";
this.dgvDbProduct.RowTemplate.Height = 23; this.dgvDbProduct.RowTemplate.Height = 23;
this.dgvDbProduct.Size = new System.Drawing.Size(1230, 586); this.dgvDbProduct.Size = new System.Drawing.Size(1230, 600);
this.dgvDbProduct.TabIndex = 7; this.dgvDbProduct.TabIndex = 7;
this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick); this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick);
this.dgvDbProduct.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellValueChanged); this.dgvDbProduct.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellValueChanged);
@@ -535,6 +560,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuSn.Name = "colSkuSn"; this.colSkuSn.Name = "colSkuSn";
this.colSkuSn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.colSkuSn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
// //
// panel5
//
this.panel5.Location = new System.Drawing.Point(3, 843);
this.panel5.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(1250, 10);
this.panel5.TabIndex = 15;
//
// btnRestoreAll // btnRestoreAll
// //
this.btnRestoreAll.CanvasColor = System.Drawing.SystemColors.Control; this.btnRestoreAll.CanvasColor = System.Drawing.SystemColors.Control;
@@ -609,17 +642,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSaveSkuLst.Text = "保存"; this.btnSaveSkuLst.Text = "保存";
this.btnSaveSkuLst.Click += new System.EventHandler(this.btnSaveSkuLst_Click); this.btnSaveSkuLst.Click += new System.EventHandler(this.btnSaveSkuLst_Click);
// //
// pnlCef
//
this.pnlCef.Location = new System.Drawing.Point(5, 7);
this.pnlCef.Name = "pnlCef";
this.pnlCef.Size = new System.Drawing.Size(78, 49);
this.pnlCef.TabIndex = 9;
//
// PDDDBProdEditDetailForm // PDDDBProdEditDetailForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1280, 700); this.ClientSize = new System.Drawing.Size(1280, 720);
this.Controls.Add(this.panel2); this.Controls.Add(this.panel2);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
@@ -644,6 +670,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlSpec2.PerformLayout(); this.pnlSpec2.PerformLayout();
this.flowLayoutPanel2.ResumeLayout(false); this.flowLayoutPanel2.ResumeLayout(false);
this.flowLayoutPanel2.PerformLayout(); this.flowLayoutPanel2.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.flowLayoutPanel4.ResumeLayout(false); this.flowLayoutPanel4.ResumeLayout(false);
this.panel3.ResumeLayout(false); this.panel3.ResumeLayout(false);
this.panel3.PerformLayout(); this.panel3.PerformLayout();
@@ -695,5 +723,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuSn; private System.Windows.Forms.DataGridViewTextBoxColumn colSkuSn;
private DevComponents.DotNetBar.PanelEx btnRestoreAll; private DevComponents.DotNetBar.PanelEx btnRestoreAll;
private System.Windows.Forms.Panel pnlCef; private System.Windows.Forms.Panel pnlCef;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel5;
} }
} }
@@ -46,7 +46,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pbLoading.BringToFront(); this.pbLoading.BringToFront();
this.pbLoading.Location = new Point(this.pbLoading.Location.X, 300); this.pbLoading.Location = new Point(this.pbLoading.Location.X, 300);
this.ActiveControl = dgvDbProduct; this.ActiveControl = btnAddSpec1; // dgvDbProduct;
this.dgvDbProduct.AddImgColumn("colSkuImg", "colSkuImgUrl"); this.dgvDbProduct.AddImgColumn("colSkuImg", "colSkuImgUrl");
flowLayoutPanel1.Controls.Clear(); flowLayoutPanel1.Controls.Clear();
flowLayoutPanel2.Controls.Clear(); flowLayoutPanel2.Controls.Clear();
@@ -351,6 +351,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return; return;
var newSpec1 = JsonHelper.DeserializeJsonToObject<spec_item>(JsonHelper.SerializeObject(spec)); var newSpec1 = JsonHelper.DeserializeJsonToObject<spec_item>(JsonHelper.SerializeObject(spec));
// 防止spec名称重复
while (lstSkuEditItem.Any(s => s.spec.Any(sp => sp.spec_name == newSpec1.parent_name + this.addSpecIndex1)))
this.addSpecIndex1++;
newSpec1.spec_id = null; newSpec1.spec_id = null;
newSpec1.spec_name = newSpec1.parent_name + this.addSpecIndex1; newSpec1.spec_name = newSpec1.parent_name + this.addSpecIndex1;
AddSpec1(newSpec1); AddSpec1(newSpec1);
@@ -377,6 +380,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
newSku.price = null; newSku.price = null;
newSku.thumb_url = null; newSku.thumb_url = null;
newSku.thumb_url_file_id = null; newSku.thumb_url_file_id = null;
newSku.thumb_md5 = null;
newSku.multi_price = null; newSku.multi_price = null;
newSku.out_sku_sn = ""; newSku.out_sku_sn = "";
if (this.lstSkuEditItem.All(s => s.spec.Count == 1)) if (this.lstSkuEditItem.All(s => s.spec.Count == 1))
@@ -396,6 +400,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return; return;
var newSpec2 = JsonHelper.DeserializeJsonToObject<spec_item>(JsonHelper.SerializeObject(spec)); var newSpec2 = JsonHelper.DeserializeJsonToObject<spec_item>(JsonHelper.SerializeObject(spec));
// 防止spec名称重复
while (lstSkuEditItem.Any(s => s.spec.Any(sp => sp.spec_name == newSpec2.parent_name + this.addSpecIndex1)))
this.addSpecIndex1++;
newSpec2.spec_id = null; newSpec2.spec_id = null;
newSpec2.spec_name = newSpec2.parent_name + this.addSpecIndex2; newSpec2.spec_name = newSpec2.parent_name + this.addSpecIndex2;
AddSpec2(newSpec2); AddSpec2(newSpec2);
@@ -698,6 +705,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void btnSaveSkuLst_Click(object sender, EventArgs e) private void btnSaveSkuLst_Click(object sender, EventArgs e)
{ {
// 焦点移动到别的控件上自动更新表格内的数值
this.ActiveControl = btnSaveSkuLst;
if (this.lstSkuEditItem.Any(s => s.multi_price.ParseToDecimal() == 0 || s.price.ParseToDecimal() == 0)) if (this.lstSkuEditItem.Any(s => s.multi_price.ParseToDecimal() == 0 || s.price.ParseToDecimal() == 0))
{ {
BaseMsgForm.ShowError("价格不能为 0"); BaseMsgForm.ShowError("价格不能为 0");
@@ -708,6 +718,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
BaseMsgForm.ShowError("单买价低于拼单价加 1 元"); BaseMsgForm.ShowError("单买价低于拼单价加 1 元");
return; return;
} }
if (this.lstSkuEditItem.Any(s => s.thumb_url.IsNullOrEmpty() && s.thumb_md5.IsNullOrEmpty()))
{
BaseMsgForm.ShowError("sku图片不能为空");
return;
}
var url = BaseClass.BuildObjString("product/mdy_db_product"); var url = BaseClass.BuildObjString("product/mdy_db_product");
var data = UserLogin.GetSignaturex() + var data = UserLogin.GetSignaturex() +
@@ -53,7 +53,6 @@
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX(); this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
this.btnOk = new TemuKJD.UserControls.ButtonEx(); this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.btnTest = new DevComponents.DotNetBar.PanelEx();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -62,7 +61,6 @@
// panel2 // panel2
// //
this.panel2.BackColor = System.Drawing.Color.White; this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.btnTest);
this.panel2.Controls.Add(this.btnEditDetail); this.panel2.Controls.Add(this.btnEditDetail);
this.panel2.Controls.Add(this.btnSelect); this.panel2.Controls.Add(this.btnSelect);
this.panel2.Controls.Add(this.buttonEx1); this.panel2.Controls.Add(this.buttonEx1);
@@ -371,30 +369,6 @@
this.btnOk.UseVisualStyleBackColor = false; this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click); this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
// //
// btnTest
//
this.btnTest.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnTest.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnTest.DisabledBackColor = System.Drawing.Color.Empty;
this.btnTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTest.Location = new System.Drawing.Point(317, 18);
this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(85, 26);
this.btnTest.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnTest.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnTest.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnTest.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnTest.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnTest.Style.GradientAngle = 90;
this.btnTest.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnTest.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnTest.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnTest.TabIndex = 654;
this.btnTest.Text = "测试";
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
//
// PDDDBProdEditForm // PDDDBProdEditForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -441,6 +415,5 @@
private UserControls.ButtonEx buttonEx1; private UserControls.ButtonEx buttonEx1;
private UserControls.ButtonEx btnSelect; private UserControls.ButtonEx btnSelect;
private DevComponents.DotNetBar.PanelEx btnEditDetail; private DevComponents.DotNetBar.PanelEx btnEditDetail;
private DevComponents.DotNetBar.PanelEx btnTest;
} }
} }
@@ -234,48 +234,5 @@ namespace TemuKJD.PDDForms.ProductSelectForms
PDDDBProdEditDetailForm editDetailForm = new PDDDBProdEditDetailForm(this.dbProd); PDDDBProdEditDetailForm editDetailForm = new PDDDBProdEditDetailForm(this.dbProd);
editDetailForm.ShowDialog(); editDetailForm.ShowDialog();
} }
private void btnTest_Click(object sender, EventArgs e)
{
string text = "";
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = false;
// 设置过滤条件,只显示文本文件
openFileDialog.Filter = "图片文件 (*.jpeg;*.jpg;*.png)|*.jpeg;*.jpg;*.png|All files (*.*)|*.*";
// 显示对话框并获取结果
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
try
{
string filePath = openFileDialog.FileName;
//using (Image image = Image.FromFile(filePath))
//{
// // 现在你可以使用image对象进行各种操作,比如绘制、保存等
// //Console.WriteLine("Image loaded successfully.");
// this.pictureBox2.Image = image;
//}
Image image = Image.FromFile(filePath);
this.pictureBox2.Image = image;
string imgBase64 = "";
using (MemoryStream memoryStream = new MemoryStream())
{
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Png);
byte[] imageBytes = memoryStream.ToArray();
imgBase64 = Convert.ToBase64String(imageBytes);
//imgBase64 = Convert.ToBase64String(imageBytes, Base64FormattingOptions.InsertLineBreaks);
}
string img_md5 = BaseClass.GetMd5(imgBase64);
}
catch (Exception ex)
{
//Console.WriteLine("An error occurred: " + ex.Message);
BaseMsgForm.ShowError("打开自定义图片失败 " + ex.Message);
return;
}
}
}
} }
} }
@@ -1,5 +1,6 @@
using AllBase; using AllBase;
using AllBase.Helper; using AllBase.Helper;
using AllBase.Model.Param.PDDProdParam;
using AllBase.Model.Result; using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult; using AllBase.Model.Result.PDDResult;
using NaiBa.Util.Extension; using NaiBa.Util.Extension;
@@ -182,7 +183,21 @@ namespace TemuKJD.PDDForms.ShopForms
OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message); OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
return; return;
} }
if (decoration == null) //if (decoration != null && decoration_json.ParseToString().Length < 20)
//{
// try
// {
// var prod_detail_decoration_rst = GetPddProdDetail(sourceShop, sourceProdId.ToString(), commitId);
// }
// catch (Exception ex)
// {
// OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
// return;
// }
//}
if (decoration == null || decoration_json.ParseToString().Length < 20)
{ {
OnInfoReceived("商品获取失败!商品详情图获取失败!"); OnInfoReceived("商品获取失败!商品详情图获取失败!");
return; return;
@@ -607,6 +622,68 @@ namespace TemuKJD.PDDForms.ShopForms
} }
return result; return result;
} }
private string GetPddProdOnShopDetail(ShopLoginInfo shop, string prodId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/on_shop/detail"; //获取详情图
//string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/detail";
//string body = @"{""goods_id"":" + prodId + "}";
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":""" + prodId + @"""}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
/// <summary>
/// 保存商品详情图装修列表
/// gorse/mms/goods/decoration/commit/save
/// </summary>
/// <param name="shop"></param>
/// <param name="decoration"></param>
/// <param name="goodsId"></param>
/// <param name="commitId"></param>
/// <returns></returns>
private string save_decoration(ShopLoginInfo shop, PDDProdDecorationCommitParam decoration, string goodsId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/save";
string body = @"{""goods_id"":" + goodsId + "}";
body = JsonHelper.SerializeObject(decoration);
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + goodsId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string GetPddProdSizeSpec(ShopLoginInfo shop, string prodId, string commitId, string sizeSpecId) private string GetPddProdSizeSpec(ShopLoginInfo shop, string prodId, string commitId, string sizeSpecId)
{ {
var anti = shop.AntiContents.LastOrDefault().ParseToString(); var anti = shop.AntiContents.LastOrDefault().ParseToString();
@@ -658,6 +735,7 @@ namespace TemuKJD.PDDForms.ShopForms
if (shop.AntiContents.Count > 0) if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)]; anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2"; string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
string body = @"{""goods_commit_id"":" + commitId + @",""goods_id"":" + prodId + @"}"; string body = @"{""goods_commit_id"":" + commitId + @",""goods_id"":" + prodId + @"}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit"; string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);