Browse Source

增加京东搜图

master
feng 4 years ago
parent
commit
b83eaef92e
  1. 2
      客户端/齐越慧眼/齐越慧眼/ApiHelper.cs
  2. 9
      客户端/齐越慧眼/齐越慧眼/Helpers/JdApiHelper.cs
  3. 5
      客户端/齐越慧眼/齐越慧眼/MainWindow.xaml.cs
  4. 2
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs
  5. 3
      客户端/齐越慧眼/齐越慧眼/UserControls/CatControl.xaml.cs
  6. 6
      客户端/齐越慧眼/齐越慧眼/UserControls/ItemControl.xaml.cs
  7. 16
      客户端/齐越慧眼/齐越慧眼/UserControls/SomeBrowerControl.xaml.cs
  8. 17
      客户端/齐越慧眼/齐越慧眼/script/account.js
  9. 27
      客户端/齐越慧眼/齐越慧眼/script/app.js
  10. 17
      客户端/齐越慧眼/齐越慧眼/script/package.json
  11. 2810
      客户端/齐越慧眼/齐越慧眼/script/yarn.lock
  12. 477
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue
  13. 1
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/css/app.a281d79c.css
  14. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/index.html
  15. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js
  16. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map
  17. 4
      客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj

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

@ -21,7 +21,7 @@ namespace 齐越慧眼
public static string JwtToken { public static string JwtToken {
get get
{ {
return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNDA1MTUxNjE5NTk0NTg4MTYwIiwidGVhbUlkIjoiMTQzOTg5OTEyMzk1NTI3MzcyOCIsImV4cCI6MTY3MDQ3MDkyNX0.iUkxjlPOsuLSuoUG9-O7VIkI33fDlu9AmPdqJBTBa-w"; //return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNDM5OTA3NDY1MDMzNDIwODAwIiwidGVhbUlkIjoiMTQzNjI4ODUwMDIzNTI0MzUyMCIsImV4cCI6MTY3MDY2ODk3OX0.EXnvVkAAUkDndalUo_SalFKOBsbzpx_c-L_ddCwa7RY";
if (string.IsNullOrEmpty(jwtToken)) if (string.IsNullOrEmpty(jwtToken))
{ {
jwtToken = GetMemoryToken().Replace("\r\n",""); jwtToken = GetMemoryToken().Replace("\r\n","");

9
客户端/齐越慧眼/齐越慧眼/Helpers/JdApiHelper.cs

@ -19,8 +19,9 @@ namespace 齐越慧眼.Helpers
using (System.Net.WebClient webClient = new System.Net.WebClient()) using (System.Net.WebClient webClient = new System.Net.WebClient())
{ {
try
webClient.Headers.Add("cookie", "__jdv=76161171|direct|-|none|-|1638869805933; __jdu=16388698059328286849; areaId=19; ipLoc-djd=19-1666-0-0; PCSYCityID=CN_440000_440600_0; _pst=16927647-35691944; unick=%E7%BC%BA%E9%98%B3%E5%85%89%E7%9A%84%E5%90%8A%E5%85%B0; pin=16927647-35691944; _tp=XgOfMtPFh92ZbKpmUXyiKkww9vdhsCgPikOUZsSQog8%3D; shshshfpa=6791a0cf-5a8f-7694-426b-368379ec439f-1638869824; shshshfpb=jb35ePu5DchO3Y4rjX%20xERA%3D%3D; qrsc=3; shshshfp=1f964b3df427da1779b7c5745b5cbddb; thor=015C6984E52D7AA6F54B79351F45CECCAA86F5B71F7807178D7E5044B5B8C528095D1EC065B7BB3B3478716F0193B94DCA09CD8C24E4EF5B8FEF4E26CA166E59681381AF92538D12DD17E89019060216036A0F30231A3CA47AD2B56A508B462F2651A1976D997C9A16073A0DA758F3DDF61B41359BED5A7FC84C16677B4FE6CA75A472DB8A772628BDBCB39A9B39ADA97072F2268D249D74E955B0F17A413D89; pinId=xpLDZpChZphYLUlvWdbaKvwZj9lbjz-c; __jda=76161171.16388698059328286849.1638869806.1638869806.1638879362.2; __jdb=76161171.4.16388698059328286849|2.1638879362; __jdc=76161171; shshshsID=d20602783dcaaffcb5355ea48291319c_2_1638879385194; 3AB9D23F7A4B3C9B=RMPGIHATPH4SBVV7LECL6XAHEWL242U2UZT6MW2CFKUCKQVVMS7HKIU7GT2O63I5A3SUEKPWBSHOLYCUQ3N7HMKZ5E"); {
webClient.Headers.Add("cookie", cookie);
webClient.Headers.Add("origin", "https://www.jd.com"); webClient.Headers.Add("origin", "https://www.jd.com");
webClient.Headers.Add("referer", "https://www.jd.com"); webClient.Headers.Add("referer", "https://www.jd.com");
webClient.Headers.Add("sec-fetch-dest", "iframe"); webClient.Headers.Add("sec-fetch-dest", "iframe");
@ -44,6 +45,10 @@ namespace 齐越慧眼.Helpers
return json; return json;
} }
catch(Exception ex) {
WpfNoticeMsg.NoticeMessage.Show("请退出重新登录京东后重试!");
}
}
return string.Empty; return string.Empty;
} }

5
客户端/齐越慧眼/齐越慧眼/MainWindow.xaml.cs

@ -38,7 +38,7 @@ namespace 齐越慧眼
public static MainWindow Main; public static MainWindow Main;
public MainWindow() public MainWindow()
{ {
Test(); //Test();
InitializeComponent(); InitializeComponent();
Main = this; Main = this;
@ -47,7 +47,6 @@ namespace 齐越慧眼
private void Test() private void Test()
{ {
new JdApiHelper().UploadFile(System.IO.File.ReadAllBytes(@"C:\Users\feng\Desktop\4cd3c6af18ba9ed9.jpg"),"");
} }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) private void MainWindow_Loaded(object sender, RoutedEventArgs e)
@ -75,7 +74,7 @@ namespace 齐越慧眼
UserControls.ItemControl itemControl = new UserControls.ItemControl(); UserControls.ItemControl itemControl = new UserControls.ItemControl();
gridItem.Children.Add(itemControl); gridItem.Children.Add(itemControl);
this.Title += $" { ApiHelper.LoginSystemUser.DepartmentName}"; this.Title += $" { ApiHelper.LoginSystemUser.DepartmentName}({ApiHelper.LoginSystemUser.UserName})";
} }
public void ChangeTab(string keyWord,int type) public void ChangeTab(string keyWord,int type)

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

@ -77,7 +77,7 @@ namespace 齐越慧眼.UserControls
private void Visitor_SendCookie(Cookie obj) private void Visitor_SendCookie(Cookie obj)
{ {
string cookies = obj.Name + ":" + obj.Value + ";"; string cookies = obj.Name + "=" + obj.Value + ";";
App.JdCookie += cookies; App.JdCookie += cookies;
} }

3
客户端/齐越慧眼/齐越慧眼/UserControls/CatControl.xaml.cs

@ -66,8 +66,9 @@ namespace 齐越慧眼.UserControls
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
if(web.WebBrowser!=null&& web.WebBrowser.GetDevToolsClient() != null) {
web.WebBrowser.GetDevToolsClient().DOMStorage.SetDOMStorageItemAsync(new CefSharp.DevTools.DOMStorage.StorageId() { SecurityOrigin = "nacollector://home", IsLocalStorage = true }, "user", Newtonsoft.Json.JsonConvert.SerializeObject(new { token = ApiHelper.JwtToken })); web.WebBrowser.GetDevToolsClient().DOMStorage.SetDOMStorageItemAsync(new CefSharp.DevTools.DOMStorage.StorageId() { SecurityOrigin = "nacollector://home", IsLocalStorage = true }, "user", Newtonsoft.Json.JsonConvert.SerializeObject(new { token = ApiHelper.JwtToken }));
}
web.ExecuteScriptAsyncWhenPageLoaded(@$"window.getDatas();"); web.ExecuteScriptAsyncWhenPageLoaded(@$"window.getDatas();");
}); });
isInit = true; isInit = true;

