其他平台买手拍单发送功能 店铺筛选功能逻辑优化

This commit is contained in:
wule committed 2026-05-15 19:27:52 +08:00
1 parent 2dece676c1
commit aa45b35145
46 files changed
+4038 -2223

No files matched your search

@@ -802,7 +802,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"是",
"否"});
this.cmbPddRelation.Location = new System.Drawing.Point(777, 7);
this.cmbPddRelation.Location = new System.Drawing.Point(777, 5);
this.cmbPddRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbPddRelation.Name = "cmbPddRelation";
this.cmbPddRelation.Size = new System.Drawing.Size(52, 25);
@@ -857,7 +857,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbCat2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbCat2.FormattingEnabled = true;
this.cmbCat2.Location = new System.Drawing.Point(290, 75);
this.cmbCat2.Location = new System.Drawing.Point(290, 77);
this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat2.Name = "cmbCat2";
this.cmbCat2.Size = new System.Drawing.Size(52, 25);
@@ -894,7 +894,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"普通商品",
"爆款数据"});
this.cmbSpProdType.Location = new System.Drawing.Point(777, 42);
this.cmbSpProdType.Location = new System.Drawing.Point(777, 40);
this.cmbSpProdType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSpProdType.Name = "cmbSpProdType";
this.cmbSpProdType.Size = new System.Drawing.Size(52, 25);
@@ -956,7 +956,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"机会商品",
"以图搜品",
"外部数据"});
this.cmbSourceType.Location = new System.Drawing.Point(290, 40);
this.cmbSourceType.Location = new System.Drawing.Point(290, 42);
this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSourceType.Name = "cmbSourceType";
this.cmbSourceType.Size = new System.Drawing.Size(52, 25);
@@ -1013,7 +1013,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"是",
"否"});
this.cmbWxCat.Location = new System.Drawing.Point(651, 5);
this.cmbWxCat.Location = new System.Drawing.Point(651, 7);
this.cmbWxCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbWxCat.Name = "cmbWxCat";
this.cmbWxCat.Size = new System.Drawing.Size(52, 25);
@@ -1035,7 +1035,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbSort.Items.AddRange(new object[] {
"入库时间",
"曝光量"});
this.cmbSort.Location = new System.Drawing.Point(399, 40);
this.cmbSort.Location = new System.Drawing.Point(399, 42);
this.cmbSort.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSort.Name = "cmbSort";
this.cmbSort.Size = new System.Drawing.Size(52, 25);
@@ -1111,7 +1111,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbGroupFilter.FormattingEnabled = true;
this.cmbGroupFilter.Location = new System.Drawing.Point(181, 40);
this.cmbGroupFilter.Location = new System.Drawing.Point(181, 42);
this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbGroupFilter.Name = "cmbGroupFilter";
this.cmbGroupFilter.Size = new System.Drawing.Size(52, 25);
@@ -1126,7 +1126,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"是",
"否",
"导出未拉回"});
this.cmbExportToOutServer.Location = new System.Drawing.Point(651, 40);
this.cmbExportToOutServer.Location = new System.Drawing.Point(651, 42);
this.cmbExportToOutServer.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbExportToOutServer.Name = "cmbExportToOutServer";
this.cmbExportToOutServer.Size = new System.Drawing.Size(52, 25);
@@ -1162,7 +1162,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"安全商品",
"违规商品",
"未校验"});
this.cmbWxSafe.Location = new System.Drawing.Point(525, 40);
this.cmbWxSafe.Location = new System.Drawing.Point(525, 42);
this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbWxSafe.Name = "cmbWxSafe";
this.cmbWxSafe.Size = new System.Drawing.Size(52, 25);
@@ -1204,7 +1204,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbCat1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbCat1.FormattingEnabled = true;
this.cmbCat1.Location = new System.Drawing.Point(181, 75);
this.cmbCat1.Location = new System.Drawing.Point(181, 77);
this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat1.Name = "cmbCat1";
this.cmbCat1.Size = new System.Drawing.Size(52, 25);
@@ -1226,7 +1226,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbCat3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbCat3.FormattingEnabled = true;
this.cmbCat3.Location = new System.Drawing.Point(399, 75);
this.cmbCat3.Location = new System.Drawing.Point(399, 77);
this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat3.Name = "cmbCat3";
this.cmbCat3.Size = new System.Drawing.Size(52, 25);
@@ -1603,7 +1603,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_db_id
//
this.col_db_id.FillWeight = 50F;
this.col_db_id.FillWeight = 60F;
this.col_db_id.HeaderText = "数据库Id";
this.col_db_id.Name = "col_db_id";
this.col_db_id.ReadOnly = true;
@@ -1829,7 +1829,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSpProdType.HeaderText = "商品类型";
this.colSpProdType.Name = "colSpProdType";
this.colSpProdType.ReadOnly = true;
this.colSpProdType.Visible = false;
//
// colWxSafe
//
@@ -1858,7 +1857,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_edit
//
this.col_edit.FillWeight = 42F;
this.col_edit.FillWeight = 40F;
this.col_edit.HeaderText = "详情";
this.col_edit.Name = "col_edit";
this.col_edit.ReadOnly = true;
@@ -1867,7 +1866,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_delete
//
this.col_delete.FillWeight = 42F;
this.col_delete.FillWeight = 40F;
this.col_delete.HeaderText = "删除";
this.col_delete.Name = "col_delete";
this.col_delete.ReadOnly = true;
@@ -243,7 +243,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
prod.end_words,
prod.fission_words,
prod.product_get_type_text == "厂商直采" ? (prod.product_get_type_text + " " + prod.skc_id).Trim() : prod.product_get_type_text,
prod.special_prod_type,
prod.special_prod_type == "爆款数据" ? "爆款数据" : "普通商品",
prod.wx_safe_status,
prod.add_time.ToString("yy-MM-dd HH:mm"),
prod.mdy_time.ToString("yy-MM-dd HH:mm"),
@@ -251,7 +251,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"删除",
"认领");
dgvDbProduct.Rows[rowIndex].Height = dgvDbProduct.Columns["colMainImg"].Width;
var row = dgvDbProduct.Rows[rowIndex];
row.Height = dgvDbProduct.Columns["colMainImg"].Width;
if (prod.special_prod_type == "爆款数据")
row.Cells["colSpProdType"].Style.ForeColor = Color.Orange;
if (prod.wx_safe_status == "违规商品")
row.Cells["colWxSafe"].Style.ForeColor = Color.Red;
if (prod.wx_safe_status == "安全商品")
row.Cells["colWxSafe"].Style.ForeColor = Color.Green;
}));
}
@@ -1199,7 +1206,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var url1 = BaseClass.BuildPDDObjString("product/wx_api_get_all_cate");
var data1 = UserLogin.GetSignaturex();
data1 += "&token=" + GlobalConfig.WxTokenList.OrderBy(x => Guid.NewGuid()).FirstOrDefault()?.accessToken;
data1 += "&token=" + GlobalConfig.WxGlobalTokenList.OrderBy(x => Guid.NewGuid()).FirstOrDefault()?.accessToken;
var html1 = GetHtml.PostUtf8(url1, data1);
var catDataObj = JsonHelper.JObjectParse(html1)["cats_v2"];
+38 -18
View File
@@ -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;
}
}
+98 -13
View File
@@ -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;
}
}
});
}
}
}