|
|
@ -128,7 +128,6 @@ namespace JdShopListener |
|
|
|
webClient.DownloadFileCompleted += WebClient_DownloadFileCompleted; |
|
|
|
webClient.DownloadProgressChanged += WebClient_DownloadProgressChanged; |
|
|
|
webClient.DownloadFileTaskAsync("https://qymds.oss-cn-hangzhou.aliyuncs.com/chromium/.local-chromium.zip", System.Environment.CurrentDirectory+"\\tempZip.zip").Wait(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void WebClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) |
|
|
@ -163,7 +162,10 @@ namespace JdShopListener |
|
|
|
IsInitLoding = true; |
|
|
|
var result = ApiHelper.GetLabelByItemIds(); |
|
|
|
|
|
|
|
result.datas.ForEach(item => { |
|
|
|
AddLog($"检测到{result.datas.Count}个慧眼竞品添加!"); |
|
|
|
|
|
|
|
result.datas.ForEach(item => |
|
|
|
{ |
|
|
|
|
|
|
|
var last = skuList.FirstOrDefault(c => c.SkuId == item.GoodsId); |
|
|
|
if (last != null) |
|
|
@ -175,17 +177,24 @@ namespace JdShopListener |
|
|
|
} |
|
|
|
} |
|
|
|
//新增
|
|
|
|
else { |
|
|
|
Application.Current.Dispatcher.Invoke(() => { |
|
|
|
else |
|
|
|
{ |
|
|
|
Application.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
InitText = $"正在添加【{item.GoodsId}】..."; |
|
|
|
}); |
|
|
|
AddSku(item.GoodsId); |
|
|
|
AddSku(item.GoodsId, "慧眼竞品添加"); |
|
|
|
} |
|
|
|
//
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
finally { |
|
|
|
catch(Exception ex) |
|
|
|
{ |
|
|
|
AddLog($"慧眼添加异常{ex.Message}\r\n{ex.StackTrace}!"); |
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
IsInitLoding = false; |
|
|
|
} |
|
|
|
}); |
|
|
@ -417,7 +426,7 @@ namespace JdShopListener |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void AddSku(string newSku) |
|
|
|
private void AddSku(string newSku,string desc=null) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(JDCookie)) |
|
|
|
{ |
|
|
@ -446,7 +455,7 @@ namespace JdShopListener |
|
|
|
{ |
|
|
|
SkuModel model = new SkuModel() |
|
|
|
{ |
|
|
|
Desc = Desc, |
|
|
|
Desc = desc??Desc, |
|
|
|
SkuId = sku["skuId"].ToString(), |
|
|
|
SpuId = spuId |
|
|
|
}; |
|
|
@ -1225,6 +1234,8 @@ namespace JdShopListener |
|
|
|
|
|
|
|
//Args = new string[] { "--no-sandbox" }
|
|
|
|
}).Result; |
|
|
|
try |
|
|
|
{ |
|
|
|
// 打开一个页面
|
|
|
|
var page = browser.NewPageAsync().Result; |
|
|
|
|
|
|
@ -1240,6 +1251,11 @@ namespace JdShopListener |
|
|
|
{ |
|
|
|
JDCookie += $"{c.Name}={c.Value};"; |
|
|
|
}); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
WpfNoticeMsg.NoticeMessage.Show("初始化内核失败,请尝试关闭跟屁虫重新启动!", "错误"); |
|
|
|
} |
|
|
|
|
|
|
|
AddLog("获取到Cookie" + JDCookie); |
|
|
|
} |
|
|
|