客服提示功能
This commit is contained in:
1 parent
2ae38c8105
commit
42be98616b
12 files changed
+366
-141
No files matched your search
@@ -1173,6 +1173,12 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
using (Graphics g = Graphics.FromImage(imageBg))
|
||||
{
|
||||
g.DrawImage(image, new Rectangle(0, 0, imageBg.Width, imageBg.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "图书" || prodInfo.detail.cats.FirstOrDefault() == "书籍/杂志/报纸")
|
||||
{
|
||||
|
||||
g.FillRectangle(new SolidBrush(Color.FromArgb(Randomx.GetId(256), Randomx.GetId(256), Randomx.GetId(256))),
|
||||
new Rectangle(Randomx.GetId(imageBg.Width - 30), Randomx.GetId(imageBg.Height - 30), 30, 30));
|
||||
}
|
||||
}
|
||||
|
||||
// 取前三张图片保存到系统temp路径,配合商品标题获取商品类目
|
||||
@@ -1374,7 +1380,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
detailGalleries.Add(new gallery_item() { type = 2, url = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1)?.url });
|
||||
foreach (var gallery_item in detailGalleries)
|
||||
{
|
||||
var locationStr = UploadImg(shop, gallery_item.url, cell);
|
||||
bool randomDrawBlock = false;
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "图书" || prodInfo.detail.cats.FirstOrDefault() == "书籍/杂志/报纸")
|
||||
randomDrawBlock = true;
|
||||
var locationStr = UploadImg(shop, gallery_item.url, cell, randomDrawBlock);
|
||||
if (!locationStr.Contains("\"success\":true"))
|
||||
return locationStr;
|
||||
var location = BaseRegex.GetStringJson(ref locationStr, "Location");
|
||||
@@ -1405,7 +1414,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
attr = productAttr.attr.FirstOrDefault(r => r.name == "填充物种类" || r.name == "填充物");
|
||||
}
|
||||
|
||||
// 书籍类目匹配
|
||||
// 书籍类目属性匹配
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "图书" || prodInfo.detail.cats.FirstOrDefault() == "书籍/杂志/报纸")
|
||||
{
|
||||
if (propInfo.name == "出版社名称")
|
||||
@@ -1442,6 +1451,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
attrValue = propInfo.values.FirstOrDefault()?.value;
|
||||
}
|
||||
//书籍属性处理
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "图书" || prodInfo.detail.cats.FirstOrDefault() == "书籍/杂志/报纸")
|
||||
{
|
||||
if (attrValue.IsNullOrEmpty() && attr.type == "integer_unit" && (propInfo.values.FirstOrDefault()?.value).IsNumber())
|
||||
@@ -1756,7 +1766,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
#region 书籍类生成书籍图片
|
||||
//qualificationList
|
||||
if (1 == 1)
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "图书" || prodInfo.detail.cats.FirstOrDefault() == "书籍/杂志/报纸")
|
||||
{
|
||||
if (cell != null)
|
||||
{
|
||||
@@ -1918,7 +1928,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
|
||||
|
||||
public string UploadImg(ShopLoginInfo shop, string img_url, DataGridViewCell cell = null)
|
||||
public string UploadImg(ShopLoginInfo shop, string img_url, DataGridViewCell cell = null, bool randomBlock = false)
|
||||
{
|
||||
string getImgError;
|
||||
var image = GetHtml.GetUrlImg(img_url.Replace("https://", "http://"), out getImgError);
|
||||
@@ -1934,6 +1944,9 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
using (Graphics g = Graphics.FromImage(imageBg))
|
||||
{
|
||||
g.DrawImage(image, new Rectangle(0, 0, imageBg.Width, imageBg.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
|
||||
if (randomBlock)
|
||||
g.FillRectangle(new SolidBrush(Color.FromArgb(Randomx.GetId(256), Randomx.GetId(256), Randomx.GetId(256))),
|
||||
new Rectangle(Randomx.GetId(imageBg.Width - 30), Randomx.GetId(imageBg.Height - 30), 30, 30));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in new issue
Block a user