1服务功能 2用户商品备注并支持下拉框显示
This commit is contained in:
1 parent
bd3040efa3
commit
b4ec400796
33 files changed
+2597
-551
No files matched your search
@@ -42,7 +42,6 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
public bool IsWxNotUseSoftwareDefaultAddressOnce { get; set; } = false;
|
||||
public bool IsLoadComplate { get; set; } = false;
|
||||
|
||||
public ConcurrentList<TemuDBProductSelect> lstTemuDBProductSelect = new ConcurrentList<TemuDBProductSelect>();
|
||||
ConcurrentList<AddPriceRule> lstAddPriceRule = new ConcurrentList<AddPriceRule>();
|
||||
@@ -205,6 +204,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
this.txtPreDays.Text = wxUploadRule.PreSaleDays.ParseToString();
|
||||
this.txtReplaceText.Text = wxUploadRule.FilterWords.ParseToString();
|
||||
this.chkSkipReplaceText.Checked = wxUploadRule.IsSkipHasFilterWordsProd.ParseToBool();
|
||||
this.txtMinPrice.Text = wxUploadRule.SkuMinPrice.ParseToString();
|
||||
this.txtWaitSeconds.Text = wxUploadRule.WaitSeconds.ParseToString();
|
||||
this.chkHighestPriceSku.Checked = wxUploadRule.OnlyHighestPriceSku.ParseToBool();
|
||||
@@ -389,6 +389,14 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
chkRandomFissionProduct.Visible = true;
|
||||
txtRandomFissionProductCount.Visible = true;
|
||||
|
||||
lblNotes.Visible = true;
|
||||
cmbNotes.Visible = true;
|
||||
Task.Run(() =>
|
||||
{
|
||||
string addUserName = BaseClass.GroupId == 3 ? BaseClass.UserName : BaseClass.ParentUserName;
|
||||
PDDDBProdListForm.GetPDDProductNotes(new List<ComboBox> { cmbNotes }, addUserName);
|
||||
});
|
||||
}
|
||||
cmbHot_TextChanged(null, null);
|
||||
|
||||
@@ -405,7 +413,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
List<Control> ctrlLst = new List<Control>()
|
||||
{
|
||||
lblSourceType, cmbSourceType, lblGroupFilter, cmbGroupFilter, lblHot, cmbHot, lblIdFilter, txtIdFilter,
|
||||
chkRandomFissionProduct, txtRandomFissionProductCount, lblJstInitSet, cmbJstInitSet
|
||||
chkRandomFissionProduct, txtRandomFissionProductCount/*, lblNotes, cmbNotes*//*, lblJstInitSet, cmbJstInitSet*/
|
||||
};
|
||||
for (int i = 0; i < ctrlLst.Count - 2; i += 2)
|
||||
{
|
||||
@@ -413,14 +421,19 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
for (int j= ctrlLst.Count - 2; j > i; j-=2)
|
||||
{
|
||||
ctrlLst[j].Parent = ucGroupBoxEx4;
|
||||
ctrlLst[j].Location = new Point(ctrlLst[j - 2].Location.X, ctrlLst[j - 2].Location.Y);
|
||||
ctrlLst[j + 1].Location = new Point(ctrlLst[j].Location.X + ctrlLst[j].Width - 3, ctrlLst[j - 1].Location.Y);
|
||||
ctrlLst[j + 1].BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cmbNotes.Visible == false)
|
||||
{
|
||||
txtSearchGoodsName.Width = 229;
|
||||
}
|
||||
|
||||
IsLoadComplate = true;
|
||||
IsFormLoad = true;
|
||||
}
|
||||
|
||||
private void btnRefreshAuthor_Click(object sender, EventArgs e)
|
||||
@@ -1780,74 +1793,66 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// 过滤标题敏感词
|
||||
if (lstTitleReplaceText.Count > 0)
|
||||
{
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
if (chkSkipReplaceText.Checked)
|
||||
{
|
||||
dbProd.product_name = dbProd.product_name.Replace(txt, "");
|
||||
selectProd.product_name = selectProd.product_name.Replace(txt, "");
|
||||
}
|
||||
if (lstTitleReplaceText.Any(t => selectProd.product_name.Contains(t)))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"命中敏感词\"}";
|
||||
if (lstTitleReplaceText.Any(t => dbProd.product_name.Contains(t)))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"命中敏感词\"}";
|
||||
|
||||
var goods_name = prodJObj["detail"]["goods_name"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
goods_name = goods_name.Replace(txt, "");
|
||||
var goods_name = prodJObj["detail"]["goods_name"].ParseToString();
|
||||
if (lstTitleReplaceText.Any(t => goods_name.Contains(t)))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"命中敏感词\"}";
|
||||
var tiny_name = prodJObj["detail"]["tiny_name"].ParseToString();
|
||||
if (lstTitleReplaceText.Any(t => tiny_name.Contains(t)))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"命中敏感词\"}";
|
||||
var goods_desc = prodJObj["detail"]["goods_desc"].ParseToString();
|
||||
if (lstTitleReplaceText.Any(t => goods_desc.Contains(t)))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"命中敏感词\"}";
|
||||
var share_desc = prodJObj["detail"]["share_desc"].ParseToString();
|
||||
if (lstTitleReplaceText.Any(t => share_desc.Contains(t)))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"命中敏感词\"}";
|
||||
}
|
||||
prodJObj["detail"]["goods_name"] = goods_name;
|
||||
else
|
||||
{
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
dbProd.product_name = dbProd.product_name.Replace(txt, "");
|
||||
selectProd.product_name = selectProd.product_name.Replace(txt, "");
|
||||
}
|
||||
|
||||
var tiny_name = prodJObj["detail"]["tiny_name"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
tiny_name = tiny_name.Replace(txt, "");
|
||||
}
|
||||
prodJObj["detail"]["tiny_name"] = tiny_name;
|
||||
var goods_name = prodJObj["detail"]["goods_name"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
goods_name = goods_name.Replace(txt, "");
|
||||
}
|
||||
prodJObj["detail"]["goods_name"] = goods_name;
|
||||
|
||||
var goods_desc = prodJObj["detail"]["goods_desc"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
goods_desc = goods_desc.Replace(txt, "");
|
||||
}
|
||||
prodJObj["detail"]["goods_desc"] = goods_desc;
|
||||
var tiny_name = prodJObj["detail"]["tiny_name"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
tiny_name = tiny_name.Replace(txt, "");
|
||||
}
|
||||
prodJObj["detail"]["tiny_name"] = tiny_name;
|
||||
|
||||
var share_desc = prodJObj["detail"]["share_desc"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
share_desc = share_desc.Replace(txt, "");
|
||||
var goods_desc = prodJObj["detail"]["goods_desc"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
goods_desc = goods_desc.Replace(txt, "");
|
||||
}
|
||||
prodJObj["detail"]["goods_desc"] = goods_desc;
|
||||
|
||||
var share_desc = prodJObj["detail"]["share_desc"].ParseToString();
|
||||
foreach (var txt in lstTitleReplaceText)
|
||||
{
|
||||
share_desc = share_desc.Replace(txt, "");
|
||||
}
|
||||
prodJObj["detail"]["share_desc"] = share_desc;
|
||||
}
|
||||
prodJObj["detail"]["share_desc"] = share_desc;
|
||||
}
|
||||
// 过滤标题特殊字符
|
||||
if (chkRemoveSpecialChar.Checked)
|
||||
{
|
||||
//if (dbProd.product_name.Contains("】") && dbProd.product_name.IndexOf("】") < dbProd.product_name.Length / 2 && dbProd.product_name.Length > 10)
|
||||
// dbProd.product_name = dbProd.product_name.Substring(dbProd.product_name.IndexOf("】")).Trim('】');
|
||||
|
||||
//if (selectProd.product_name.Contains("】") && selectProd.product_name.IndexOf("】") < selectProd.product_name.Length / 2 && selectProd.product_name.Length > 10)
|
||||
// selectProd.product_name = selectProd.product_name.Substring(selectProd.product_name.IndexOf("】")).Trim('】');
|
||||
|
||||
//var goods_name = prodJObj["detail"]["goods_name"].ParseToString();
|
||||
//if (goods_name.Contains("】") && goods_name.IndexOf("】") < goods_name.Length / 2 && goods_name.Length > 10)
|
||||
// prodJObj["detail"]["goods_name"] = goods_name.Substring(goods_name.IndexOf("】")).Trim('】');
|
||||
|
||||
//if (dbProd.product_name.Contains("]") && dbProd.product_name.IndexOf("]") < dbProd.product_name.Length / 2 && dbProd.product_name.Length > 10)
|
||||
// dbProd.product_name = dbProd.product_name.Substring(dbProd.product_name.IndexOf("]")).Trim(']');
|
||||
|
||||
//if (selectProd.product_name.Contains("]") && selectProd.product_name.IndexOf("]") < selectProd.product_name.Length / 2 && selectProd.product_name.Length > 10)
|
||||
// selectProd.product_name = selectProd.product_name.Substring(selectProd.product_name.IndexOf("]")).Trim(']');
|
||||
|
||||
//goods_name = prodJObj["detail"]["goods_name"].ParseToString();
|
||||
//if (goods_name.Contains("]") && goods_name.IndexOf("]") < goods_name.Length / 2 && goods_name.Length > 10)
|
||||
// prodJObj["detail"]["goods_name"] = goods_name.Substring(goods_name.IndexOf("]")).Trim(']');
|
||||
|
||||
|
||||
//if (dbProd.product_name.Contains("}") && dbProd.product_name.IndexOf("}") < dbProd.product_name.Length / 2 && dbProd.product_name.Length > 10)
|
||||
// dbProd.product_name = dbProd.product_name.Substring(dbProd.product_name.IndexOf("}")).Trim('}');
|
||||
|
||||
//if (selectProd.product_name.Contains("}") && selectProd.product_name.IndexOf("}") < selectProd.product_name.Length / 2 && selectProd.product_name.Length > 10)
|
||||
// selectProd.product_name = selectProd.product_name.Substring(selectProd.product_name.IndexOf("}")).Trim('}');
|
||||
|
||||
//goods_name = prodJObj["detail"]["goods_name"].ParseToString();
|
||||
//if (goods_name.Contains("}") && goods_name.IndexOf("}") < goods_name.Length / 2 && goods_name.Length > 10)
|
||||
// prodJObj["detail"]["goods_name"] = goods_name.Substring(goods_name.IndexOf("}")).Trim('}');
|
||||
|
||||
var chLst = new List<char> { ']', '】', ')', ')', '}', };
|
||||
foreach (var ch in chLst)
|
||||
{
|
||||
@@ -4432,21 +4437,131 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}));
|
||||
}
|
||||
|
||||
string publisher = "出版社名称:" + new List<string>() { "技术出版社", "文化出版社", "美术出版社" }[Randomx.GetId(3)];
|
||||
//string publisher = "出版社名称:" + new List<string>() { "技术出版社", "文化出版社", "美术出版社" }[Randomx.GetId(3)];
|
||||
////string isbn = "ISBN:";
|
||||
//string isbn = "ISBN/CN刊号:";
|
||||
////string bookName = "书名:";
|
||||
//string bookName = "图书名称:";
|
||||
//string bookPrice = "定价:" + upProdParam.product.productSkus.Max(s => s.productSkuInfo.salePrice) * 0.01;
|
||||
//string author = "作者:王老师";
|
||||
//string publishTime = "出版时间:" + DateTime.Now.AddMonths(-3).ToString("yyyy年MM月dd日");
|
||||
//string edition = "版次:1";
|
||||
//string binding = "装帧:平装";
|
||||
|
||||
//foreach (var propParam in upProdParam.product.info.param)
|
||||
//{
|
||||
// if (propParam.categorys[0].name.Contains("出版社名称"))
|
||||
// publisher = "出版社名称:" + propParam.categorys[1].name;
|
||||
// else if (propParam.categorys[0].name.Contains("ISBN版号/CN刊号"))
|
||||
// {
|
||||
// //isbn = "ISBN:" + propParam.categorys[1].name;
|
||||
// isbn = "ISBN/CN刊号:" + propParam.categorys[1].name;
|
||||
// if (propParam.categorys[1].name.Length == 13)
|
||||
// {
|
||||
// var isbnStr = propParam.categorys[1].name;
|
||||
// isbn = "ISBN/CN刊号:" + isbnStr[0] + isbnStr[1] + isbnStr[2] + "-" + isbnStr[3] + "-" + isbnStr[4] + isbnStr[5] + isbnStr[6] + isbnStr[7] + "-" + isbnStr[8] + isbnStr[9] + isbnStr[10] + isbnStr[11] + "-" + isbnStr[12];
|
||||
// }
|
||||
// }
|
||||
// else if (propParam.categorys[0].name.Contains("书名"))
|
||||
// {
|
||||
// //bookName = "书名:" + propParam.categorys[1].name;
|
||||
// bookName = "图书名称:" + propParam.categorys[1].name;
|
||||
// }
|
||||
// else if (propParam.categorys[0].name.Contains("定价"))
|
||||
// {
|
||||
// //bookPrice = "定价:" + propParam.categorys[1].name;
|
||||
// propParam.categorys[1].name = bookPrice;
|
||||
// }
|
||||
// else if (propParam.categorys[0].name.Contains("作者"))
|
||||
// author = "作者:" + propParam.categorys[1].name;
|
||||
// else if (propParam.categorys[0].name.Contains("出版时间"))
|
||||
// publishTime = "出版时间:" + propParam.categorys[1].name;
|
||||
// else if (propParam.categorys[0].name.Contains("版次"))
|
||||
// edition = "版次:" + propParam.categorys[1].name;
|
||||
// else if (propParam.categorys[0].name.Contains("包装"))
|
||||
// binding = "装帧:" + propParam.categorys[1].name;
|
||||
//}
|
||||
|
||||
//var bookStr = publisher + "\r\n" + "\r\n" +
|
||||
// isbn + "\r\n" + "\r\n" +
|
||||
// bookName + "\r\n" + "\r\n" +
|
||||
// bookPrice + "\r\n" + "\r\n" +
|
||||
// author + "\r\n" + "\r\n" +
|
||||
// publishTime + "\r\n" + "\r\n" +
|
||||
// edition + "\r\n" + "\r\n" +
|
||||
// binding;
|
||||
|
||||
//int imgW = 800; int imgH = 800; int textImgH = 0;
|
||||
//string getImgError;
|
||||
//var img_url = upProdParam.product.info.headImg[0];
|
||||
//if (!img_url.Contains("wst.wxapp.tc.qq.com") && !img_url.Contains("mmecimage.cn"))
|
||||
// img_url = img_url.Replace("https://", "http://");
|
||||
//var imageMain = GetHtml.GetUrlImg(img_url, out getImgError);
|
||||
//if (imageMain == null)
|
||||
// imageMain = new Bitmap(800, 800);
|
||||
//using (Bitmap bitmap = new Bitmap(1, 1)) // 尺寸不重要,只是为了使用Graphics对象
|
||||
//using (Graphics g = Graphics.FromImage(bitmap)) // 获取Graphics对象
|
||||
//{
|
||||
// // 定义字体
|
||||
// Font font = new Font("微软雅黑", 16, FontStyle.Regular);
|
||||
// g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
// // 定义要测量的字符串
|
||||
// string text = bookStr;
|
||||
// // 测量字符串大小
|
||||
// SizeF size = g.MeasureString(text, font, imgW - 120);
|
||||
// // 输出高度信息
|
||||
// //Console.WriteLine("Text Height: " + size.Height);
|
||||
// textImgH = size.Height.ParseToInt() + 180;
|
||||
//}
|
||||
|
||||
////var bookImg = new Bitmap(imgW, imgH);
|
||||
////using (Graphics g = Graphics.FromImage(bookImg))
|
||||
////{
|
||||
//// g.Clear(Color.White);
|
||||
//// //Font font = new Font("宋体", 15, FontStyle.Bold);
|
||||
//// //Font font = new Font("微软雅黑", 15, FontStyle.Regular);
|
||||
//// Font font = new Font("微软雅黑", 16, FontStyle.Regular);
|
||||
//// //Font font = new Font("宋体", 17, FontStyle.Bold);
|
||||
//// Brush textBrush = Brushes.Black;
|
||||
//// g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
//// RectangleF rectF = new RectangleF(60, 80, imgW - 120, imgH - 180);
|
||||
//// g.DrawString(bookStr, font, textBrush, rectF);
|
||||
////}
|
||||
|
||||
//// 绘制一张带主图的商品详情页
|
||||
//var bookImg = new Bitmap(imgW, imgH + textImgH);
|
||||
//using (Graphics g = Graphics.FromImage(bookImg))
|
||||
//{
|
||||
// g.Clear(Color.FromArgb(248, 239, 244));
|
||||
|
||||
// g.DrawImage(imageMain, new Rectangle(0, 0, imgW, imgH), 0, 0, imageMain.Width, imageMain.Height, GraphicsUnit.Pixel);
|
||||
|
||||
// //Font font = new Font("宋体", 15, FontStyle.Bold);
|
||||
// //Font font = new Font("微软雅黑", 15, FontStyle.Regular);
|
||||
// Font font = new Font("微软雅黑", 18, FontStyle.Regular);
|
||||
// //Font font = new Font("宋体", 17, FontStyle.Bold);
|
||||
// Brush textBrush = Brushes.Black;
|
||||
// g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
// RectangleF rectF = new RectangleF(60, imgH + 80, imgW - 120, textImgH - 180);
|
||||
// g.DrawString(bookStr, font, textBrush, rectF);
|
||||
//}
|
||||
|
||||
|
||||
string publisher = "出版发行:" + new List<string>() { "技术出版社", "文化出版社", "美术出版社" }[Randomx.GetId(3)];
|
||||
//string isbn = "ISBN:";
|
||||
string isbn = "ISBN/CN刊号:";
|
||||
//string bookName = "书名:";
|
||||
string bookName = "图书名称:";
|
||||
string bookPrice = "定价:" + upProdParam.product.productSkus.Max(s => s.productSkuInfo.salePrice) * 0.01;
|
||||
string author = "作者:王老师";
|
||||
string bookPrice = "定 价:" + upProdParam.product.productSkus.Max(s => s.productSkuInfo.salePrice) * 0.01;
|
||||
string author = "作 者:王老师";
|
||||
string publishTime = "出版时间:" + DateTime.Now.AddMonths(-3).ToString("yyyy年MM月dd日");
|
||||
string edition = "版次:1";
|
||||
string binding = "装帧:平装";
|
||||
string edition = "版 次:1";
|
||||
string binding = "装 帧:平装";
|
||||
|
||||
foreach (var propParam in upProdParam.product.info.param)
|
||||
{
|
||||
if (propParam.categorys[0].name.Contains("出版社名称"))
|
||||
publisher = "出版社名称:" + propParam.categorys[1].name;
|
||||
publisher = "出版发行:" + propParam.categorys[1].name;
|
||||
else if (propParam.categorys[0].name.Contains("ISBN版号/CN刊号"))
|
||||
{
|
||||
//isbn = "ISBN:" + propParam.categorys[1].name;
|
||||
@@ -4468,13 +4583,13 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
propParam.categorys[1].name = bookPrice;
|
||||
}
|
||||
else if (propParam.categorys[0].name.Contains("作者"))
|
||||
author = "作者:" + propParam.categorys[1].name;
|
||||
author = "作 者:" + propParam.categorys[1].name;
|
||||
else if (propParam.categorys[0].name.Contains("出版时间"))
|
||||
publishTime = "出版时间:" + propParam.categorys[1].name;
|
||||
else if (propParam.categorys[0].name.Contains("版次"))
|
||||
edition = "版次:" + propParam.categorys[1].name;
|
||||
edition = "版 次:" + propParam.categorys[1].name;
|
||||
else if (propParam.categorys[0].name.Contains("包装"))
|
||||
binding = "装帧:" + propParam.categorys[1].name;
|
||||
binding = "装 帧:" + propParam.categorys[1].name;
|
||||
}
|
||||
|
||||
var bookStr = publisher + "\r\n" + "\r\n" +
|
||||
@@ -4509,38 +4624,95 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
textImgH = size.Height.ParseToInt() + 180;
|
||||
}
|
||||
|
||||
//var bookImg = new Bitmap(imgW, imgH);
|
||||
//using (Graphics g = Graphics.FromImage(bookImg))
|
||||
//{
|
||||
// g.Clear(Color.White);
|
||||
// //Font font = new Font("宋体", 15, FontStyle.Bold);
|
||||
// //Font font = new Font("微软雅黑", 15, FontStyle.Regular);
|
||||
// Font font = new Font("微软雅黑", 16, FontStyle.Regular);
|
||||
// //Font font = new Font("宋体", 17, FontStyle.Bold);
|
||||
// Brush textBrush = Brushes.Black;
|
||||
// g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
// RectangleF rectF = new RectangleF(60, 80, imgW - 120, imgH - 180);
|
||||
// g.DrawString(bookStr, font, textBrush, rectF);
|
||||
//}
|
||||
|
||||
// 绘制一张带主图的商品详情页
|
||||
var bookImg = new Bitmap(imgW, imgH + textImgH);
|
||||
var bookImg = TemuKJD.Properties.Resources.empty_book_900_1200;
|
||||
imgH = bookImg.Height;
|
||||
imgW = bookImg.Width;
|
||||
using (Graphics g = Graphics.FromImage(bookImg))
|
||||
{
|
||||
g.Clear(Color.FromArgb(248, 239, 244));
|
||||
|
||||
g.DrawImage(imageMain, new Rectangle(0, 0, imgW, imgH), 0, 0, imageMain.Width, imageMain.Height, GraphicsUnit.Pixel);
|
||||
|
||||
//Font font = new Font("宋体", 15, FontStyle.Bold);
|
||||
//Font font = new Font("微软雅黑", 15, FontStyle.Regular);
|
||||
Font font = new Font("微软雅黑", 18, FontStyle.Regular);
|
||||
//Font font = new Font("宋体", 17, FontStyle.Bold);
|
||||
Brush textBrush = Brushes.Black;
|
||||
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
RectangleF rectF = new RectangleF(60, imgH + 80, imgW - 120, textImgH - 180);
|
||||
g.DrawString(bookStr, font, textBrush, rectF);
|
||||
float txtY = 80;
|
||||
|
||||
// 书名
|
||||
Font font = new Font("宋体", 22, FontStyle.Bold);
|
||||
RectangleF rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY - 80);
|
||||
g.DrawString(bookName.Replace("图书名称:", ""), font, textBrush, rectF);
|
||||
// 测量文本的高度 决定接下来文字绘制位置
|
||||
var textSize = g.MeasureString(bookName.Replace("图书名称:", ""), font, imgW - 200);
|
||||
txtY += 20 + textSize.Height;
|
||||
|
||||
font = new Font("宋体", 16, FontStyle.Bold);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY - 80);
|
||||
g.DrawString(author.Replace("作 者:", "").TrimEnd('著', ' ') + " 著", font, textBrush, rectF);
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(author.Replace("作 者:", "").TrimEnd('著', ' ') + " 著", font, imgW - 200);
|
||||
txtY += 20 + textSize.Height;
|
||||
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY - 80);
|
||||
g.DrawString(publisher.Replace("出版发行:", ""), font, textBrush, rectF);
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(publisher.Replace("出版发行:", ""), font, imgW - 200);
|
||||
txtY += 20 + textSize.Height;
|
||||
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY - 80);
|
||||
g.DrawString(isbn.Replace("ISBN/CN刊号:", "ISBN "), font, textBrush, rectF);
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(isbn.Replace("ISBN/CN刊号:", "ISBN "), font, imgW - 200);
|
||||
txtY += 20 + textSize.Height;
|
||||
|
||||
// 以下从下往上写
|
||||
txtY = imgH - 120;
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(binding, font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(binding, font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(edition, font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(edition, font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(publishTime, font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(publishTime, font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(author, font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(author, font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(bookPrice + "元", font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(bookPrice + "元", font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(bookName, font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(bookName, font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(isbn.Replace("ISBN/CN刊号:", "书号 ISBN "), font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(isbn.Replace("ISBN/CN刊号:", "书 号:ISBN "), font, textBrush, rectF);
|
||||
|
||||
// 测量文本的高度
|
||||
textSize = g.MeasureString(publisher, font, imgW - 200);
|
||||
txtY -= (10 + textSize.Height);
|
||||
rectF = new RectangleF(100, txtY, imgW - 200, imgH - txtY);
|
||||
g.DrawString(publisher, font, textBrush, rectF);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Thread.Sleep(Randomx.GetId(500, 800));
|
||||
var locationStr = UploadImg(shop, bookImg, cell);
|
||||
if (!locationStr.Contains("\"success\":true"))
|
||||
@@ -5666,6 +5838,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
data += "&in_groups=" + serach_group;
|
||||
|
||||
data += "&in_notes=" + cmbNotes.Text.Trim();
|
||||
|
||||
data += "&product_name=" + txtSearchGoodsName.Text.Trim();
|
||||
|
||||
// 商品采集权限可以随机管理员或自己采集的商品
|
||||
@@ -5678,6 +5852,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
cmbHot.Text != "爆款数据" && !BaseClass.UserAuthority.Contains("货源选择"))
|
||||
data += "&add_user_name=" + (BaseClass.GroupId == 3 ? BaseClass.UserName : BaseClass.ParentUserName);
|
||||
|
||||
// 防止手输查询学员数据
|
||||
if (!BaseClass.UserAuthority.Contains("学员数据") && !BaseClass.ParentAuthority.Contains("学员数据") && cmbSourceType.Text.Contains("学员数据"))
|
||||
{
|
||||
cmbSourceType.Text = cmbSourceType.Text.Replace("学员数据", "");
|
||||
@@ -5928,7 +6103,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void txtAddPrice_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (IsLoadComplate)
|
||||
if (IsFormLoad)
|
||||
{
|
||||
defaultAddPriceRule.AddPriceTimes = txtAddTimes.Text.Trim().ParseToDecimal();
|
||||
defaultAddPriceRule.AddMorePrice = txtAddMorePrice.Text.Trim().ParseToDecimal();
|
||||
@@ -5965,7 +6140,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void chkAddMorePriceFirst_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (IsLoadComplate)
|
||||
if (IsFormLoad)
|
||||
{
|
||||
defaultAddPriceRule.AddMorePriceFirst = chkAddMorePriceFirst.Checked;
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_default_add_price_rule", defaultAddPriceRule);
|
||||
@@ -6574,7 +6749,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void txtFissionTitle_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsLoadComplate)
|
||||
if (this.IsFormLoad)
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_prod_fission_title", txtFissionTitle.Text);
|
||||
lblFissionTitleCount.Text = "标题数:" + txtFissionTitle.Text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList().Count();
|
||||
}
|
||||
@@ -6593,9 +6768,13 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
}
|
||||
|
||||
private void chkSameSpecPrice_CheckedChanged(object sender, EventArgs e)
|
||||
private void chkSkipReplaceText_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (this.IsFormLoad)
|
||||
{
|
||||
wxUploadRule.IsSkipHasFilterWordsProd = chkSkipReplaceText.Checked;
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_upload_rule", wxUploadRule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7046,6 +7225,7 @@ Content-Type: application/octet-stream
|
||||
public int PreSaleDays { get; set; } = 5;
|
||||
|
||||
public string FilterWords { get; set; } = "顶级,之王,二手,亏本,冲量,白菜价,跳楼价,xx,xxx,最大,最小,低价,降价,成本,赔钱,甩卖,真丝,蚕丝,香云纱,羊绒,羊毛,羊羔绒,羊羔毛,羽绒,皮草";
|
||||
public bool IsSkipHasFilterWordsProd { get; set; } = false;
|
||||
|
||||
public int SkuMinPrice { get; set; } = 10;
|
||||
public int SkuMaxPrice { get; set; } = 9999;
|
||||
|
||||
Reference in new issue
Block a user