1拼多多sku货号价格 2拼多多sku增删改功能(70%)

This commit is contained in:
wule committed 2025-12-11 14:39:16 +08:00
1 parent 4dde0936ed
commit ad238cd241
31 files changed
+3155 -348

No files matched your search

@@ -225,11 +225,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
string.Empty
);
row = dgvShop.Rows[id];
//row.Cells["colLoginStatus"].Style.ForeColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
DisplayLoginStatus(row, canUse);
}
else
{
@@ -238,12 +234,8 @@ namespace TemuKJD.KJDForms.SalesCenterForms
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colShopNotes"].Value = shopEntity.Notes;
row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线";
//row.Cells["colLoginStatus"].Style.ForeColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
row.Cells["colCanUse"].Value = canUse;
DisplayLoginStatus(row, canUse);
}
if (soloActivityShop != null && row != null)
{
@@ -260,6 +252,14 @@ namespace TemuKJD.KJDForms.SalesCenterForms
}
}
private void DisplayLoginStatus(DataGridViewRow row, bool canUse)
{
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
}
private void dgvShop_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
@@ -308,10 +308,24 @@ namespace TemuKJD.KJDForms.SalesCenterForms
}
break;
case "colLoginStatus":
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
RefreshShop();
{
ShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
if (shop.LoginStatus2 == "国际版在线")
{
ShopLoginForm adminLoginForm = new ShopLoginForm(shop);
adminLoginForm.openType = EnumOpenType.manage;
adminLoginForm.WindowState = FormWindowState.Maximized;
adminLoginForm.InitUrl = "https://agentseller.temu.com";
adminLoginForm.Show();
}
else
{
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
RefreshShop();
}
}
break;
}
}
@@ -444,8 +458,9 @@ namespace TemuKJD.KJDForms.SalesCenterForms
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "店铺掉线";
row.Cells["colLoginStatus"].Value = "国际版未登录";
row.Cells["colLoginStatus"].Value = "掉线";
row.Cells["colCanUse"].Value = false;
DisplayLoginStatus(row, false);
}
}));
errMsg = "店铺可能已掉线,指定的值含有无效的控制字符";
@@ -714,8 +729,9 @@ namespace TemuKJD.KJDForms.SalesCenterForms
foreach (var r in shopRows)
{
r.Cells["colMessage"].Value = "店铺掉线";
r.Cells["colLoginStatus"].Value = "国际版未登录";
r.Cells["colLoginStatus"].Value = "掉线";
r.Cells["colCanUse"].Value = false;
DisplayLoginStatus(r, false);
}
}));
continue;
@@ -1013,6 +1029,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
continue;
int tryCount = 0;
string searchScrollContext = "";
tryAgain:
Thread.Sleep(100 + Randomx.GetId(200));
if (chkNoSaleProd.Checked && noSaleProdIdLst.Count == 0)
@@ -1024,7 +1041,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
noSaleProdIdLst.Clear();
noSaleProdIdLst.Add(soloActivityProduct.productId.ToString());
}
var jsonRst = GetActivityMatch(shop, activity.activityType, activity.activityThematicId, string.Join(",", noSaleProdIdLst));
var jsonRst = GetActivityMatch(shop, activity.activityType, activity.activityThematicId, searchScrollContext, string.Join(", ", noSaleProdIdLst));
if (jsonRst.Contains("指定的值含有无效的控制字符") || jsonRst.Contains("login") || jsonRst.Contains("Login"))
{
@@ -1034,8 +1051,9 @@ namespace TemuKJD.KJDForms.SalesCenterForms
foreach (var r in shopRows)
{
r.Cells["colMessage"].Value = "店铺掉线";
r.Cells["colLoginStatus"].Value = "国际版未登录";
r.Cells["colLoginStatus"].Value = "掉线";
r.Cells["colCanUse"].Value = false;
DisplayLoginStatus(r, false);
}
}));
continue;
@@ -1072,7 +1090,19 @@ namespace TemuKJD.KJDForms.SalesCenterForms
}
catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); }
if (jArr.Count() == 0)
int stillCount = BaseRegex.GetIntJson(ref jsonRst, "stillCount");
this.Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在报名活动商品... 剩余 " + stillCount + " 件";
}));
searchScrollContext = BaseRegex.GetStringJson(ref jsonRst, "searchScrollContext");
if (jArr.Count() == 0 && stillCount > 0 && tryCount < 5)
{
tryCount++;
goto tryAgain;
}
if (jArr.Count() == 0 && stillCount == 0)
{
if (soloActivityShop != null && soloActivityProduct != null)
{
@@ -1246,8 +1276,9 @@ namespace TemuKJD.KJDForms.SalesCenterForms
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "店铺掉线";
row.Cells["colLoginStatus"].Value = "国际版未登录";
row.Cells["colLoginStatus"].Value = "掉线";
row.Cells["colCanUse"].Value = false;
DisplayLoginStatus(row, false);
}
}));
return false;
@@ -1282,21 +1313,26 @@ namespace TemuKJD.KJDForms.SalesCenterForms
/// <param name="thematicId"></param>
/// <param name="spuIds">多个用逗号隔开</param>
/// <returns></returns>
private string GetActivityMatch(ShopLoginInfo shop,int? activityType, long? thematicId, string spuIds="")
private string GetActivityMatch(ShopLoginInfo shop,int? activityType, long? thematicId, string searchScrollContext = "", string spuIds="")
{
string url = "https://agentseller.temu.com/api/kiana/gamblers/marketing/enroll/scroll/match";
string body;
body = "{\"activityType\":" + activityType;
if (thematicId != activityType)
body += ",\"activityThematicId\":" + thematicId;
body += ",\"rowCount\":50}";
body += ",\"rowCount\":50";
if (!string.IsNullOrWhiteSpace(searchScrollContext))
body += ",\"searchScrollContext\":\"" + searchScrollContext + "\"";
if (!string.IsNullOrWhiteSpace(spuIds))
{
body = "{\"activityType\":" + activityType;
if (thematicId != activityType)
body += ",\"activityThematicId\":" + thematicId;
body += ",\"rowCount\":50,\"productIds\":[" + spuIds + "],\"productSkcExtCodes\":[]}";
}
body += ",\"productIds\":[" + spuIds + "],\"productSkcExtCodes\":[]";
body += "}";
//if (!string.IsNullOrWhiteSpace(spuIds))
//{
// body = "{\"activityType\":" + activityType;
// if (thematicId != activityType)
// body += ",\"activityThematicId\":" + thematicId;
// body += ",\"rowCount\":50,\"productIds\":[" + spuIds + "],\"productSkcExtCodes\":[]}";
//}
string refere = "https://agentseller.temu.com/activity/marketing-activity/detail-new?type=" + activityType;
if (thematicId != activityType)
refere += "&thematicId=" + thematicId;