优化自动拍单优惠券逻辑

This commit is contained in:
wule committed 2026-10-23 09:45:39 +08:00
1 parent 8ec1b63f8a
commit f8e68a6322
3 files changed
+30 -20

No files matched your search

+11 -2
View File
@@ -73,6 +73,7 @@ namespace TemuKJD.ToolForms
private static readonly object lockObj = new();
private static readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
private string sourceCode = string.Empty;
private string shopCookieHead = "yangkeduo.com";
private string shopMainUrl = "https://mobile.yangkeduo.com/index.html";
private ChromiumWebBrowser cefWebBrowser = null;
@@ -767,7 +768,6 @@ namespace TemuKJD.ToolForms
public async Task CheckSourceCode()
{
var sourceCode = txtSourceCode.Text.Trim();
var ts1 = await EvaluateJsBuyTagNameAndInnerHtml("div", sourceCode);
if (ts1.Result?.Value.ParseToString() != "success")
{
@@ -875,6 +875,11 @@ namespace TemuKJD.ToolForms
{
break;
}
var ts2 = await EvaluateJsBuyTagNameAndInnerHtml("div", "立即支付");
if (ts2.Result.Value is string rstStr2 && rstStr2 == "success" && ts1.Result.Value is string rstStr1 && rstStr1 != "success")
{
return "";
}
}
Thread.Sleep(Randomx.GetId(200, 400));
@@ -1356,7 +1361,6 @@ namespace TemuKJD.ToolForms
Invoke(() => { lblErrMsg.Text = "页面未加载!"; });
return;
}
//var sourceCode = txtSourceCode.Text.Trim();
//var jsStr1 = @"(function() { var elements = document.getElementsByTagName('div');
// for (i = elements.length - 1; i >= 0; i--){
// var element = elements[i];
@@ -2011,5 +2015,10 @@ namespace TemuKJD.ToolForms
{
pnlMask.Visible = false;
}
private void txtSourceCode_TextChanged(object sender, EventArgs e)
{
}
}
}