Browse Source

pdd 页面

master
feng 3 years ago
parent
commit
44096b96f9
  1. 13
      src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs
  2. 7
      src/Coldairarrow.Api/Filters/EnumDocumentFilter.cs
  3. 1
      src/Coldairarrow.Api/Startup.cs
  4. 14
      src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs
  5. 37
      src/Coldairarrow.Entity/DTO/ItemLabelDto.cs
  6. 6
      src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs
  7. 2
      客户端/齐越慧眼/齐越慧眼/ApiHelper.cs
  8. 9
      客户端/齐越慧眼/齐越慧眼/Properties/PublishProfiles/FolderProfile.pubxml
  9. 12
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs
  10. 1
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerTabPanelControl.xaml
  11. 4
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerTabPanelControl.xaml.cs
  12. 17
      客户端/齐越慧眼/齐越慧眼/cefhelper/CefRequestHandler.cs

13
src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs

@ -78,11 +78,11 @@ namespace Coldairarrow.Api.Controllers.HuiYan
/// <summary> /// <summary>
/// 获取标签状态 /// 获取标签状态
/// </summary> /// </summary>
/// <param name="ids"></param> /// <param name="ids">商品id集合</param>
/// <param name="platform"></param> /// <param name="platform">所属平台</param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public AjaxResult GetLabelByItemIds([FromBody] List<string> ids, [FromQuery] ItemPlatform platform) public List<ItemlabelInfoDto> GetLabelByItemIds([FromBody] List<string> ids, [FromQuery] ItemPlatform platform)
{ {
return _itemlabelsBus.GetLabelByItemIds(ids, platform); return _itemlabelsBus.GetLabelByItemIds(ids, platform);
} }
@ -91,10 +91,10 @@ namespace Coldairarrow.Api.Controllers.HuiYan
/// <summary> /// <summary>
/// 检索阿里巴巴合作标签的商品 /// 检索阿里巴巴合作标签的商品
/// </summary> /// </summary>
/// <param name="ids"></param> /// <param name="ids">商品id集合</param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public AjaxResult GetAlbbLabelByShopIds([FromBody] List<string> ids) public List<albbitemlabels> GetAlbbLabelByShopIds([FromBody] List<string> ids)
{ {
return _itemlabelsBus.GetAlbbLabelByShopIds(ids); return _itemlabelsBus.GetAlbbLabelByShopIds(ids);
} }
@ -113,9 +113,10 @@ namespace Coldairarrow.Api.Controllers.HuiYan
/// <summary> /// <summary>
/// 获取竞品相关商品列表 /// 获取竞品相关商品列表
/// </summary> /// </summary>
/// <param name="type">可不传</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public AjaxResult GetItemsByJpLabels(int type) public List<ItemlabelInfoDto> GetItemsByJpLabels(int type)
{ {
return _itemlabelsBus.GetItemsByJpLabels(type); return _itemlabelsBus.GetItemsByJpLabels(type);
} }

7
src/Coldairarrow.Api/Filters/EnumDocumentFilter.cs

@ -0,0 +1,7 @@
namespace Coldairarrow.Api.Filters
{
public class EnumDocumentFilter
{
}
}

1
src/Coldairarrow.Api/Startup.cs

