From 3b3a903e251b8869a8b84d112637e437ea4f4324 Mon Sep 17 00:00:00 2001 From: wule_5900x Date: Thu, 26 Mar 2026 23:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AllBase/BaseClass.cs | 2 +- AllBase/BaseRegex.cs | 4 +-- TEMUKJD/BLL/PDDProdFormConverter.cs | 33 ++++++++++++++++--- .../ProductSelectForms/PDDDBProdEditForm.cs | 12 +++---- .../ProductForms/WXDBProdUploadForm.cs | 13 ++++++-- 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 1e323a7..006edde 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 932; + public static int VersionCount = 935; //public static int VersionCount = 613; /// diff --git a/AllBase/BaseRegex.cs b/AllBase/BaseRegex.cs index 7c1ebfc..fe2c7a6 100644 --- a/AllBase/BaseRegex.cs +++ b/AllBase/BaseRegex.cs @@ -685,7 +685,7 @@ namespace AllBase if (html == null) return rstLst; - string htmlTmp = html.Replace("\\{", "\\这里是正花括号占位符").Replace("\\}", "\\这里是反花括号占位符"); + string htmlTmp = html.Replace("\\{", "\\这里是正花括号占位符").Replace("\\}", "\\这里是反花括号占位符").Replace("\"" + reg + "\": {", "\"" + reg + "\":{"); retry: string lvStr = ""; @@ -738,7 +738,7 @@ namespace AllBase if (html == null) return rstLst; - string htmlTmp = html.Replace("\\[", "\\这里是正方括号占位符").Replace("\\]", "\\这里是反方括号占位符"); + string htmlTmp = html.Replace("\\[", "\\这里是正方括号占位符").Replace("\\]", "\\这里是反方括号占位符").Replace("\"" + reg + "\": [", "\"" + reg + "\":["); retry: var index1 = htmlTmp.IndexOf("\"" + reg + "\":["); diff --git a/TEMUKJD/BLL/PDDProdFormConverter.cs b/TEMUKJD/BLL/PDDProdFormConverter.cs index a491417..a811dab 100644 --- a/TEMUKJD/BLL/PDDProdFormConverter.cs +++ b/TEMUKJD/BLL/PDDProdFormConverter.cs @@ -1571,6 +1571,16 @@ namespace TemuKJD.BLL var wxxdData = JsonHelper.SerializeObject(JsonHelper.JObjectParse(dbProd.product_json)["wxxdData"]); var baseData = JsonHelper.JObjectParse(dbProd.product_json)["baseData"].ParseToString(); + var str_lst = BaseRegex.GetJsonArrStrJson(ref baseData, "productSkus"); + try + { + var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault(); + var productSkus = JsonHelper.DeserializeJsonToList(regex_str); + } + catch + { + } + WXClientProductInfoLite wxClientProdInfo = JsonHelper.DeserializeJsonToObject(wxxdData); if (wxClientProdInfo.info.sku_list == null) { @@ -1863,14 +1873,27 @@ namespace TemuKJD.BLL // addPrice = 100; //skuInfo.multi_price += addPrice; //skuInfo.price += addPrice; - foreach (var wxSpec in wxEditSkuInfo.productSkuInfo.saleParam) + if (wxEditSkuInfo.productSkuInfo.saleParam != null) + { + foreach (var wxSpec in wxEditSkuInfo.productSkuInfo.saleParam) + { + skuInfo.spec.Add(new spec_item() + { + parent_id = wxSpec.categorys[0].catId.ParseToLong(), + parent_name = wxSpec.categorys[0].name, + spec_id = wxSpec.categorys[1].catId.ParseToLong(), + spec_name = wxSpec.categorys[1].name, + }); + } + } + else { skuInfo.spec.Add(new spec_item() { - parent_id = wxSpec.categorys[0].catId.ParseToLong(), - parent_name = wxSpec.categorys[0].name, - spec_id = wxSpec.categorys[1].catId.ParseToLong(), - spec_name = wxSpec.categorys[1].name, + parent_id = 0, + parent_name = "规格", + spec_id = 0, + spec_name = "默认", }); } skuInfo.out_sku_sn = wxEditSkuInfo.productSkuInfo.skuCode; diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs index af09605..17aef4d 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs @@ -253,12 +253,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms BaseMsgForm.ShowError("商品结构获取失败 " + convertRst); return; } - string exportData = dbProd.product_json; - var address = Path.Combine("D:\\", dbProd.spu_id + ".txt"); - using (StreamWriter sw = new StreamWriter(Path.Combine("D:\\", dbProd.spu_id + ".txt"), false, Encoding.UTF8)) - { - sw.Write(exportData); - } + //string exportData = dbProd.product_json; + //var address = Path.Combine("D:\\", dbProd.spu_id + ".txt"); + //using (StreamWriter sw = new StreamWriter(Path.Combine("D:\\", dbProd.spu_id + ".txt"), false, Encoding.UTF8)) + //{ + // sw.Write(exportData); + //} } if (dbProd.product_get_type_text == "微信店采") { diff --git a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs index e2e7a67..c9289a9 100644 --- a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs +++ b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs @@ -1773,7 +1773,7 @@ namespace TemuKJD.WXForms.ProductForms continue; } - if (needAddRandomBlock || wantAddRandomBlock) + if (needAddRandomBlock || wantAddRandomBlock || gallery_item.url.Contains("wst.wxapp.tc.qq.com")) { // 如果想打码或者需要打码,就走差异化详情图,不走api直传 } @@ -2558,7 +2558,7 @@ namespace TemuKJD.WXForms.ProductForms continue; } - if (needAddRandomBlock || wantAddRandomBlock) + if (needAddRandomBlock || wantAddRandomBlock || gallery_item.url.Contains("wst.wxapp.tc.qq.com")) { // 如果想打码或者需要打码,就走差异化详情图,不走api直传 } @@ -2954,6 +2954,13 @@ namespace TemuKJD.WXForms.ProductForms else attr.value = "100 ml"; } + else if (attr.value == "L") + { + if ((propInfo.values.FirstOrDefault()?.value).ParseToString().EndsWith(attr.value)) + attrValue = propInfo.values.FirstOrDefault()?.value; + else + attr.value = "100 ml"; + } else if (attr.value == "g;kg;ml;L") { var propInfoValue = (propInfo.values.FirstOrDefault()?.value).ParseToString(); @@ -3206,7 +3213,7 @@ namespace TemuKJD.WXForms.ProductForms continue; } // 使用接口链接传sku图 - if (1 == 1) + if (1 == 1 && !sku.thumb_url.Contains("wst.wxapp.tc.qq.com")) { var urlImg = BaseClass.BuildPDDObjString("product/wx_api_upload_image"); var upDate = UserLogin.GetSignaturex();