From 4d5ea741d7c42a84178c73e1e09959095e2e21a0 Mon Sep 17 00:00:00 2001 From: wule Date: Wed, 26 Nov 2025 13:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=B4=E9=80=9A=E8=BD=A6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductForms/TemuAdsForm.Designer.cs | 2 +- TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs | 51 ++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs index a8710f5..1c539cf 100644 --- a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs @@ -883,7 +883,7 @@ namespace TemuKJD.KJDForms.ProductForms // // colShopName // - this.colShopName.HeaderText = "店铺名"; + this.colShopName.HeaderText = "店铺名称"; this.colShopName.Name = "colShopName"; this.colShopName.ReadOnly = true; this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True; diff --git a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs index 5ee5812..eed2748 100644 --- a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs +++ b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs @@ -272,10 +272,10 @@ namespace TemuKJD.KJDForms.ProductForms string body; body = "{\"ad_status\":[],\"ad_advice_types\":[],\"page_size\":" + pageSize + ",\"page_number\":" + page + ",\"specific_query_info\":\"\",\"sort_by\":0,\"sort_type\":\"desc\",\"start_time\":" + - startTime + "," + "\"end_time\":" + - endTime + - ",\"need_calculate_goods_summary\":true,\"ad_phase\":-1}"; + startTime + "," + "\"end_time\":" + endTime + + ",\"need_calculate_goods_summary\":true,\"list_id\":\"dc582b8d-ae93-4f4d-94e4-031590a245fa\",\"ad_phase\":-1}"; + //refere = "https://ads.temu.com/ad-list.html?_x_sessn_id=vmkt5y1lqe&refer_page_name=home&refer_page_id=22941_1764131076104_dfy9mxx891&refer_page_sn=22941"; string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); return HttpResponseBLL.PostResponseAds(shop, url, body, refere); @@ -309,7 +309,14 @@ namespace TemuKJD.KJDForms.ProductForms { string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; string body; - body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":2}"; + //body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":2}"; + body = "{\"modify_ad_dtos\":["; + foreach(var goods_id in idList) + { + body += "{\"goods_id\":\"" + goods_id + "\",\"status\":2},"; + } + body = body.TrimEnd(','); + body += "]}"; string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); @@ -319,7 +326,14 @@ namespace TemuKJD.KJDForms.ProductForms { string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; string body; - body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":0}"; + //body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":0}"; + body = "{\"modify_ad_dtos\":["; + foreach (var goods_id in idList) + { + body += "{\"goods_id\":\"" + goods_id + "\",\"status\":0},"; + } + body = body.TrimEnd(','); + body += "]}"; string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); @@ -329,7 +343,14 @@ namespace TemuKJD.KJDForms.ProductForms { string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; string body; - body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":3}"; + //body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":3}"; + body = "{\"modify_ad_dtos\":["; + foreach (var goods_id in idList) + { + body += "{\"goods_id\":\"" + goods_id + "\",\"status\":3},"; + } + body = body.TrimEnd(','); + body += "]}"; string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); @@ -1682,8 +1703,10 @@ namespace TemuKJD.KJDForms.ProductForms tryAgain: Thread.Sleep(100 + Randomx.GetId(200)); - var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); - string mdyRst = DelAds(shop, adIdLst); + //var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); + //string mdyRst = DelAds(shop, adIdLst); + var goodsIdLst = tmpAdsDetailLst.Select(a => a.goods_id).ToList(); + string mdyRst = DelAds(shop, goodsIdLst); if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) { tryCount++; @@ -1900,8 +1923,10 @@ namespace TemuKJD.KJDForms.ProductForms tryAgain: Thread.Sleep(100 + Randomx.GetId(200)); - var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); - string mdyRst = PauseAds(shop, adIdLst); + //var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); + //string mdyRst = PauseAds(shop, adIdLst); + var goodIdLst = tmpAdsDetailLst.Select(a => a.goods_id).ToList(); + string mdyRst = PauseAds(shop, goodIdLst); if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) { tryCount++; @@ -2119,8 +2144,10 @@ namespace TemuKJD.KJDForms.ProductForms tryAgain: Thread.Sleep(100 + Randomx.GetId(200)); - var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); - string mdyRst = continueAds(shop, adIdLst); + //var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); + //string mdyRst = continueAds(shop, adIdLst); + var goodsIdLst = tmpAdsDetailLst.Select(a => a.goods_id).ToList(); + string mdyRst = continueAds(shop, goodsIdLst); if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) { tryCount++;