拼多多界面优化 评分考核权限设置
This commit is contained in:
1 parent
ce23b0a49a
commit
05553a3ba3
46 files changed
+1269
-1170
No files matched your search
@@ -84,6 +84,8 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
public int LocationXY = 0;
|
||||
public int LocationSize = 200;
|
||||
|
||||
DateTime nextRefreshTime = DateTime.Now.AddMinutes(30);
|
||||
|
||||
public WxTalkForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -178,9 +180,10 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
Thread.Sleep(100);
|
||||
|
||||
SetMainBrowserUrl(GlobalConfig.ShopLoginList.FirstOrDefault());
|
||||
// 网页初始化
|
||||
LoadShop();
|
||||
RefreshCookie(true);
|
||||
InitOrderForm(); // 加载店铺确认默认店铺后再初始化订单列表读取
|
||||
InitAutoExecute();
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var shopNote in GlobalConfig.ShopLoginList.Select(s => s.Notes).Where(s => !s.IsNullOrEmpty()).Distinct())
|
||||
@@ -205,6 +208,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
try
|
||||
{
|
||||
RefreshCookie(true);
|
||||
LoadShop();
|
||||
}
|
||||
catch (Exception ex) { BaseMsgForm.ShowError("刷新Cookie出错 " + ex.Message); }
|
||||
try
|
||||
@@ -421,7 +425,6 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
|
||||
orderListForm = new BuyerOrderListForm();
|
||||
orderListForm.TopLevel = false;
|
||||
orderListForm.FormBorderStyle = FormBorderStyle.None;
|
||||
@@ -430,7 +433,6 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
orderListForm.lblCurrentShop.Tag = currentShop;
|
||||
tabPage3.Controls.Add(orderListForm);
|
||||
orderListForm.Show();
|
||||
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -664,6 +666,19 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (shop.Chat?.IsBrowserInitialized != true)
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
|
||||
if (shop != currentShop || ChatConfig.ChatSettingConfig.IsAutoReply)
|
||||
{
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
shop.Chat.Load("https://store.weixin.qq.com/shop/kf");
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -1049,134 +1064,6 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
mainWebBrowser.Load("https://store.weixin.qq.com/shop/home");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动回复等
|
||||
/// </summary>
|
||||
public void InitAutoExecute()
|
||||
{
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// while (true)
|
||||
// {
|
||||
// foreach (var shop in GlobalConfig.DouShopLoginList)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// Thread.Sleep(new Random(DateTime.Now.Millisecond).Next(300, 500));
|
||||
// bool needReLogin = AutoCheckShopLoginStatus(shop);
|
||||
// if (ChatConfig.ChatSettingConfig.IsAutoReLogin && needReLogin)
|
||||
// AutoReLogin(shop);
|
||||
|
||||
// if (shop.LoginStatus != "登录成功")
|
||||
// continue;
|
||||
|
||||
// Thread.Sleep(new Random(DateTime.Now.Millisecond).Next(300, 500));
|
||||
// AutoReConnect(shop);
|
||||
|
||||
// Thread.Sleep(new Random(DateTime.Now.Millisecond).Next(300, 500));
|
||||
// AutoCloseMaskWindow(shop);
|
||||
|
||||
|
||||
// Thread.Sleep(new Random(DateTime.Now.Millisecond).Next(300, 500));
|
||||
// var isNewMessage = AutoGetNewMessage(shop);
|
||||
// while (isNewMessage && ChatConfig.ChatSettingConfig.IsAutoReply)
|
||||
// {
|
||||
// AutoReplyWithJs(shop);
|
||||
// Thread.Sleep(new Random(DateTime.Now.Millisecond).Next(300, 500));
|
||||
// isNewMessage = AutoGetNewMessage(shop);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// var sleepTime = 1000;
|
||||
// while (true)
|
||||
// {
|
||||
// Thread.Sleep(sleepTime);
|
||||
// var jsStr = "function getVideo() {\r\n" +
|
||||
// " var videos = document.getElementsByTagName('video')\r\n" +
|
||||
// " if (videos && videos.length > 0) {\r\n" +
|
||||
// " var src = videos[0].src;\r\n" +
|
||||
// " videos[0].parentElement.parentElement.click();\r\n" +
|
||||
// " return src;\r\n" +
|
||||
// " //return '';\r\n" +
|
||||
// " }\r\n" +
|
||||
// " return '';\r\n" +
|
||||
// "}" +
|
||||
// "getVideo();\r\n";
|
||||
// if (currentShop?.Chat != null && currentShop.Chat.IsBrowserInitialized)
|
||||
// {
|
||||
// var t = currentShop.Chat.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
// t.Wait();
|
||||
// if (!string.IsNullOrEmpty(t.Result?.Result?.ToString()))
|
||||
// {
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// AllBase.GetHtml.OpenUrl(t.Result.Result.ToString());
|
||||
// }));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// var sleepTime = 2500;
|
||||
// while (true)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// Thread.Sleep(sleepTime);
|
||||
// var jsStr1 = "function ClosePopWindow() {\r\n" +
|
||||
// " var result = 'no_pop'\r\n" +
|
||||
// " var item = document.getElementsByClassName('anticon-close-circle');\r\n" +
|
||||
// " for(i = 0; i < item.length; i++) {\r\n" +
|
||||
// " item[i].click();\r\n" +
|
||||
// " result = 'success'\r\n" +
|
||||
// " }\r\n" +
|
||||
// " return result;\r\n" +
|
||||
// "}\r\n" +
|
||||
// "ClosePopWindow();\r\n";
|
||||
// var jsStr2 = "function clickPopWindow() {\r\n"
|
||||
// + "var child = document.body.firstElementChild;\r\n"
|
||||
// + "var element1 = null;\r\n"
|
||||
// + " while (child) {\r\n"
|
||||
// + " if (child.innerHTML.indexOf('知道了') >= 0) {\r\n"
|
||||
// + " element1 = child;\r\n"
|
||||
// + " if (child.firstElementChild) {\r\n"
|
||||
// + " child = child.firstElementChild; continue;\r\n"
|
||||
// + " } else break;\r\n"
|
||||
// + " }\r\n"
|
||||
// + " child = child.nextElementSibling;\r\n"
|
||||
// + " }\r\n"
|
||||
// + " if (element1) {\r\n"
|
||||
// + " element1.click(); return 'success';\r\n"
|
||||
// + " } else return 'no_pop';\r\n"
|
||||
// + "}\r\n"
|
||||
// + "clickPopWindow();\r\n";
|
||||
// if (mainWebBrowser.IsBrowserInitialized)
|
||||
// {
|
||||
// var t1 = mainWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr1);
|
||||
// t1.Wait();
|
||||
// var t2 = mainWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr2);
|
||||
// t2.Wait();
|
||||
// if (t1.Result?.Result?.ToString() == "success" || t2.Result?.Result?.ToString() == "success")
|
||||
// sleepTime = Randomx.GetId(550, 650);
|
||||
// else
|
||||
// sleepTime = Randomx.GetId(2500, 3000);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex) { }
|
||||
// }
|
||||
//});
|
||||
}
|
||||
|
||||
private void chkIsAutoReLogin_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ChatConfig.ChatSettingConfig.IsAutoReLogin = chkIsAutoReLogin.Checked;
|
||||
@@ -1314,7 +1201,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 右键点击
|
||||
private void dgvShop_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex < 0 || e.RowIndex < 0)
|
||||
@@ -1371,6 +1258,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
}));
|
||||
|
||||
WXShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
|
||||
// 掉线店铺重登校验后刷新网页
|
||||
LoadShop(new List<ShopLoginInfo>() { shop });
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
@@ -1421,9 +1309,11 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
}
|
||||
|
||||
currentShop = shop;
|
||||
orderListForm.lblCurrentShop.Text = currentShop.ShopAccount;
|
||||
orderListForm.lblCurrentShop.Tag = currentShop;
|
||||
|
||||
if (orderListForm != null)
|
||||
{
|
||||
orderListForm.lblCurrentShop.Text = currentShop.ShopAccount;
|
||||
orderListForm.lblCurrentShop.Tag = currentShop;
|
||||
}
|
||||
|
||||
shop.Chat.Dock = DockStyle.Fill;
|
||||
shop.Chat.BringToFront();
|
||||
@@ -1462,13 +1352,18 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
Task.Run(() =>
|
||||
{
|
||||
RefreshCookie();
|
||||
LoadShop();
|
||||
Invoke(new Action(() => { pbLoading.Visible = false; }));
|
||||
});
|
||||
}
|
||||
|
||||
DateTime nextRefreshTime = DateTime.Now;
|
||||
void RefreshCookie(bool isAuto = false)
|
||||
{
|
||||
if (ChatConfig.ChatSettingConfig.IsAutoReply)
|
||||
{
|
||||
Invoke(new Action(()=> { this.ucTabControl1.SelectedIndex = 0; }));
|
||||
}
|
||||
|
||||
if (!isAuto)
|
||||
WXShopListForm.UpdateShop();
|
||||
foreach (var shop in GlobalConfig.ShopLoginList)
|
||||
@@ -1486,7 +1381,6 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
r.Cells["colMessage"].Value = "";
|
||||
}));
|
||||
}
|
||||
LoadShop();
|
||||
}
|
||||
|
||||
private void btnFilterShop_Click(object sender, EventArgs e)
|
||||
@@ -1750,6 +1644,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
pbLoading.Visible = true;
|
||||
Task.Run(() =>
|
||||
{
|
||||
// 批量登录后刷新网页
|
||||
LoadShop(switchShopLst);
|
||||
foreach (var shop in needUpdateShopLst)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user