1优化拍单逻辑 2优化部分文件位置命名等

This commit is contained in:
wule committed 2026-06-25 16:45:28 +08:00
1 parent 34c51c6fcd
commit 1e27c0b1e1
65 files changed
+2594 -268

No files matched your search

+6 -3
View File
@@ -25,7 +25,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\KJD Cef138\Bin\</OutputPath>
<OutputPath>..\Bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -242,8 +242,11 @@
<Compile Include="_29Tools\BLL\SendBuyerOrder.cs" />
<Compile Include="_29Tools\BLL\HttpResponseWXBLL.cs" />
<Compile Include="_29Tools\BLL\HttpResponseYkdBLL.cs" />
<Compile Include="_29Tools\CefTools\CustomResourceRequestHandlerLocal.cs" />
<Compile Include="_29Tools\CefTools\LifeSpanHandlerLocal.cs" />
<Compile Include="_29Tools\CefTools\LocalCookieVisitor.cs" />
<Compile Include="_29Tools\CefTools\LocalRequestHandler.cs" />
<Compile Include="_29Tools\CefTools\LocalResourceRequestHandler.cs" />
<Compile Include="_29Tools\CefTools\LocalLifeSpanHandler.cs" />
<Compile Include="_29Tools\CefTools\LocalMenuHandler.cs" />
<Compile Include="_29Tools\Forms\PddMobileBuyOrderForm.cs">
<SubType>Form</SubType>
</Compile>
+1
View File
@@ -1,4 +1,5 @@
using AllBase;
using AllBase.Model.Local;
using AllBase.Model.Result;
using Newtonsoft.Json;
using System;
+1
View File
@@ -1,4 +1,5 @@
using AllBase;
using AllBase.Model.Local;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
+1
View File
@@ -1,4 +1,5 @@
using AllBase;
using AllBase.Model.Local;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using System;
+1
View File
@@ -1,4 +1,5 @@
using AllBase;
using AllBase.Model.Local;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using System;
+1 -1
View File
@@ -1,6 +1,6 @@
using AllBase;
using AllBase.Model;
using AllBase.Model.Params;
using AllBase.Model.Local;
using CefSharp.DevTools.LayerTree;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
+572
View File
@@ -0,0 +1,572 @@
using CefSharp;
using CefSharp.WinForms;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
using NaiBa.Util;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using NaiBa.Util.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Work._29Tools.CefTools
{
public class LocalCEFBrowser
{
public static bool IsKeepGlobalCookie = true; // true 的时候,cookie 会保存在硬盘上,cookie 是持久化的
public static string CefGlobalCachePath = Path.Combine(FileHelper.GetApplicationDir(), "cef_temp");
public static string CefMemoryCachePath = Path.Combine(CefGlobalCachePath, "memory");
public static void Init(string userAgent = "")
{
// 必须在主线程进行初始化
if (NaiBaGlobalConfig.IsDevelopment)
{
FileHelper.DeleteFolder(CefGlobalCachePath);
}
FileHelper.CreateDirectory(CefGlobalCachePath);
CefSharpSettings.WcfEnabled = false;
CefSettings settings = new CefSettings
{
IgnoreCertificateErrors = false,
Locale = "zh-CN",
PersistSessionCookies = true,
//PersistUserPreferences = true, //cef138
LogFile = Path.Combine(CefGlobalCachePath, "debug.log"),
LogSeverity = NaiBaGlobalConfig.IsDevelopment ? LogSeverity.Verbose : LogSeverity.Error,
CachePath = IsKeepGlobalCookie ? CefGlobalCachePath : string.Empty,
RootCachePath = IsKeepGlobalCookie ? CefGlobalCachePath : string.Empty
};
settings.UserAgent = string.IsNullOrEmpty(userAgent) ? NaiBaGlobalConfig.UserAgent : userAgent;
settings.CefCommandLineArgs.Add("disable-gpu", "1");
settings.CefCommandLineArgs.Add("--ignore-ssl-errors");
settings.CefCommandLineArgs.Add("--disable-web-security");
settings.CefCommandLineArgs.Add("--allow-file-access-from-files"); // 允许通过 file:/// 协议访问 Worker
System.Net.IWebProxy webProxy = NaiBaGlobalConfig.GetDevelopProxy();
if (webProxy != null)
{
if (NaiBaGlobalConfig.IsDevelopment)
{
bool isSetFiddlerProxy = false; // 由于店铺可能绑定了代理,浏览器不设置 Fiddler 代理
if (isSetFiddlerProxy)
{
string address = ReflectionHelper.GetObjectPropertyValue(webProxy, "Address").ParseToString();
if (!address.IsNullOrEmpty())
{
address = address.Trim('/');
// Don't set any proxy during initialize,becuase once setting,it couldn't be changed at runtime
settings.CefCommandLineArgs.Add("--proxy-server", address);
}
}
}
}
var rst = Cef.Initialize(settings);
}
/// <summary>
/// 关闭所有Cef进程
/// </summary>
public static void ShutDown()
{
Cef.Shutdown();
}
public static ChromiumWebBrowser CreateChromiumWebBrowser(string url, bool isGlobal = true, bool isPopupNewWindow = true)
{
ChromiumWebBrowser cefBrowser = new ChromiumWebBrowser(url);
if (!isGlobal)
{
cefBrowser.RequestContext = new RequestContext(GetRequestContextIsolateSettings());
}
cefBrowser.BrowserSettings = new BrowserSettings
{
Javascript = CefState.Enabled,
JavascriptAccessClipboard = CefState.Enabled,
JavascriptCloseWindows = CefState.Enabled,
JavascriptDomPaste = CefState.Enabled,
LocalStorage = CefState.Enabled,
//Plugins = CefState.Disabled, //cef138
//FileAccessFromFileUrls = CefState.Enabled, //cef138
//UniversalAccessFromFileUrls = CefState.Enabled //cef138
};
cefBrowser.KeyboardHandler = new KeyboardHandler();
cefBrowser.MenuHandler = new MenuHandler();
cefBrowser.LifeSpanHandler = new LifeSpanHandler(isPopupNewWindow);
return cefBrowser;
}
public static RequestContextSettings GetRequestContextIsolateSettings()
{
RequestContextSettings requestContextSettings = new RequestContextSettings()
{
PersistSessionCookies = true,
CookieableSchemesExcludeDefaults = false,
};
//requestContextSettings.PersistSessionCookies = false;
//requestContextSettings.PersistUserPreferences = false; // cef138
return requestContextSettings;
}
public static void CheckCefPlatform()
{
string executingFolder = FileHelper.GetApplicationDir();
//If libcef.dll doesn't exist in our executing folder then we'll copy the files
//For this method the user must have write permissions to the executing folder.
if (!File.Exists(Path.Combine(executingFolder, "libcef.dll")))
{
var libPath = Path.Combine(executingFolder, Environment.Is64BitProcess ? "x64" : "x86");
if (Directory.Exists(libPath))
{
FileHelper.MoveFolder(libPath, executingFolder);
}
string dir = executingFolder + "x86";
if (Directory.Exists(dir))
{
Directory.Delete(dir, recursive: true);
}
dir = executingFolder + "x64";
if (Directory.Exists(dir))
{
Directory.Delete(dir, recursive: true);
}
}
}
public static async Task<bool> SetProxyAsync(ChromiumWebBrowser cefWebBrowser, string proxyUrl)
{
bool isUseProxy = false;
await Cef.UIThreadTaskFactory.StartNew(() =>
{
try
{
var rc = cefWebBrowser.GetBrowser().GetHost().RequestContext;
var dict = new Dictionary<string, object>();
if (string.IsNullOrEmpty(proxyUrl))
{
dict.Add("mode", "system");
}
else
{
var objProxy = HttpHelper.ResoveProxyServer(proxyUrl);
if (objProxy.Tag == 1)
{
BaseProxyServer baseProxyServer = objProxy.Data;
if (!baseProxyServer.Username.IsNullOrEmpty() && !baseProxyServer.Password.IsNullOrEmpty())
{
CustomRequestHandler customRequestHandler = cefWebBrowser.RequestHandler as CustomRequestHandler;
if (customRequestHandler != null)
{
customRequestHandler.UserName = baseProxyServer.Username;
customRequestHandler.Password = baseProxyServer.Password;
}
}
proxyUrl = string.Format("http://{0}:{1}", baseProxyServer.ServerIP, baseProxyServer.ServerPort);
}
dict.Add("mode", "fixed_servers"); // fixed_servers,pac_script,auto_detect,system,direct
dict.Add("server", proxyUrl);
}
string error;
bool success = rc.SetPreference("proxy", dict, out error);
if (success)
{
isUseProxy = true;
}
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
});
return isUseProxy;
}
public static string ParseCookieListToString(List<Cookie> cookieList)
{
string cookies = string.Empty;
foreach (Cookie cookie in cookieList)
{
cookies += string.Format("{0}={1};", cookie.Name, cookie.Value);
}
return cookies;
}
public static List<Cookie> GetCookieList(string domains = "", ICookieManager cookieManager = null)
{
if (cookieManager == null)
{
cookieManager = Cef.GetGlobalCookieManager();
}
CookieVisitor visitor = new CookieVisitor();
if (cookieManager.VisitAllCookies(visitor))
{
visitor.WaitForAllCookie();
}
if (string.IsNullOrEmpty(domains))
{
return visitor.CookieList;
}
else
{
List<Cookie> list = new List<Cookie>();
foreach (string domain in domains.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
{
list.AddRange(visitor.CookieList.Where(p => p.Domain != null && p.Domain.Contains(domain.Trim())).ToList());
}
return list;
}
}
public static string GetCookie(string domains = "", ICookieManager cookieManager = null)
{
List<Cookie> cookieList = GetCookieList(domains, cookieManager);
string cookies = ParseCookieListToString(cookieList);
return cookies;
}
public static async Task SetCookieAsync(string domain, string cookies, ICookieManager cookieManager = null)
{
try
{
foreach (string cookie in cookies.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries))
{
int i = cookie.IndexOf('=');
if (i > 0)
{
string name = cookie.Substring(0, i).ToString().Trim();
string value = cookie.Substring(i + 1).ToString().Trim();
if (name.ToLower() == "expires" || name.ToLower() == "path" || name.ToLower() == "domain")
{
continue;
}
Cookie newCookie = new Cookie
{
Domain = domain,
Name = name,
Value = value,
Path = "/"
};
if (cookieManager == null)
{
bool result = await Cef.GetGlobalCookieManager().SetCookieAsync("http://" + domain, newCookie);
}
else
{
bool result = await cookieManager.SetCookieAsync("http://" + domain, newCookie);
}
}
}
}
catch { }
}
public static async Task SetCookieAsync(string cookieList, ICookieManager cookieManager = null)
{
try
{
if (!string.IsNullOrEmpty(cookieList))
{
List<Cookie> list = JsonConvert.DeserializeObject<List<Cookie>>(cookieList);
foreach (Cookie cookie in list)
{
cookie.Secure = false;
if (cookieManager == null)
{
bool result = await Cef.GetGlobalCookieManager().SetCookieAsync("http://" + cookie.Domain.Trim('.'), cookie);
}
else
{
bool result = await cookieManager.SetCookieAsync("http://" + cookie.Domain.Trim('.'), cookie);
}
}
}
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
}
public static async Task DeleteCookieAsync(ICookieManager cookieManager, string domain = "", string name = "")
{
string url = string.Empty;
if (!string.IsNullOrEmpty(domain))
{
url = "http://" + domain;
}
if (cookieManager == null)
{
int result = await Cef.GetGlobalCookieManager().DeleteCookiesAsync(url, name);
}
else
{
int result = await cookieManager.DeleteCookiesAsync(url, name);
}
}
public static void DeleteCookie(ICookieManager cookieManager, string domain = "", string name = "")
{
string url = string.Empty;
if (!string.IsNullOrEmpty(domain))
{
url = "http://" + domain;
}
if (cookieManager == null)
{
bool result = Cef.GetGlobalCookieManager().DeleteCookies(url, name);
}
else
{
bool result = cookieManager.DeleteCookies(url, name);
}
}
public static void ExecJavascript(ChromiumWebBrowser cefWebBrowser, string js)
{
// cef138
//List<long> frameIdentifierList = cefWebBrowser.GetBrowser().GetFrameIdentifiers();
//foreach (long identifier in frameIdentifierList)
List<string> frameIdentifierList = cefWebBrowser.GetBrowser().GetFrameIdentifiers();
foreach (string identifier in frameIdentifierList)
{
//IFrame frame = cefWebBrowser.GetBrowser().GetFrame(identifier);
IFrame frame = cefWebBrowser.GetBrowser().GetFrameByIdentifier(identifier);
if (frame.IsMain)
{
frame.ExecuteJavaScriptAsync(js);
break;
}
}
}
public static void ExecJavascript(ChromiumWebBrowser cefWebBrowser, string expectUrl, string js, Func<string, string, bool> checkUrl)
{
// cef138
//List<long> frameIdentifierList = cefWebBrowser.GetBrowser().GetFrameIdentifiers();
//foreach (long identifier in frameIdentifierList)
List<string> frameIdentifierList = cefWebBrowser.GetBrowser().GetFrameIdentifiers();
foreach (string identifier in frameIdentifierList)
{
//IFrame frame = cefWebBrowser.GetBrowser().GetFrame(identifier);
IFrame frame = cefWebBrowser.GetBrowser().GetFrameByIdentifier(identifier);
if (checkUrl(frame.Url, expectUrl))
{
frame.ExecuteJavaScriptAsync(js);
break;
}
}
}
public static void ExecJavascriptEqualsUrl(ChromiumWebBrowser cefWebBrowser, string url, string js)
{
ExecJavascript(cefWebBrowser, url, js, (frameUrl, expectUrl) =>
{
if (frameUrl.Equals(expectUrl))
{
return true;
}
else
{
return true;
}
});
}
public static void ExecJavascriptStartsWithUrl(ChromiumWebBrowser cefWebBrowser, string url, string js)
{
ExecJavascript(cefWebBrowser, url, js, (frameUrl, expectUrl) =>
{
if (frameUrl.StartsWith(expectUrl))
{
return true;
}
else
{
return true;
}
});
}
public static void ExecJavascriptContainsUrl(ChromiumWebBrowser cefWebBrowser, string url, string js)
{
ExecJavascript(cefWebBrowser, url, js, (frameUrl, expectUrl) =>
{
if (frameUrl.Contains(expectUrl))
{
return true;
}
else
{
return false;
}
});
}
public static JavascriptResponse EvaluateScript(ChromiumWebBrowser cefWebBrowser, string js)
{
JavascriptResponse javascriptResponse = null;
Task task = Task.Run(async () =>
{
javascriptResponse = await cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(js);
return javascriptResponse;
});
task.Wait();
return javascriptResponse;
}
public static async Task<JavascriptResponse> EvaluateScriptAsync(ChromiumWebBrowser cefWebBrowser, string js)
{
JavascriptResponse javascriptResponse = await cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(js);
return javascriptResponse;
}
public static async Task<JavascriptResponse> EvaluateScriptAsync(ChromiumWebBrowser cefWebBrowser, string url, string js, Func<string, string, bool> checkUrl)
{
// cef138
JavascriptResponse javascriptResponse = new JavascriptResponse();
//List<long> frameIdentifierList = cefWebBrowser.GetBrowser().GetFrameIdentifiers();
//foreach (long identifier in frameIdentifierList)
List<string> frameIdentifierList = cefWebBrowser.GetBrowser().GetFrameIdentifiers();
foreach (string identifier in frameIdentifierList)
{
//IFrame frame = cefWebBrowser.GetBrowser().GetFrame(identifier);
IFrame frame = cefWebBrowser.GetBrowser().GetFrameByIdentifier(identifier);
if (checkUrl(frame.Url, url))
{
javascriptResponse = await frame.EvaluateScriptAsync(js);
}
}
return javascriptResponse;
}
public static string GetElementLocation(ChromiumWebBrowser cefWebBrowser, string elementIdOrClass)
{
string js = @"function getElementLocation() {
var element = document.getElementById('{0}');
if (element == null || element == undefined) {
var elements = document.getElementsByClassName('{0}');
if(elements){
element = elements[0];
}
}
if (element == null || element == undefined)
{
return '0,0,0,0';
}
return element.getBoundingClientRect().left.toString() + ',' + element.getBoundingClientRect().top.toString() + ',' + (element.width?element.width.toString():element.getBoundingClientRect().width) + ',' + (element.height?element.height.toString():element.getBoundingClientRect().height);
}
getElementLocation();
";
string formatJs = js.Replace("{0}", elementIdOrClass);
Task<JavascriptResponse> task = cefWebBrowser.EvaluateScriptAsync(formatJs);
task.Wait(2000);
string location = task.Result.Result.ParseToString();
return location;
}
public static LocationPoint GetElementLocationPoint(ChromiumWebBrowser cefWebBrowser, string elementIdOrClass)
{
LocationPoint locationPoint = new LocationPoint();
string location = GetElementLocation(cefWebBrowser, elementIdOrClass);
if (location.Contains(","))
{
string[] xy = location.Split(',');
locationPoint.Left = xy[0].DecimalPointParseToInt();
locationPoint.Top = xy[1].DecimalPointParseToInt();
locationPoint.Width = xy[2].DecimalPointParseToInt();
locationPoint.Height = xy[3].DecimalPointParseToInt();
}
return locationPoint;
}
public static void SimulateMouseLeftClick(IBrowserHost host, int x, int y)
{
Random random = new Random(Guid.NewGuid().GetHashCode());
host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None); // 按下鼠标左键
Thread.Sleep(75 + random.Next(50));
host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None); // 松开鼠标左键
Thread.Sleep(300);
}
/// <summary>
/// 模拟鼠标滑动
/// </summary>
/// <param name="host"></param>
/// <param name="fromX">左边缘Left</param>
/// <param name="fromY">左边缘Top</param>
/// <param name="toX">右边缘Left</param>
/// <param name="toY">右边缘Top</param>
/// <param name="slideWidth">滑块的宽度</param>
/// <param name="slideHeight">滑块的高度</param>
public static void SimulateMouseMove(IBrowserHost host, int fromX, int fromY, int toX, int toY, int slideWidth = 0, int slideHeight = 0)
{
Thread.Sleep(RandomHelper.GetRandom(0, 50));
int randomX = 0;
int randomY = 0;
if (slideWidth == 0)
{
randomX = -2 + RandomHelper.GetRandom(0, 5);
}
else
{
randomX = RandomHelper.GetRandom(0, slideWidth);
}
if (slideHeight == 0)
{
randomY = -2 + RandomHelper.GetRandom(0, 5);
}
else
{
randomY = RandomHelper.GetRandom(0, slideHeight);
}
int x = fromX + randomX;
int y = fromY + randomY;
host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None); // 按下鼠标左键
Thread.Sleep(200 + RandomHelper.GetRandom(0, 200));
int times = 0;
while (x < toX - 4) // 后半部分
{
times++;
x += 4 + RandomHelper.GetRandom(0, 4);
y = y - 1 + RandomHelper.GetRandom(0, 3);
Thread.Sleep(6 + times / 6 + RandomHelper.GetRandom(0, 4));
host.SendMouseMoveEvent(x, y, false, CefEventFlags.LeftMouseButton); // 移动鼠标
}
x = toX - 1 + RandomHelper.GetRandom(0, 3);
Thread.Sleep(100 + RandomHelper.GetRandom(0, 100));
host.SendMouseMoveEvent(x, y, false, CefEventFlags.LeftMouseButton); // 移动鼠标
Thread.Sleep(400 + RandomHelper.GetRandom(0, 600));
host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None); // 抬起鼠标左键
}
public static void SimulateInputChar(IBrowserHost host, int key)
{
Random random = new Random();
host.SendKeyEvent(new KeyEvent() { WindowsKeyCode = key, Type = KeyEventType.KeyDown });
Thread.Sleep(10 + random.Next(10));
host.SendKeyEvent(new KeyEvent() { WindowsKeyCode = key, Type = KeyEventType.Char });
Thread.Sleep(50 + random.Next(40));
host.SendKeyEvent(new KeyEvent() { WindowsKeyCode = key, Type = KeyEventType.KeyUp });
Thread.Sleep(50 + random.Next(40));
}
}
}
@@ -0,0 +1,72 @@
using CefSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Work._29Tools.CefTools
{
public class LocalCookieVisitor : ICookieVisitor
{
public List<Cookie> CookieList;
public ManualResetEvent gotAllCookie = new ManualResetEvent(false);
public LocalCookieVisitor()
{
CookieList = new List<Cookie>();
}
public bool Visit(Cookie cookie, int count, int total, ref bool deleteCookie)
{
CookieList.Add(cookie);
if (count == total - 1)
{
gotAllCookie.Set();
}
return true;
}
public void WaitForAllCookie()
{
gotAllCookie.WaitOne();
}
#region IDisposable Support
private bool disposedValue = false; // To detect redundant calls
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
// TODO: dispose managed state (managed objects).
}
// TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
// TODO: set large fields to null.
disposedValue = true;
}
}
// TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.
// ~CookieVisitor()
// {
// // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
// Dispose(false);
// }
// This code added to correctly implement the disposable pattern.
void IDisposable.Dispose()
{
// Do not change this code. Put cleanup code in Dispose(bool disposing) above.
Dispose(true);
// TODO: uncomment the following line if the finalizer is overridden above.
// GC.SuppressFinalize(this);
}
#endregion
}
}
@@ -18,16 +18,16 @@ namespace Work._29Tools.CefTools
{
public string Url { get; set; }
}
public class LifeSpanHandlerLocal : ILifeSpanHandler
public class LocalLifeSpanHandler : ILifeSpanHandler
{
private PopWindowType popWindowType = PopWindowType.NewWindow;
public event EventHandler<PopData> OnPop;
public ChromiumWebBrowser parent;
public LifeSpanHandlerLocal()
public LocalLifeSpanHandler()
{
}
public LifeSpanHandlerLocal(PopWindowType _popWindowType)
public LocalLifeSpanHandler(PopWindowType _popWindowType)
{
popWindowType = _popWindowType;
}
+259
View File
@@ -0,0 +1,259 @@
using CefSharp;
using NaiBa.Util;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using NaiBa.Util.Model;
using NaiBa.Util.Winform.Forms;
using NaiBa.Util.Winform.Helper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Work._29Tools.CefTools
{
public class LocalMenuHandler : IContextMenuHandler
{
public List<CefContextMenu> ContextMenuList;
public Func<List<Cookie>, TData> SaveCookie;
public List<Cookie> CookieList;
void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
model.Clear();
bool hasCopyPaste = false;
if ((parameters.EditStateFlags & ContextMenuEditState.CanCopy).ParseToInt() != 0)
{
model.AddItem(CefMenuCommand.Copy, "复制");
hasCopyPaste = true;
}
if ((parameters.EditStateFlags & ContextMenuEditState.CanPaste).ParseToInt() != 0)
{
model.AddItem(CefMenuCommand.Paste, "粘贴");
hasCopyPaste = true;
}
if (hasCopyPaste)
{
model.AddSeparator();
}
model.AddItem(CefMenuCommand.Back, "后退");
model.AddItem(CefMenuCommand.Forward, "前进");
model.AddItem(CefMenuCommand.ReloadNoCache, "刷新");
model.AddSeparator();
model.AddItem(CefMenuCommand.ViewSource, "查看页面源代码");
model.AddSeparator();
model.AddItem((CefMenuCommand)26500, "复制页面地址");
if (parameters.MediaType == ContextMenuMediaType.Image)
{
model.AddSeparator();
model.AddItem((CefMenuCommand)26600, "复制图片地址");
model.AddItem((CefMenuCommand)26601, "保存图片");
if (NaiBaGlobalConfig.IsNewFeature)
{
model.AddSeparator();
model.AddItem((CefMenuCommand)26700, "识别图片文字");
}
}
if ((parameters.EditStateFlags & ContextMenuEditState.CanTranslate).ParseToInt() != 0)
{
model.AddSeparator();
model.AddItem((CefMenuCommand)26800, "翻译网页");
}
if (SaveCookie != null)
{
model.AddSeparator();
model.AddItem((CefMenuCommand)26900, "保存 Cookie");
}
if (ContextMenuList != null && ContextMenuList.Any())
{
model.AddSeparator();
if (ContextMenuList.Where(p => p.CommandCode < 28000 || p.CommandCode > 28500).Any())
{
BaseMsgTipFormHelper.ShowError("Cef右键菜单,无效的 CommandCode,CommandCode 的范围 28000-28500");
return;
}
foreach (var menu in ContextMenuList)
{
model.AddItem((CefMenuCommand)menu.CommandCode, menu.CommandText);
}
}
}
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
{
if (commandId == (CefMenuCommand)26500)
{
string url = parameters.PageUrl;
if (!string.IsNullOrEmpty(url))
{
Clipboard.SetText(url);
BaseMsgTipFormHelper.ShowInfo("复制页面地址到剪贴板成功");
}
else
{
BaseMsgTipFormHelper.ShowError("复制页面地址到剪贴板失败");
}
return true;
}
if (commandId == (CefMenuCommand)26600)
{
string url = parameters.SourceUrl;
if (!string.IsNullOrEmpty(url))
{
Clipboard.SetText(url);
BaseMsgTipFormHelper.ShowInfo("复制图片地址到剪贴板成功");
}
else
{
BaseMsgTipFormHelper.ShowError("复制图片地址到剪贴板失败");
}
return true;
}
if (commandId == (CefMenuCommand)26601)
{
string url = parameters.SourceUrl;
SaveFileDialog dialog = FormDialogHelper.SaveFileDialogCustom(Path.GetFileNameWithoutExtension(url), Path.GetExtension(url), false, false);
if (dialog != null)
{
try
{
HttpHelper.DownloadFile(new HttpParam { Url = url }, dialog.FileName);
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
}
return true;
}
if (commandId == (CefMenuCommand)26700)
{
string url = parameters.SourceUrl;
try
{
if (NaiBaGlobalConfig.ImageOCR != null)
{
var byteArr = HttpHelper.GetByte(new HttpParam { Url = url });
var obj = NaiBaGlobalConfig.ImageOCR(Convert.ToBase64String(byteArr));
if (obj.Tag == 1)
{
FileHelper.OpenNotepad(string.Join(Environment.NewLine, obj.Data));
}
else
{
BaseMsgFormHelper.ShowError(obj.Message);
}
}
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
return true;
}
if (commandId == (CefMenuCommand)26800)
{
try
{
string fileName = "NaiBa.CefHelper.Resources.google_translate.js";
string js = FileHelper.GetResourceFileContent(Assembly.GetExecutingAssembly(), fileName);
browser.MainFrame.ExecuteJavaScriptAsync(js);
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
return true;
}
if (commandId == (CefMenuCommand)26900)
{
try
{
if (CookieList == null)
{
BaseMsgTipFormHelper.ShowError("未获取到 Cookie,请等待页面加载完后再试");
}
else
{
var obj = SaveCookie(CookieList);
if (obj.Tag == 1)
{
BaseMsgTipFormHelper.ShowInfo("保存 Cookie 成功");
}
else
{
BaseMsgTipFormHelper.ShowError("保存 Cookie 失败:" + obj.Message);
}
}
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
return true;
}
if ((int)commandId >= 28000 && (int)commandId <= 28500)
{
if (ContextMenuList != null)
{
var contextMenu = ContextMenuList.Where(p => p.CommandCode == (int)commandId).FirstOrDefault();
if (contextMenu != null)
{
try
{
contextMenu.CommandAction?.Invoke(parameters);
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
return true;
}
}
}
// Return false should ignore the selected option of the user !
return false;
}
void IContextMenuHandler.OnContextMenuDismissed(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame)
{
}
bool IContextMenuHandler.RunContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
{
return false;
}
}
public class CefContextMenu
{
public int CommandCode { get; set; }
public string CommandText { get; set; }
public Action<IContextMenuParams> CommandAction { get; set; }
}
}
@@ -0,0 +1,290 @@
using CefSharp;
using CefSharp.Handler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace Work._29Tools.CefTools
{
public class LocalRequestHandler : IRequestHandler
{
/// <summary>
/// 代理用户名
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 代理密码
/// </summary>
public string Password { get; set; }
private ResourceRequestHandler resourceRequestHandler;
public LocalRequestHandler()
{
}
public LocalRequestHandler(ResourceRequestHandler customResourceRequestHandler)
{
resourceRequestHandler = customResourceRequestHandler;
}
void IRequestHandler.OnDocumentAvailableInMainFrame(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
}
bool IRequestHandler.OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect)
{
return OnBeforeBrowse(chromiumWebBrowser, browser, frame, request, userGesture, isRedirect);
}
/// <summary>
/// Called before browser navigation. If the navigation is allowed <see cref="IWebBrowser.FrameLoadStart"/> and
/// <see cref="IWebBrowser.FrameLoadEnd"/>
/// will be called. If the navigation is canceled <see cref="IWebBrowser.LoadError"/> will be called with an ErrorCode value of
/// <see cref="CefErrorCode.Aborted"/>.
/// </summary>
/// <param name="chromiumWebBrowser">the ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="frame">The frame the request is coming from.</param>
/// <param name="request">the request object - cannot be modified in this callback.</param>
/// <param name="userGesture">The value will be true if the browser navigated via explicit user gesture (e.g. clicking a link) or
/// false if it navigated automatically (e.g. via the DomContentLoaded event).</param>
/// <param name="isRedirect">has the request been redirected.</param>
/// <returns>
/// Return true to cancel the navigation or false to allow the navigation to proceed.
/// </returns>
protected virtual bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect)
{
return false;
}
/// <inheritdoc/>
bool IRequestHandler.OnOpenUrlFromTab(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture)
{
return OnOpenUrlFromTab(chromiumWebBrowser, browser, frame, targetUrl, targetDisposition, userGesture);
}
/// <summary>
/// Called on the UI thread before OnBeforeBrowse in certain limited cases where navigating a new or different browser might be
/// desirable. This includes user-initiated navigation that might open in a special way (e.g. links clicked via middle-click or
/// ctrl + left-click) and certain types of cross-origin navigation initiated from the renderer process (e.g. navigating the top-
/// level frame to/from a file URL).
/// </summary>
/// <param name="chromiumWebBrowser">the ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="frame">The frame object.</param>
/// <param name="targetUrl">target url.</param>
/// <param name="targetDisposition">The value indicates where the user intended to navigate the browser based on standard
/// Chromium behaviors (e.g. current tab, new tab, etc).</param>
/// <param name="userGesture">The value will be true if the browser navigated via explicit user gesture (e.g. clicking a link) or
/// false if it navigated automatically (e.g. via the DomContentLoaded event).</param>
/// <returns>
/// Return true to cancel the navigation or false to allow the navigation to proceed in the source browser's top-level frame.
/// </returns>
protected virtual bool OnOpenUrlFromTab(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture)
{
return false;
}
/// <inheritdoc/>
IResourceRequestHandler IRequestHandler.GetResourceRequestHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool isNavigation, bool isDownload, string requestInitiator, ref bool disableDefaultHandling)
{
return GetResourceRequestHandler(chromiumWebBrowser, browser, frame, request, isNavigation, isDownload, requestInitiator, ref disableDefaultHandling);
}
/// <summary>
/// Called on the CEF IO thread before a resource request is initiated.
/// </summary>
/// <param name="chromiumWebBrowser">the ChromiumWebBrowser control.</param>
/// <param name="browser">represent the source browser of the request.</param>
/// <param name="frame">represent the source frame of the request.</param>
/// <param name="request">represents the request contents and cannot be modified in this callback.</param>
/// <param name="isNavigation">will be true if the resource request is a navigation.</param>
/// <param name="isDownload">will be true if the resource request is a download.</param>
/// <param name="requestInitiator">is the origin (scheme + domain) of the page that initiated the request.</param>
/// <param name="disableDefaultHandling">[in,out] to true to disable default handling of the request, in which case it will need
/// to be handled via <see cref="IResourceRequestHandler.GetResourceHandler"/> or it will be canceled.</param>
/// <returns>
/// To allow the resource load to proceed with default handling return null. To specify a handler for the resource return a
/// <see cref="IResourceRequestHandler"/> object. If this callback returns null the same method will be called on the associated
/// <see cref="IRequestContextHandler"/>, if any.
/// </returns>
protected virtual IResourceRequestHandler GetResourceRequestHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool isNavigation, bool isDownload, string requestInitiator, ref bool disableDefaultHandling)
{
return resourceRequestHandler;
}
/// <inheritdoc/>
bool IRequestHandler.GetAuthCredentials(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback)
{
return GetAuthCredentials(chromiumWebBrowser, browser, originUrl, isProxy, host, port, realm, scheme, callback);
}
/// <summary>
/// Called when the browser needs credentials from the user.
/// </summary>
/// <param name="chromiumWebBrowser">The ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="originUrl">is the origin making this authentication request.</param>
/// <param name="isProxy">indicates whether the host is a proxy server.</param>
/// <param name="host">hostname.</param>
/// <param name="port">port number.</param>
/// <param name="realm">realm.</param>
/// <param name="scheme">scheme.</param>
/// <param name="callback">Callback interface used for asynchronous continuation of authentication requests.</param>
/// <returns>
/// Return true to continue the request and call <see cref="IAuthCallback.Continue(string, string)"/> when the authentication
/// information is available. Return false to cancel the request.
/// </returns>
protected virtual bool GetAuthCredentials(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback)
{
if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password))
{
callback.Continue(UserName, Password);
return true;
}
callback.Dispose();
return false;
}
/// <inheritdoc/>
//bool IRequestHandler.OnQuotaRequest(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, long newSize, IRequestCallback callback)
//{
// return OnQuotaRequest(chromiumWebBrowser, browser, originUrl, newSize, callback);
//}//cef138
/// <summary>
/// Called when JavaScript requests a specific storage quota size via the webkitStorageInfo.requestQuota function. For async
/// processing return true and execute <see cref="IRequestCallback.Continue"/> at a later time to grant or deny the request or
/// <see cref="IRequestCallback.Cancel"/> to cancel.
/// </summary>
/// <param name="chromiumWebBrowser">The ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="originUrl">the origin of the page making the request.</param>
/// <param name="newSize">is the requested quota size in bytes.</param>
/// <param name="callback">Callback interface used for asynchronous continuation of url requests.</param>
/// <returns>
/// Return false to cancel the request immediately. Return true to continue the request and call
/// <see cref="IRequestCallback.Continue"/> either in this method or at a later time to grant or deny the request.
/// </returns>
protected virtual bool OnQuotaRequest(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, long newSize, IRequestCallback callback)
{
callback.Dispose();
return false;
}
/// <inheritdoc/>
bool IRequestHandler.OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
return OnCertificateError(chromiumWebBrowser, browser, errorCode, requestUrl, sslInfo, callback);
}
void IRequestHandler.OnRenderProcessTerminated(IWebBrowser chromiumWebBrowser, IBrowser browser, CefTerminationStatus status, int errorCode, string errorMessage)
{
//cef138
}
/// <summary>
/// Called to handle requests for URLs with an invalid SSL certificate. Return true and call
/// <see cref="IRequestCallback.Continue"/> either in this method or at a later time to continue or cancel the request.
/// If CefSettings.IgnoreCertificateErrors is set all invalid certificates will be accepted without calling this method.
/// </summary>
/// <param name="chromiumWebBrowser">the ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="errorCode">the error code for this invalid certificate.</param>
/// <param name="requestUrl">the url of the request for the invalid certificate.</param>
/// <param name="sslInfo">ssl certificate information.</param>
/// <param name="callback">Callback interface used for asynchronous continuation of url requests. If empty the error cannot be
/// recovered from and the request will be canceled automatically.</param>
/// <returns>
/// Return false to cancel the request immediately. Return true and use <see cref="IRequestCallback"/> to execute in an async
/// fashion.
/// </returns>
protected virtual bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
callback.Dispose();
return false;
}
/// <inheritdoc/>
bool IRequestHandler.OnSelectClientCertificate(IWebBrowser chromiumWebBrowser, IBrowser browser, bool isProxy, string host, int port, X509Certificate2Collection certificates, ISelectClientCertificateCallback callback)
{
return OnSelectClientCertificate(chromiumWebBrowser, browser, isProxy, host, port, certificates, callback);
}
/// <summary>
/// Called when the browser needs user to select Client Certificate for authentication requests (eg. PKI authentication).
/// </summary>
/// <param name="chromiumWebBrowser">The ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="isProxy">indicates whether the host is a proxy server.</param>
/// <param name="host">hostname.</param>
/// <param name="port">port number.</param>
/// <param name="certificates">List of Client certificates for selection.</param>
/// <param name="callback">Callback interface used for asynchronous continuation of client certificate selection for
/// authentication requests.</param>
/// <returns>
/// Return true to continue the request and call ISelectClientCertificateCallback.Select() with the selected certificate for
/// authentication. Return false to use the default behavior where the browser selects the first certificate from the list.
///
/// </returns>
protected virtual bool OnSelectClientCertificate(IWebBrowser chromiumWebBrowser, IBrowser browser, bool isProxy, string host, int port, X509Certificate2Collection certificates, ISelectClientCertificateCallback callback)
{
callback.Dispose();
return false;
}
/// <inheritdoc/>
//void IRequestHandler.OnPluginCrashed(IWebBrowser chromiumWebBrowser, IBrowser browser, string pluginPath)
//{
// OnPluginCrashed(chromiumWebBrowser, browser, pluginPath);
//}//cef138
/// <summary>
/// Called when a plugin has crashed.
/// </summary>
/// <param name="chromiumWebBrowser">the ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="pluginPath">path of the plugin that crashed.</param>
protected virtual void OnPluginCrashed(IWebBrowser chromiumWebBrowser, IBrowser browser, string pluginPath)
{
}
/// <inheritdoc/>
void IRequestHandler.OnRenderViewReady(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
OnRenderViewReady(chromiumWebBrowser, browser);
}
/// <summary>
/// Called on the CEF UI thread when the render view associated with browser is ready to receive/handle IPC messages in the
/// render process.
/// </summary>
/// <param name="chromiumWebBrowser">The ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
protected virtual void OnRenderViewReady(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
}
/// <inheritdoc/>
//void IRequestHandler.OnRenderProcessTerminated(IWebBrowser chromiumWebBrowser, IBrowser browser, CefTerminationStatus status)
//{
// OnRenderProcessTerminated(chromiumWebBrowser, browser, status);
//}//cef138
/// <summary>
/// Called when the render process terminates unexpectedly.
/// </summary>
/// <param name="chromiumWebBrowser">The ChromiumWebBrowser control.</param>
/// <param name="browser">the browser object.</param>
/// <param name="status">indicates how the process terminated.</param>
protected virtual void OnRenderProcessTerminated(IWebBrowser chromiumWebBrowser, IBrowser browser, CefTerminationStatus status)
{
}
}
}
@@ -53,7 +53,7 @@ namespace Work._29Tools.CefTools
}
}
public class CustomResourceRequestHandlerLocal : BaseResourceRequestHandler
public class LocalResourceRequestHandler : BaseResourceRequestHandler
{
private ConcurrentDictionary<ulong, MemoryStream> responseDict = new ConcurrentDictionary<ulong, MemoryStream>();
+16 -7
View File
@@ -1,7 +1,7 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model;
using AllBase.Model.Params;
using AllBase.Model.Local;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
@@ -64,6 +64,8 @@ namespace TemuKJD.ToolForms
this.Height = SystemInformation.WorkingArea.Height - 80;
this.CenterToScreen();
//splitContainer1.Dock = DockStyle.Fill;
if (CloseAfterSecond > 0)
{
Task.Run(() =>
@@ -96,7 +98,7 @@ namespace TemuKJD.ToolForms
this.txtShopSkuId.Text = orderItem.sku_id;
this.txtShopGoodsId.Text = orderItem.product_id;
this.txtUpSpuCode.Text = orderItem.out_product_id;
this.txtUpSkuCode.Text = orderItem.out_sku_id;
this.txtUpSkuCode.Text = orderItem.out_sku_id.IsNullOrEmpty() ? orderItem.sku_attr_str : orderItem.out_sku_id;
this.txtShopGoodsName.Text = orderItem.title;
this.txtShopSpecName.Text = orderItem.sku_attr_str;
this.txtShopOrderItemCnt.Text = orderItem.sku_cnt.ParseToString();
@@ -140,14 +142,14 @@ namespace TemuKJD.ToolForms
{
//cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser("about:blank", false);
if (!string.IsNullOrEmpty(InitUrl))
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, true, true);
else
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, false);
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
var lifeSapnHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow);
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
cefWebBrowser.LifeSpanHandler = lifeSapnHandler;
cefWebBrowser.KeyboardHandler = new KeyboardHandler();
cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
@@ -193,7 +195,8 @@ namespace TemuKJD.ToolForms
// cef138必须init后方可设置或删除cookie
while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
Thread.Sleep(20);
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null), "mobile.yangkeduo.com");
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null), "yangkeduo.com");
//if (cookieLst.Any(c => c.Value.StartsWith("windows_1")))
// cefWebBrowser.ExecuteScriptAsync("navigator.__defineGetter__('userAgent', function() { return 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36 PddWorkbench-Online PddBrowser pdd_windows_version/3.0.3.12'; });");
@@ -553,7 +556,8 @@ namespace TemuKJD.ToolForms
{
foreach (var item in order.order_items)
{
if (item.out_product_id == map.spu_code && item.out_sku_id == map.sku_code)
if ((item.out_product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
(item.out_product_id == map.spu_code && item.sku_attr_str == map.sku_code))
{
item.buy_map = map;
@@ -636,5 +640,10 @@ namespace TemuKJD.ToolForms
pictureBox1.Size = new Size(100, 100);
}
}
private void btnJumpOrderList_Click(object sender, EventArgs e)
{
cefWebBrowser.Load("https://mobile.yangkeduo.com/orders.html");
}
}
}
+152 -105
View File
@@ -83,6 +83,8 @@
this.txtAddress = new System.Windows.Forms.TextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.chkChangeWarehouseAddress = new Work.UserComponents.UcCheckBox(this.components);
this.panel1 = new System.Windows.Forms.Panel();
this.btnJumpOrderList = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel2.SuspendLayout();
@@ -92,6 +94,7 @@
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// pbCloseBase
@@ -101,68 +104,24 @@
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Location = new System.Drawing.Point(3, 4);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.splitContainer1.Panel1MinSize = 0;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.chkChangeWarehouseAddress);
this.splitContainer1.Panel2.Controls.Add(this.pictureBox1);
this.splitContainer1.Panel2.Controls.Add(this.txtBuySkuName);
this.splitContainer1.Panel2.Controls.Add(this.label20);
this.splitContainer1.Panel2.Controls.Add(this.label6);
this.splitContainer1.Panel2.Controls.Add(this.label21);
this.splitContainer1.Panel2.Controls.Add(this.cmbTransitWarehouse);
this.splitContainer1.Panel2.Controls.Add(this.label15);
this.splitContainer1.Panel2.Controls.Add(this.txtShopOrderItemPrice);
this.splitContainer1.Panel2.Controls.Add(this.txtBuySkuId);
this.splitContainer1.Panel2.Controls.Add(this.label16);
this.splitContainer1.Panel2.Controls.Add(this.txtBuyOrderId);
this.splitContainer1.Panel2.Controls.Add(this.txtShopOrderItemCnt);
this.splitContainer1.Panel2.Controls.Add(this.label22);
this.splitContainer1.Panel2.Controls.Add(this.label17);
this.splitContainer1.Panel2.Controls.Add(this.label19);
this.splitContainer1.Panel2.Controls.Add(this.btnManualUpdateTransitWarehouse);
this.splitContainer1.Panel2.Controls.Add(this.label23);
this.splitContainer1.Panel2.Controls.Add(this.label18);
this.splitContainer1.Panel2.Controls.Add(this.txtBuyCnt);
this.splitContainer1.Panel2.Controls.Add(this.txtBuyGoodsId);
this.splitContainer1.Panel2.Controls.Add(this.txtShopSpecName);
this.splitContainer1.Panel2.Controls.Add(this.txtBuyGoodsName);
this.splitContainer1.Panel2.Controls.Add(this.label14);
this.splitContainer1.Panel2.Controls.Add(this.txtBuyPrice);
this.splitContainer1.Panel2.Controls.Add(this.label13);
this.splitContainer1.Panel2.Controls.Add(this.label24);
this.splitContainer1.Panel2.Controls.Add(this.txtUpSpuCode);
this.splitContainer1.Panel2.Controls.Add(this.label12);
this.splitContainer1.Panel2.Controls.Add(this.txtUpSkuCode);
this.splitContainer1.Panel2.Controls.Add(this.label11);
this.splitContainer1.Panel2.Controls.Add(this.txtShopSkuId);
this.splitContainer1.Panel2.Controls.Add(this.label10);
this.splitContainer1.Panel2.Controls.Add(this.label9);
this.splitContainer1.Panel2.Controls.Add(this.txtShopGoodsId);
this.splitContainer1.Panel2.Controls.Add(this.label8);
this.splitContainer1.Panel2.Controls.Add(this.txtShopGoodsName);
this.splitContainer1.Panel2.Controls.Add(this.label7);
this.splitContainer1.Panel2.Controls.Add(this.btnManualUpdateBuyOrder);
this.splitContainer1.Panel2.Controls.Add(this.txtMapSkuName);
this.splitContainer1.Panel2.Controls.Add(this.label5);
this.splitContainer1.Panel2.Controls.Add(this.btnManualUpdateSendProvince);
this.splitContainer1.Panel2.Controls.Add(this.txtMapSkuId);
this.splitContainer1.Panel2.Controls.Add(this.label4);
this.splitContainer1.Panel2.Controls.Add(this.label3);
this.splitContainer1.Panel2.Controls.Add(this.txtMapGoodsId);
this.splitContainer1.Panel2.Controls.Add(this.txtMapGoodsName);
this.splitContainer1.Panel2.Controls.Add(this.label2);
this.splitContainer1.Panel2.Controls.Add(this.label1);
this.splitContainer1.Panel2.Controls.Add(this.txtSendProvince);
this.splitContainer1.Size = new System.Drawing.Size(1358, 704);
this.splitContainer1.SplitterDistance = 868;
this.splitContainer1.Panel2.Controls.Add(this.btnJumpOrderList);
this.splitContainer1.Panel2MinSize = 0;
this.splitContainer1.Size = new System.Drawing.Size(864, 696);
this.splitContainer1.SplitterDistance = 667;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -171,7 +130,7 @@
this.txtBuySkuName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtBuySkuName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuySkuName.Location = new System.Drawing.Point(83, 347);
this.txtBuySkuName.Location = new System.Drawing.Point(85, 352);
this.txtBuySkuName.Name = "txtBuySkuName";
this.txtBuySkuName.Size = new System.Drawing.Size(388, 23);
this.txtBuySkuName.TabIndex = 848;
@@ -179,7 +138,7 @@
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(27, 349);
this.label21.Location = new System.Drawing.Point(29, 354);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(56, 17);
this.label21.TabIndex = 847;
@@ -190,7 +149,7 @@
this.txtBuySkuId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtBuySkuId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuySkuId.Location = new System.Drawing.Point(319, 376);
this.txtBuySkuId.Location = new System.Drawing.Point(321, 381);
this.txtBuySkuId.Name = "txtBuySkuId";
this.txtBuySkuId.Size = new System.Drawing.Size(152, 23);
this.txtBuySkuId.TabIndex = 846;
@@ -198,7 +157,7 @@
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(250, 379);
this.label22.Location = new System.Drawing.Point(252, 384);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(69, 17);
this.label22.TabIndex = 845;
@@ -207,7 +166,7 @@
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(14, 379);
this.label23.Location = new System.Drawing.Point(16, 384);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(69, 17);
this.label23.TabIndex = 844;
@@ -216,7 +175,7 @@
// txtBuyGoodsId
//
this.txtBuyGoodsId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuyGoodsId.Location = new System.Drawing.Point(83, 376);
this.txtBuyGoodsId.Location = new System.Drawing.Point(85, 381);
this.txtBuyGoodsId.Name = "txtBuyGoodsId";
this.txtBuyGoodsId.Size = new System.Drawing.Size(152, 23);
this.txtBuyGoodsId.TabIndex = 843;
@@ -226,7 +185,7 @@
this.txtBuyGoodsName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtBuyGoodsName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuyGoodsName.Location = new System.Drawing.Point(83, 318);
this.txtBuyGoodsName.Location = new System.Drawing.Point(85, 323);
this.txtBuyGoodsName.Name = "txtBuyGoodsName";
this.txtBuyGoodsName.Size = new System.Drawing.Size(388, 23);
this.txtBuyGoodsName.TabIndex = 842;
@@ -234,7 +193,7 @@
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(27, 321);
this.label24.Location = new System.Drawing.Point(29, 326);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(56, 17);
this.label24.TabIndex = 841;
@@ -244,7 +203,7 @@
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(27, 294);
this.label6.Location = new System.Drawing.Point(29, 299);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(68, 17);
this.label6.TabIndex = 840;
@@ -254,7 +213,7 @@
//
this.label20.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(39, 632);
this.label20.Location = new System.Drawing.Point(41, 631);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(44, 17);
this.label20.TabIndex = 839;
@@ -265,7 +224,7 @@
this.cmbTransitWarehouse.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cmbTransitWarehouse.FormattingEnabled = true;
this.cmbTransitWarehouse.Location = new System.Drawing.Point(83, 628);
this.cmbTransitWarehouse.Location = new System.Drawing.Point(85, 627);
this.cmbTransitWarehouse.Name = "cmbTransitWarehouse";
this.cmbTransitWarehouse.Size = new System.Drawing.Size(388, 25);
this.cmbTransitWarehouse.TabIndex = 838;
@@ -275,7 +234,7 @@
this.txtBuyPrice.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtBuyPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuyPrice.Location = new System.Drawing.Point(319, 405);
this.txtBuyPrice.Location = new System.Drawing.Point(321, 410);
this.txtBuyPrice.Name = "txtBuyPrice";
this.txtBuyPrice.ReadOnly = true;
this.txtBuyPrice.Size = new System.Drawing.Size(152, 23);
@@ -284,7 +243,7 @@
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(263, 408);
this.label18.Location = new System.Drawing.Point(265, 413);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(56, 17);
this.label18.TabIndex = 836;
@@ -293,7 +252,7 @@
// txtBuyCnt
//
this.txtBuyCnt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuyCnt.Location = new System.Drawing.Point(83, 405);
this.txtBuyCnt.Location = new System.Drawing.Point(85, 410);
this.txtBuyCnt.Name = "txtBuyCnt";
this.txtBuyCnt.Size = new System.Drawing.Size(152, 23);
this.txtBuyCnt.TabIndex = 835;
@@ -301,7 +260,7 @@
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(27, 408);
this.label19.Location = new System.Drawing.Point(29, 413);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(56, 17);
this.label19.TabIndex = 834;
@@ -312,7 +271,7 @@
this.txtShopOrderItemPrice.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtShopOrderItemPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopOrderItemPrice.Location = new System.Drawing.Point(319, 254);
this.txtShopOrderItemPrice.Location = new System.Drawing.Point(321, 259);
this.txtShopOrderItemPrice.Name = "txtShopOrderItemPrice";
this.txtShopOrderItemPrice.Size = new System.Drawing.Size(152, 23);
this.txtShopOrderItemPrice.TabIndex = 833;
@@ -320,7 +279,7 @@
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(287, 257);
this.label16.Location = new System.Drawing.Point(289, 262);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(32, 17);
this.label16.TabIndex = 832;
@@ -329,7 +288,7 @@
// txtShopOrderItemCnt
//
this.txtShopOrderItemCnt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopOrderItemCnt.Location = new System.Drawing.Point(83, 254);
this.txtShopOrderItemCnt.Location = new System.Drawing.Point(85, 259);
this.txtShopOrderItemCnt.Name = "txtShopOrderItemCnt";
this.txtShopOrderItemCnt.Size = new System.Drawing.Size(152, 23);
this.txtShopOrderItemCnt.TabIndex = 831;
@@ -337,7 +296,7 @@
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(51, 257);
this.label17.Location = new System.Drawing.Point(53, 262);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(32, 17);
this.label17.TabIndex = 830;
@@ -348,7 +307,7 @@
this.txtBuyOrderId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtBuyOrderId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtBuyOrderId.Location = new System.Drawing.Point(83, 434);
this.txtBuyOrderId.Location = new System.Drawing.Point(85, 439);
this.txtBuyOrderId.Name = "txtBuyOrderId";
this.txtBuyOrderId.ReadOnly = true;
this.txtBuyOrderId.Size = new System.Drawing.Size(388, 23);
@@ -357,7 +316,7 @@
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(15, 437);
this.label15.Location = new System.Drawing.Point(17, 442);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(68, 17);
this.label15.TabIndex = 828;
@@ -370,7 +329,7 @@
this.btnManualUpdateTransitWarehouse.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnManualUpdateTransitWarehouse.DisabledBackColor = System.Drawing.Color.Empty;
this.btnManualUpdateTransitWarehouse.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnManualUpdateTransitWarehouse.Location = new System.Drawing.Point(357, 659);
this.btnManualUpdateTransitWarehouse.Location = new System.Drawing.Point(359, 658);
this.btnManualUpdateTransitWarehouse.Name = "btnManualUpdateTransitWarehouse";
this.btnManualUpdateTransitWarehouse.Size = new System.Drawing.Size(114, 23);
this.btnManualUpdateTransitWarehouse.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -393,7 +352,7 @@
this.txtShopSpecName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtShopSpecName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopSpecName.Location = new System.Drawing.Point(83, 167);
this.txtShopSpecName.Location = new System.Drawing.Point(85, 172);
this.txtShopSpecName.Name = "txtShopSpecName";
this.txtShopSpecName.Size = new System.Drawing.Size(388, 23);
this.txtShopSpecName.TabIndex = 817;
@@ -401,7 +360,7 @@
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(27, 170);
this.label14.Location = new System.Drawing.Point(29, 175);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(56, 17);
this.label14.TabIndex = 816;
@@ -412,7 +371,7 @@
this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label13.Location = new System.Drawing.Point(27, 488);
this.label13.Location = new System.Drawing.Point(29, 487);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(92, 17);
this.label13.TabIndex = 815;
@@ -421,7 +380,7 @@
// txtUpSpuCode
//
this.txtUpSpuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtUpSpuCode.Location = new System.Drawing.Point(83, 225);
this.txtUpSpuCode.Location = new System.Drawing.Point(85, 230);
this.txtUpSpuCode.Name = "txtUpSpuCode";
this.txtUpSpuCode.Size = new System.Drawing.Size(152, 23);
this.txtUpSpuCode.TabIndex = 814;
@@ -429,7 +388,7 @@
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(239, 228);
this.label12.Location = new System.Drawing.Point(241, 233);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(80, 17);
this.label12.TabIndex = 813;
@@ -440,7 +399,7 @@
this.txtUpSkuCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtUpSkuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtUpSkuCode.Location = new System.Drawing.Point(319, 225);
this.txtUpSkuCode.Location = new System.Drawing.Point(321, 230);
this.txtUpSkuCode.Name = "txtUpSkuCode";
this.txtUpSkuCode.Size = new System.Drawing.Size(152, 23);
this.txtUpSkuCode.TabIndex = 812;
@@ -448,7 +407,7 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(3, 228);
this.label11.Location = new System.Drawing.Point(5, 233);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(80, 17);
this.label11.TabIndex = 811;
@@ -459,7 +418,7 @@
this.txtShopSkuId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtShopSkuId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopSkuId.Location = new System.Drawing.Point(319, 196);
this.txtShopSkuId.Location = new System.Drawing.Point(321, 201);
this.txtShopSkuId.Name = "txtShopSkuId";
this.txtShopSkuId.Size = new System.Drawing.Size(152, 23);
this.txtShopSkuId.TabIndex = 810;
@@ -467,7 +426,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(250, 199);
this.label10.Location = new System.Drawing.Point(252, 204);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(69, 17);
this.label10.TabIndex = 809;
@@ -476,7 +435,7 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(14, 199);
this.label9.Location = new System.Drawing.Point(16, 204);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(69, 17);
this.label9.TabIndex = 808;
@@ -485,7 +444,7 @@
// txtShopGoodsId
//
this.txtShopGoodsId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopGoodsId.Location = new System.Drawing.Point(83, 196);
this.txtShopGoodsId.Location = new System.Drawing.Point(85, 201);
this.txtShopGoodsId.Name = "txtShopGoodsId";
this.txtShopGoodsId.Size = new System.Drawing.Size(152, 23);
this.txtShopGoodsId.TabIndex = 807;
@@ -494,7 +453,7 @@
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(27, 114);
this.label8.Location = new System.Drawing.Point(29, 119);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(92, 17);
this.label8.TabIndex = 806;
@@ -505,7 +464,7 @@
this.txtShopGoodsName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtShopGoodsName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopGoodsName.Location = new System.Drawing.Point(83, 138);
this.txtShopGoodsName.Location = new System.Drawing.Point(85, 143);
this.txtShopGoodsName.Name = "txtShopGoodsName";
this.txtShopGoodsName.Size = new System.Drawing.Size(388, 23);
this.txtShopGoodsName.TabIndex = 805;
@@ -513,7 +472,7 @@
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(27, 141);
this.label7.Location = new System.Drawing.Point(29, 146);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(56, 17);
this.label7.TabIndex = 804;
@@ -526,7 +485,7 @@
this.btnManualUpdateBuyOrder.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnManualUpdateBuyOrder.DisabledBackColor = System.Drawing.Color.Empty;
this.btnManualUpdateBuyOrder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnManualUpdateBuyOrder.Location = new System.Drawing.Point(357, 463);
this.btnManualUpdateBuyOrder.Location = new System.Drawing.Point(359, 468);
this.btnManualUpdateBuyOrder.Name = "btnManualUpdateBuyOrder";
this.btnManualUpdateBuyOrder.Size = new System.Drawing.Size(114, 23);
this.btnManualUpdateBuyOrder.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -549,7 +508,7 @@
this.txtMapSkuName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtMapSkuName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtMapSkuName.Location = new System.Drawing.Point(83, 541);
this.txtMapSkuName.Location = new System.Drawing.Point(85, 540);
this.txtMapSkuName.Name = "txtMapSkuName";
this.txtMapSkuName.Size = new System.Drawing.Size(388, 23);
this.txtMapSkuName.TabIndex = 794;
@@ -558,7 +517,7 @@
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(27, 543);
this.label5.Location = new System.Drawing.Point(29, 542);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 17);
this.label5.TabIndex = 793;
@@ -571,7 +530,7 @@
this.btnManualUpdateSendProvince.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnManualUpdateSendProvince.DisabledBackColor = System.Drawing.Color.Empty;
this.btnManualUpdateSendProvince.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnManualUpdateSendProvince.Location = new System.Drawing.Point(357, 599);
this.btnManualUpdateSendProvince.Location = new System.Drawing.Point(359, 598);
this.btnManualUpdateSendProvince.Name = "btnManualUpdateSendProvince";
this.btnManualUpdateSendProvince.Size = new System.Drawing.Size(114, 23);
this.btnManualUpdateSendProvince.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -594,7 +553,7 @@
this.txtMapSkuId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtMapSkuId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtMapSkuId.Location = new System.Drawing.Point(319, 570);
this.txtMapSkuId.Location = new System.Drawing.Point(321, 569);
this.txtMapSkuId.Name = "txtMapSkuId";
this.txtMapSkuId.Size = new System.Drawing.Size(152, 23);
this.txtMapSkuId.TabIndex = 474;
@@ -603,7 +562,7 @@
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(250, 573);
this.label4.Location = new System.Drawing.Point(252, 572);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(69, 17);
this.label4.TabIndex = 473;
@@ -613,7 +572,7 @@
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(14, 573);
this.label3.Location = new System.Drawing.Point(16, 572);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(69, 17);
this.label3.TabIndex = 472;
@@ -623,7 +582,7 @@
//
this.txtMapGoodsId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtMapGoodsId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtMapGoodsId.Location = new System.Drawing.Point(83, 570);
this.txtMapGoodsId.Location = new System.Drawing.Point(85, 569);
this.txtMapGoodsId.Name = "txtMapGoodsId";
this.txtMapGoodsId.Size = new System.Drawing.Size(152, 23);
this.txtMapGoodsId.TabIndex = 471;
@@ -633,7 +592,7 @@
this.txtMapGoodsName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtMapGoodsName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtMapGoodsName.Location = new System.Drawing.Point(83, 512);
this.txtMapGoodsName.Location = new System.Drawing.Point(85, 511);
this.txtMapGoodsName.Name = "txtMapGoodsName";
this.txtMapGoodsName.Size = new System.Drawing.Size(388, 23);
this.txtMapGoodsName.TabIndex = 470;
@@ -642,7 +601,7 @@
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(27, 515);
this.label2.Location = new System.Drawing.Point(29, 514);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 17);
this.label2.TabIndex = 469;
@@ -652,7 +611,7 @@
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(39, 602);
this.label1.Location = new System.Drawing.Point(41, 601);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 17);
this.label1.TabIndex = 468;
@@ -663,7 +622,7 @@
this.txtSendProvince.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtSendProvince.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSendProvince.Location = new System.Drawing.Point(83, 599);
this.txtSendProvince.Location = new System.Drawing.Point(85, 598);
this.txtSendProvince.Name = "txtSendProvince";
this.txtSendProvince.Size = new System.Drawing.Size(268, 23);
this.txtSendProvince.TabIndex = 467;
@@ -683,6 +642,7 @@
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.panel1);
this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
this.splitContainer2.Size = new System.Drawing.Size(1358, 734);
this.splitContainer2.SplitterDistance = 26;
@@ -703,7 +663,7 @@
// pictureBox1
//
this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.pictureBox1.Location = new System.Drawing.Point(30, 7);
this.pictureBox1.Location = new System.Drawing.Point(32, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(100, 100);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@@ -716,13 +676,97 @@
this.chkChangeWarehouseAddress.AutoSize = true;
this.chkChangeWarehouseAddress.Checked = true;
this.chkChangeWarehouseAddress.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkChangeWarehouseAddress.Location = new System.Drawing.Point(307, 6);
this.chkChangeWarehouseAddress.Location = new System.Drawing.Point(309, 11);
this.chkChangeWarehouseAddress.Name = "chkChangeWarehouseAddress";
this.chkChangeWarehouseAddress.Size = new System.Drawing.Size(171, 21);
this.chkChangeWarehouseAddress.TabIndex = 859;
this.chkChangeWarehouseAddress.Text = "保存地址时替换为云仓地址";
this.chkChangeWarehouseAddress.UseVisualStyleBackColor = true;
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.chkChangeWarehouseAddress);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Controls.Add(this.txtSendProvince);
this.panel1.Controls.Add(this.txtBuySkuName);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.label20);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.txtMapGoodsName);
this.panel1.Controls.Add(this.label21);
this.panel1.Controls.Add(this.txtMapGoodsId);
this.panel1.Controls.Add(this.cmbTransitWarehouse);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.label15);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.txtShopOrderItemPrice);
this.panel1.Controls.Add(this.txtMapSkuId);
this.panel1.Controls.Add(this.txtBuySkuId);
this.panel1.Controls.Add(this.txtShopOrderItemCnt);
this.panel1.Controls.Add(this.label16);
this.panel1.Controls.Add(this.txtBuyOrderId);
this.panel1.Controls.Add(this.btnManualUpdateSendProvince);
this.panel1.Controls.Add(this.label22);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.label17);
this.panel1.Controls.Add(this.txtMapSkuName);
this.panel1.Controls.Add(this.label19);
this.panel1.Controls.Add(this.label18);
this.panel1.Controls.Add(this.btnManualUpdateTransitWarehouse);
this.panel1.Controls.Add(this.label23);
this.panel1.Controls.Add(this.btnManualUpdateBuyOrder);
this.panel1.Controls.Add(this.txtBuyCnt);
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.txtBuyGoodsId);
this.panel1.Controls.Add(this.txtShopGoodsName);
this.panel1.Controls.Add(this.txtShopSpecName);
this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.txtBuyGoodsName);
this.panel1.Controls.Add(this.txtShopGoodsId);
this.panel1.Controls.Add(this.label14);
this.panel1.Controls.Add(this.label9);
this.panel1.Controls.Add(this.txtBuyPrice);
this.panel1.Controls.Add(this.label10);
this.panel1.Controls.Add(this.label13);
this.panel1.Controls.Add(this.txtShopSkuId);
this.panel1.Controls.Add(this.label24);
this.panel1.Controls.Add(this.label11);
this.panel1.Controls.Add(this.txtUpSpuCode);
this.panel1.Controls.Add(this.txtUpSkuCode);
this.panel1.Controls.Add(this.label12);
this.panel1.Location = new System.Drawing.Point(868, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(487, 698);
this.panel1.TabIndex = 0;
//
// btnJumpOrderList
//
this.btnJumpOrderList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnJumpOrderList.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnJumpOrderList.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnJumpOrderList.DisabledBackColor = System.Drawing.Color.Empty;
this.btnJumpOrderList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnJumpOrderList.Location = new System.Drawing.Point(0, 2);
this.btnJumpOrderList.Name = "btnJumpOrderList";
this.btnJumpOrderList.Size = new System.Drawing.Size(114, 23);
this.btnJumpOrderList.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnJumpOrderList.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnJumpOrderList.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnJumpOrderList.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnJumpOrderList.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnJumpOrderList.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnJumpOrderList.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnJumpOrderList.Style.GradientAngle = 90;
this.btnJumpOrderList.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnJumpOrderList.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
this.btnJumpOrderList.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
this.btnJumpOrderList.TabIndex = 807;
this.btnJumpOrderList.Text = "去订单列表页";
this.btnJumpOrderList.Click += new System.EventHandler(this.btnJumpOrderList_Click);
//
// PddMobileBuyOrderForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -740,7 +784,6 @@
this.Controls.SetChildIndex(this.splitContainer2, 0);
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
@@ -749,6 +792,8 @@
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
@@ -808,5 +853,7 @@
private System.Windows.Forms.ComboBox cmbTransitWarehouse;
private System.Windows.Forms.PictureBox pictureBox1;
private Work.UserComponents.UcCheckBox chkChangeWarehouseAddress;
private System.Windows.Forms.Panel panel1;
private DevComponents.DotNetBar.PanelEx btnJumpOrderList;
}
}
+3 -2
View File
@@ -1,5 +1,6 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Local;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
@@ -100,11 +101,11 @@ namespace TemuKJD.ToolForms
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
else
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, false);
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
var lifeSapnHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow);
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
cefWebBrowser.LifeSpanHandler = lifeSapnHandler;
cefWebBrowser.KeyboardHandler = new KeyboardHandler();
cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;