1拼多多皮肤 2打包编译脚本优化 3.头部选中所有的DataGridView列控件
This commit is contained in:
1 parent
05553a3ba3
commit
f04c74fa32
34 files changed
+1710
-1135
No files matched your search
@@ -1650,8 +1650,25 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 暂时不上传视频
|
||||
#region 提取源商品详情,根据需要生成sku货号
|
||||
var prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(dbProd.product_json);
|
||||
|
||||
// 如果没有货号或有相同货号无法区分sku,自定义货号
|
||||
if (dbProd.product_get_type_text != "厂商直采")
|
||||
{
|
||||
if (prodInfo.detail.sku.Any(s => s.out_sku_sn.IsNullOrEmpty()) ||
|
||||
prodInfo.detail.sku.Select(s => s.out_sku_sn).ToList().Count > prodInfo.detail.sku.Select(s => s.out_sku_sn).Distinct().ToList().Count)
|
||||
{
|
||||
foreach (var sku in prodInfo.detail.sku)
|
||||
{
|
||||
sku.out_sku_sn = string.Join(";", sku.spec.Select(s => s.spec_name));
|
||||
sku.out_sku_sn = "EC1" + Math.Abs(BaseClass.GetLong(sku.out_sku_sn)) + "A";
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 暂时不上传视频
|
||||
prodInfo.detail.galleries.RemoveAll(g => g.type == 6); // 视频暂时移除,以后再视情况加上
|
||||
#endregion
|
||||
|
||||
@@ -2852,7 +2869,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
if (propInfo.name == "出版社名称")
|
||||
attr = productAttr.attr.FirstOrDefault(r => r.name == "出版社名称");
|
||||
else if (propInfo.name == "ISBN编号")
|
||||
else if (propInfo.name == "ISBN编号" && !prodInfo.property.goods_properties.Any(p => p.name == "ISBN版号/CN刊号"))
|
||||
attr = productAttr.attr.FirstOrDefault(r => r.name == "ISBN版号/CN刊号");
|
||||
else if (propInfo.name == "书名")
|
||||
attr = productAttr.attr.FirstOrDefault(r => r.name == "书名");
|
||||
@@ -3049,7 +3066,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
if ((propInfo.values.FirstOrDefault()?.value).ParseToString().EndsWith(attr.value))
|
||||
attrValue = propInfo.values.FirstOrDefault()?.value;
|
||||
else
|
||||
attr.value = "100 ml";
|
||||
attrValue = "100 ml";
|
||||
}
|
||||
else if (attr.value == "L")
|
||||
{
|
||||
@@ -3062,7 +3079,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
attrValue = "1 L";
|
||||
}
|
||||
else
|
||||
attr.value = "1 L";
|
||||
attrValue = "1 L";
|
||||
}
|
||||
else if (attr.value == "g;kg;ml;L")
|
||||
{
|
||||
@@ -3070,7 +3087,26 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
if (propInfoValue.EndsWith("g") || propInfoValue.EndsWith("kg") || propInfoValue.EndsWith("ml") || propInfoValue.EndsWith("L"))
|
||||
attrValue = propInfo.values.FirstOrDefault()?.value;
|
||||
else
|
||||
attr.value = "100 g";
|
||||
attrValue = "100 g";
|
||||
}
|
||||
else
|
||||
{
|
||||
attrValue = propInfo.values.FirstOrDefault()?.value.ParseToString();
|
||||
var units = attr.value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var unit in units)
|
||||
{
|
||||
var val = attrValue.Replace(unit, "").Trim();
|
||||
if (attr.type == "decimal4_unit" && val.ParseToDecimal() != 0m)
|
||||
{
|
||||
attrValue = val + " " + unit;
|
||||
break;
|
||||
}
|
||||
if (attr.type == "integer_unit" && val.ParseToInt() != 0)
|
||||
{
|
||||
attrValue = val + " " + unit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3157,6 +3193,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
attrValue = new List<string>() { "李老师", "张老师", "王老师" }[Randomx.GetId(3)];
|
||||
if (attr.name == "包装")
|
||||
attrValue = "平装";
|
||||
if (attr.name == "出版时间")
|
||||
attrValue = DateTime.Now.AddMonths(0 - Randomx.GetId(3, 7)).ToString("yyyy-MM");
|
||||
}
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "食品饮料" || prodInfo.detail.cats.FirstOrDefault() == "食品饮料")
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user