优化清理无流量逻辑 修复用户导入商品失败问题 图书上传资质文件逻辑完成
This commit is contained in:
1 parent
7d07c83579
commit
3514be2dba
16 files changed
+705
-340
No files matched your search
@@ -41,6 +41,14 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.btnEmpty = new DevComponents.DotNetBar.PanelEx();
|
||||
this.pbLoading = new System.Windows.Forms.PictureBox();
|
||||
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
|
||||
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colCat1Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colImgMd5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colImg = new System.Windows.Forms.DataGridViewImageColumn();
|
||||
this.colTextMargin = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colChangeImage = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
|
||||
this.txtBottom = new System.Windows.Forms.TextBox();
|
||||
@@ -60,13 +68,6 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
|
||||
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colCat1Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colImgMd5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colImg = new System.Windows.Forms.DataGridViewImageColumn();
|
||||
this.colChangeImage = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -140,7 +141,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.btnSearch.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnSearch.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnSearch.Location = new System.Drawing.Point(181, 12);
|
||||
this.btnSearch.Location = new System.Drawing.Point(362, 12);
|
||||
this.btnSearch.Name = "btnSearch";
|
||||
this.btnSearch.Size = new System.Drawing.Size(56, 23);
|
||||
this.btnSearch.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -162,7 +163,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
//
|
||||
this.txtCatName.Location = new System.Drawing.Point(83, 12);
|
||||
this.txtCatName.Name = "txtCatName";
|
||||
this.txtCatName.Size = new System.Drawing.Size(90, 23);
|
||||
this.txtCatName.Size = new System.Drawing.Size(273, 23);
|
||||
this.txtCatName.TabIndex = 419;
|
||||
//
|
||||
// label5
|
||||
@@ -179,7 +180,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.btnEmpty.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.btnEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnEmpty.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnEmpty.Location = new System.Drawing.Point(242, 12);
|
||||
this.btnEmpty.Location = new System.Drawing.Point(423, 12);
|
||||
this.btnEmpty.Name = "btnEmpty";
|
||||
this.btnEmpty.Size = new System.Drawing.Size(56, 23);
|
||||
this.btnEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -233,6 +234,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.colCat1Name,
|
||||
this.colImgMd5,
|
||||
this.colImg,
|
||||
this.colTextMargin,
|
||||
this.colChangeImage,
|
||||
this.colDelete,
|
||||
this.colMsg});
|
||||
@@ -248,6 +250,67 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
|
||||
this.dgvShop.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvShop_CellMouseDown);
|
||||
//
|
||||
// colSelect
|
||||
//
|
||||
this.colSelect.FillWeight = 16F;
|
||||
this.colSelect.HeaderText = "选";
|
||||
this.colSelect.Name = "colSelect";
|
||||
this.colSelect.ReadOnly = true;
|
||||
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
//
|
||||
// colCat1Name
|
||||
//
|
||||
this.colCat1Name.FillWeight = 70F;
|
||||
this.colCat1Name.HeaderText = "类目名称";
|
||||
this.colCat1Name.Name = "colCat1Name";
|
||||
this.colCat1Name.ReadOnly = true;
|
||||
//
|
||||
// colImgMd5
|
||||
//
|
||||
this.colImgMd5.FillWeight = 50F;
|
||||
this.colImgMd5.HeaderText = "图片码";
|
||||
this.colImgMd5.Name = "colImgMd5";
|
||||
this.colImgMd5.ReadOnly = true;
|
||||
//
|
||||
// colImg
|
||||
//
|
||||
this.colImg.FillWeight = 40F;
|
||||
this.colImg.HeaderText = "图片";
|
||||
this.colImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
|
||||
this.colImg.Name = "colImg";
|
||||
this.colImg.ReadOnly = true;
|
||||
this.colImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
//
|
||||
// colTextMargin
|
||||
//
|
||||
this.colTextMargin.HeaderText = "文字边距";
|
||||
this.colTextMargin.Name = "colTextMargin";
|
||||
this.colTextMargin.ReadOnly = true;
|
||||
//
|
||||
// colChangeImage
|
||||
//
|
||||
this.colChangeImage.FillWeight = 46F;
|
||||
this.colChangeImage.HeaderText = "编辑图片";
|
||||
this.colChangeImage.Name = "colChangeImage";
|
||||
this.colChangeImage.ReadOnly = true;
|
||||
this.colChangeImage.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colChangeImage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
//
|
||||
// colDelete
|
||||
//
|
||||
this.colDelete.FillWeight = 46F;
|
||||
this.colDelete.HeaderText = "删除";
|
||||
this.colDelete.Name = "colDelete";
|
||||
this.colDelete.ReadOnly = true;
|
||||
//
|
||||
// colMsg
|
||||
//
|
||||
this.colMsg.HeaderText = "操作结果";
|
||||
this.colMsg.Name = "colMsg";
|
||||
this.colMsg.ReadOnly = true;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.BackColor = System.Drawing.Color.White;
|
||||
@@ -305,17 +368,18 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
// txtBottom
|
||||
//
|
||||
this.txtBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtBottom.Location = new System.Drawing.Point(557, 442);
|
||||
this.txtBottom.Location = new System.Drawing.Point(557, 438);
|
||||
this.txtBottom.Name = "txtBottom";
|
||||
this.txtBottom.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtBottom.TabIndex = 471;
|
||||
this.txtBottom.Text = "270";
|
||||
this.txtBottom.TextChanged += new System.EventHandler(this.txt_TextChanged);
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(531, 445);
|
||||
this.label7.Location = new System.Drawing.Point(531, 441);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(32, 17);
|
||||
this.label7.TabIndex = 472;
|
||||
@@ -324,17 +388,18 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
// txtRight
|
||||
//
|
||||
this.txtRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtRight.Location = new System.Drawing.Point(557, 413);
|
||||
this.txtRight.Location = new System.Drawing.Point(557, 409);
|
||||
this.txtRight.Name = "txtRight";
|
||||
this.txtRight.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtRight.TabIndex = 469;
|
||||
this.txtRight.Text = "240";
|
||||
this.txtRight.TextChanged += new System.EventHandler(this.txt_TextChanged);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(531, 416);
|
||||
this.label6.Location = new System.Drawing.Point(531, 412);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(32, 17);
|
||||
this.label6.TabIndex = 470;
|
||||
@@ -343,17 +408,18 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
// txtTop
|
||||
//
|
||||
this.txtTop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtTop.Location = new System.Drawing.Point(557, 384);
|
||||
this.txtTop.Location = new System.Drawing.Point(557, 380);
|
||||
this.txtTop.Name = "txtTop";
|
||||
this.txtTop.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtTop.TabIndex = 467;
|
||||
this.txtTop.Text = "270";
|
||||
this.txtTop.TextChanged += new System.EventHandler(this.txt_TextChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(531, 387);
|
||||
this.label4.Location = new System.Drawing.Point(531, 383);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(32, 17);
|
||||
this.label4.TabIndex = 468;
|
||||
@@ -362,7 +428,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
// txtLeft
|
||||
//
|
||||
this.txtLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtLeft.Location = new System.Drawing.Point(557, 355);
|
||||
this.txtLeft.Location = new System.Drawing.Point(557, 351);
|
||||
this.txtLeft.Name = "txtLeft";
|
||||
this.txtLeft.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtLeft.TabIndex = 465;
|
||||
@@ -373,7 +439,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
//
|
||||
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(531, 358);
|
||||
this.label3.Location = new System.Drawing.Point(531, 354);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(32, 17);
|
||||
this.label3.TabIndex = 466;
|
||||
@@ -383,7 +449,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
//
|
||||
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(531, 325);
|
||||
this.label2.Location = new System.Drawing.Point(531, 329);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(68, 17);
|
||||
this.label2.TabIndex = 464;
|
||||
@@ -506,62 +572,6 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
this.panel3.Size = new System.Drawing.Size(1271, 576);
|
||||
this.panel3.TabIndex = 35;
|
||||
//
|
||||
// colSelect
|
||||
//
|
||||
this.colSelect.FillWeight = 16F;
|
||||
this.colSelect.HeaderText = "选";
|
||||
this.colSelect.Name = "colSelect";
|
||||
this.colSelect.ReadOnly = true;
|
||||
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
//
|
||||
// colCat1Name
|
||||
//
|
||||
this.colCat1Name.FillWeight = 70F;
|
||||
this.colCat1Name.HeaderText = "类目名称";
|
||||
this.colCat1Name.Name = "colCat1Name";
|
||||
this.colCat1Name.ReadOnly = true;
|
||||
//
|
||||
// colImgMd5
|
||||
//
|
||||
this.colImgMd5.FillWeight = 50F;
|
||||
this.colImgMd5.HeaderText = "图片码";
|
||||
this.colImgMd5.Name = "colImgMd5";
|
||||
this.colImgMd5.ReadOnly = true;
|
||||
//
|
||||
// colImg
|
||||
//
|
||||
this.colImg.FillWeight = 40F;
|
||||
this.colImg.HeaderText = "图片";
|
||||
this.colImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
|
||||
this.colImg.Name = "colImg";
|
||||
this.colImg.ReadOnly = true;
|
||||
this.colImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
//
|
||||
// colChangeImage
|
||||
//
|
||||
this.colChangeImage.FillWeight = 46F;
|
||||
this.colChangeImage.HeaderText = "编辑图片";
|
||||
this.colChangeImage.Name = "colChangeImage";
|
||||
this.colChangeImage.ReadOnly = true;
|
||||
this.colChangeImage.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colChangeImage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
//
|
||||
// colDelete
|
||||
//
|
||||
this.colDelete.FillWeight = 46F;
|
||||
this.colDelete.HeaderText = "删除";
|
||||
this.colDelete.Name = "colDelete";
|
||||
this.colDelete.ReadOnly = true;
|
||||
this.colDelete.Visible = false;
|
||||
//
|
||||
// colMsg
|
||||
//
|
||||
this.colMsg.HeaderText = "操作结果";
|
||||
this.colMsg.Name = "colMsg";
|
||||
this.colMsg.ReadOnly = true;
|
||||
//
|
||||
// WXAdminQualificationImageForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@@ -634,6 +644,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colCat1Name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colImgMd5;
|
||||
private System.Windows.Forms.DataGridViewImageColumn colImg;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colTextMargin;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colChangeImage;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Printing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -88,7 +89,9 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
{
|
||||
int pageCount;
|
||||
decimal seconds = 0;
|
||||
var list = AdminGetServerQualificationImageLst(out pageCount, out seconds, page, ucSplitPage1.PageSize);
|
||||
var catName = "";
|
||||
Invoke(new Action(() => { catName = txtCatName.Text.Trim(); }));
|
||||
var list = AdminGetServerQualificationImageLst(out pageCount, out seconds, "", "", page, ucSplitPage1.PageSize);
|
||||
lstWxQualificationImageInfo.AddRange(list);
|
||||
this.ucSplitPage1.TotalPage = pageCount;
|
||||
|
||||
@@ -101,6 +104,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
image.cat_name,
|
||||
image.img_md5,
|
||||
Base64ChangeImgUrl.Base64ToImage(image.img_thumb_base64),
|
||||
image.txt_margin,
|
||||
"编辑",
|
||||
"删除");
|
||||
|
||||
@@ -149,28 +153,43 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
|
||||
switch (headerText)
|
||||
{
|
||||
case "进入店铺":
|
||||
//IsOperate = true;
|
||||
//{
|
||||
// WXAdminShopLoginForm adminLoginForm = new WXAdminShopLoginForm(shop);
|
||||
// adminLoginForm.openType = EnumOpenType.manage;
|
||||
// adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
// adminLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
|
||||
// adminLoginForm.Show();
|
||||
//}
|
||||
//IsOperate = false;
|
||||
break;
|
||||
case "删除":
|
||||
if (BaseMsgForm.ShowConfirm("确定删除吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
|
||||
return;
|
||||
//if (ShopBLL.AdminDelServerShop(shop))
|
||||
// SearchImg(this.ucSplitPage1.CurrentPage);
|
||||
var url = BaseClass.BuildObjString("product/wx_del_qualification_image");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&img_md5=" + row.Cells["colImgMd5"].Value.ParseToString();
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (!html.Contains("\"code\":200"))
|
||||
BaseMsgForm.ShowError(BaseRegex.GetStringJsonByRegs(ref html, html, "msg"));
|
||||
SearchImg(ucSplitPage1.CurrentPage);
|
||||
break;
|
||||
case "编辑图片":
|
||||
var image = lstWxQualificationImageInfo.FirstOrDefault(i => i.img_md5 == row.Cells["colImgMd5"].Value.ParseToString());
|
||||
if (image != null)
|
||||
{
|
||||
image.img_base64.IsNullOrEmpty();
|
||||
if (image.img_base64.IsNullOrEmpty())
|
||||
{
|
||||
int pageCount;
|
||||
decimal seconds = 0;
|
||||
image.img_base64 = AdminGetServerQualificationImageLst(out pageCount, out seconds, "", image.img_md5).FirstOrDefault()?.img_base64;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (image.txt_margin.ParseToString().Split(',').Select(m => m.ParseToInt()).ToList() is List<int> marginValueList && marginValueList.Count == 4)
|
||||
{
|
||||
txtLeft.Text = marginValueList[0].ToString();
|
||||
txtTop.Text = marginValueList[1].ToString();
|
||||
txtRight.Text = marginValueList[2].ToString();
|
||||
txtBottom.Text = marginValueList[3].ToString();
|
||||
}
|
||||
var imageSource = Base64ChangeImgUrl.Base64ToImage(image.img_base64);
|
||||
LoadImg(imageSource);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("加载图片失败" + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -197,7 +216,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
return shopNameList;
|
||||
}
|
||||
|
||||
public List<wx_qualification_image_info> AdminGetServerQualificationImageLst(out int pageCount, out decimal seconds, int page = 1, int pageSize = 50)
|
||||
public static List<wx_qualification_image_info> AdminGetServerQualificationImageLst(out int pageCount, out decimal seconds, string cat_name="", string img_md5 = "", int page = 1, int pageSize = 200)
|
||||
{
|
||||
List<wx_qualification_image_info> list = new List<wx_qualification_image_info>();
|
||||
pageCount = 1;
|
||||
@@ -207,7 +226,15 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&page=" + page +
|
||||
"&page_size=" + pageSize;
|
||||
data += "&is_detail=true";
|
||||
if (!string.IsNullOrEmpty(img_md5))
|
||||
{
|
||||
data += "&img_md5=" + img_md5;
|
||||
data += "&is_detail=true";
|
||||
}
|
||||
if (!cat_name.IsNullOrEmpty())
|
||||
{
|
||||
data += "&cat_name=" + cat_name;
|
||||
}
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (!html.Contains("\"code\":200"))
|
||||
return list;
|
||||
@@ -240,33 +267,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
{
|
||||
string filePath = openFileDialog.FileName;
|
||||
Image imageSource = Image.FromFile(filePath);
|
||||
EmptyImage = new Bitmap(900, 1200);
|
||||
using (Graphics g = Graphics.FromImage(EmptyImage))
|
||||
{
|
||||
g.DrawImage(imageSource, new Rectangle(0, 0, EmptyImage.Width, EmptyImage.Height), 0, 0, imageSource.Width, imageSource.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
string imgBase64 = "";
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
EmptyImage.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
byte[] imageBytes = memoryStream.ToArray();
|
||||
imgBase64 = Convert.ToBase64String(imageBytes);
|
||||
}
|
||||
|
||||
if (this.pictureBox1.Tag.ParseToString() != imgBase64)
|
||||
{
|
||||
this.pictureBox1.Tag = imgBase64;
|
||||
this.pictureBox1.ImageLocation = "";
|
||||
|
||||
Image image = new Bitmap(900, 1200);
|
||||
using (Graphics g = Graphics.FromImage(image))
|
||||
{
|
||||
g.DrawImage(EmptyImage, new Rectangle(0, 0, image.Width, image.Height), 0, 0, EmptyImage.Width, EmptyImage.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
DrawText(image, txtLeft.Text.ParseToInt(), txtTop.Text.ParseToInt(), txtRight.Text.ParseToInt(), txtBottom.Text.ParseToInt());
|
||||
this.pictureBox1.Image = image;
|
||||
}
|
||||
LoadImg(imageSource);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -276,6 +277,32 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string imgBase64 = "";
|
||||
public void LoadImg(Image imageSource)
|
||||
{
|
||||
EmptyImage = new Bitmap(900, 1200);
|
||||
using (Graphics g = Graphics.FromImage(EmptyImage))
|
||||
{
|
||||
g.DrawImage(imageSource, new Rectangle(0, 0, EmptyImage.Width, EmptyImage.Height), 0, 0, imageSource.Width, imageSource.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
EmptyImage.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
byte[] imageBytes = memoryStream.ToArray();
|
||||
imgBase64 = Convert.ToBase64String(imageBytes);
|
||||
}
|
||||
this.pictureBox1.ImageLocation = "";
|
||||
|
||||
Image image = new Bitmap(900, 1200);
|
||||
using (Graphics g = Graphics.FromImage(image))
|
||||
{
|
||||
g.DrawImage(EmptyImage, new Rectangle(0, 0, image.Width, image.Height), 0, 0, EmptyImage.Width, EmptyImage.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
DrawText(image, txtLeft.Text.ParseToInt(), txtTop.Text.ParseToInt(), txtRight.Text.ParseToInt(), txtBottom.Text.ParseToInt());
|
||||
this.pictureBox1.Image = image;
|
||||
}
|
||||
|
||||
public static void DrawText(Image img, int _txtLeft, int _txtTop, int _txtRight, int _txtBottom)
|
||||
{
|
||||
if (img == null)
|
||||
@@ -385,6 +412,9 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
|
||||
private void txt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (EmptyImage == null)
|
||||
return;
|
||||
|
||||
Image image = new Bitmap(900, 1200);
|
||||
using (Graphics g = Graphics.FromImage(image))
|
||||
{
|
||||
@@ -396,7 +426,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (pictureBox1.Tag.ParseToString().IsNullOrEmpty())
|
||||
if (imgBase64.IsNullOrEmpty())
|
||||
return;
|
||||
|
||||
var thumbImage = new Bitmap(90, 120);
|
||||
@@ -418,8 +448,8 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
data = UserLogin.GetSignaturex();
|
||||
data += "&img_md5=" + BaseClass.GetMd5(pictureBox1.Tag.ParseToString());
|
||||
data += "&img_base64=" + pictureBox1.Tag.ParseToString();
|
||||
data += "&img_md5=" + BaseClass.GetMd5(imgBase64);
|
||||
data += "&img_base64=" + imgBase64;
|
||||
data += "&txt_margin=" + txtLeft.Text.ParseToInt() + "," + txtTop.Text.ParseToInt() + "," + txtRight.Text.ParseToInt() + "," + txtBottom.Text.ParseToInt();
|
||||
data += "&img_thumb_base64=" + thumbBase64;
|
||||
}));
|
||||
@@ -428,6 +458,8 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
|
||||
SearchImg(ucSplitPage1.CurrentPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,6 +129,9 @@
|
||||
<metadata name="colImg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colTextMargin.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colChangeImage.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
Reference in new issue
Block a user