Browse Source

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

master
feng 4 years ago
parent
commit
ad436d6fe3
  1. 2
      src/Coldairarrow.Entity/HuiYan/teamitems.cs
  2. 39
      客户端/齐越慧眼/齐越慧眼/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>
public Int32? RivalPLCount { get; set; }
public string RivalPLCount { get; set; }
/// <summary>
/// 接比价任务的用户ID

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

@ -73,6 +73,16 @@ namespace 齐越慧眼.UserControls
web.TitleChanged += Web_TitleChanged;
}
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)
@ -627,19 +637,34 @@ namespace 齐越慧眼.UserControls
{
//添加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(@"
window.optClick= function (ele,type){
var e=window.event || arguments.callee.caller.arguments[0];
e.preventDefault();
e.stopPropagation();
var infoDiv=$($(ele).parent().parent().parent().parent().parent().parent());
var parentDiv=window.getparent(ele);
var infoDiv=$(parentDiv.find(""div:first"")[0]);
var itemid= infoDiv.attr(""data-sku"");
var price=infoDiv.find("".showPricec"").text();
var sales=infoDiv.find("".sale"").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"");
hyCoreModel.set1688ItemData({itemid:itemid,price:price,sales:sales,title:title,img:img,type:type,shopId:shopId});
};
@ -1095,7 +1120,13 @@ namespace 齐越慧眼.UserControls
string itemId = data.itemid;
string shopId = data.shopId;
img = Regex.Match(img, @"url\(""(.*?)""\)").Groups[1].Value;
if (!string.IsNullOrEmpty(img))
{
img = img.Split('?')[0];
}
if (type == 4)
{
var result = ApiHelper.SetAlbbCooperation(shopId);

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

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

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

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