@ -69,6 +69,7 @@ namespace Coldairarrow.Api
//swagger //swagger
services.AddOpenApiDocument(settings => services.AddOpenApiDocument(settings =>
{ {
settings.GenerateEnumMappingDescription = true;
settings.AllowReferencesWithProperties = true; settings.AllowReferencesWithProperties = true;
settings.AddSecurity("身份认证Token", Enumerable.Empty<string>(), new OpenApiSecurityScheme() settings.AddSecurity("身份认证Token", Enumerable.Empty<string>(), new OpenApiSecurityScheme()
{ {

14
src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs

@ -78,7 +78,7 @@ namespace Coldairarrow.Business.HuiYan
#endregion #endregion
public AjaxResult GetLabelByItemIds(List<string> ids, ItemPlatform platform) public List<ItemlabelInfoDto> GetLabelByItemIds(List<string> ids, ItemPlatform platform)
{ {
Expression<Func<itemlabels, items, ItemlabelInfoDto>> select = (a, b) => new ItemlabelInfoDto Expression<Func<itemlabels, items, ItemlabelInfoDto>> select = (a, b) => new ItemlabelInfoDto
{ {
@ -112,14 +112,14 @@ namespace Coldairarrow.Business.HuiYan
} }
}); });
return Success(list); return list;
} }
public AjaxResult GetAlbbLabelByShopIds(List<string>ids) public List<albbitemlabels> GetAlbbLabelByShopIds(List<string>ids)
{ {
var list= Db.GetIQueryable<albbitemlabels>().Where(c => ids.Contains(c.ShopId)); var list= Db.GetIQueryable<albbitemlabels>().Where(c => ids.Contains(c.ShopId)).ToList();
return Success(list); return list;
} }
public AjaxResult SetItemLabel(ItemLabelDto model) public AjaxResult SetItemLabel(ItemLabelDto model)
@ -372,7 +372,7 @@ namespace Coldairarrow.Business.HuiYan
} }
} }
public AjaxResult GetItemsByJpLabels(int type) public List<ItemlabelInfoDto> GetItemsByJpLabels(int type)
{ {
Expression<Func<itemlabels, items, ItemlabelInfoDto>> select = (a, b) => new ItemlabelInfoDto Expression<Func<itemlabels, items, ItemlabelInfoDto>> select = (a, b) => new ItemlabelInfoDto
{ {
@ -394,7 +394,7 @@ namespace Coldairarrow.Business.HuiYan
var list = q.Where(where).ToList(); var list = q.Where(where).ToList();
return Success(list); return list;
} }
} }

37
src/Coldairarrow.Entity/DTO/ItemLabelDto.cs

