1优化拍单逻辑 2优化部分文件位置命名等
This commit is contained in:
1 parent
34c51c6fcd
commit
1e27c0b1e1
65 files changed
+2594
-268
No files matched your search
@@ -51,7 +51,7 @@
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -59,6 +59,7 @@
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
@@ -18,6 +18,7 @@ using Work;
|
||||
using Work.Api;
|
||||
using Work.BaseForms;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
|
||||
namespace _29WxOrder.FactoryExportForms
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@ using Work.BaseForms;
|
||||
using Work.BuyUsers;
|
||||
using _29WxOrder.MyControl;
|
||||
using Work.BLL;
|
||||
using AllBase.Model.Local;
|
||||
|
||||
namespace _29WxOrder
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using _29WxOrder.ShopForms;
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Helper;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using DevComponents.DotNetBar;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -24,6 +24,7 @@ using Work.Api;
|
||||
using Work.BaseForms;
|
||||
using Work.BuyUsers;
|
||||
using Work.Pinduoduo;
|
||||
using AllBase.Model.Local;
|
||||
|
||||
namespace _29WxOrder.OrderForms
|
||||
{
|
||||
@@ -43,7 +44,7 @@ namespace _29WxOrder.OrderForms
|
||||
public delegate void delegateClick(object sender, EventArgs e);
|
||||
public string order_id;
|
||||
public DouYinOrderModel orderDetail;
|
||||
public AllBase.Model.Result.ShopLoginInfo shop;
|
||||
public ShopLoginInfo shop;
|
||||
public string webUrl = "https://yangkeduo.com/goods.html?goods_id=";
|
||||
public static string PddUid = "";
|
||||
public string detailHtml = "";//商品详情
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -20,6 +20,7 @@ using Work;
|
||||
using Work.Api;
|
||||
using Work.BaseForms;
|
||||
using Work.BuyUsers;
|
||||
using AllBase.Model.Local;
|
||||
|
||||
namespace _29WxOrder.OrderForms
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Work.BaseForms;
|
||||
using AllBase.Model.Local;
|
||||
|
||||
namespace _29WxOrder.ShopForms
|
||||
{
|
||||
|
||||
@@ -40,7 +40,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>
|
||||
@@ -49,7 +49,7 @@
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\KJD Cef138\Bin\</OutputPath>
|
||||
<OutputPath>..\Bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -99,14 +99,15 @@
|
||||
<DependentUpon>BaseMsgWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseWindows\BaseWindow.cs" />
|
||||
<Compile Include="CefHelper\WPFCEFBrowser.cs" />
|
||||
<Compile Include="Converters\ImageUrlToBitmapImageConverter.cs" />
|
||||
<Compile Include="Converters\HasValueToVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\StatusToColorBrushConverter.cs" />
|
||||
<Compile Include="Converters\TextToVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\VisibleToVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\ValueMinus24Converter.cs" />
|
||||
<Compile Include="Ctrls\BuyerCtrls\PDDBuyerOrderListCtrl.xaml.cs">
|
||||
<DependentUpon>PDDBuyerOrderListCtrl.xaml</DependentUpon>
|
||||
<Compile Include="Ctrls\BuyerCtrls\PDDBuyerOrderReadCtrl.xaml.cs">
|
||||
<DependentUpon>PDDBuyerOrderReadCtrl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Ctrls\BuyerCtrls\PDDBuyerSelectCtrl.xaml.cs">
|
||||
<DependentUpon>PDDBuyerSelectCtrl.xaml</DependentUpon>
|
||||
@@ -145,7 +146,7 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Ctrls\BuyerCtrls\PDDBuyerOrderListCtrl.xaml">
|
||||
<Page Include="Ctrls\BuyerCtrls\PDDBuyerOrderReadCtrl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -325,10 +326,13 @@
|
||||
<Resource Include="Resources\err_pic.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\loading_blue.gif" />
|
||||
<Resource Include="Resources\loading.gif" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="CefHelper\" />
|
||||
<Resource Include="Resources\buyer_order.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\loading.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
@@ -0,0 +1,573 @@
|
||||
using CefSharp;
|
||||
using CefSharp.Handler;
|
||||
using CefSharp.Wpf;
|
||||
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;
|
||||
using Work._29Tools.CefTools;
|
||||
|
||||
namespace _29WxOrderWpf.CefHelper
|
||||
{
|
||||
public class WPFCEFBrowser
|
||||
{
|
||||
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 LocalMenuHandler();
|
||||
cefBrowser.LifeSpanHandler = new LocalLifeSpanHandler(isPopupNewWindow ? PopWindowType.NewWindow : PopWindowType.SelfWindow);
|
||||
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())
|
||||
{
|
||||
LocalRequestHandler customRequestHandler = cefWebBrowser.RequestHandler as LocalRequestHandler;
|
||||
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();
|
||||
}
|
||||
LocalCookieVisitor visitor = new LocalCookieVisitor();
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerOrderListCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// PDDBuyerOrderListCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PDDBuyerOrderListCtrl : UserControl
|
||||
{
|
||||
public PDDBuyerOrderListCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerOrderReadCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="1000">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Content="自动读买手单" x:Name="chkAutoReadBuyerOrder" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left"
|
||||
Margin="6,0" VerticalAlignment="Center" Checked="chkAutoReadBuyerOrder_CheckedChanged" Unchecked="chkAutoReadBuyerOrder_CheckedChanged" IsChecked="True"/>
|
||||
|
||||
<TextBox x:Name="txtUrlAddress" Grid.Column="2" Margin="8,0,20,0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" Height="28"
|
||||
VerticalContentAlignment="Center" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" Background="LightGray" x:Name="GridCef">
|
||||
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" VerticalAlignment="Bottom" Visibility="Visible">
|
||||
<DataGrid Height="300" RowHeight="50" AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}" CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="30">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="0.5*" Header="" Binding="{Binding order_id}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1*" Header="买手名称" Binding="{Binding order_id}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1.5*" Header="拍单订单号"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="0.8*" Header="拍单时间"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1.8*" Header="商品信息"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="0.8*" Header="金额"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1*" Header="订单状态"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1*" Header="物流名称"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1*" Header="物流单号"></DataGridTextColumn>
|
||||
<DataGridTextColumn Width="1*" Header="订单信息"></DataGridTextColumn>
|
||||
<DataGridTemplateColumn Width="0.6*" Header="手动发送" x:Name="colSendBuyerOrder" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnSendBuyerOrder" Background="Transparent" HorizontalAlignment="Center" Foreground="#409eff" BorderBrush="Transparent"
|
||||
Margin="4,0,0,0" Content="发送" Click="btnSendBuyerOrder_Click"></Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,133 @@
|
||||
using _29WxOrderWpf.CefHelper;
|
||||
using AllBase;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Result;
|
||||
using CefSharp;
|
||||
using CefSharp.Handler;
|
||||
using CefSharp.Wpf;
|
||||
using NaiBa.Util;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Work._29Tools.CefTools;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// PDDBuyerOrderReadCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PDDBuyerOrderReadCtrl : UserControl
|
||||
{
|
||||
ChromiumWebBrowser cefWebBrowser = null;
|
||||
public bool AutoReadBuyerOrder = true;
|
||||
ConcurrentList<PddBuyerOrderLiteInfo> lstPddBuyerOrderInfoLite { get; set; } = new ConcurrentList<PddBuyerOrderLiteInfo>();
|
||||
|
||||
public PDDBuyerOrderReadCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
InitCef();
|
||||
}
|
||||
|
||||
public void InitCef()
|
||||
{
|
||||
//CefSharp.Wpf.ChromiumWebBrowser cefWebBrowser = new CefSharp.Wpf.ChromiumWebBrowser();
|
||||
//cefWebBrowser.Address = "https://www.baidu.com";
|
||||
cefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser("https://www.baidu.com", false);
|
||||
Grid.SetRow(cefWebBrowser, 0);
|
||||
this.GridCef.Children.Add(cefWebBrowser);
|
||||
|
||||
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
||||
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
||||
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
|
||||
cefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
||||
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||
cefWebBrowser.LifeSpanHandler = lifeSapnHandler;
|
||||
cefWebBrowser.KeyboardHandler = new KeyboardHandler();
|
||||
cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
|
||||
cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
|
||||
cefWebBrowser.LoadError += CefWebBrowser_LoadError;
|
||||
|
||||
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
//Thread.Sleep(2000);
|
||||
//Dispatcher.Invoke(new Action(() => {
|
||||
// browser.Visibility = Visibility.Hidden;
|
||||
//}));
|
||||
//Thread.Sleep(1000);
|
||||
//Dispatcher.Invoke(new Action(() => {
|
||||
|
||||
// browser.Address = "https://www.sina.com.cn";
|
||||
|
||||
|
||||
// //}));
|
||||
// //Thread.Sleep(3000);
|
||||
// //var jsStr = @"window.scrollTo(0, document.body.scrollHeight);";
|
||||
// //var client = browser.GetDevToolsClient();
|
||||
// //if (client != null)
|
||||
// //{
|
||||
// // var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
// // //result.Wait(5000);
|
||||
// // //string resultStr = result.Result.Result.Value.ParseToString();
|
||||
// // ////if (resultStr.ParseToInt() > 0)
|
||||
// // //{
|
||||
// // // CEFBrowser.DeleteCookie(browser.GetCookieManager(null));
|
||||
// // // //return;
|
||||
// // //}
|
||||
// //}
|
||||
// //Dispatcher.Invoke(new Action(() => {
|
||||
// //}));
|
||||
// //Thread.Sleep(3000);
|
||||
// //Dispatcher.Invoke(new Action(() => {
|
||||
// // browser.Visibility = Visibility.Visible;
|
||||
// //}));
|
||||
//});
|
||||
}
|
||||
|
||||
private void CefWebBrowser_LoadError(object sender, LoadErrorEventArgs e)
|
||||
{
|
||||
}
|
||||
private void CefWebBrowser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e)
|
||||
{
|
||||
}
|
||||
private void CefWebBrowser_AddressChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||
{
|
||||
}
|
||||
|
||||
private void chkAutoReadBuyerOrder_CheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AutoReadBuyerOrder = chkAutoReadBuyerOrder.IsChecked == true;
|
||||
}
|
||||
|
||||
private void btnSendBuyerOrder_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Margin="4,0,0,0" Width="24" Height="24" Source="{StaticResource imgBuyerOrder}" MouseLeftButtonUp="Image_MouseLeftButtonUp" Cursor="Hand"></Image>
|
||||
<ComboBox Grid.Column="1" x:Name="cmbPddBuyer" Margin="8,0,0,0" VerticalContentAlignment="Center" Style="{StaticResource RoundedComboBox}" Height="24"
|
||||
MouseLeftButtonUp="cmbPddBuyer_MouseLeftButtonUp" SelectionChanged="cmbPddBuyer_SelectionChanged" SelectedIndex="0">
|
||||
<ComboBox.ItemTemplate>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -154,5 +155,15 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
// GetPddBuyer();
|
||||
//});
|
||||
}
|
||||
|
||||
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (MainWindow.Instance.pddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
MainWindow.Instance.pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
if (Panel.GetZIndex(MainWindow.Instance.pddBuyerOrderReadCtrl) < 1)
|
||||
Panel.SetZIndex(MainWindow.Instance.pddBuyerOrderReadCtrl, 1);
|
||||
else
|
||||
Panel.SetZIndex(MainWindow.Instance.pddBuyerOrderReadCtrl, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,21 +63,25 @@
|
||||
|
||||
<Button Grid.Column="8" x:Name="btnFilter" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0" Content="过滤" Width="48" Height="24" Click="btnFilter_Click"/>
|
||||
<Button Grid.Column="9" x:Name="btnSearch" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,4,0" Content="读单" Width="48" Height="24" Click="btnSearch_Click"/>
|
||||
<Image x:Name="imgLoading" Grid.Column="10" Source="{StaticResource loading_pic}" Width="20" Height="20" Margin="0,15,0,15">
|
||||
<!--<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="Image.Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetName="myElement"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="360"
|
||||
Duration="0:0:5"
|
||||
RepeatBehavior="Forever"/>
|
||||
<Image x:Name="imgLoading" Grid.Column="10" Source="{StaticResource imgLoadingPic}" Width="20" Height="20" Margin="0,15,0,15">
|
||||
<Image.RenderTransform>
|
||||
<RotateTransform Angle="45" CenterX="10" CenterY="10"/>
|
||||
</Image.RenderTransform>
|
||||
<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="Image.Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="imgLoading"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
From="0"
|
||||
To="360"
|
||||
Duration="0:0:3"
|
||||
RepeatBehavior="Forever">
|
||||
</DoubleAnimation>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Image.Triggers>-->
|
||||
</Image.Triggers>
|
||||
</Image>
|
||||
</Grid>
|
||||
|
||||
@@ -140,7 +144,8 @@
|
||||
</DataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ListBox BorderThickness="0" ItemsSource="{Binding lstFilterOrder}" Grid.Row="3" HorizontalContentAlignment="Stretch" x:Name="lbxOrder" Margin="0,0,0,4">
|
||||
<ListBox BorderThickness="0" ItemsSource="{Binding lstFilterOrder}" Grid.Row="3" HorizontalContentAlignment="Stretch" x:Name="lbxOrder" Margin="0,0,0,4"
|
||||
ScrollViewer.CanContentScroll="True" VirtualizingPanel.ScrollUnit="Pixel">
|
||||
<!--使用自定义属性模板去除ListBox高亮显示框-->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
|
||||
@@ -4,7 +4,7 @@ using AllBase;
|
||||
using AllBase.Extension;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Result;
|
||||
using AllBase.Model.Local;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
@@ -224,6 +224,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
order.order_items.Add(item);
|
||||
|
||||
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
|
||||
if (item.buy_map == null)
|
||||
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
|
||||
|
||||
item.item_transit_orders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
|
||||
}
|
||||
@@ -275,7 +277,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
imgLoading.Visibility = Visibility.Collapsed;
|
||||
imgLoading.Visibility = Visibility.Hidden;
|
||||
btnSearch.IsEnabled = true;
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase.Model.Local;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -42,7 +43,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
//if (gridChildOrder.Children.Count > 0)
|
||||
// return;
|
||||
|
||||
var order = this.DataContext as AllBase.Model.oms_wei_order_info;
|
||||
var order = this.DataContext as oms_wei_order_info;
|
||||
if (order == null)
|
||||
return;
|
||||
|
||||
@@ -69,14 +70,14 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void btnSeeAddressDetail_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var order = this.DataContext as AllBase.Model.oms_wei_order_info;
|
||||
var order = this.DataContext as oms_wei_order_info;
|
||||
if (order == null)
|
||||
return;
|
||||
}
|
||||
|
||||
private void btnGetRefundAddress_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var order = this.DataContext as AllBase.Model.oms_wei_order_info;
|
||||
var order = this.DataContext as oms_wei_order_info;
|
||||
if (order == null)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</Border>
|
||||
|
||||
|
||||
<Image Margin="8,8,0,8" Grid.Column="4" Width="24" Height="24" Source="{StaticResource OrderWeishopIcon}"></Image>
|
||||
<Image Margin="8,8,0,8" Grid.Column="4" Width="24" Height="24" Source="{StaticResource imgOrderWeishopIcon}"></Image>
|
||||
<uc:UcWaterMarkTextBox WaterMark="店铺名称" x:Name="txtShopName" Grid.Column="5" Margin="4,8,0,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="{Binding shop_name}" BorderThickness="0" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--<Image Grid.RowSpan="20" Grid.Column="0" Height="80" Width="80" Margin="0,0,8,0" Source="{DynamicResource err_pic}"></Image>-->
|
||||
<!--<Image Grid.RowSpan="20" Grid.Column="0" Height="80" Width="80" Margin="0,0,8,0" Source="{DynamicResource imgErrPic}"></Image>-->
|
||||
<uc:UcWaterMarkTextBox WaterMark="商品名称" x:Name="txtGoodsName" Text="{Binding title}" Grid.Column="1" Grid.Row="1" Margin="0,2,4,2"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" FontWeight="Bold"/>
|
||||
|
||||
@@ -198,20 +198,27 @@
|
||||
<!--<TextBox Text="发货:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="发货" Text="" Grid.Column="1" Grid.Row="1" Margin="0,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>-->
|
||||
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2">
|
||||
<TextBlock Text="外部单号:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtOutOrderNumStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
|
||||
<uc:UcWaterMarkTextBox WaterMark="外部单号:" Text="{Binding item_transit_order.OutOrderNumStr}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
x:Name="txtOutOrderNumStr" Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
</WrapPanel>
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
|
||||
<TextBox Text="外采:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="外采" Text="{Binding item_order.out_express_company}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="外采" Text="-" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
<uc:UcWaterMarkTextBox WaterMark="-" Text="-" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="外采" Text="{Binding item_order.out_express_no}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
</WrapPanel>
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
|
||||
<TextBox Text="退货:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="退货" Text="{Binding item_refund.return_delivery_name}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="退货" Text="-" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
<uc:UcWaterMarkTextBox WaterMark="-" Text="-" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="退货" Text="{Binding item_refund.return_waybill_id}" Grid.Column="1" Grid.Row="1" Padding="0" Margin="-2,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Local;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -32,14 +33,14 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void btnSeeAddressDetail_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var order = this.DataContext as AllBase.Model.oms_wei_order_item_info;
|
||||
var order = this.DataContext as oms_wei_order_item_info;
|
||||
if (order == null)
|
||||
return;
|
||||
}
|
||||
|
||||
private void btnGetRefundAddress_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var order = this.DataContext as AllBase.Model.oms_wei_order_item_info;
|
||||
var order = this.DataContext as oms_wei_order_item_info;
|
||||
if (order == null)
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +57,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void btnBuyOrder_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var orderItem = this.DataContext as AllBase.Model.oms_wei_order_item_info;
|
||||
var orderItem = this.DataContext as oms_wei_order_item_info;
|
||||
if (orderItem == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError(MainWindow.Instance, "订单信息为空");
|
||||
@@ -76,9 +77,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, orderItem, GlobalConfig.CurrentPddBuyer, orderItem.buy_map);
|
||||
|
||||
//所有订单页面
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html?type=0&comment_tab=1&combine_orders=1&" +
|
||||
"main_orders=1&refer_page_name=personal&refer_page_id=10001_1782219035613_a9ulipk4k3&refer_page_sn=10001";
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html"; //"?type=0&comment_tab=1&combine_orders=1&main_orders=1&refer_page_name=personal&refer_page_id=10001_1782219035613_a9ulipk4k3&refer_page_sn=10001";
|
||||
//已有拍单关联的跳的到订单确认界面
|
||||
if (orderItem.buy_map != null)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<DataGrid Grid.Row="1" Opacity="0" HorizontalContentAlignment="Center" Margin="2,0,2,2" RowHeight="60" x:Name="dgOrder" Grid.ColumnSpan="2"
|
||||
<DataGrid Grid.Row="1" Opacity="1" HorizontalContentAlignment="Center" Margin="2,0,2,2" RowHeight="60" x:Name="dgOrder" Grid.ColumnSpan="2"
|
||||
AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}" CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="40">
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using _29WxOrderWpf.Utils;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<orderctrls:OrderListCtrl x:Name="orderListCtrl" Grid.Column="1" Visibility="Collapsed"></orderctrls:OrderListCtrl>
|
||||
|
||||
<buyerctrls:PDDBuyerSelectCtrl Width="240" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="8"/>
|
||||
<buyerctrls:PDDBuyerOrderReadCtrl x:Name="pddBuyerOrderReadCtrl" Grid.Column="1" Visibility="Collapsed" Panel.ZIndex="-1" Width="800" HorizontalAlignment="Right" Margin="0,40,0,0"></buyerctrls:PDDBuyerOrderReadCtrl>
|
||||
<buyerctrls:PDDBuyerSelectCtrl x:Name="pddBuyerSelectCtrl" Visibility="Collapsed" Width="280" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="8"/>
|
||||
<Grid x:Name="gridUser" Visibility="Hidden" Grid.ColumnSpan="2" Background="#7F000000">
|
||||
<Border CornerRadius="4" Width="500" Height="600" Background="White">
|
||||
<shopctrls:ShopListCtrl x:Name="shopListCtrl" Visibility="{Binding ElementName=gridUser,Mode=TwoWay,Path=Visibility}" Margin="2"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Extension;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using CefSharp;
|
||||
using NaiBa.Util;
|
||||
@@ -68,6 +70,8 @@ namespace _29WxOrderWpf
|
||||
{
|
||||
//shopListCtrl.Visibility = Visibility.Visible;
|
||||
orderListCtrl.Visibility = Visibility.Visible;
|
||||
pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
pddBuyerSelectCtrl.Visibility = Visibility.Visible;
|
||||
Task.Run(() =>
|
||||
{
|
||||
GetServerShop();
|
||||
@@ -77,46 +81,6 @@ namespace _29WxOrderWpf
|
||||
GetPddBuyer();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//CefSharp.Wpf.ChromiumWebBrowser browser = new CefSharp.Wpf.ChromiumWebBrowser();
|
||||
//browser.Address = "https://www.baidu.com";
|
||||
//Grid.SetRow(browser, 1);
|
||||
//this.mainGrid.Children.Add(browser);
|
||||
//Task. Run(() => {
|
||||
|
||||
// Thread.Sleep(2000);
|
||||
// Dispatcher.Invoke(new Action(() => {
|
||||
// browser.Visibility = Visibility.Hidden;
|
||||
// }));
|
||||
// Thread.Sleep(1000);
|
||||
// Dispatcher.Invoke(new Action(() => {
|
||||
|
||||
// browser.Address = "https://www.sina.com.cn";
|
||||
|
||||
|
||||
// }));
|
||||
// Thread.Sleep(3000);
|
||||
// var jsStr = @"window.scrollTo(0, document.body.scrollHeight);";
|
||||
// var client = browser.GetDevToolsClient();
|
||||
// if (client != null)
|
||||
// {
|
||||
// var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
// //result.Wait(5000);
|
||||
// //string resultStr = result.Result.Result.Value.ParseToString();
|
||||
// ////if (resultStr.ParseToInt() > 0)
|
||||
// //{
|
||||
// // CEFBrowser.DeleteCookie(browser.GetCookieManager(null));
|
||||
// // //return;
|
||||
// //}
|
||||
// }
|
||||
// Dispatcher.Invoke(new Action(() => {
|
||||
// }));
|
||||
// Thread.Sleep(3000);
|
||||
// Dispatcher.Invoke(new Action(() => {
|
||||
// browser.Visibility = Visibility.Visible;
|
||||
// }));
|
||||
//});
|
||||
}
|
||||
|
||||
#region 反抓包功能
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
File renamed without changes.
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -13,7 +13,8 @@
|
||||
<BitmapImage x:Key="imgBaseMsgErr" UriSource="/Resources/BaseMsgErr.png"/>
|
||||
<BitmapImage x:Key="imgBaseMsgInfo" UriSource="/Resources/BaseMsgInfo.png"/>
|
||||
<BitmapImage x:Key="imgBaseMsgQue" UriSource="/Resources/BaseMsgQue.png"/>
|
||||
<BitmapImage x:Key="OrderWeishopIcon" UriSource="/Resources/order_weishop_icon.png" />
|
||||
<BitmapImage x:Key="err_pic" UriSource="/Resources/err_pic.png" />
|
||||
<BitmapImage x:Key="loading_pic" UriSource="/Resources/loading_blue.gif" />
|
||||
<BitmapImage x:Key="imgOrderWeishopIcon" UriSource="/Resources/order_weishop_icon.png" />
|
||||
<BitmapImage x:Key="imgErrPic" UriSource="/Resources/err_pic.png" />
|
||||
<BitmapImage x:Key="imgLoadingPic" UriSource="/Resources/loading.png" />
|
||||
<BitmapImage x:Key="imgBuyerOrder" UriSource="/Resources/buyer_order.png" />
|
||||
</ResourceDictionary>
|
||||
@@ -63,14 +63,14 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -141,10 +141,12 @@
|
||||
<Compile Include="DouYinModel\Param\ShopManage\DouShopSettingParam.cs" />
|
||||
<Compile Include="DouYinModel\Result\DouGoodsInfo.cs" />
|
||||
<Compile Include="DouYinModel\Result\DouOrderListInfo.cs" />
|
||||
<Compile Include="Model\oms_wei_external_procurement_log.cs" />
|
||||
<Compile Include="Model\Params\TransitWarehouseParam.cs" />
|
||||
<Compile Include="Model\Params\WaybillHelper.cs" />
|
||||
<Compile Include="Model\Result\ShopLoginInfo.cs" />
|
||||
<Compile Include="Model\Local\oms_wei_external_procurement_log.cs" />
|
||||
<Compile Include="Model\Local\TransitWarehouseParam.cs" />
|
||||
<Compile Include="Model\Local\WaybillHelper.cs" />
|
||||
<Compile Include="Model\Result\PddBuyerAfterSaleLiteInfo.cs" />
|
||||
<Compile Include="Model\Result\PddBuyerOrderLiteInfo.cs" />
|
||||
<Compile Include="Model\Local\ShopLoginInfo.cs" />
|
||||
<Compile Include="DouYinModel\Result\DouSubAccountModel.cs" />
|
||||
<Compile Include="DouYinModel\Result\DouYinAfterSaleOrderModel.cs" />
|
||||
<Compile Include="DouYinModel\Result\DouYinOrderModel.cs" />
|
||||
@@ -161,13 +163,13 @@
|
||||
<Compile Include="LogSave.cs" />
|
||||
<Compile Include="Md5Base.cs" />
|
||||
<Compile Include="Model\MvvmBaseClasses\PropertyNotifyObject.cs" />
|
||||
<Compile Include="Model\oms_wei_order_info.cs" />
|
||||
<Compile Include="Model\oms_wei_order_item_info.cs" />
|
||||
<Compile Include="Model\oms_wei_refund_info.cs" />
|
||||
<Compile Include="Model\PddMultiBuyerInfo.cs" />
|
||||
<Compile Include="Model\PddPifaShopInfo.cs" />
|
||||
<Compile Include="Model\Result\BuyerLoginInfo.cs" />
|
||||
<Compile Include="Model\WXBuyMapInfo.cs" />
|
||||
<Compile Include="Model\Local\oms_wei_order_info.cs" />
|
||||
<Compile Include="Model\Local\oms_wei_order_item_info.cs" />
|
||||
<Compile Include="Model\Local\oms_wei_refund_info.cs" />
|
||||
<Compile Include="Model\Old\PddMultiBuyerInfo.cs" />
|
||||
<Compile Include="Model\Old\PddPifaShopInfo.cs" />
|
||||
<Compile Include="Model\Local\BuyerLoginInfo.cs" />
|
||||
<Compile Include="Model\Local\WXBuyMapInfo.cs" />
|
||||
<Compile Include="MultiThreadClient.cs" />
|
||||
<Compile Include="OutExcel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -191,6 +193,9 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Model\Params\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -665,5 +665,66 @@ namespace AllBase
|
||||
Match m = reg.Match(url);
|
||||
return m.Groups["VAL"].ToString(); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取值
|
||||
/// </summary>
|
||||
/// <param name="html"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetStringQuery(ref string queryString, string key)
|
||||
{
|
||||
//var queryStringTmp = "&" + queryString;
|
||||
//int nIndex = queryStringTmp.IndexOf(key + "=");
|
||||
//if (nIndex == -1)
|
||||
// return null;
|
||||
|
||||
//string temp = queryStringTmp.Substring(nIndex).Replace(key + "=", "");
|
||||
//nIndex = temp.IndexOf('&');
|
||||
//if (nIndex > -1)
|
||||
// temp = temp.Substring(0, nIndex);
|
||||
|
||||
//return temp;
|
||||
try { return GetURLParams(queryString, key); } catch { return null; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取值
|
||||
/// </summary>
|
||||
/// <param name="html"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetStringCookie(ref string cookieStr, string key)
|
||||
{
|
||||
int nIndex = cookieStr.IndexOf(key + "=");
|
||||
if (nIndex == -1)
|
||||
return null;
|
||||
|
||||
string temp = cookieStr.Substring(nIndex).Replace(key + "=", "");
|
||||
nIndex = temp.IndexOf(';');
|
||||
if (nIndex > -1)
|
||||
temp = temp.Substring(0, nIndex);
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static string FliterHtmlTag(string htmlStr)
|
||||
{
|
||||
if (String.IsNullOrEmpty(htmlStr))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; //定义style的正则表达式
|
||||
string regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; //定义script的正则表达式
|
||||
string regEx_html = "<[^>]+>"; //定义HTML标签的正则表达式
|
||||
htmlStr = Regex.Replace(htmlStr, regEx_style, "");//删除css
|
||||
htmlStr = Regex.Replace(htmlStr, regEx_script, "");//删除js
|
||||
htmlStr = Regex.Replace(htmlStr, regEx_html, "");//删除html标记
|
||||
htmlStr = Regex.Replace(htmlStr, "\\s*|\t|\r|\n", "");//去除tab、空格、空行
|
||||
htmlStr = htmlStr.Replace("\"", "");//去除异常的引号
|
||||
|
||||
return htmlStr.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using AllBase.DouYinModel.Param.ConfigManage;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util;
|
||||
using System;
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AllBase.Model.Result
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class BuyerLoginInfo : PropertyNotifyObject
|
||||
{
|
||||
@@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Result
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class ShopLoginInfo : PropertyNotifyObject
|
||||
{
|
||||
+1
-1
@@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Params
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class TransitWarehouseParam
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class WXBuyMapInfo
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Params
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class WaybillHelper
|
||||
{
|
||||
+9
-1
@@ -4,10 +4,17 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class oms_wei_external_procurement_log
|
||||
{
|
||||
public string OutOrderNumStr
|
||||
{
|
||||
get { return "外部单号:" + out_order_no; }
|
||||
set { }
|
||||
}
|
||||
|
||||
|
||||
public long id { get; set; }
|
||||
public string out_order_no { get; set; }
|
||||
public string order_no { get; set; }
|
||||
@@ -15,5 +22,6 @@ namespace AllBase.Model
|
||||
public string buyer_account { get; set; }
|
||||
public int? out_amount { get; set; }
|
||||
public string purchaser_note { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AllBase.Model
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class oms_wei_order_info : PropertyNotifyObject
|
||||
{
|
||||
+1
-2
@@ -9,9 +9,8 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace AllBase.Model
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class oms_wei_order_item_info : PropertyNotifyObject
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AllBase.Model
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class oms_wei_refund_info
|
||||
{
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,78 @@
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Result
|
||||
{
|
||||
public class PddBuyerAfterSaleLiteInfo
|
||||
{
|
||||
public string buyerId { get; set; } // 买手Id
|
||||
public string buyerName { get; set; } // 买手名称
|
||||
public string sendStatus { get; set; } = "";
|
||||
public string orderSn
|
||||
{
|
||||
get
|
||||
{
|
||||
var detailPage = listItemExtraVO.navToDetailPageUrl;
|
||||
return BaseRegex.GetStringQuery(ref detailPage, "order_sn");
|
||||
}
|
||||
}
|
||||
public int? orderDate { get { return orderSn.Split('-').FirstOrDefault().ParseToInt(); } }
|
||||
|
||||
|
||||
public long? afterSalesId { get; set; } // 20129688312436,
|
||||
public ListItemExtraVO listItemExtraVO { get; set; }
|
||||
public ListItemMallVO listItemMallVO { get; set; }
|
||||
public ListItemStatusVO listItemStatusVO { get; set; }
|
||||
public ListItemGoodsVO listItemGoodsVO { get; set; }
|
||||
public ListItemAmountVO listItemAmountVO { get; set; }
|
||||
}
|
||||
|
||||
public class ListItemAmountVO
|
||||
{
|
||||
public string orderAmountTitle { get; set; } // "实付:",
|
||||
public int? orderAmount { get; set; } // 1580,
|
||||
public object payLaterAmountTitle { get; set; } // null,
|
||||
public object payLaterAmount { get; set; } // null,
|
||||
public string refundAmountTitle { get; set; } // "退款金额:",
|
||||
public int? refundAmount { get; set; } // 1580,
|
||||
public object refundAmountText { get; set; } // null,
|
||||
public bool? useCoupon { get; set; } // false
|
||||
|
||||
}
|
||||
|
||||
public class ListItemGoodsVO
|
||||
{
|
||||
public string goodsImage { get; set; } // "https://img.pddpic.com/gaudit-image/2026-01-08/a3f431dd2be815640a2a41ed9a6cae5f.jpeg",
|
||||
public string goodsName { get; set; } // "假发男士爸爸中老年自然轻手织男士假发道具中年",
|
||||
public string spec { get; set; } // "",
|
||||
public int? goodsPrice { get; set; } // 1580,
|
||||
public int? goodsNumber { get; set; } // 1,
|
||||
public object richTextList { get; set; } // null
|
||||
|
||||
}
|
||||
|
||||
public class ListItemStatusVO
|
||||
{
|
||||
public string statusText { get; set; } // "退款成功"
|
||||
|
||||
}
|
||||
|
||||
public class ListItemMallVO
|
||||
{
|
||||
public string mallName { get; set; } // "江霞假发",
|
||||
public string mallLogo { get; set; } // "http://t16img.yangkeduo.com/pdd_ims/img_check/v2/E6EDFF2D6EE40120200112172428556/9824d59f68694de79252d95c62828c61.png",
|
||||
public string mallTagLink { get; set; } // null,
|
||||
public string pddRoute { get; set; } // "mall_page.html?mall_id=891600087&msn=tytnfyyplkflxcwnke2jkevprq_axbuy&_sop_rcto=YWKMWyWgOwRhdOxkIstGcbATTuXTx_3fIjo"
|
||||
|
||||
}
|
||||
|
||||
public class ListItemExtraVO
|
||||
{
|
||||
public string navToDetailPageUrl { get; set; } // "/complaints_new_detail.html?after_sales_id=20129688312436&order_sn=260409-566440793722665"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Result
|
||||
{
|
||||
public class PddBuyerOrderLiteInfo
|
||||
{
|
||||
//平台快递编码 微信快递名称 PDD
|
||||
//EMS EMS 邮政快递包裹
|
||||
//EMS EMS 邮政电商标快
|
||||
//JTSD 极兔速递 极兔速递
|
||||
//STO 申通快递 申通快递
|
||||
//YD 韵达速递 韵达快递
|
||||
//YTO 圆通速递 圆通快递
|
||||
//ZTO 中通快递 中通快递
|
||||
//BTWL 百世快运
|
||||
//HTKY 百世快递
|
||||
|
||||
public static string GetPddToTransitWarehouseExpressCompanyCode(string expressCompanyName)
|
||||
{
|
||||
if (expressCompanyName == null || expressCompanyName == "") return "";
|
||||
if (expressCompanyName.Contains("顺丰速运")) return "SF";
|
||||
if (expressCompanyName.Contains("邮政快递包裹")) return "EMS";
|
||||
if (expressCompanyName.Contains("邮政电商标快")) return "EMS";
|
||||
if (expressCompanyName.Contains("邮政EMS")) return "EMS";
|
||||
if (expressCompanyName.Contains("圆通快递")) return "YTO";
|
||||
if (expressCompanyName.Contains("中通快递")) return "ZTO";
|
||||
if (expressCompanyName.Contains("百世快递")) return "HTKY";
|
||||
if (expressCompanyName.Contains("百世快运")) return "HTKY";
|
||||
if (expressCompanyName.Contains("申通快递")) return "STO";
|
||||
if (expressCompanyName.Contains("韵达快递")) return "YUNDA";
|
||||
if (expressCompanyName.Contains("京东快递")) return "JDKD";
|
||||
if (expressCompanyName.Contains("京东快运")) return "JDKD";
|
||||
if (expressCompanyName.Contains("京东大件物流")) return "JDKD";
|
||||
if (expressCompanyName.Contains("极兔速递")) return "JTSD";
|
||||
if (expressCompanyName.Contains("极兔快递")) return "JTSD";
|
||||
return "";
|
||||
|
||||
|
||||
//SF 顺丰 //EMS 邮政快递 //YTO 圆通 //ZTO 中通 //HTKY 百世 //STO 申通 //YUNDA 韵达 //JDKD 京东快递 //JTSD 极兔
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static string GetPddToWxExpressCompanyCode(string expressCompanyName)
|
||||
{
|
||||
if (expressCompanyName == null || expressCompanyName == "") return "";
|
||||
if (expressCompanyName.Contains("邮政快递包裹")) return "EMS";
|
||||
if (expressCompanyName.Contains("邮政电商标快")) return "EMS";
|
||||
if (expressCompanyName.Contains("邮政EMS")) return "EMS";
|
||||
if (expressCompanyName.Contains("极兔速递")) return "JTSD";
|
||||
if (expressCompanyName.Contains("极兔快递")) return "JTSD";
|
||||
if (expressCompanyName.Contains("申通快递")) return "STO";
|
||||
if (expressCompanyName.Contains("韵达快递")) return "YD";
|
||||
if (expressCompanyName.Contains("圆通快递")) return "YTO";
|
||||
if (expressCompanyName.Contains("中通快递")) return "ZTO";
|
||||
if (expressCompanyName.Contains("百世快运")) return "BTWL";
|
||||
if (expressCompanyName.Contains("百世快递")) return "HTKY";
|
||||
if (expressCompanyName.Contains("顺丰速运")) return "SF";
|
||||
if (expressCompanyName.Contains("京东快递")) return "JD";
|
||||
if (expressCompanyName.Contains("京东快运")) return "JDKY";
|
||||
if (expressCompanyName.Contains("京东大件物流")) return "JD";
|
||||
if (expressCompanyName.Contains("其他快递")) return "OTHER";
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string GetWxExpressNameToWxExpressCode(string expressCompanyName)
|
||||
{
|
||||
if (expressCompanyName == null || expressCompanyName == "") return "";
|
||||
if (expressCompanyName.Contains("邮政快递包裹")) return "EMS";
|
||||
if (expressCompanyName.Contains("邮政电商标快")) return "EMS";
|
||||
if (expressCompanyName.Contains("邮政EMS")) return "EMS";
|
||||
if (expressCompanyName.Contains("极兔速递")) return "JTSD";
|
||||
if (expressCompanyName.Contains("申通快递")) return "STO";
|
||||
if (expressCompanyName.Contains("韵达速递")) return "YD";
|
||||
if (expressCompanyName.Contains("圆通速递")) return "YTO";
|
||||
if (expressCompanyName.Contains("中通快递")) return "ZTO";
|
||||
if (expressCompanyName.Contains("百世快运")) return "BTWL";
|
||||
if (expressCompanyName.Contains("百世快递")) return "HTKY";
|
||||
if (expressCompanyName.Contains("顺丰速运")) return "SF";
|
||||
if (expressCompanyName.Contains("京东快递")) return "JD";
|
||||
if (expressCompanyName.Contains("京东快运")) return "JDKY";
|
||||
if (expressCompanyName.Contains("其他快递")) return "OTHER";
|
||||
return "";
|
||||
}
|
||||
|
||||
public string outExpressCompanyMsg { get; set; } // 物流公司名称,可以尝试直接从列表中匹配
|
||||
public string outExpressCompanyCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetPddToWxExpressCompanyCode(outExpressCompanyName);
|
||||
}
|
||||
}
|
||||
public string outExpressCompanyName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (outExpressCompanyMsg == null || outExpressCompanyMsg == "") return "";
|
||||
if (outExpressCompanyMsg.Contains("邮政快递包裹")) return "邮政快递包裹";
|
||||
if (outExpressCompanyMsg.Contains("邮政电商标快")) return "邮政电商标快";
|
||||
if (outExpressCompanyMsg.Contains("邮政EMS")) return "邮政EMS";
|
||||
if (outExpressCompanyMsg.Contains("极兔速递")) return "极兔速递";
|
||||
if (outExpressCompanyMsg.Contains("极兔快递")) return "极兔速递";
|
||||
if (outExpressCompanyMsg.Contains("申通快递")) return "申通快递";
|
||||
if (outExpressCompanyMsg.Contains("韵达快递")) return "韵达快递";
|
||||
if (outExpressCompanyMsg.Contains("圆通快递")) return "圆通快递";
|
||||
if (outExpressCompanyMsg.Contains("中通快递")) return "中通快递";
|
||||
if (outExpressCompanyMsg.Contains("百世快运")) return "百世快运";
|
||||
if (outExpressCompanyMsg.Contains("百世快递")) return "百世快递";
|
||||
if (outExpressCompanyMsg.Contains("顺丰速运")) return "顺丰速运";
|
||||
if (outExpressCompanyMsg.Contains("顺丰快递")) return "顺丰速运";
|
||||
if (outExpressCompanyMsg.Contains("京东快递")) return "京东快递";
|
||||
if (outExpressCompanyMsg.Contains("京东快运")) return "京东快运";
|
||||
if (outExpressCompanyMsg.Contains("京东大件物流")) return "京东大件物流";
|
||||
if (outExpressCompanyMsg.Contains("其他快递")) return "其他快递";
|
||||
return "物流名称获取失败";
|
||||
}
|
||||
}
|
||||
public string sendStatus { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 微信退款单状态
|
||||
/// </summary>
|
||||
public string wxRefundStatus { get; set; } = "";
|
||||
public string buyerId { get; set; } // 买手Id
|
||||
public string buyerName { get; set; } // 买手名称
|
||||
|
||||
public string order_sn { get; set; } // "260409-440915730042665",
|
||||
public string parent_order_sn { get; set; } // "",
|
||||
public int? order_amount { get; set; } // 2090,
|
||||
public int? shipping_amount { get; set; } // 0,
|
||||
public int? discount_amount { get; set; } // 200,
|
||||
public int? service_amount { get; set; } // 0,
|
||||
public string display_amount { get; set; } // 2090 实付款
|
||||
public long? order_time { get; set; } // 1775731637
|
||||
public string tracking_number { get; set; } // "JT5474027114111", 物流单号
|
||||
public string order_link_url { get; set; } // "order.html?order_sn=260408-386657164922665&page_from=1",
|
||||
|
||||
public List<order_good> order_Goods { get; set; }
|
||||
public after_sales after_sales { get; set; }
|
||||
public string order_status_prompt { get; set; } // "待收货",
|
||||
public string order_prompt_color { get; set; } // "#E02E24",
|
||||
public string activity_type { get; set; } // 3,
|
||||
|
||||
//[JsonProperty(PropertyName = "extraInfo")]
|
||||
public extra_info extra_info { get; set; }
|
||||
}
|
||||
|
||||
public class extra_info
|
||||
{
|
||||
public order_hint order_hint { get; set; }
|
||||
}
|
||||
|
||||
public class order_hint
|
||||
{
|
||||
public string type { get; set; } // "express_info",
|
||||
public string message { get; set; } // "商家已发货,正在通知极兔速递取件",
|
||||
}
|
||||
|
||||
public class after_sales
|
||||
{
|
||||
public string after_sales_id { get; set; } // "20032511557436",
|
||||
public int? after_sales_type { get; set; } // 2,
|
||||
public int? after_sales_status { get; set; } // 31 // 待用户拒收商品
|
||||
}
|
||||
|
||||
public class order_good
|
||||
{
|
||||
public string goods_id { get; set; } // "865983669848",
|
||||
public string sku_id { get; set; } // "1824184724450",
|
||||
public string goods_name { get; set; } // "新款夏季性感上衣蕾丝吊带带胸垫防走光吊带打底背心女美背内衣女",
|
||||
public int? goods_price { get; set; } // 2290,
|
||||
public int? goods_number { get; set; } // 1,
|
||||
public string thumb_url { get; set; } // "https://img.pddpic.com/mms-goods-image/2026-03-03/bdf06666-5663-4ddf-96a4-cfc09a3ba3aa.jpeg.a.jpeg",
|
||||
public string spec { get; set; } // "XL(适合140-160斤),白色+可可棕",
|
||||
public int? event_type { get; set; } // 0,
|
||||
public int? is_pre_sale { get; set; } // 0,
|
||||
public int? goods_type { get; set; } // 1,
|
||||
public long? cat_id_1 { get; set; } // 8583,
|
||||
public long? cat_id_2 { get; set; } // 8589,
|
||||
public long? cat_id_3 { get; set; } // 8614,
|
||||
public long? cat_id_4 { get; set; } // 0
|
||||
}
|
||||
}
|
||||
@@ -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,4 +1,5 @@
|
||||
using AllBase;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AllBase;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AllBase;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AllBase;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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>();
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user