1688上传类目转换等优化 充值用户服务充值和用户续费店铺功能

This commit is contained in:
wule committed 2026-05-27 22:01:04 +08:00
1 parent ecb291e3d7
commit aab73b978f
56 files changed
+4532 -1748

No files matched your search

@@ -39,6 +39,8 @@ namespace TemuKJD.WXForms.TalkForms
public partial class PDDBuyerOrderListForm : BaseGeneralForm
{
private static PDDBuyerOrderListForm instance = null;
public DateTime lastCefReadOrderTime = DateTime.Now;
public static PDDBuyerOrderListForm Instance { get { if (instance == null || instance.IsDisposed || instance.Disposing) instance = new PDDBuyerOrderListForm(); return instance; } }
ShopLoginInfo currentShop { get { return this.lblCurrentShop.Tag as ShopLoginInfo; } }
//ConcurrentList<WxOrderInfoLite> lstWxOrderInfoLite { get; set; } = new ConcurrentList<WxOrderInfoLite>();
@@ -532,6 +534,8 @@ namespace TemuKJD.WXForms.TalkForms
if (buyer == null)
return;
lastCefReadOrderTime = DateTime.Now;
//{"server_time":1775789489,"orders":[],"extra_info":{}}
if (data.Contains("\"orders\":[]"))
{
@@ -622,6 +626,8 @@ namespace TemuKJD.WXForms.TalkForms
}
lastCefReadOrderTime = DateTime.Now;
if (data.Contains("\"listItemVOList\":[]") || data.Contains("\"hasNextQuery\":false"))
{
Invoke(new Action(() =>
@@ -825,40 +831,43 @@ namespace TemuKJD.WXForms.TalkForms
if (buyer == null)
return;
if (selectIds == null)
selectIds = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
bool canUse = buyer.status == "在线";
var row = dgvBuyer.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colBuyerId").ParseToString() == buyer.buyer_id);
if (row == null)
Invoke(new Action(() =>
{
var rowIndex = this.dgvBuyer.Rows.Add(
true,
buyer.buyer_id,
buyer.buyer_name,
buyer.buyer_nick,
buyer.notes,
"访问",
buyer.status
);
row = dgvBuyer.Rows[rowIndex];
}
else
{
row.Cells["colSelect"].Value = selectIds.Contains(buyer.buyer_id);
row.Cells["colBuyerId"].Value = buyer.buyer_id;
row.Cells["colBuyerName"].Value = buyer.buyer_name;
row.Cells["colBuyerNick"].Value = buyer.buyer_nick;
row.Cells["colShopNotes"].Value = buyer.notes;
row.Cells["colBuyerId"].Value = buyer.buyer_id;
row.Cells["colLoginStatus"].Value = buyer.status;
row.Cells["colMessage"].Value = msg;
}
if (selectIds == null)
selectIds = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightBlue : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkBlue : Color.DarkRed;
bool canUse = buyer.status == "在线";
var row = dgvBuyer.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colBuyerId").ParseToString() == buyer.buyer_id);
if (row == null)
{
var rowIndex = this.dgvBuyer.Rows.Add(
true,
buyer.buyer_id,
buyer.buyer_name,
buyer.buyer_nick,
buyer.notes,
"访问",
buyer.status
);
row = dgvBuyer.Rows[rowIndex];
}
else
{
row.Cells["colSelect"].Value = selectIds.Contains(buyer.buyer_id);
row.Cells["colBuyerId"].Value = buyer.buyer_id;
row.Cells["colBuyerName"].Value = buyer.buyer_name;
row.Cells["colBuyerNick"].Value = buyer.buyer_nick;
row.Cells["colShopNotes"].Value = buyer.notes;
row.Cells["colBuyerId"].Value = buyer.buyer_id;
row.Cells["colLoginStatus"].Value = buyer.status;
row.Cells["colMessage"].Value = msg;
}
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightBlue : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkBlue : Color.DarkRed;
}));
}
@@ -926,10 +935,13 @@ namespace TemuKJD.WXForms.TalkForms
continue;
var row = dgvBuyer.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colBuyerNick"].Value.ParseToString() == buyer.buyer_nick);
if (row == null || row.Cells["colSelect"].Value.ParseToBool() != true)
if (row == null)
{
if (row != null)
Invoke(new Action(() => { row.Cells["colMessage"].Value = "未勾选买手号,跳过"; }));
continue;
}
if (row.Cells["colSelect"].Value.ParseToBool() != true)
{
Invoke(new Action(() => { row.Cells["colMessage"].Value = "未勾选买手号,跳过"; }));
continue;
}
@@ -954,20 +966,30 @@ namespace TemuKJD.WXForms.TalkForms
buyer.browser.Load("https://mobile.yangkeduo.com/complaint_list.html?refer_page_name=personal&refer_page_sn=10001&tab=all");
Thread.Sleep(Randomx.GetId(2000, 3000));
BindBuyer(buyer, "正在读取售后");
int top = 0;
int times = 0;
lastCefReadOrderTime = DateTime.Now;
while (currentReadBuyer == readBuyer)
{
if (cancellationTokenSource.IsCancellationRequested)
{
BindBuyer(buyer, "已取消读取");
break;
}
if (times % 100 == 0)
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
{
CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
}
if (buyer.status != "在线")
if (buyer.status != "在线")
{
BindBuyer(buyer, "店铺掉线");
break;
}
BindBuyer(buyer, "停滞时间超过30秒,跳过");
break;
times++;
}
Invoke(new Action(() => { buyer.browser.BringToFront(); }));
@@ -994,9 +1016,14 @@ namespace TemuKJD.WXForms.TalkForms
}
}
if (cancellationTokenSource.IsCancellationRequested)
{
BindBuyer(buyer, "已取消读取");
break;
}
Thread.Sleep(Randomx.GetId(2000, 3000));
BindBuyer(buyer, "正在读取待发货");
// 待发货
readBuyer = buyer.buyer_id;
currentReadBuyer = buyer.buyer_id;
@@ -1004,10 +1031,26 @@ namespace TemuKJD.WXForms.TalkForms
Thread.Sleep(Randomx.GetId(2000, 3000));
top = 0;
lastCefReadOrderTime = DateTime.Now;
while (currentReadBuyer == readBuyer)
{
if (cancellationTokenSource.IsCancellationRequested)
{
BindBuyer(buyer, "已取消读取");
break;
}
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
{
CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
if (buyer.status != "在线")
{
BindBuyer(buyer, "店铺掉线");
break;
}
BindBuyer(buyer, "停滞时间超过30秒,跳过");
break;
}
if (times % 100 == 0)
{
@@ -1042,9 +1085,14 @@ namespace TemuKJD.WXForms.TalkForms
}
}
if (cancellationTokenSource.IsCancellationRequested)
{
BindBuyer(buyer, "已取消读取");
break;
}
Thread.Sleep(Randomx.GetId(2000, 3000));
BindBuyer(buyer, "正在读取已发货");
// 已发货
readBuyer = buyer.buyer_id;
currentReadBuyer = buyer.buyer_id;
@@ -1052,18 +1100,26 @@ namespace TemuKJD.WXForms.TalkForms
Thread.Sleep(Randomx.GetId(2000, 3000));
top = 0;
lastCefReadOrderTime = DateTime.Now;
while (currentReadBuyer == readBuyer)
{
if (cancellationTokenSource.IsCancellationRequested)
{
BindBuyer(buyer, "已取消读取");
break;
}
if (times % 100 == 0)
if (lastCefReadOrderTime < DateTime.Now.AddSeconds(-30))
{
CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
}
if (buyer.status != "在线")
if (buyer.status != "在线")
{
BindBuyer(buyer, "店铺掉线");
break;
}
BindBuyer(buyer, "停滞时间超过30秒,跳过");
break;
times++;
}
Invoke(new Action(() => { buyer.browser.BringToFront(); }));
@@ -1089,6 +1145,11 @@ namespace TemuKJD.WXForms.TalkForms
result.Wait(5000);
}
}
Invoke(new Action(() =>
{
if (row.Cells["colMessage"].Value.ParseToString().StartsWith("正在读取"))
BindBuyer(buyer, " ");
}));
}
catch
{