@ -8,15 +8,34 @@ namespace Coldairarrow.Entity.DTO
{ {
public class ItemLabelDto public class ItemLabelDto
{ {
/// <summary>
/// 商品ID
/// </summary>
public string ItemId { get; set; } public string ItemId { get; set; }
/// <summary>
/// 商品标题
/// </summary>
public string Title { get; set; } public string Title { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal Price { get; set; } public decimal Price { get; set; }
/// <summary>
/// 销量
/// </summary>
public string Sales { get; set; } public string Sales { get; set; }
/// <summary>
/// 主图链接
/// </summary>
public string Img { get; set; } public string Img { get; set; }
/// <summary>
/// 类目ID
/// </summary>
public string CatId { get; set; } public string CatId { get; set; }
/// <summary> /// <summary>
/// 标签状态 /// 标签状态
@ -50,7 +69,11 @@ namespace Coldairarrow.Entity.DTO
/// <summary> /// <summary>
/// 阿里巴巴 /// 阿里巴巴
/// </summary> /// </summary>
ALBB = 2 ALBB = 2,
/// <summary>
/// 拼多多
/// </summary>
PDD = 3
} }
/// <summary> /// <summary>
@ -59,17 +82,17 @@ namespace Coldairarrow.Entity.DTO
public enum ItemLabelStatus public enum ItemLabelStatus
{ {
/// <summary> /// <summary>
/// 筛选 /// 同款
/// </summary> /// </summary>
Screening=0, Screening = 0,
/// <summary> /// <summary>
/// 过滤 /// 淘汰
/// </summary> /// </summary>
Filter =1, Filter = 1,
/// <summary> /// <summary>
/// 添加产品库 /// 海选
/// </summary> /// </summary>
Added=2, Added = 2,
/// <summary> /// <summary>
/// 竞品 /// 竞品
/// </summary> /// </summary>

6
src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs

@ -15,10 +15,10 @@ namespace Coldairarrow.Business.HuiYan
Task DeleteDataAsync(List<string> ids); Task DeleteDataAsync(List<string> ids);
AjaxResult SetItemLabel(ItemLabelDto model); AjaxResult SetItemLabel(ItemLabelDto model);
AjaxResult GetLabelByItemIds(List<string> ids, ItemPlatform platform); List<ItemlabelInfoDto> GetLabelByItemIds(List<string> ids, ItemPlatform platform);
AjaxResult GetAlbbLabelByShopIds(List<string> ids); List<albbitemlabels> GetAlbbLabelByShopIds(List<string> ids);
AjaxResult SetAlbbCooperation(string shopId); AjaxResult SetAlbbCooperation(string shopId);
AjaxResult GetItemsByJpLabels(int type); List<ItemlabelInfoDto> GetItemsByJpLabels(int type);
} }
} }

2
客户端/齐越慧眼/齐越慧眼/ApiHelper.cs

@ -33,7 +33,7 @@ namespace 齐越慧眼
#if LOCATION #if LOCATION
//return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTE5NTA3MzgwMTkzMjAyMTc2IiwidGVhbUlkIjoiMTQzOTg5ODUxNDIyMDkxMjY0MCIsImV4cCI6MTY4ODExNzc4Nn0.xnkLLkvmMtNwS1u4SAEj-i6rwNZ1_prx_LmkGQEP47o"; //return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTE5NTA3MzgwMTkzMjAyMTc2IiwidGVhbUlkIjoiMTQzOTg5ODUxNDIyMDkxMjY0MCIsImV4cCI6MTY4ODExNzc4Nn0.xnkLLkvmMtNwS1u4SAEj-i6rwNZ1_prx_LmkGQEP47o";
return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxMDUzOTEzMzUwNjA2ODQ4IiwidGVhbUlkIjoiMTU2NzA0ODk5MjgwODc2NzQ4OCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTU3OTU4MTV9.JvCOsec7mh94--zFtV9egqhVLGNsfSUv_LH5natQtWo"; return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjAxODUxNDAyMDAxMzIxOTg0IiwidGVhbUlkIjoiMTU2NzA0ODk5MjgwODc2NzQ4OCIsInNvblRlYW1JZHMiOiIxNTY3MDQ4OTkyODA4NzY3NDg4IiwiZXhwIjoxNzAyMjgyMjUwfQ.nd11fJb99Ous6YuS10oodyFwVOVstEJ87JE6z-NGswU";
#endif #endif
if (string.IsNullOrEmpty(jwtToken)) if (string.IsNullOrEmpty(jwtToken))

9
客户端/齐越慧眼/齐越慧眼/Properties/PublishProfiles/FolderProfile.pubxml

@ -4,15 +4,14 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration>Release</Configuration> <Configuration>Location</Configuration>
<Platform>Any CPU</Platform> <Platform>x64</Platform>
<PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir> <PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol> <PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained> <SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile> <PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun> <PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

12
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

@ -46,7 +46,8 @@ namespace 齐越慧眼.UserControls
//关于跨域限制 //关于跨域限制
//WebSecurity = CefState.Disabled, //WebSecurity = CefState.Disabled,
ApplicationCache = CefState.Enabled, ApplicationCache = CefState.Enabled,
LocalStorage = CefState.Enabled LocalStorage = CefState.Enabled,
}, },
@ -73,9 +74,12 @@ namespace 齐越慧眼.UserControls
web.TitleChanged += Web_TitleChanged; web.TitleChanged += Web_TitleChanged;
} }
web.AddressChanged += Web_AddressChanged; web.AddressChanged += Web_AddressChanged;
this.KeyUp += BrowerControl_KeyUp; this.KeyUp += BrowerControl_KeyUp;
} }
private void BrowerControl_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) private void BrowerControl_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{ {
@ -97,6 +101,7 @@ namespace 齐越慧眼.UserControls
{ {
txtUrl.Text = e.NewValue.ToString(); txtUrl.Text = e.NewValue.ToString();
}); });
if (IsJustLoginJd) if (IsJustLoginJd)
@ -236,6 +241,11 @@ namespace 齐越慧眼.UserControls
nowPatlom = 2; nowPatlom = 2;
} }
if (lastUrl.StartsWith("https://mobile.yangkeduo.com/"))
{
nowPatlom = 3;
}
StartPage(); StartPage();
} }
} }

