|
@ -27,16 +27,20 @@ namespace 齐越慧眼.UserControls |
|
|
BrowserSettings = |
|
|
BrowserSettings = |
|
|
{ |
|
|
{ |
|
|
DefaultEncoding = "UTF-8", |
|
|
DefaultEncoding = "UTF-8", |
|
|
// Plugins = CefState.Enabled,
|
|
|
Plugins = CefState.Enabled, |
|
|
//关于跨域限制
|
|
|
//关于跨域限制
|
|
|
//WebSecurity = CefState.Disabled,
|
|
|
//WebSecurity = CefState.Disabled,
|
|
|
// ApplicationCache = CefState.Enabled,
|
|
|
ApplicationCache = CefState.Enabled, |
|
|
// LocalStorage = CefState.Enabled
|
|
|
LocalStorage = CefState.Enabled |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// RequestHandler = myRequest
|
|
|
|
|
|
|
|
|
//RequestHandler =new MyRequestHandler()
|
|
|
}; |
|
|
}; |
|
|
|
|
|
MyResourceRequestHandlerFactory myResourceRequestHandlerFactory = new MyResourceRequestHandlerFactory(); |
|
|
|
|
|
myResourceRequestHandlerFactory.Handlers.TryAdd("test",null); |
|
|
|
|
|
|
|
|
|
|
|
web.ResourceRequestHandlerFactory = myResourceRequestHandlerFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(web); |
|
|
grid.Children.Add(web); |
|
@ -46,19 +50,32 @@ namespace 齐越慧眼.UserControls |
|
|
web.JavascriptObjectRepository.Register("hyCoreModel", new CefAsyncJS(), BindingOptions.DefaultBinder); |
|
|
web.JavascriptObjectRepository.Register("hyCoreModel", new CefAsyncJS(), BindingOptions.DefaultBinder); |
|
|
Main = this; |
|
|
Main = this; |
|
|
web.StartNewWindow += Web_StartNewWindow; |
|
|
web.StartNewWindow += Web_StartNewWindow; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int nowPatlom = 0; |
|
|
|
|
|
|
|
|
public void OnUrlEnd(string url) |
|
|
public void OnUrlEnd(string url) |
|
|
{ |
|
|
{ |
|
|
if (url.Contains("s_new.php")) |
|
|
if (url.Contains("s_new.php")) |
|
|
{ |
|
|
{ |
|
|
Task.Factory.StartNew(() => |
|
|
Task.Factory.StartNew(() => |
|
|
{ |
|
|
{ |
|
|
|
|
|
nowPatlom = 1; |
|
|
lastUrl = "search.jd.com"; |
|
|
lastUrl = "search.jd.com"; |
|
|
DoWork(); |
|
|
DoWork(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (url.Contains("s.1688.com/selloffer/offer_search.htm")) |
|
|
|
|
|
{ |
|
|
|
|
|
Task.Factory.StartNew(() => |
|
|
|
|
|
{ |
|
|
|
|
|
nowPatlom = 2; |
|
|
|
|
|
lastUrl = "s.1688.com"; |
|
|
|
|
|
StartPage(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void Web_StartNewWindow(object sender, NewWindowEventArgs e) |
|
|
private void Web_StartNewWindow(object sender, NewWindowEventArgs e) |
|
@ -102,9 +119,22 @@ namespace 齐越慧眼.UserControls |
|
|
//开始单页查询
|
|
|
//开始单页查询
|
|
|
if (lastUrl.StartsWith("https://s.taobao.com/search")|| lastUrl.StartsWith("https://search.jd.com/")||lastUrl.StartsWith("https://s.1688.com/selloffer/offer_search.htm")) |
|
|
if (lastUrl.StartsWith("https://s.taobao.com/search")|| lastUrl.StartsWith("https://search.jd.com/")||lastUrl.StartsWith("https://s.1688.com/selloffer/offer_search.htm")) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (lastUrl.StartsWith("https://s.taobao.com/search")) { |
|
|
|
|
|
|
|
|
|
|
|
nowPatlom = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if (lastUrl.StartsWith("https://search.jd.com/")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
nowPatlom =1; |
|
|
|
|
|
} |
|
|
|
|
|
if (lastUrl.StartsWith("https://s.1688.com/")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
nowPatlom = 2; |
|
|
|
|
|
} |
|
|
StartPage(); |
|
|
StartPage(); |
|
|
} |
|
|
} |
|
|
// web.ShowDevTools();
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -124,7 +154,7 @@ namespace 齐越慧眼.UserControls |
|
|
AddJquery(); |
|
|
AddJquery(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
AddAjaxHook(); |
|
|
// AddAjaxHook();
|
|
|
|
|
|
|
|
|
DoWork(); |
|
|
DoWork(); |
|
|
} |
|
|
} |
|
@ -158,26 +188,26 @@ namespace 齐越慧眼.UserControls |
|
|
{ |
|
|
{ |
|
|
AddCss(); |
|
|
AddCss(); |
|
|
|
|
|
|
|
|
if (lastUrl.Contains("s.taobao.com")) |
|
|
if (nowPatlom==0) |
|
|
{ |
|
|
{ |
|
|
AddTaoBaoOptionDiv(); |
|
|
AddTaoBaoOptionDiv(); |
|
|
CheckTaoBaoPageItem(); |
|
|
CheckTaoBaoPageItem(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (lastUrl.Contains("search.jd.com")) |
|
|
if (nowPatlom == 1) |
|
|
{ |
|
|
{ |
|
|
AddJDOptionDiv(); |
|
|
AddJDOptionDiv(); |
|
|
CheckJDPageItem(); |
|
|
CheckJDPageItem(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//if (lastUrl.Contains("s.1688.com"))
|
|
|
if (nowPatlom == 2) |
|
|
//{
|
|
|
{ |
|
|
// Add1688OptionDiv();
|
|
|
Add1688OptionDiv(); |
|
|
// Check1688PageItem();
|
|
|
Check1688PageItem(); |
|
|
// web.ShowDevTools();
|
|
|
web.ShowDevTools(); |
|
|
//}
|
|
|
} |
|
|
|
|
|
|
|
|
lastUrl = string.Empty; |
|
|
//lastUrl = string.Empty;
|
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -410,7 +440,8 @@ namespace 齐越慧眼.UserControls |
|
|
{ |
|
|
{ |
|
|
reports.ForEach(c => |
|
|
reports.ForEach(c => |
|
|
{ |
|
|
{ |
|
|
string objid = Regex.Match(c, "object_id@(.*?)^").Groups[1].Value; |
|
|
string objid = Regex.Match(c, "object_id\\@(.*?)\\^").Groups[1].Value; |
|
|
|
|
|
DoJavaScript(@$"$(""ul#sm-offer-list"").find('div[data-aplus-report=""{c}""]').attr(""data-sku"",""{objid}"")"); |
|
|
itemIds.Add(objid); |
|
|
itemIds.Add(objid); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|