6
客户端/齐越慧眼/齐越慧眼/UserControls/ItemControl.xaml.cs

@ -103,7 +103,7 @@ namespace 齐越慧眼.UserControls
} }
public string getImgBase64(string url) public string getImgBase64(string url,string type)
{ {
using (WebClient client = new WebClient()) using (WebClient client = new WebClient())
{ {
@ -112,13 +112,15 @@ namespace 齐越慧眼.UserControls
byte[] arr = client.DownloadData(url.Replace("_.webp", "")); byte[] arr = client.DownloadData(url.Replace("_.webp", ""));
arr = GetSmallImgArr(arr); arr = GetSmallImgArr(arr);
if (url.Contains("jd.com")||url.Contains("360buyimg.com")) //京东搜图
if (type=="2")
{ {
if (string.IsNullOrEmpty(App.JdCookie)) if (string.IsNullOrEmpty(App.JdCookie))
{ {
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
BrowerTabPanelControl.Main.NewTab("https://passport.jd.com/uc/login?ltype=logout&ReturnUrl=https://home.jd.com/"); BrowerTabPanelControl.Main.NewTab("https://passport.jd.com/uc/login?ltype=logout&ReturnUrl=https://home.jd.com/");
MainWindow.Main.tab.SelectedIndex = 2;
}); });
} }
else { else {

16
客户端/齐越慧眼/齐越慧眼/UserControls/SomeBrowerControl.xaml.cs

@ -62,11 +62,14 @@ namespace 齐越慧眼.UserControls
this.KeyDown += BrowerControl_KeyDown; this.KeyDown += BrowerControl_KeyDown;
} }
public bool IsJd { get; set; }
public SomeBrowerControl(string url,bool isJd, HandyControl.Controls.TabItem tabItem) public SomeBrowerControl(string url,bool isJd, HandyControl.Controls.TabItem tabItem)
{ {
InitializeComponent(); InitializeComponent();
Tab = tabItem; Tab = tabItem;
IsJd = isJd;
web = new ExtChromiumBrowser(url) web = new ExtChromiumBrowser(url)
{ {
BrowserSettings = BrowserSettings =
@ -92,14 +95,13 @@ namespace 齐越慧眼.UserControls
grid.Children.Add(web); grid.Children.Add(web);
Loaded += BrowerControl_Loaded; Loaded += BrowerControl_Loaded;
//web.JavascriptObjectRepository.Settings.LegacyBindingEnabled = true; //web.JavascriptObjectRepository.Settings.LegacyBindingEnabled = true;
//var cjs = new Cef2AsyncJS(); //var cjs = new Cef2AsyncJS();
//cjs.Brower = this; //cjs.Brower = this;
//web.JavascriptObjectRepository.Register("hyCoreModel", cjs, BindingOptions.DefaultBinder); //web.JavascriptObjectRepository.Register("hyCoreModel", cjs, BindingOptions.DefaultBinder);
//web.StartNewWindow += Web_StartNewWindow; web.StartNewWindow += Web_StartNewWindow;
//web.TitleChanged += Web_TitleChanged; web.TitleChanged += Web_TitleChanged;
//web.AddressChanged += Web_AddressChanged; web.AddressChanged += Web_AddressChanged;
//web.ExecuteScriptAsyncWhenPageLoaded("hyCoreModel.onLoad()"); //web.ExecuteScriptAsyncWhenPageLoaded("hyCoreModel.onLoad()");
//this.KeyDown += BrowerControl_KeyDown; //this.KeyDown += BrowerControl_KeyDown;
} }
@ -163,7 +165,11 @@ namespace 齐越慧眼.UserControls
private void BrowerControl_Loaded(object sender, RoutedEventArgs e) private void BrowerControl_Loaded(object sender, RoutedEventArgs e)
{ {
if(IsJd)
tip.Visibility = Visibility.Collapsed; tip.Visibility = Visibility.Collapsed;
Thread t = new Thread(() => { Thread t = new Thread(() => {
IWebBrowser webBrowser = null; IWebBrowser webBrowser = null;

17
客户端/齐越慧眼/齐越慧眼/script/account.js

@ -1,17 +0,0 @@
var Web3 = require('web3')
var web3 = new Web3('https://bsc-dataseed.binance.org/');
module.exports = function (callback) {
var data= web3.eth.accounts.create();
callback(null, {
address: data.address,
privateKey: data.privateKey
});
}

27
客户端/齐越慧眼/齐越慧眼/script/app.js

@ -1,27 +0,0 @@
var Web3 = require('web3')
const sigUtil = require('eth-sig-util')
const ethUtil = require('ethereumjs-util')
var web3 = new Web3('https://bsc-dataseed.binance.org/');
module.exports = function (callback, obj) {
var extraParams = {}
var key = obj.privateKey;
obj = obj.data;
var from = obj.params[0];
var message = obj.params[1];
var msgParams = {
from: from,
data: JSON.parse(message),
}
const serialized = sigUtil.signTypedData(Buffer.from(key.replace('0x', ''), 'hex'), msgParams);
callback(null, serialized);
}

17
客户端/齐越慧眼/齐越慧眼/script/package.json

@ -1,17 +0,0 @@
{
"name": "script",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"eth-sig-util": "^3.0.1",
"ethereumjs-util": "^7.1.3",
"web3": "^1.6.1"
}
}

2810
客户端/齐越慧眼/齐越慧眼/script/yarn.lock

File diff suppressed because it is too large

477
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue

@ -1,24 +1,12 @@
<template> <template>
<div class="about"> <div class="about">
<a-tabs @change="changeTab"> <a-tabs @change="changeTab">
<a-tab-pane key="0" tab="待比价"> <a-tab-pane key="0" tab="待比价"> </a-tab-pane>
<a-tab-pane key="6" tab="已比价"> </a-tab-pane>
</a-tab-pane> <a-tab-pane key="1" tab="精选"> </a-tab-pane>
<a-tab-pane key="6" tab="已比价"> <a-tab-pane key="8" tab="待上架"> </a-tab-pane>
<a-tab-pane key="2" tab="已上架"> </a-tab-pane>
</a-tab-pane> <a-tab-pane key="3" tab="放弃"> </a-tab-pane>
<a-tab-pane key="1" tab="精选">
</a-tab-pane>
<a-tab-pane key="8" tab="待上架">
</a-tab-pane>
<a-tab-pane key="2" tab="已上架">
</a-tab-pane>
<a-tab-pane key="3" tab="放弃">
</a-tab-pane>
</a-tabs> </a-tabs>
<div class="border"> <div class="border">
@ -58,60 +46,106 @@
</a-col> </a-col>
</a-row> </a-row>
<!--内容页面--> <!--内容页面-->
<a-row justify="center" style="text-align: center;" v-for="item in datas" :key="item.Id"> <a-row
justify="center"
style="text-align: center"
v-for="item in datas"
:key="item.Id"
>
<a-col :span="4"> <a-col :span="4">
<div class="borderRight"> <div class="borderRight">
<div <div
style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 0px auto;height: 215px;"> style="
<a target="_black" :href="item.GoodsUrl"> <img :src="'http:'+item.ItemImg" width="200" padding-top: 10px;
height="165" /></a> padding-bottom: 10px;
width: 200px;
margin: 0px auto;
height: 215px;
"
>
<a target="_black" :href="item.GoodsUrl">
<img :src="'http:' + item.ItemImg" width="200" height="165"
/></a>
<a-row> <a-row>
<a-col :span="12" style="text-align: left;">¥{{item.Price}}</a-col> <a-col :span="12" style="text-align: left"
<a-col :span="12" style="text-align: right;">{{item.Sales}}</a-col> >¥{{ item.Price }}</a-col
>
<a-col :span="12" style="text-align: right">{{
item.Sales
}}</a-col>
</a-row> </a-row>
</div> </div>
</div> </div>
</a-col> </a-col>
<!--供应商来源方式--> <!--供应商来源方式-->
<a-col :span="2" style="margin-top: 5px;"> <a-col :span="2" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
<a-select v-if="item.isEdit" v-model='ext.SupplierFrom' :show-search="true" v-for="(ext, index) in item.Extensions"
:not-found-content="null" :show-arrow="false" :filter-option="true" style="height: 40px"
style="width: 100%;" :key="index"
:autoClearSearchValue="false" @search="handleSearch($event,ext)" @blur="handleBlur($event,ext,item)" >
@change="handleChange($event,ext,item)"> <a-select
<a-select-option v-for="item in extFormList" :key="item"> {{item}}</a-select-option> v-if="item.isEdit"
v-model="ext.SupplierFrom"
:show-search="true"
:not-found-content="null"
:show-arrow="false"
:filter-option="true"
style="width: 100%"
:autoClearSearchValue="false"
@search="handleSearch($event, ext)"
@blur="handleBlur($event, ext, item)"
@change="handleChange($event, ext, item)"
>
<a-select-option v-for="item in extFormList" :key="item">
{{ item }}</a-select-option
>
</a-select> </a-select>
<span class="spanValue" v-else>{{ ext.SupplierFrom }}</span> <span class="spanValue" v-else>{{ ext.SupplierFrom }}</span>
</div> </div>
</a-col> </a-col>
<!--平台--> <!--平台-->
<a-col :span="1" style="margin-top: 5px;"> <a-col :span="1" style="margin-top: 5px">
<div style="height: 40px;" v-for="(ext,index) in item.Extensions" :key="index"> <div
style="height: 40px"
v-for="(ext, index) in item.Extensions"
:key="index"
>
<span v-if="ext.Platform == 0">淘宝</span> <span v-if="ext.Platform == 0">淘宝</span>
<span v-if="ext.Platform == 1">京东</span> <span v-if="ext.Platform == 1">京东</span>
<span v-if="ext.Platform == 2">阿里巴巴</span> <span v-if="ext.Platform == 2">阿里巴巴</span>
</div> </div>
</a-col> </a-col>
<!--采购链接--> <!--采购链接-->
<a-col :span="2" style="margin-top: 5px;"> <a-col :span="2" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<a-input v-if="item.isEdit" v-model="ext.BuyUrl"></a-input> <a-input v-if="item.isEdit" v-model="ext.BuyUrl"></a-input>
<span class="spanValue" v-else>{{ ext.BuyUrl }}</span> <span class="spanValue" v-else>{{ ext.BuyUrl }}</span>
</div> </div>
</a-col> </a-col>
<!--SKU名称--> <!--SKU名称-->
<a-col :span="3" style="margin-top: 5px;"> <a-col :span="3" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<a-input v-if="item.isEdit" v-model="ext.SkuName"></a-input> <a-input v-if="item.isEdit" v-model="ext.SkuName"></a-input>
<span class="spanValue" v-else>{{ ext.SkuName }}</span> <span class="spanValue" v-else>{{ ext.SkuName }}</span>
</div> </div>
</a-col> </a-col>
<!--采购价--> <!--采购价-->
<a-col :span="2" style="margin-top: 5px;"> <a-col :span="2" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<div v-if="ext.BuyPrice || item.isEdit"> <div v-if="ext.BuyPrice || item.isEdit">
<a-input v-if="item.isEdit" v-model="ext.BuyPrice"></a-input> <a-input v-if="item.isEdit" v-model="ext.BuyPrice"></a-input>
<span class="spanValue" v-else>{{ ext.BuyPrice }}</span> <span class="spanValue" v-else>{{ ext.BuyPrice }}</span>
@ -120,8 +154,12 @@
</div> </div>
</a-col> </a-col>
<!--快递费--> <!--快递费-->
<a-col :span="2" style="margin-top: 5px;"> <a-col :span="2" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<div v-if="ext.BuyPrice || item.isEdit"> <div v-if="ext.BuyPrice || item.isEdit">
<a-input v-if="item.isEdit" v-model="ext.KDPrice"></a-input> <a-input v-if="item.isEdit" v-model="ext.KDPrice"></a-input>
<span class="spanValue" v-else>{{ ext.KDPrice }}</span> <span class="spanValue" v-else>{{ ext.KDPrice }}</span>
@ -130,50 +168,95 @@
</div> </div>
</a-col> </a-col>
<!--平台扣点--> <!--平台扣点-->
<a-col :span="2" style="margin-top: 5px;"> <a-col :span="2" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<!-- <a-input v-if="item.isEdit" v-model="ext.PlatformPoint"></a-input>--> <!-- <a-input v-if="item.isEdit" v-model="ext.PlatformPoint"></a-input>-->
<span class="spanValue">{{ ext.PlatformPoint }}</span> <span class="spanValue">{{ ext.PlatformPoint }}</span>
</div> </div>
</a-col> </a-col>
<!--利润--> <!--利润-->
<a-col :span="1" style="margin-top: 5px;"> <a-col :span="1" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<span v-if="ext.BuyPrice" class="spanValue">{{ ext.Profit }}</span> <span v-if="ext.BuyPrice" class="spanValue">{{ ext.Profit }}</span>
<span v-else>-</span> <span v-else>-</span>
</div> </div>
</a-col> </a-col>
<!--利润率--> <!--利润率-->
<a-col :span="1" style="margin-top: 5px;"> <a-col :span="1" style="margin-top: 5px">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index"> <div
v-for="(ext, index) in item.Extensions"
style="height: 40px"
:key="index"
>
<!-- <a-input v-if="item.isEdit" v-model="ext.Profits"></a-input>--> <!-- <a-input v-if="item.isEdit" v-model="ext.Profits"></a-input>-->
<span v-if="ext.BuyPrice" class="spanValue">{{ext.Profits}}%</span> <span v-if="ext.BuyPrice" class="spanValue"
>{{ ext.Profits }}%</span
>
<span v-else>-</span> <span v-else>-</span>
</div> </div>
</a-col> </a-col>
<a-col :span="4"> <a-col :span="4">
<div style="padding-top: 10px;padding-bottom: 10px;height: 215px;" class="borderLeft"> <div
<div style="margin: 0px auto;width: 200px;"> style="padding-top: 10px; padding-bottom: 10px; height: 215px"
class="borderLeft"
>
<div style="margin: 0px auto; width: 200px">
<div v-if="item.isEdit"> <div v-if="item.isEdit">
<a-input style="margin-top: 10px;" v-model="item.RivalTitle" placeholder="请输入竞品标题"> <a-input
style="margin-top: 10px"
v-model="item.RivalTitle"
placeholder="请输入竞品标题"
>
</a-input> </a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalPrice" placeholder="请输入竞品价格"> <a-input
style="margin-top: 10px"
v-model="item.RivalPrice"
placeholder="请输入竞品价格"
>
</a-input> </a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalPLCount" placeholder="请输入竞品评论数"> <a-input
style="margin-top: 10px"
v-model="item.RivalPLCount"
placeholder="请输入竞品评论数"
>
</a-input> </a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalGoodsId" placeholder="请输入竞品链接"> <a-input
style="margin-top: 10px"
v-model="item.RivalGoodsId"
placeholder="请输入竞品链接"
>
</a-input> </a-input>
</div> </div>
<div v-else> <div v-else>
<div style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 5px auto;"> <div
style="
padding-top: 10px;
padding-bottom: 10px;
width: 200px;
margin: 5px auto;
"
>
<a target="_black" :href="item.RivalGoodsId"> <a target="_black" :href="item.RivalGoodsId">
<img src="/jp.png" width="200" height="165" /></a> <img src="/jp.png" width="200" height="165"
/></a>
<a-row> <a-row>
<a-col :span="12" style="text-align: left;">¥{{item.RivalPrice}}</a-col> <a-col :span="12" style="text-align: left"
<a-col :span="12" style="text-align: right;">{{item.RivalPLCount}}人评论</a-col> >¥{{ item.RivalPrice }}</a-col
>
<a-col :span="12" style="text-align: right"
>{{ item.RivalPLCount }}人评论</a-col
>
</a-row> </a-row>
</div> </div>
</div> </div>
@ -184,68 +267,125 @@
<a-col :span="24" class="borderT"> <a-col :span="24" class="borderT">
<a-row justify="center" type="flex" :align="'middle'"> <a-row justify="center" type="flex" :align="'middle'">
<a-col :span="4"> <a-col :span="4">
<a class="borderNoTop itemtitle" :title="item.Title">{{item.Title}}</a> <a class="borderNoTop itemtitle" :title="item.Title">{{
item.Title
}}</a>
</a-col> </a-col>
<a-col :span="16"> <a-col :span="16">
<a-row> <a-row>
<a-col :span="12" style="text-align: left;"> <a-col :span="12" style="text-align: left">
<span v-if="item.State == 0 || item.State == 5"> <span v-if="item.State == 0 || item.State == 5">
<a-button style="margin-left: 10px;" type="primary" <a-dropdown
@click="getImgBase64(item.ItemImg)">搜图 style="margin-left: 10px">
<a-menu slot="overlay" >
<a-menu-item key="1" @click="getImgBase64(item.ItemImg,1)">
阿里巴巴
</a-menu-item>
<a-menu-item key="2" @click="getImgBase64(item.ItemImg,2)">
京东
</a-menu-item>
</a-menu>
<a-button
type="primary">
搜图 <a-icon type="down" />
</a-button> </a-button>
<a-button style="margin-left: 10px;" type="primary" </a-dropdown>
@click="setState(item.Id,item.State==5?0:5)">{{item.State==5?'取消发布':'发布任务'}}
<a-button
style="margin-left: 10px"
type="primary"
@click="setState(item.Id, item.State == 5 ? 0 : 5)"
>{{ item.State == 5 ? "取消发布" : "发布任务" }}
</a-button> </a-button>
<a-button style="margin-left: 10px;" type="primary" <a-button
@click="setState(item.Id,6)">完成比价 style="margin-left: 10px"
type="primary"
@click="setState(item.Id, 6)"
>完成比价
</a-button> </a-button>
</span> </span>
<span v-if="item.State == 6 || item.State == 7"> <span v-if="item.State == 6 || item.State == 7">
<a-button style="margin-left: 10px;" type="primary" <a-button
@click="setState(item.Id,1)">精选 style="margin-left: 10px"
type="primary"
@click="setState(item.Id, 1)"
>精选
</a-button> </a-button>
<a-button style="margin-left: 10px;" type="primary" <a-button
@click="setState(item.Id,item.State==7?6:7)">{{item.State==6?'需要修改':'待修改'}} style="margin-left: 10px"
type="primary"
@click="setState(item.Id, item.State == 7 ? 6 : 7)"
>{{ item.State == 6 ? "需要修改" : "待修改" }}
</a-button> </a-button>
</span> </span>
<span v-if="item.State == 1"> <span v-if="item.State == 1">
<a-button style="margin-left: 10px;" type="primary" <a-button
@click="setState(item.Id,8)">待上架 style="margin-left: 10px"
type="primary"
@click="setState(item.Id, 8)"
>待上架
</a-button> </a-button>
</span> </span>
<span v-if="item.State == 8"> <span v-if="item.State == 8">
<a-button style="margin-left: 10px;" type="primary" <a-button
@click="setState(item.Id,2)">已上架 style="margin-left: 10px"
type="primary"
@click="setState(item.Id, 2)"
>已上架
</a-button> </a-button>
</span> </span>
</a-col> </a-col>
<a-col :span="12" style="text-align: right;"> <a-col :span="12" style="text-align: right">
<a-button style="margin-right: 10px;" type="primary" v-if="currentTab==='3'" <a-button
@click="setState(item.Id,-1)">删除</a-button> style="margin-right: 10px"
type="primary"
<a-button style="margin-right: 10px;" type="primary" v-else v-if="currentTab === '3'"
@click="setState(item.Id,3)">放弃</a-button> @click="setState(item.Id, -1)"
>删除</a-button
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===false" >
@click="editData(item)">编辑</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true" <a-button
@click="canelEdit(item)">取消</a-button> style="margin-right: 10px"
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true" type="primary"
@click="setData(item)">保存</a-button> v-else
@click="setState(item.Id, 3)"
>放弃</a-button
>
<a-button
style="margin-right: 10px"
type="primary"
v-if="item.isEdit === false"
@click="editData(item)"
>编辑</a-button
>
<a-button
style="margin-right: 10px"
type="primary"
v-if="item.isEdit === true"
@click="canelEdit(item)"
>取消</a-button
>
<a-button
style="margin-right: 10px"
type="primary"
v-if="item.isEdit === true"
@click="setData(item)"
>保存</a-button
>
</a-col> </a-col>
</a-row> </a-row>
</a-col> </a-col>
<a-col :span="4"> <a-col :span="4">
<a class="borderNoTop itemtitle" :title="item.RivalTitle">{{item.RivalTitle}}</a> <a class="borderNoTop itemtitle" :title="item.RivalTitle">{{
item.RivalTitle
}}</a>
</a-col> </a-col>
</a-row> </a-row>
</a-col> </a-col>
@ -263,20 +403,21 @@
pagination: { pagination: {
current: 1, current: 1,
pageSize: 10, pageSize: 10,
showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}` showTotal: (total, range) =>
`总数:${total} 当前:${range[0]}-${range[1]}`,
}, },
filters: {}, filters: {},
sorter: { field: 'Id', order: 'asc' }, sorter: { field: "Id", order: "asc" },
loading: false, loading: false,
queryParam: { condition: 'State', keyword: 0 }, queryParam: { condition: "State", keyword: 0 },
selectedRowKeys: [], selectedRowKeys: [],
currentTab: 0, currentTab: 0,
lastEditData: undefined, lastEditData: undefined,
extFormList:['以图搜款'] extFormList: ["以图搜款"],
} };
}, },
mounted() { mounted() {
window.getDatas = this.getDatas window.getDatas = this.getDatas;
// this.getDatas(0) // this.getDatas(0)
}, },
activated() { activated() {
@ -288,13 +429,13 @@
this.handleChange(value, ext, item); this.handleChange(value, ext, item);
}, },
handleChange(value, ext, item) { handleChange(value, ext, item) {
ext.SupplierFrom = value != null && value != "" ? value : [];
ext.SupplierFrom= value != null && value != '' ? value : []; if (
item.Extensions.filter((c) => c.SupplierFrom == "以图搜款").length > 2
if(item.Extensions.filter(c=>c.SupplierFrom=='以图搜款').length>2) ) {
{ this.$message.error("以图搜款最多可选择2个!");
this.$message.error('以图搜款最多可选择2个!'); ext.SupplierFrom = "";
ext.SupplierFrom=''
} }
}, },
handleBlur(value, ext) { handleBlur(value, ext) {
@ -304,111 +445,119 @@
} }
}, },
changeTab(e) { changeTab(e) {
this.getDatas(e) this.getDatas(e);
this.currentTab = e this.currentTab = e;
}, },
getDatas(type) { getDatas(type) {
this.http.post('/HuiYan/teamitems/GetItems', { this.http
.post("/HuiYan/teamitems/GetItems", {
PageIndex: this.pagination.current, PageIndex: this.pagination.current,
PageRows: this.pagination.pageSize, PageRows: this.pagination.pageSize,
SortField: this.sorter.field || 'Id', SortField: this.sorter.field || "Id",
SortType: this.sorter.order, SortType: this.sorter.order,
Search: { condition: 'State', keyword: type }, Search: { condition: "State", keyword: type },
...this.filters ...this.filters,
}).then(res => { })
res.Data.forEach(item => { .then((res) => {
item.isEdit = false res.Data.forEach((item) => {
item.Extensions.forEach(ext => { item.isEdit = false;
ext.PlatformPoint = parseFloat(item.RivalPrice * 0.05).toFixed(2) item.Extensions.forEach((ext) => {
ext.Profit = item.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint ext.PlatformPoint = parseFloat(item.RivalPrice * 0.05).toFixed(2);
ext.Profit =
item.RivalPrice -
ext.BuyPrice -
ext.KDPrice -
ext.PlatformPoint;
if (ext.BuyPrice == 0) { if (ext.BuyPrice == 0) {
ext.Profits = 0 ext.Profits = 0;
} } else {
else { ext.Profits = parseFloat(
ext.Profits = parseFloat((ext.Profit / ext.BuyPrice) * 100).toFixed(2) (ext.Profit / ext.BuyPrice) * 100
).toFixed(2);
} }
})
}); });
this.datas = res.Data });
}) this.datas = res.Data;
});
}, },
editData(data) { editData(data) {
data.isEdit = true data.isEdit = true;
this.lastEditData = JSON.parse(JSON.stringify(data)) this.lastEditData = JSON.parse(JSON.stringify(data));
}, },
canelEdit(data) { canelEdit(data) {
this.lastEditData.isEdit = false this.lastEditData.isEdit = false;
Object.assign(data, this.lastEditData) Object.assign(data, this.lastEditData);
}, },
setData(data) { setData(data) {
data.Extensions.forEach(ext => { data.Extensions.forEach((ext) => {
ext.PlatformPoint = parseFloat(data.RivalPrice * 0.05).toFixed(2) ext.PlatformPoint = parseFloat(data.RivalPrice * 0.05).toFixed(2);
ext.Profit = data.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint ext.Profit =
data.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint;
if (ext.BuyPrice == 0) { if (ext.BuyPrice == 0) {
ext.Profits = 0 ext.Profits = 0;
} } else {
else { ext.Profits = parseFloat((ext.Profit / ext.BuyPrice) * 100).toFixed(
ext.Profits = parseFloat((ext.Profit / ext.BuyPrice) * 100).toFixed(2) 2
);
} }
}) });
this.http.post('/HuiYan/teamitems/SetItem', data).then(res => { this.http.post("/HuiYan/teamitems/SetItem", data).then((res) => {
if (res.Success) { if (res.Success) {
this.$message.success('操作成功!'); this.$message.success("操作成功!");
data.isEdit = false data.isEdit = false;
} else { } else {
this.$message.error(res.Msg); this.$message.error(res.Msg);
} }
}) });
}, },
setState(id, type) { setState(id, type) {
/// ///
if (type == 5) { if (type == 5) {
this.sendPriceTask(id) this.sendPriceTask(id);
} } else if (type == 0) {
else if (type == 0) { this.canelPriceTask(id);
this.canelPriceTask(id) } else {
} this.http
else { .post(`/HuiYan/teamitems/SetState?id=${id}&state=${type}`)
this.http.post(`/HuiYan/teamitems/SetState?id=${id}&state=${type}`).then(res => { .then((res) => {
if (res.Success) { if (res.Success) {
this.$message.success('操作成功!'); this.$message.success("操作成功!");
this.getDatas(this.currentTab) this.getDatas(this.currentTab);
} else { } else {
this.$message.error(res.Msg); this.$message.error(res.Msg);
} }
}) });
} }
}, },
sendPriceTask(id) { sendPriceTask(id) {
this.http.post(`/HuiYan/pricetasklog/AddTask?id=${id}`).then(res => { this.http.post(`/HuiYan/pricetasklog/AddTask?id=${id}`).then((res) => {
if (res.Success) { if (res.Success) {
this.$message.success('操作成功!'); this.$message.success("操作成功!");
this.getDatas(this.currentTab) this.getDatas(this.currentTab);
} else { } else {
this.$message.error(res.Msg); this.$message.error(res.Msg);
} }
}) });
}, },
canelPriceTask(id) { canelPriceTask(id) {
this.http.post(`/HuiYan/pricetasklog/CanelTask?id=${id}`).then(res => { this.http.post(`/HuiYan/pricetasklog/CanelTask?id=${id}`).then((res) => {
if (res.Success) { if (res.Success) {
this.$message.success('操作成功!'); this.$message.success("操作成功!");
this.getDatas(this.currentTab) this.getDatas(this.currentTab);
} else { } else {
this.$message.error(res.Msg); this.$message.error(res.Msg);
} }
}) });
}, },
getImgBase64(src) { getImgBase64(src,type) {
hyCoreModel.getImgBase64('http:' + src).then(res => { hyCoreModel.getImgBase64("http:" + src,type).then((res) => {
console.log(res) console.log(res);
}) });
}, },
}, },
} };
</script> </script>
<style> <style>

1
客户端/齐越慧眼/齐越慧眼/vuepage/dist/css/app.a281d79c.css

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>client</title><link href="/css/app.cbd86d30.css" rel="preload" as="style"><link href="/css/app.css" rel="preload" as="style"><link href="/css/chunk-vendors.09af4a6b.css" rel="preload" as="style"><link href="/css/chunk-vendors.css" rel="preload" as="style"><link href="/js/app.js" rel="preload" as="script"><link href="/js/chunk-vendors.js" rel="preload" as="script"><link href="/css/chunk-vendors.09af4a6b.css" rel="stylesheet"><link href="/css/chunk-vendors.css" rel="stylesheet"><link href="/css/app.cbd86d30.css" rel="stylesheet"><link href="/css/app.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.js"></script><script src="/js/app.js"></script></body></html> <!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>client</title><link href="/css/app.a281d79c.css" rel="preload" as="style"><link href="/css/app.css" rel="preload" as="style"><link href="/css/chunk-vendors.09af4a6b.css" rel="preload" as="style"><link href="/css/chunk-vendors.css" rel="preload" as="style"><link href="/js/app.js" rel="preload" as="script"><link href="/js/chunk-vendors.js" rel="preload" as="script"><link href="/css/chunk-vendors.09af4a6b.css" rel="stylesheet"><link href="/css/chunk-vendors.css" rel="stylesheet"><link href="/css/app.a281d79c.css" rel="stylesheet"><link href="/css/app.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.js"></script><script src="/js/app.js"></script></body></html>

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map

File diff suppressed because one or more lines are too long

4
客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj

@ -42,6 +42,7 @@
<None Remove="vuepage\client\.gitignore" /> <None Remove="vuepage\client\.gitignore" />
<None Remove="vuepage\client\.postcssrc.js" /> <None Remove="vuepage\client\.postcssrc.js" />
<None Remove="vuepage\dist\css\app.90b53025.css" /> <None Remove="vuepage\dist\css\app.90b53025.css" />
<None Remove="vuepage\dist\css\app.a281d79c.css" />
<None Remove="vuepage\dist\css\app.b0aefef5.css" /> <None Remove="vuepage\dist\css\app.b0aefef5.css" />
<None Remove="vuepage\dist\css\app.cbd86d30.css" /> <None Remove="vuepage\dist\css\app.cbd86d30.css" />
<None Remove="vuepage\dist\css\app.css" /> <None Remove="vuepage\dist\css\app.css" />
@ -55,7 +56,6 @@
<None Remove="vuepage\client\README.md" /> <None Remove="vuepage\client\README.md" />
<None Remove="vuepage\client\vue.config.js" /> <None Remove="vuepage\client\vue.config.js" />
<None Remove="vuepage\client\yarn.lock" /> <None Remove="vuepage\client\yarn.lock" />
<None Remove="vuepage\dist\jp.png" />
<None Remove="vuepage\dist\js\app.js" /> <None Remove="vuepage\dist\js\app.js" />
<None Remove="vuepage\dist\js\app.js.map" /> <None Remove="vuepage\dist\js\app.js.map" />
<None Remove="vuepage\dist\js\chunk-vendors.js" /> <None Remove="vuepage\dist\js\chunk-vendors.js" />
@ -73,6 +73,7 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="vuepage\dist\css\app.90b53025.css" /> <EmbeddedResource Include="vuepage\dist\css\app.90b53025.css" />
<EmbeddedResource Include="vuepage\dist\css\app.a281d79c.css" />
<EmbeddedResource Include="vuepage\dist\css\app.cbd86d30.css" /> <EmbeddedResource Include="vuepage\dist\css\app.cbd86d30.css" />
<EmbeddedResource Include="vuepage\dist\css\app.css" /> <EmbeddedResource Include="vuepage\dist\css\app.css" />
<EmbeddedResource Include="vuepage\dist\css\chunk-vendors.09af4a6b.css" /> <EmbeddedResource Include="vuepage\dist\css\chunk-vendors.09af4a6b.css" />
@ -85,7 +86,6 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="vuepage\dist\favicon.ico" /> <EmbeddedResource Include="vuepage\dist\favicon.ico" />
<EmbeddedResource Include="vuepage\dist\index.html" /> <EmbeddedResource Include="vuepage\dist\index.html" />
<EmbeddedResource Include="vuepage\dist\jp.png" />
<EmbeddedResource Include="vuepage\dist\js\app.js" /> <EmbeddedResource Include="vuepage\dist\js\app.js" />
<EmbeddedResource Include="vuepage\dist\js\app.js.map" /> <EmbeddedResource Include="vuepage\dist\js\app.js.map" />
<EmbeddedResource Include="vuepage\dist\js\chunk-vendors.js" /> <EmbeddedResource Include="vuepage\dist\js\chunk-vendors.js" />

Loading…
Cancel
Save