1
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerTabPanelControl.xaml

@ -33,6 +33,7 @@
<RadioButton Content="淘宝" IsChecked="True" x:Name="tbRb" Click="tbRb_Click" GroupName="rbtab"></RadioButton> <RadioButton Content="淘宝" IsChecked="True" x:Name="tbRb" Click="tbRb_Click" GroupName="rbtab"></RadioButton>
<RadioButton Content="京东" x:Name="jdRb" Click="jdRb_Click" GroupName="rbtab"></RadioButton> <RadioButton Content="京东" x:Name="jdRb" Click="jdRb_Click" GroupName="rbtab"></RadioButton>
<RadioButton Content="阿里巴巴" x:Name="albbRb" Click="albbRb_Click" GroupName="rbtab"></RadioButton> <RadioButton Content="阿里巴巴" x:Name="albbRb" Click="albbRb_Click" GroupName="rbtab"></RadioButton>
<RadioButton Content="拼多多" x:Name="pddRb" Click="pddRb_Click" GroupName="rbtab"></RadioButton>
</StackPanel> </StackPanel>
<hc:TabControl IsAnimationEnabled="True" IsTabFillEnabled="False" Name="tab" ShowCloseButton="True" DockPanel.Dock="Bottom"> <hc:TabControl IsAnimationEnabled="True" IsTabFillEnabled="False" Name="tab" ShowCloseButton="True" DockPanel.Dock="Bottom">

4
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerTabPanelControl.xaml.cs

@ -120,5 +120,9 @@ namespace 齐越慧眼.UserControls
}); });
} }
private void pddRb_Click(object sender, RoutedEventArgs e)
{
NewTab("https://mobile.yangkeduo.com/index.html");
}
} }
} }

17
客户端/齐越慧眼/齐越慧眼/cefhelper/CefRequestHandler.cs

@ -18,7 +18,7 @@ namespace 齐越慧眼.cefhelper
protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture,
bool isRedirect) bool isRedirect)
{ {
// 先调用基类的实现,断点调试 // 先调用基类的实现,断点调试
return base.OnBeforeBrowse(chromiumWebBrowser, browser, frame, request, userGesture, isRedirect); return base.OnBeforeBrowse(chromiumWebBrowser, browser, frame, request, userGesture, isRedirect);
} }
@ -85,9 +85,22 @@ namespace 齐越慧眼.cefhelper
return base.OnResourceResponse(chromiumWebBrowser, browser, frame, request, response); return base.OnResourceResponse(chromiumWebBrowser, browser, frame, request, response);
} }
protected override CefReturnValue OnBeforeResourceLoad(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback)
{
if (!request.Url.Contains("mobile.yangkeduo.com/login.html"))
{
if (request.Url.Contains("yangkeduo"))
{
request.SetHeaderByName("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63070517)", true);
}
}
return base.OnBeforeResourceLoad(chromiumWebBrowser, browser, frame, request, callback);
}
//protected override IResponseFilter GetResourceResponseFilter(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response) //protected override IResponseFilter GetResourceResponseFilter(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response)
//{ //{
// if (request.Url.Contains("search.jd.com")) // if (request.Url.Contains("static.pddpic.com"))
// { // {
// var fil = new MyResponseFilter(true, Brower, request.Url); // var fil = new MyResponseFilter(true, Brower, request.Url);
// return fil; // return fil;

Loading…
Cancel
Save