其他平台买手拍单发送功能 店铺筛选功能逻辑优化
This commit is contained in:
1 parent
2dece676c1
commit
aa45b35145
46 files changed
+4038
-2223
No files matched your search
+38
-18
@@ -86,6 +86,7 @@
|
||||
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
|
||||
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
|
||||
this.btnRefreshOrderApi = new TemuKJD.UserControls.ButtonEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -153,7 +154,7 @@
|
||||
this.panel5.Controls.Add(this.btnCheck);
|
||||
this.panel5.Location = new System.Drawing.Point(1044, 3);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(217, 40);
|
||||
this.panel5.Size = new System.Drawing.Size(217, 52);
|
||||
this.panel5.TabIndex = 1;
|
||||
//
|
||||
// btnRefreshShop
|
||||
@@ -163,14 +164,14 @@
|
||||
this.btnRefreshShop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnRefreshShop.ForeColor = System.Drawing.Color.White;
|
||||
this.btnRefreshShop.Location = new System.Drawing.Point(7, 9);
|
||||
this.btnRefreshShop.Location = new System.Drawing.Point(5, 8);
|
||||
this.btnRefreshShop.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnRefreshShop.Name = "btnRefreshShop";
|
||||
this.btnRefreshShop.Size = new System.Drawing.Size(66, 26);
|
||||
this.btnRefreshShop.TabIndex = 375;
|
||||
this.btnRefreshShop.Text = "刷新店铺";
|
||||
this.btnRefreshShop.UseVisualStyleBackColor = false;
|
||||
this.btnRefreshShop.Click += new System.EventHandler(this.btnRefreshCookie_Click);
|
||||
this.btnRefreshShop.Click += new System.EventHandler(this.btnRefreshShop_Click);
|
||||
//
|
||||
// btnLoginSelect
|
||||
//
|
||||
@@ -179,7 +180,7 @@
|
||||
this.btnLoginSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnLoginSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnLoginSelect.ForeColor = System.Drawing.Color.White;
|
||||
this.btnLoginSelect.Location = new System.Drawing.Point(148, 9);
|
||||
this.btnLoginSelect.Location = new System.Drawing.Point(148, 8);
|
||||
this.btnLoginSelect.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnLoginSelect.Name = "btnLoginSelect";
|
||||
this.btnLoginSelect.Size = new System.Drawing.Size(66, 26);
|
||||
@@ -195,7 +196,7 @@
|
||||
this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnCheck.ForeColor = System.Drawing.Color.White;
|
||||
this.btnCheck.Location = new System.Drawing.Point(78, 9);
|
||||
this.btnCheck.Location = new System.Drawing.Point(77, 8);
|
||||
this.btnCheck.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnCheck.Name = "btnCheck";
|
||||
this.btnCheck.Size = new System.Drawing.Size(66, 26);
|
||||
@@ -206,6 +207,7 @@
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.Controls.Add(this.btnRefreshOrderApi);
|
||||
this.panel4.Controls.Add(this.label5);
|
||||
this.panel4.Controls.Add(this.btnImport);
|
||||
this.panel4.Controls.Add(this.btnAddShop);
|
||||
@@ -241,7 +243,7 @@
|
||||
this.btnImport.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnImport.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnImport.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnImport.Location = new System.Drawing.Point(72, 9);
|
||||
this.btnImport.Location = new System.Drawing.Point(72, 8);
|
||||
this.btnImport.Name = "btnImport";
|
||||
this.btnImport.Size = new System.Drawing.Size(66, 26);
|
||||
this.btnImport.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -265,7 +267,7 @@
|
||||
this.btnAddShop.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnAddShop.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnAddShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAddShop.Location = new System.Drawing.Point(3, 9);
|
||||
this.btnAddShop.Location = new System.Drawing.Point(3, 8);
|
||||
this.btnAddShop.Name = "btnAddShop";
|
||||
this.btnAddShop.Size = new System.Drawing.Size(66, 26);
|
||||
this.btnAddShop.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -291,10 +293,10 @@
|
||||
this.btnOpenOrder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnOpenOrder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnOpenOrder.ForeColor = System.Drawing.Color.White;
|
||||
this.btnOpenOrder.Location = new System.Drawing.Point(933, 9);
|
||||
this.btnOpenOrder.Location = new System.Drawing.Point(924, 8);
|
||||
this.btnOpenOrder.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnOpenOrder.Name = "btnOpenOrder";
|
||||
this.btnOpenOrder.Size = new System.Drawing.Size(100, 25);
|
||||
this.btnOpenOrder.Size = new System.Drawing.Size(93, 25);
|
||||
this.btnOpenOrder.TabIndex = 466;
|
||||
this.btnOpenOrder.Text = "登录订单系统";
|
||||
this.btnOpenOrder.UseVisualStyleBackColor = false;
|
||||
@@ -303,7 +305,7 @@
|
||||
// chkUsePddWorkbanch
|
||||
//
|
||||
this.chkUsePddWorkbanch.AutoSize = true;
|
||||
this.chkUsePddWorkbanch.Location = new System.Drawing.Point(800, 11);
|
||||
this.chkUsePddWorkbanch.Location = new System.Drawing.Point(796, 10);
|
||||
this.chkUsePddWorkbanch.Name = "chkUsePddWorkbanch";
|
||||
this.chkUsePddWorkbanch.Size = new System.Drawing.Size(128, 21);
|
||||
this.chkUsePddWorkbanch.TabIndex = 417;
|
||||
@@ -315,7 +317,7 @@
|
||||
// cmbNotes
|
||||
//
|
||||
this.cmbNotes.FormattingEnabled = true;
|
||||
this.cmbNotes.Location = new System.Drawing.Point(522, 10);
|
||||
this.cmbNotes.Location = new System.Drawing.Point(522, 9);
|
||||
this.cmbNotes.Name = "cmbNotes";
|
||||
this.cmbNotes.Size = new System.Drawing.Size(120, 25);
|
||||
this.cmbNotes.TabIndex = 413;
|
||||
@@ -326,7 +328,7 @@
|
||||
this.btnEmpty.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.btnEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnEmpty.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnEmpty.Location = new System.Drawing.Point(718, 9);
|
||||
this.btnEmpty.Location = new System.Drawing.Point(718, 8);
|
||||
this.btnEmpty.Name = "btnEmpty";
|
||||
this.btnEmpty.Size = new System.Drawing.Size(66, 26);
|
||||
this.btnEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -352,7 +354,7 @@
|
||||
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnSearch.ForeColor = System.Drawing.Color.White;
|
||||
this.btnSearch.Location = new System.Drawing.Point(647, 9);
|
||||
this.btnSearch.Location = new System.Drawing.Point(647, 8);
|
||||
this.btnSearch.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnSearch.Name = "btnSearch";
|
||||
this.btnSearch.Size = new System.Drawing.Size(66, 26);
|
||||
@@ -364,7 +366,7 @@
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(462, 14);
|
||||
this.label4.Location = new System.Drawing.Point(462, 13);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(68, 17);
|
||||
this.label4.TabIndex = 377;
|
||||
@@ -372,7 +374,7 @@
|
||||
//
|
||||
// txtShopName
|
||||
//
|
||||
this.txtShopName.Location = new System.Drawing.Point(352, 11);
|
||||
this.txtShopName.Location = new System.Drawing.Point(352, 10);
|
||||
this.txtShopName.Name = "txtShopName";
|
||||
this.txtShopName.Size = new System.Drawing.Size(110, 23);
|
||||
this.txtShopName.TabIndex = 374;
|
||||
@@ -380,7 +382,7 @@
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(304, 14);
|
||||
this.label3.Location = new System.Drawing.Point(304, 13);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(56, 17);
|
||||
this.label3.TabIndex = 375;
|
||||
@@ -388,7 +390,7 @@
|
||||
//
|
||||
// txtShopId
|
||||
//
|
||||
this.txtShopId.Location = new System.Drawing.Point(194, 11);
|
||||
this.txtShopId.Location = new System.Drawing.Point(194, 10);
|
||||
this.txtShopId.Name = "txtShopId";
|
||||
this.txtShopId.Size = new System.Drawing.Size(110, 23);
|
||||
this.txtShopId.TabIndex = 372;
|
||||
@@ -396,7 +398,7 @@
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(146, 14);
|
||||
this.label2.Location = new System.Drawing.Point(146, 13);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(55, 17);
|
||||
this.label2.TabIndex = 373;
|
||||
@@ -764,6 +766,23 @@
|
||||
this.statusBar.Size = new System.Drawing.Size(1264, 29);
|
||||
this.statusBar.TabIndex = 1;
|
||||
//
|
||||
// btnRefreshOrderApi
|
||||
//
|
||||
this.btnRefreshOrderApi.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnRefreshOrderApi.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnRefreshOrderApi.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnRefreshOrderApi.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnRefreshOrderApi.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnRefreshOrderApi.ForeColor = System.Drawing.Color.White;
|
||||
this.btnRefreshOrderApi.Location = new System.Drawing.Point(924, 35);
|
||||
this.btnRefreshOrderApi.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnRefreshOrderApi.Name = "btnRefreshOrderApi";
|
||||
this.btnRefreshOrderApi.Size = new System.Drawing.Size(93, 25);
|
||||
this.btnRefreshOrderApi.TabIndex = 832;
|
||||
this.btnRefreshOrderApi.Text = "刷新订单Api";
|
||||
this.btnRefreshOrderApi.UseVisualStyleBackColor = false;
|
||||
this.btnRefreshOrderApi.Click += new System.EventHandler(this.btnRefreshOrderApi_Click);
|
||||
//
|
||||
// PDDShopListForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@@ -855,5 +874,6 @@
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
|
||||
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
|
||||
private System.Windows.Forms.Label label5;
|
||||
public UserControls.ButtonEx btnRefreshOrderApi;
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
public static PDDShopListForm Instance { get { if (_instance == null) { _instance = new PDDShopListForm(); } return _instance; } set { _instance = value; } }
|
||||
public static bool IsOperate { get; set; } = false;
|
||||
private bool isLoading { get; set; } = false;
|
||||
public ConcurrentList<AuthInfo> lstPddOrderAuthInfo = new ConcurrentList<AuthInfo>();
|
||||
|
||||
#region 服务端店铺管理
|
||||
public static void UpdateShop()
|
||||
@@ -265,13 +266,13 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
else
|
||||
{
|
||||
ShopBLL.AddServerShop(shopInfo);
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.MdyPDDWXServerShopSubInfo(shopInfo);
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,7 +293,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
StartUp.SaveLocalShopLoginInfo();
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}));
|
||||
});
|
||||
}
|
||||
@@ -301,7 +302,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
{
|
||||
IsOperate = true;
|
||||
ImportShop();
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
|
||||
void ImportShop()
|
||||
@@ -469,6 +470,9 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
}
|
||||
else
|
||||
{
|
||||
var auth = lstPddOrderAuthInfo.FirstOrDefault(a => a.ShopId == param.ShopId);
|
||||
if (auth == null)
|
||||
auth = new AuthInfo() { ShopId = param.ShopId };
|
||||
int rowIndex = this.dgvShop.Rows.Add(
|
||||
isRowCheck,
|
||||
param.LoginName,
|
||||
@@ -486,7 +490,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
"购买授权",
|
||||
"绑定授权" + (param.AuthExpiresTime < DateTime.Now ? " (已过期)" : param.AuthExpiresTime.ToString(" MM-dd")),
|
||||
"购买授权",
|
||||
"绑定授权",
|
||||
"绑定授权" + (auth.ExpiresTime < DateTime.Now ? " (已过期)" : auth.ExpiresTime.ToString(" MM-dd")),
|
||||
"进入",
|
||||
"检测",
|
||||
string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim(),
|
||||
@@ -512,6 +516,11 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
{
|
||||
if (dgvr == null || param == null)
|
||||
return;
|
||||
|
||||
var auth = lstPddOrderAuthInfo.FirstOrDefault(a => a.ShopId == param.ShopId);
|
||||
if (auth == null)
|
||||
auth = new AuthInfo() { ShopId = param.ShopId };
|
||||
|
||||
dgvr.Cells["colCookie"].Value = param.Cookies;
|
||||
dgvr.Cells["colApiAuth"].Value = param.ApiAuthStatus;
|
||||
dgvr.Cells["colBuyApiAuth"].Value = param.BuyApiAuth.ApiAuthStatus;
|
||||
@@ -525,12 +534,19 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
dgvr.Cells["colChatAccount"].Value = param.ChatAccount;
|
||||
dgvr.Cells["colRelogin"].Value = string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim();
|
||||
dgvr.Cells["colBindApi"].Value = "绑定授权" + (param.AuthExpiresTime < DateTime.Now ? " (已过期)" : param.AuthExpiresTime.ToString(" MM-dd"));
|
||||
dgvr.Cells["colBindOrderApi"].Value = "绑定授权" + (auth.ExpiresTime < DateTime.Now ? " (已过期)" : auth.ExpiresTime.ToString(" MM-dd"));
|
||||
}
|
||||
|
||||
void displayShopStatus(ShopLoginInfo shop)
|
||||
{
|
||||
bool canUse = shop.LoginStatus == "登录成功";
|
||||
bool apiAuth = shop.AuthExpiresTime > DateTime.Now;
|
||||
|
||||
var orderApiAuthInfo = lstPddOrderAuthInfo.FirstOrDefault(a => a.ShopId == shop.ShopId);
|
||||
if (orderApiAuthInfo == null)
|
||||
orderApiAuthInfo = new AuthInfo() { ShopId = shop.ShopId };
|
||||
bool orderApiAuth = orderApiAuthInfo.ExpiresTime > DateTime.Now;
|
||||
|
||||
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopId"].Value.ParseToString() == shop?.ShopId);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
@@ -543,6 +559,11 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
(row.Cells["colBindApi"] as DataGridViewLinkCell).LinkColor = apiAuth ? Color.Blue : Color.Red;
|
||||
(row.Cells["colBindApi"] as DataGridViewLinkCell).ActiveLinkColor = apiAuth ? Color.LightBlue : Color.OrangeRed;
|
||||
(row.Cells["colBindApi"] as DataGridViewLinkCell).VisitedLinkColor = apiAuth ? Color.DarkBlue : Color.DarkRed;
|
||||
|
||||
(row.Cells["colBindOrderApi"] as DataGridViewLinkCell).Style.ForeColor = orderApiAuth ? Color.Blue : Color.Red;
|
||||
(row.Cells["colBindOrderApi"] as DataGridViewLinkCell).LinkColor = orderApiAuth ? Color.Blue : Color.Red;
|
||||
(row.Cells["colBindOrderApi"] as DataGridViewLinkCell).ActiveLinkColor = orderApiAuth ? Color.LightBlue : Color.OrangeRed;
|
||||
(row.Cells["colBindOrderApi"] as DataGridViewLinkCell).VisitedLinkColor = orderApiAuth ? Color.DarkBlue : Color.DarkRed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,12 +696,26 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
return "";
|
||||
}
|
||||
|
||||
bool isFirst = true;
|
||||
private void ShopListForm_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Visible == true)
|
||||
{
|
||||
this.pbLoading.Visible = true;
|
||||
RefreshDataGridView(true);
|
||||
Task.Run(() =>
|
||||
{
|
||||
RefreshDataGridView(true);
|
||||
|
||||
if (isFirst)
|
||||
{
|
||||
isFirst = false;
|
||||
while (isLoading)
|
||||
Thread.Sleep(1000);
|
||||
|
||||
RefreshOrderApi();
|
||||
RefreshDataGridView(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,6 +752,11 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
// shop.ShopSubAccountList.AddRange(shopSubAccountList.Where(s => s.shop_login_name == shop.LoginName));
|
||||
// }
|
||||
//}
|
||||
|
||||
lstPddOrderAuthInfo = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ConcurrentList<AuthInfo>>("pdd_order_api_auth_lst");
|
||||
if (lstPddOrderAuthInfo == null)
|
||||
lstPddOrderAuthInfo = new ConcurrentList<AuthInfo>();
|
||||
|
||||
foreach (var shop in GlobalConfig.ShopLoginList)
|
||||
{
|
||||
shop.ShopSubAccountList.Clear();
|
||||
@@ -859,7 +899,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
IsOperate = false;
|
||||
break;
|
||||
@@ -875,7 +915,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -894,7 +934,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
shopLoginForm.AuthClientId = currentPddClient.client_id;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -909,7 +949,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -926,7 +966,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
//shopLoginForm.AuthClientId = currentPddClient.client_id;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1011,7 +1051,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
}
|
||||
}
|
||||
|
||||
private void btnRefreshCookie_Click(object sender, EventArgs e)
|
||||
private void btnRefreshShop_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.pbLoading.Visible = true;
|
||||
this.splitContainer1.Panel1.Enabled = false;
|
||||
@@ -1098,7 +1138,7 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
shopLoginForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
btnRefreshCookie_Click(null, null);
|
||||
btnRefreshShop_Click(null, null);
|
||||
}
|
||||
PDDShopListForm.IsOperate = false;
|
||||
}
|
||||
@@ -1245,5 +1285,50 @@ function setCookie(name, value, daysToLive, path, domain, secure, httpOnly, same
|
||||
shopLoginForm.InitUrl = "https://po.e57.cn/login?redirect=%2Findex";
|
||||
shopLoginForm.Show();
|
||||
}
|
||||
|
||||
public void RefreshOrderApi(bool isForceRefresh = false)
|
||||
{
|
||||
foreach (var shop in GlobalConfig.ShopLoginList)
|
||||
{
|
||||
var authExist = lstPddOrderAuthInfo.FirstOrDefault(s => s.ShopId == shop.ShopId);
|
||||
if (authExist == null)
|
||||
authExist = new AuthInfo() { ShopId = shop.ShopId };
|
||||
var auth = PddApiHelper.RefreshOrderApi(authExist, isForceRefresh);
|
||||
lstPddOrderAuthInfo.RemoveAll(a => a.ShopId == auth.ShopId);
|
||||
lstPddOrderAuthInfo.Add(auth);
|
||||
}
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_order_api_auth_lst", lstPddOrderAuthInfo);
|
||||
}
|
||||
|
||||
private void btnRefreshOrderApi_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.pbLoading.Visible = true;
|
||||
this.splitContainer1.Panel1.Enabled = false;
|
||||
var t = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
RefreshOrderApi(true);
|
||||
RefreshDataGridView(false);
|
||||
}
|
||||
catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); }
|
||||
});
|
||||
Task.Run(() =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
if (t.IsCompleted || t.IsCanceled || t.IsFaulted)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
this.pbLoading.Visible = false;
|
||||
this.splitContainer1.Panel1.Enabled = true;
|
||||
}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user