Browse Source

修复阿里巴巴图片获取失败

master
feng 4 years ago
parent
commit
ad436d6fe3
  1. 2
      src/Coldairarrow.Entity/HuiYan/teamitems.cs
  2. 37
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs
  3. 140
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue
  4. 126
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/pricetask/Index.vue
  5. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js
  6. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map

2
src/Coldairarrow.Entity/HuiYan/teamitems.cs

@ -105,7 +105,7 @@ namespace Coldairarrow.Entity.HuiYan
/// <summary> /// <summary>
/// 对标商品评价数量 /// 对标商品评价数量
/// </summary> /// </summary>
public Int32? RivalPLCount { get; set; } public string RivalPLCount { get; set; }
/// <summary> /// <summary>
/// 接比价任务的用户ID /// 接比价任务的用户ID

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

@ -73,6 +73,16 @@ namespace 齐越慧眼.UserControls
web.TitleChanged += Web_TitleChanged; web.TitleChanged += Web_TitleChanged;
} }
web.AddressChanged += Web_AddressChanged; web.AddressChanged += Web_AddressChanged;
this.KeyUp += BrowerControl_KeyUp;
}
private void BrowerControl_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.F12)
{
web.ShowDevTools();
}
} }
private void Visitor_SendCookie(Cookie obj) private void Visitor_SendCookie(Cookie obj)
@ -627,19 +637,34 @@ namespace 齐越慧眼.UserControls
{ {
//添加js事件 //添加js事件
DoJavaScript(@"
window.getparent=function (ele)
{
var info=$(ele).parent();
if(!info){return ele;}
if(info.hasClass(""space-offer-card-box""))
{
return info;
}
return getparent(info);
};
");
DoJavaScript(@" DoJavaScript(@"
window.optClick= function (ele,type){ window.optClick= function (ele,type){
var e=window.event || arguments.callee.caller.arguments[0]; var e=window.event || arguments.callee.caller.arguments[0];
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var parentDiv=window.getparent(ele);
var infoDiv=$($(ele).parent().parent().parent().parent().parent().parent()); var infoDiv=$(parentDiv.find(""div:first"")[0]);
var itemid= infoDiv.attr(""data-sku""); var itemid= infoDiv.attr(""data-sku"");
var price=infoDiv.find("".showPricec"").text(); var price=infoDiv.find("".showPricec"").text();
var sales=infoDiv.find("".sale"").text(); var sales=infoDiv.find("".sale"").text();
var title=infoDiv.find("".mojar-element-title"").text(); var title=infoDiv.find("".mojar-element-title"").text();
var img=$(ele).parent().parent().find(""div.img"").css(""background-image""); var img=infoDiv.find(""div.img"").css(""background-image"");
var shopId=infoDiv.attr(""data-shopId""); var shopId=infoDiv.attr(""data-shopId"");
hyCoreModel.set1688ItemData({itemid:itemid,price:price,sales:sales,title:title,img:img,type:type,shopId:shopId}); hyCoreModel.set1688ItemData({itemid:itemid,price:price,sales:sales,title:title,img:img,type:type,shopId:shopId});
}; };
@ -1095,6 +1120,12 @@ namespace 齐越慧眼.UserControls
string itemId = data.itemid; string itemId = data.itemid;
string shopId = data.shopId; string shopId = data.shopId;
img = Regex.Match(img, @"url\(""(.*?)""\)").Groups[1].Value;
if (!string.IsNullOrEmpty(img))
{
img = img.Split('?')[0];
}
if (type == 4) if (type == 4)
{ {

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

@ -1,12 +1,36 @@
<template> <template>
<div class="about"> <div class="about">
<a-tabs @change="changeTab"> <a-tabs @change="changeTab">
<a-tab-pane key="0" :tab="'待比价('+stateList.filter(c=>c==0).length+')'"> </a-tab-pane> <a-tab-pane
<a-tab-pane key="6" :tab="'已比价('+stateList.filter(c=>c==6).length+')'"> </a-tab-pane> key="0"
<a-tab-pane key="1" :tab="'精选('+stateList.filter(c=>c==1).length+')'"> </a-tab-pane> :tab="'待比价(' + stateList.filter((c) => c == 0).length + ')'"
<a-tab-pane key="8" :tab="'待上架('+stateList.filter(c=>c==8).length+')'"> </a-tab-pane> >
<a-tab-pane key="2" :tab="'已上架('+stateList.filter(c=>c==2).length+')'"> </a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" :tab="'放弃('+stateList.filter(c=>c==3).length+')'"> </a-tab-pane> <a-tab-pane
key="6"
:tab="'已比价(' + stateList.filter((c) => c == 6).length + ')'"
>
</a-tab-pane>
<a-tab-pane
key="1"
:tab="'精选(' + stateList.filter((c) => c == 1).length + ')'"
>
</a-tab-pane>
<a-tab-pane
key="8"
:tab="'待上架(' + stateList.filter((c) => c == 8).length + ')'"
>
</a-tab-pane>
<a-tab-pane
key="2"
:tab="'已上架(' + stateList.filter((c) => c == 2).length + ')'"
>
</a-tab-pane>
<a-tab-pane
key="3"
:tab="'放弃(' + stateList.filter((c) => c == 3).length + ')'"
>
</a-tab-pane>
</a-tabs> </a-tabs>
<div class="border"> <div class="border">
@ -65,7 +89,7 @@
" "
> >
<a target="_black" :href="item.GoodsUrl"> <a target="_black" :href="item.GoodsUrl">
<img :src="getImgPath( item.ItemImg)" width="200" height="165" <img :src="getImgPath(item.ItemImg)" width="200" height="165"
/></a> /></a>
<a-row> <a-row>
<a-col :span="12" style="text-align: left" <a-col :span="12" style="text-align: left"
@ -112,8 +136,6 @@
v-for="(ext, index) in item.Extensions" v-for="(ext, index) in item.Extensions"
:key="index" :key="index"
> >
<a-select <a-select
v-if="item.isEdit" v-if="item.isEdit"
v-model="ext.Platform" v-model="ext.Platform"
@ -133,7 +155,6 @@
<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>
</span> </span>
</div> </div>
</a-col> </a-col>
<!--采购链接--> <!--采购链接-->
@ -294,18 +315,22 @@
<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-dropdown <a-dropdown style="margin-left: 10px">
style="margin-left: 10px"> <a-menu slot="overlay">
<a-menu slot="overlay" > <a-menu-item
<a-menu-item key="1" @click="getImgBase64(getImgPath( item.ItemImg),1)"> key="1"
@click="getImgBase64(getImgPath(item.ItemImg), 1)"
>
阿里巴巴 阿里巴巴
</a-menu-item> </a-menu-item>
<a-menu-item key="2" @click="getImgBase64(getImgPath( item.ItemImg),2)"> <a-menu-item
京东 key="2"
@click="getImgBase64(getImgPath(item.ItemImg), 2)"
>
京东
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
<a-button <a-button type="primary">
type="primary">
搜图 <a-icon type="down" /> 搜图 <a-icon type="down" />
</a-button> </a-button>
</a-dropdown> </a-dropdown>
@ -410,18 +435,16 @@
</a-col> </a-col>
</a-row> </a-row>
<div style="float: right; margin-top: 30px">
<div style="float:right;margin-top:30px"> <a-pagination
<a-pagination v-model="pagination.current"
v-model="pagination.current" :default-current="1"
:default-current="1" :total="pagination.total"
:total="pagination.total" :page-size="pagination.pageSize"
:page-size="pagination.pageSize" @change="changePage"
@change="changePage" />
/> </div>
</div> </div>
</div>
</div> </div>
</template> </template>
@ -434,7 +457,7 @@ export default {
pagination: { pagination: {
current: 1, current: 1,
pageSize: 10, pageSize: 10,
total:0, total: 0,
showTotal: (total, range) => showTotal: (total, range) =>
`总数:${total} 当前:${range[0]}-${range[1]}`, `总数:${total} 当前:${range[0]}-${range[1]}`,
}, },
@ -443,37 +466,40 @@ export default {
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: ["以图搜款"],
stateList:[], stateList: [],
platformList:[{id:0,name:'淘宝'},{id:1,name:'京东'},{id:2,name:'1688'}] platformList: [
{ id: 0, name: "淘宝" },
{ id: 1, name: "京东" },
{ id: 2, name: "1688" },
],
}; };
}, },
mounted() { mounted() {
window.getDatas = this.getDatas; window.getDatas = this.getDatas;
this.getDatas(0) this.getDatas(0);
this.getTabCount() this.getTabCount();
}, },
activated() { activated() {
//this.getDatas(0) //this.getDatas(0)
}, },
methods: { methods: {
getTabCount() getTabCount() {
{ this.http.get("/HuiYan/teamitems/GetTeamCount").then((res) => {
this.http.get('/HuiYan/teamitems/GetTeamCount').then(res=>{ this.stateList = res.Data;
this.stateList= res.Data });
}) },
getImgPath(img) {
if (!img||img==undefined) return;
if (img.indexOf("http") >= 0) {
return img;
} else {
return "http:" + img;
}
}, },
getImgPath(img){
if(img.indexOf("http")>=0)
{
return img;
}else
{
return 'http:'+img;
}
},
// select // select
handleSearch(value, ext, item) { handleSearch(value, ext, item) {
this.handleChange(value, ext, item); this.handleChange(value, ext, item);
@ -497,16 +523,14 @@ export default {
changeTab(e) { changeTab(e) {
this.getDatas(e); this.getDatas(e);
this.currentTab = e; this.currentTab = e;
this.pagination.current=1; this.pagination.current = 1;
}, },
changePage(page, pageSize) changePage(page, pageSize) {
{ this.pagination.current = page;
this.pagination.current=page;
this.getDatas(this.currentTab); this.getDatas(this.currentTab);
}, },
getDatas(type) { getDatas(type) {
var that=this var that = this;
this.http this.http
.post("/HuiYan/teamitems/GetItems", { .post("/HuiYan/teamitems/GetItems", {
PageIndex: this.pagination.current, PageIndex: this.pagination.current,
@ -517,7 +541,7 @@ export default {
...this.filters, ...this.filters,
}) })
.then((res) => { .then((res) => {
that.pagination.total=res.Total that.pagination.total = res.Total;
res.Data.forEach((item) => { res.Data.forEach((item) => {
item.isEdit = false; item.isEdit = false;
item.Extensions.forEach((ext) => { item.Extensions.forEach((ext) => {
@ -610,8 +634,8 @@ export default {
} }
}); });
}, },
getImgBase64(src,type) { getImgBase64(src, type) {
hyCoreModel.getImgBase64(src,type).then((res) => { hyCoreModel.getImgBase64(src, type).then((res) => {
console.log(res); console.log(res);
}); });
}, },

126
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/pricetask/Index.vue

@ -1,10 +1,26 @@
<template> <template>
<div class="about"> <div class="about">
<a-tabs @change="changeTab"> <a-tabs @change="changeTab">
<a-tab-pane key="0" :tab="'待比价('+stateList.filter(c=>c==0).length+')'"> </a-tab-pane> <a-tab-pane
<a-tab-pane key="1" :tab="'已比价('+stateList.filter(c=>c==1).length+')'"> </a-tab-pane> key="0"
<a-tab-pane key="2" :tab="'待修改('+stateList.filter(c=>c==2).length+')'"> </a-tab-pane> :tab="'待比价(' + stateList.filter((c) => c == 0).length + ')'"
<a-tab-pane key="3" :tab="'已完结('+stateList.filter(c=>c==3).length+')'"> </a-tab-pane> >
</a-tab-pane>
<a-tab-pane
key="1"
:tab="'已比价(' + stateList.filter((c) => c == 1).length + ')'"
>
</a-tab-pane>
<a-tab-pane
key="2"
:tab="'待修改(' + stateList.filter((c) => c == 2).length + ')'"
>
</a-tab-pane>
<a-tab-pane
key="3"
:tab="'已完结(' + stateList.filter((c) => c == 3).length + ')'"
>
</a-tab-pane>
</a-tabs> </a-tabs>
<div class="border"> <div class="border">
@ -63,7 +79,7 @@
" "
> >
<a target="_black" :href="item.GoodsUrl"> <a target="_black" :href="item.GoodsUrl">
<img :src="getImgPath( item.ItemImg)" width="200" height="165" <img :src="getImgPath(item.ItemImg)" width="200" height="165"
/></a> /></a>
<a-row> <a-row>
<a-col :span="12" style="text-align: left" <a-col :span="12" style="text-align: left"
@ -110,8 +126,6 @@
v-for="(ext, index) in item.Extensions" v-for="(ext, index) in item.Extensions"
:key="index" :key="index"
> >
<a-select <a-select
v-if="item.isEdit" v-if="item.isEdit"
v-model="ext.Platform" v-model="ext.Platform"
@ -291,23 +305,25 @@
<a-row> <a-row>
<a-col :span="12" style="text-align: left"> <a-col :span="12" style="text-align: left">
<span v-if="item.PriceTaskState == 0"> <span v-if="item.PriceTaskState == 0">
<a-dropdown style="margin-left: 10px">
<a-dropdown <a-menu slot="overlay">
style="margin-left: 10px"> <a-menu-item
<a-menu slot="overlay" > key="1"
<a-menu-item key="1" @click="getImgBase64(getImgPath( item.ItemImg),1)"> @click="getImgBase64(getImgPath(item.ItemImg), 1)"
>
阿里巴巴 阿里巴巴
</a-menu-item> </a-menu-item>
<a-menu-item key="2" @click="getImgBase64(getImgPath( item.ItemImg),2)"> <a-menu-item
京东 key="2"
@click="getImgBase64(getImgPath(item.ItemImg), 2)"
>
京东
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
<a-button <a-button type="primary">
type="primary">
搜图 <a-icon type="down" /> 搜图 <a-icon type="down" />
</a-button> </a-button>
</a-dropdown> </a-dropdown>
</span> </span>
<a-button <a-button
@ -371,17 +387,16 @@
</a-row> </a-row>
</a-col> </a-col>
</a-row> </a-row>
<div style="float:right;margin-top:30px"> <div style="float: right; margin-top: 30px">
<a-pagination <a-pagination
v-model="pagination.current" v-model="pagination.current"
:default-current="1" :default-current="1"
:total="pagination.total" :total="pagination.total"
:page-size="pagination.pageSize" :page-size="pagination.pageSize"
@change="changePage" @change="changePage"
/> />
</div>
</div> </div>
</div>
</div> </div>
</template> </template>
@ -403,38 +418,40 @@ export default {
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: ["以图搜款"],
stateList:[], stateList: [],
platformList:[{id:0,name:'淘宝'},{id:1,name:'京东'},{id:2,name:'1688'}] platformList: [
{ id: 0, name: "淘宝" },
{ id: 1, name: "京东" },
{ id: 2, name: "1688" },
],
}; };
}, },
mounted() { mounted() {
window.getDatas = this.getDatas; window.getDatas = this.getDatas;
this.getDatas(0) this.getDatas(0);
this.getTabCount() this.getTabCount();
}, },
activated() { activated() {
//this.getDatas(0) //this.getDatas(0)
}, },
methods: { methods: {
getTabCount() getTabCount() {
{ this.http.get("/HuiYan/pricetasklog/GetTaskCount").then((res) => {
this.http.get('/HuiYan/pricetasklog/GetTaskCount').then(res=>{ this.stateList = res.Data;
this.stateList= res.Data console.log(this.stateList);
console.log(this.stateList) });
}) },
getImgPath(img) {
if (!img || img == undefined) return;
if (img.indexOf("http") >= 0) {
return img;
} else {
return "http:" + img;
}
}, },
getImgPath(img){
if(img.indexOf("http")>=0)
{
return img;
}else
{
return 'http:'+img;
}
},
// select // select
handleSearch(value, ext, item) { handleSearch(value, ext, item) {
this.handleChange(value, ext, item); this.handleChange(value, ext, item);
@ -459,15 +476,14 @@ export default {
changeTab(e) { changeTab(e) {
this.getDatas(e); this.getDatas(e);
this.currentTab = e; this.currentTab = e;
this.pagination.current=1; this.pagination.current = 1;
}, },
changePage(page, pageSize) changePage(page, pageSize) {
{ this.pagination.current = page;
this.pagination.current=page;
this.getDatas(this.currentTab); this.getDatas(this.currentTab);
}, },
getDatas(type) { getDatas(type) {
var that=this var that = this;
this.http this.http
.post("/HuiYan/pricetasklog/GetItems", { .post("/HuiYan/pricetasklog/GetItems", {
PageIndex: this.pagination.current, PageIndex: this.pagination.current,
@ -478,7 +494,7 @@ export default {
...this.filters, ...this.filters,
}) })
.then((res) => { .then((res) => {
that.pagination.total=res.Total that.pagination.total = res.Total;
res.Data.forEach((item) => { res.Data.forEach((item) => {
item.isEdit = false; item.isEdit = false;
item.Extensions.forEach((ext) => { item.Extensions.forEach((ext) => {
@ -571,8 +587,8 @@ export default {
} }
}); });
}, },
getImgBase64(src,type) { getImgBase64(src, type) {
hyCoreModel.getImgBase64(src,type).then((res) => { hyCoreModel.getImgBase64(src, type).then((res) => {
console.log(res); console.log(res);
}); });
}, },

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
Loading…
Cancel
Save