店铺优化相关功能

This commit is contained in:
wule committed 2026-04-24 21:48:22 +08:00
1 parent 9805792aed
commit 0e6a927cf2
43 files changed
+3305 -1604

No files matched your search

@@ -701,7 +701,10 @@ namespace TemuKJD.PDDForms.AdminForms
}
if (html.Contains("\"code\":200") || html.Contains("已存在"))
{
successCount++;
CheckShopLogin(new ShopLoginInfo[] { shop }, false);
}
else
failCount++;
Thread.Sleep(100);
@@ -71,6 +71,7 @@ namespace TemuKJD.PDDForms.ProductForms
string sVioInfo = JsonHelper.SerializeObject(jObj);
var punishUuid = BaseRegex.GetStringJson(ref sVioInfo, "punishUuid");
var punishReason = BaseRegex.GetStringJson(ref sVioInfo, "punishReason");
var punishTime = BaseClass.StampToDateTime(BaseRegex.GetIntJson(ref sVioInfo, "punishTime"));
var productId = BaseRegex.GetStringJson(ref sVioInfo, "productId");
var productDesc = BaseRegex.GetStringJson(ref sVioInfo, "productDesc");
//相似同款低质商品 不当使用他人权利
@@ -82,7 +83,7 @@ namespace TemuKJD.PDDForms.ProductForms
var url = BaseClass.BuildPDDObjString("product/mdy_violation_prod");
var data = UserLogin.GetSignaturex();
data += "&wx_safe_status=违规商品";
data += "&notes=" + ("违规轮询-" + shop.ShopId + "-" + punishUuid + "-" + punishReason).Trim();
data += "&notes=" + GetHtml.UrlEncodeUtf8(("违规轮询-" + shop.ShopId + "-" + punishUuid + "-" + punishReason + "-" + punishTime.ToString("yy/MM/dd HH:mm")).Trim());
data += "&product_name=" + productDesc;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -8685,6 +8685,7 @@ Content-Type: image/jpeg
continue;
}
randomShopLst.Clear();
randomShopLst.AddRange(GlobalConfig.ShopLoginList.Where(s => shopIdLst.Contains(s.ShopId) && s.LoginStatus == "登录成功"));
if (randomShopLst.Count == 0)
{
@@ -8865,7 +8866,7 @@ Content-Type: image/jpeg
var rw = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ParseToString() == shop.ShopId);
if (rw != null)
row.Cells["colSelect"].Value = false;
rw.Cells["colSelect"].Value = false;
}));
continue;
}
@@ -9225,7 +9226,11 @@ Content-Type: image/jpeg
if (panel2.Controls.Contains(cefWebBrowser))
{
panel2.Controls.Remove(cefWebBrowser);
cefWebBrowser.Dispose();
Task.Run(() =>
{
Thread.Sleep(60000);
Invoke(new Action(() => { cefWebBrowser.Dispose(); }));
});
shop.Chat = null;
}
}));
@@ -9446,7 +9451,11 @@ Content-Type: image/jpeg
if (panel2.Controls.Contains(cefWebBrowser))
{
panel2.Controls.Remove(cefWebBrowser);
cefWebBrowser.Dispose();
Task.Run(() =>
{
Thread.Sleep(60000);
Invoke(new Action(() => { cefWebBrowser.Dispose(); }));
});
shop.Chat = null;
}
}));
@@ -9558,6 +9567,8 @@ Content-Type: image/jpeg
for (int i = 0; i < prodRstObj["goods_property_list"].Count(); i++)
{
var propObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["goods_property_list"][i]));
//if (propObj["vid"].ParseToInt() == 0)
// continue;
propObj["value"] = propObj["vvalue"];
propObj["value_unit"] = propObj["punit"];
propObj.Remove("vvalue");
@@ -9936,13 +9947,24 @@ Content-Type: image/jpeg
#region 生成属性规格id
if (dbProd.product_get_type_text == "厂商直采")
{
var apiGetPddSpecIdRst = ApiGetPddSpecId(shop, prodInfo, addPriceSkuInfoLst, cell);
// 接口获取到的spec可能和模拟提交的商品spec不符合,尽量使用模拟提交的spec
prodInfo.detail.cat_id = prodRstObj["cat_id"].ParseToInt();
var specNameDic = new Dictionary<long, string>();
for (int i = 0; i < 1 && i < prodRstObj["sku_list"].Count(); i++)
{
var skuObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["sku_list"][i]));
foreach (var specObj in skuObj["spec"])
{
specNameDic[specObj["parent_id"].ParseToLong()] = specObj["parent_name"].ParseToString();
}
}
var apiGetPddSpecIdRst = ApiGetPddSpecId(shop, prodInfo, addPriceSkuInfoLst, cell, specNameDic);
if (!apiGetPddSpecIdRst.IsNullOrEmpty() && apiGetPddSpecIdRst != "success")
return apiGetPddSpecIdRst;
}
#endregion
#region // 添加一个多件sku,库存设置为0
#region 添加一个多件sku,库存设置为0
if (chkMultiPcsSku.Checked)
{
var addMulitPcsSkuRst = AddMulitPcsSku(shop, addPriceSkuInfoLst, skuFakeSpecNameDic1);
@@ -9953,12 +9975,39 @@ Content-Type: image/jpeg
#region 拼接sku,计算最高价格和最低价格
var skuApiString = "";
var apiGetSkuRst = ApiGetPddSku(ref skuApiString, shop, addPriceSkuInfoLst, fakeImg, skuFakeSpecNameDic1, skuFakeSpecNameDic2, cell);
var apiGetSkuRst = ApiGetPddSku(ref skuApiString, shop, addPriceSkuInfoLst, fakeImg, skuFakeSpecNameDic1, skuFakeSpecNameDic2, cell, true);
if (!apiGetSkuRst.IsNullOrEmpty() && apiGetSkuRst != "success")
return apiGetSkuRst;
pddApi.Data["sku_list"] = "[" + skuApiString.Trim(',') + "]";
#endregion
#region 按原商品拼接sku语句,作废
string skuStr = "";
if (1 == 1)
{
for (int i = 0; i < prodRstObj["sku_list"].Count(); i++)
{
var skuObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["sku_list"][i]));
skuObj["sku_properties"] = skuObj["sku_property_list"];
skuObj["quantity"] = 0;
string spec = "";
foreach (var specObj in skuObj["spec"])
{
spec += "," + specObj["spec_id"].ParseToString();
}
spec = spec.Trim(',');
skuObj["spec_id_list"] = "[" + spec + "]";
skuObj.Remove("sku_property_list");
//skuObj.Remove("sku_properties");
skuObj.Remove("spec");
skuStr += JsonHelper.SerializeObject(skuObj) + ",";
}
skuStr = skuStr.Trim(',');
if (1 == 2)
pddApi.Data["sku_list"] = "[" + skuStr + "]";
}
#endregion
#region 计算转换列表内是否有符合条件的转换商品
var addPriceSkuInfoMinPrice = addPriceSkuInfoLst.Min(s => s.price);
var addPriceSkuInfoMaxPrice = addPriceSkuInfoLst.Max(s => s.price);
@@ -9978,7 +10027,6 @@ Content-Type: image/jpeg
}
};
Invoke(new Action(() =>
{
if (cell != null)
@@ -10027,7 +10075,7 @@ Content-Type: image/jpeg
/// <param name="addPriceSkuInfoLst"></param>
/// <param name="cell"></param>
/// <returns></returns>
private string ApiGetPddSpecId(ShopLoginInfo shop, PDDProductInfo prodInfo, List<sku_item> addPriceSkuInfoLst, DataGridViewCell cell)
private string ApiGetPddSpecId(ShopLoginInfo shop, PDDProductInfo prodInfo, List<sku_item> addPriceSkuInfoLst, DataGridViewCell cell, Dictionary<long, string> specNameDic = null)
{
PddApi PddGoodsSpecGetApi = new PddApi(shop);
PddGoodsSpecGetApi.Data["cat_id"] = prodInfo.detail.cat_id;
@@ -10040,7 +10088,8 @@ Content-Type: image/jpeg
return "初始化Sku属性失败 " + errMsg;
}
Dictionary<long, string> specNameDic = new Dictionary<long, string>();
if (specNameDic == null)
specNameDic = new Dictionary<long, string>();
foreach (var jObj in JsonHelper.JObjectParse(PddGoodsSpecGetApiRst)["goods_spec_get_response"]["goods_spec_list"])
{
string specStr = JsonHelper.SerializeObject(jObj);
@@ -10196,7 +10245,7 @@ Content-Type: image/jpeg
}
private string ApiGetPddSku(ref string skuApiString, ShopLoginInfo shop, List<sku_item> addPriceSkuInfoLst, Image fakeImg,
Dictionary<string, string> skuFakeSpecNameDic1, Dictionary<string, string> skuFakeSpecNameDic2, DataGridViewCell cell)
Dictionary<string, string> skuFakeSpecNameDic1, Dictionary<string, string> skuFakeSpecNameDic2, DataGridViewCell cell, bool isEdit = false)
{
Dictionary<string, string> skuImgDic = new Dictionary<string, string>();
// 拼接sku,计算最高价格和最低价格
@@ -10261,11 +10310,49 @@ Content-Type: image/jpeg
int weight = addPriceSkuInfoLst[i].weight.IsNullOrZero() ? 1000 : addPriceSkuInfoLst[i].weight.ParseToInt();
skuApiString += ",{\"is_onsale\":" + addPriceSkuInfoLst[i].is_onsale + ",\"limit_quantity\":" + addPriceSkuInfoLst[i].limit_quantity +
",\"price\":\"" + addPriceSkuInfoLst[i].price + "\",\"weight\":" + weight + ",\"multi_price\":\"" + addPriceSkuInfoLst[i].multi_price +
"\",\"thumb_url\":\"" + thumb_url + "\",\"out_sku_sn\":\"" + addPriceSkuInfoLst[i].out_sku_sn +
"\",\"quantity\":" + addPriceSkuInfoLst[i].quantity + ",\"spec_id_list\":\"[" + spec + "]\"}";
//skuApiString += ",{\"is_onsale\":" + addPriceSkuInfoLst[i].is_onsale + ",\"limit_quantity\":" + addPriceSkuInfoLst[i].limit_quantity +
// ",\"price\":\"" + addPriceSkuInfoLst[i].price + "\",\"weight\":" + weight + ",\"multi_price\":\"" + addPriceSkuInfoLst[i].multi_price +
// "\",\"thumb_url\":\"" + thumb_url + "\",\"out_sku_sn\":\"" + addPriceSkuInfoLst[i].out_sku_sn +
// "\",\"quantity\":" + addPriceSkuInfoLst[i].quantity + ",\"spec_id_list\":\"[" + spec + "]\"}";
var skuApiObj = new JObject();
skuApiObj["is_onsale"] = addPriceSkuInfoLst[i].is_onsale;
skuApiObj["limit_quantity"] = addPriceSkuInfoLst[i].limit_quantity;
skuApiObj["multi_price"] = addPriceSkuInfoLst[i].multi_price;
skuApiObj["price"] = addPriceSkuInfoLst[i].price;
skuApiObj["weight"] = weight;
skuApiObj["thumb_url"] = thumb_url;
skuApiObj["out_sku_sn"] = addPriceSkuInfoLst[i].out_sku_sn;
skuApiObj["quantity"] = addPriceSkuInfoLst[i].quantity;
skuApiObj["spec_id_list"] = "[" + spec + "]";
if (isEdit)
{
skuApiObj["sku_id"] = null;
//skuApiObj.RemoveAll();
//skuApiObj["out_sku_sn"] = addPriceSkuInfoLst[i].out_sku_sn;
//skuApiObj["multi_price"] = addPriceSkuInfoLst[i].multi_price;
//skuApiObj["thumb_url"] = thumb_url;
//skuApiObj["quantity"] = addPriceSkuInfoLst[i].quantity;
//skuApiObj["sku_pre_sale_time"] = 0;
//skuApiObj["reserve_quantity"] = 0;
//skuApiObj["length"] = null;
//skuApiObj["weight"] = 0;
//skuApiObj["sku_id"] = null;
//skuApiObj["oversea_sku"] = new JObject();
//skuApiObj["oversea_sku"]["record_id_list"] = null;
//skuApiObj["oversea_sku"]["measurement_code"] = null;
//skuApiObj["oversea_sku"]["measurement_unit"] = null;
//skuApiObj["oversea_sku"]["specifications"] = null;
//skuApiObj["oversea_sku"]["taxation"] = null;
//skuApiObj["is_onsale"] = addPriceSkuInfoLst[i].is_onsale;
//skuApiObj["out_source_sku_id"] = null;
//skuApiObj["price"] = addPriceSkuInfoLst[i].price;
//skuApiObj["limit_quantity"] = 999999;
//skuApiObj["sku_properties"] = null;
//skuApiObj["spec_id_list"] = "[" + spec + "]";
}
skuApiString += "," + JsonHelper.SerializeObject(skuApiObj);
}
return "success";
}
+58 -36
View File
@@ -55,6 +55,8 @@
this.btnRefreshAuth = new TemuKJD.UserControls.ButtonEx();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMallId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -70,6 +72,8 @@
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colBuyApi = new System.Windows.Forms.DataGridViewLinkColumn();
this.colBindApi = new System.Windows.Forms.DataGridViewLinkColumn();
this.colBuyOrderApi = new System.Windows.Forms.DataGridViewLinkColumn();
this.colBindOrderApi = new System.Windows.Forms.DataGridViewLinkColumn();
this.colGotoShop = new System.Windows.Forms.DataGridViewLinkColumn();
this.colShopOperate = new System.Windows.Forms.DataGridViewLinkColumn();
this.colRelogin = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -81,8 +85,6 @@
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -459,6 +461,8 @@
this.colLoginStatus,
this.colBuyApi,
this.colBindApi,
this.colBuyOrderApi,
this.colBindOrderApi,
this.colGotoShop,
this.colShopOperate,
this.colRelogin,
@@ -480,6 +484,31 @@
this.dgvShop.TabIndex = 5;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
// chkAutoDrag
//
this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.chkAutoDrag.AutoSize = true;
this.chkAutoDrag.BackColor = System.Drawing.Color.White;
this.chkAutoDrag.Location = new System.Drawing.Point(1108, 2);
this.chkAutoDrag.Name = "chkAutoDrag";
this.chkAutoDrag.Size = new System.Drawing.Size(159, 21);
this.chkAutoDrag.TabIndex = 3;
this.chkAutoDrag.Text = "登录时自动滑动拼图验证";
this.chkAutoDrag.UseVisualStyleBackColor = false;
this.chkAutoDrag.Visible = false;
this.chkAutoDrag.Click += new System.EventHandler(this.chkAutoDrag_Click);
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Bottom;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, -1);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1264, 29);
this.statusBar.TabIndex = 1;
//
// colSelect
//
this.colSelect.FillWeight = 26F;
@@ -578,23 +607,39 @@
// colBuyApi
//
this.colBuyApi.FillWeight = 46F;
this.colBuyApi.HeaderText = "购买授权";
this.colBuyApi.HeaderText = "上传Api";
this.colBuyApi.Name = "colBuyApi";
this.colBuyApi.ReadOnly = true;
//
// colBindApi
//
this.colBindApi.FillWeight = 46F;
this.colBindApi.HeaderText = "绑定授权";
this.colBindApi.FillWeight = 48F;
this.colBindApi.HeaderText = "上传授权";
this.colBindApi.Name = "colBindApi";
this.colBindApi.ReadOnly = true;
this.colBindApi.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colBindApi.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colBuyOrderApi
//
this.colBuyOrderApi.FillWeight = 46F;
this.colBuyOrderApi.HeaderText = "订单Api";
this.colBuyOrderApi.Name = "colBuyOrderApi";
this.colBuyOrderApi.ReadOnly = true;
this.colBuyOrderApi.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colBuyOrderApi.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colBindOrderApi
//
this.colBindOrderApi.FillWeight = 48F;
this.colBindOrderApi.HeaderText = "订单授权";
this.colBindOrderApi.Name = "colBindOrderApi";
this.colBindOrderApi.ReadOnly = true;
//
// colGotoShop
//
this.colGotoShop.FillWeight = 46F;
this.colGotoShop.HeaderText = "进入店铺";
this.colGotoShop.FillWeight = 38F;
this.colGotoShop.HeaderText = "进店";
this.colGotoShop.Name = "colGotoShop";
this.colGotoShop.ReadOnly = true;
this.colGotoShop.Resizable = System.Windows.Forms.DataGridViewTriState.True;
@@ -612,7 +657,7 @@
//
// colRelogin
//
this.colRelogin.FillWeight = 40F;
this.colRelogin.FillWeight = 38F;
this.colRelogin.HeaderText = "登录";
this.colRelogin.Name = "colRelogin";
this.colRelogin.ReadOnly = true;
@@ -677,7 +722,7 @@
//
// colEdit
//
this.colEdit.FillWeight = 46F;
this.colEdit.FillWeight = 38F;
this.colEdit.HeaderText = "编辑";
this.colEdit.Name = "colEdit";
this.colEdit.ReadOnly = true;
@@ -686,36 +731,11 @@
//
// colDelete
//
this.colDelete.FillWeight = 46F;
this.colDelete.FillWeight = 38F;
this.colDelete.HeaderText = "删除";
this.colDelete.Name = "colDelete";
this.colDelete.ReadOnly = true;
//
// chkAutoDrag
//
this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.chkAutoDrag.AutoSize = true;
this.chkAutoDrag.BackColor = System.Drawing.Color.White;
this.chkAutoDrag.Location = new System.Drawing.Point(1108, 2);
this.chkAutoDrag.Name = "chkAutoDrag";
this.chkAutoDrag.Size = new System.Drawing.Size(159, 21);
this.chkAutoDrag.TabIndex = 3;
this.chkAutoDrag.Text = "登录时自动滑动拼图验证";
this.chkAutoDrag.UseVisualStyleBackColor = false;
this.chkAutoDrag.Visible = false;
this.chkAutoDrag.Click += new System.EventHandler(this.chkAutoDrag_Click);
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Bottom;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, -1);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1264, 29);
this.statusBar.TabIndex = 1;
//
// PDDShopListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -777,6 +797,7 @@
private UserControls.ButtonEx btnRefreshShop;
private System.Windows.Forms.ComboBox cmbNotes;
private UserComponent.UcCheckBox chkUsePddWorkbanch;
public UserControls.ButtonEx btnOpenOrder;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colMallId;
@@ -792,6 +813,8 @@
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewLinkColumn colBuyApi;
private System.Windows.Forms.DataGridViewLinkColumn colBindApi;
private System.Windows.Forms.DataGridViewLinkColumn colBuyOrderApi;
private System.Windows.Forms.DataGridViewLinkColumn colBindOrderApi;
private System.Windows.Forms.DataGridViewLinkColumn colGotoShop;
private System.Windows.Forms.DataGridViewLinkColumn colShopOperate;
private System.Windows.Forms.DataGridViewLinkColumn colRelogin;
@@ -803,6 +826,5 @@
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
public UserControls.ButtonEx btnOpenOrder;
}
}
+38 -5
View File
@@ -485,6 +485,8 @@ namespace TemuKJD.PDDForms.ShopForms
"",
"购买授权",
"绑定授权",
"购买授权",
"绑定授权",
"进入",
"检测",
string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim(),
@@ -759,7 +761,8 @@ namespace TemuKJD.PDDForms.ShopForms
switch (headerText)
{
case "检测":
//CheckShopLoginAsync(new string[] { loginName });
//CheckShopLoginAsync(new string[] { loginName });
case "进店":
case "进入店铺":
IsOperate = true;
{
@@ -839,7 +842,7 @@ namespace TemuKJD.PDDForms.ShopForms
}
IsOperate = false;
break;
case "购买授权":
case "上传Api":
{
var currentPddClient = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.is_current == true);
if (currentPddClient != null)
@@ -855,7 +858,7 @@ namespace TemuKJD.PDDForms.ShopForms
}
}
break;
case "绑定授权":
case "上传授权":
{
var currentPddClient = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.is_current == true);
if (currentPddClient != null)
@@ -874,6 +877,36 @@ namespace TemuKJD.PDDForms.ShopForms
}
}
break;
case "订单Api":
{
var currentPddClient = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.is_current == true);
if (currentPddClient != null)
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/service-detail?detailId=84862";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
}
}
break;
case "订单授权":
{
var currentPddClient = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.is_current == true);
if (currentPddClient != null)
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia +
"&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login?source=pdd_code_pixiu") + "&response_type=code";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.AuthClientId = currentPddClient.client_id;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
}
}
break;
//case "多重登录":
// IsOperate = true;
// ShopLoginForm shopMultiLoginForm = new ShopLoginForm(shop);
@@ -932,7 +965,7 @@ namespace TemuKJD.PDDForms.ShopForms
this.btnCheck.Enabled = false;
var t = Task.Run(() =>
{
UpdateShop();
//UpdateShop();
CheckShopListLogin(shopNameList.Distinct().ToArray());
RefreshDataGridView(false);
});
@@ -1181,7 +1214,7 @@ function setCookie(name, value, daysToLive, path, domain, secure, httpOnly, same
if (shop == null)
shop = new ShopLoginInfo();
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.openType = EnumOpenType.order_login;
shopLoginForm.WindowState = FormWindowState.Maximized;
shopLoginForm.txtUserName.ReadOnly = false;
shopLoginForm.txtPassWord.ReadOnly = false;
@@ -162,6 +162,12 @@
<metadata name="colBindApi.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBuyOrderApi.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBindOrderApi.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colGotoShop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+16 -2
View File
@@ -36,6 +36,7 @@ namespace TemuKJD.PDDForms.ShopForms
login,
manage,
refresh_cookie,
order_login,
}
public partial class PDDShopLoginForm : BaseGeneralForm
{
@@ -515,7 +516,19 @@ namespace TemuKJD.PDDForms.ShopForms
txtAddress.Text = e.Address;
}));
}
if (e.Address == "https://po.e57.cn/login?redirect=%2Findex" && shop != null && !string.IsNullOrEmpty(shop.LoginName))
if (e.Address == "https://po.e57.cn/login?redirect=%2Findex" && openType == EnumOpenType.manage)
{
Task.Run(() =>
{
Thread.Sleep(2000);
Invoke(new Action(() =>
{
if (this.Created && !this.IsDisposed && !this.Disposing)
this.Close();
}));
});
}
if (e.Address == "https://po.e57.cn/login?redirect=%2Findex" && openType == EnumOpenType.order_login && shop != null && !string.IsNullOrEmpty(shop.LoginName))
{
Task.Run(() =>
{
@@ -670,7 +683,8 @@ namespace TemuKJD.PDDForms.ShopForms
if (this.Created && !this.Disposing && !this.IsDisposed)
Invoke(new Action(() =>
{
try { this.TitleText = "店铺登录 - " + GetAntiContentsTimes; } catch { return; }
if (this.Created && !this.Disposing && !this.IsDisposed)
try { this.TitleText = "店铺登录 - " + GetAntiContentsTimes; } catch { return; }
}));
shop.AntiContents.Add(antiContent);
while (shop.AntiContents.Count > 100)