1优化自动登录失效 2优化用户操作界面无法直接登录店铺问题 3优化活动报名操作逻辑防止误报低价折扣活动 4显示aisku图片使用次数
This commit is contained in:
1 parent
4d0478a9c5
commit
a6b36c64b0
17 files changed
+737
-545
No files matched your search
@@ -676,6 +676,14 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
return HttpResponseBLL.PostResponse(shop, url, body, refere);
|
||||
}
|
||||
|
||||
public static string GetObtainCode(ShopLoginInfo shop)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/bg/swift/api/auth/obtainCode";
|
||||
string refere = "https://agentseller.temu.com/";
|
||||
string body = @"{""redirectUrl"":""https://ads.temu.com/index.html?adAreaOverride=2&source=2&seller_source=11""}";
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
|
||||
}
|
||||
|
||||
private void ShopListForm_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Visible == true)
|
||||
|
||||
@@ -669,7 +669,19 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
/// <param name="_password"></param>
|
||||
private void InputUserNameAndPassword(ChromiumWebBrowser webBrowser, string _account, string _password)
|
||||
{
|
||||
string jsStr1 = "function getInputItem () {var usernameId = document.getElementById('usernameId'); if (usernameId) return 'true';} getInputItem();";
|
||||
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sInputValueChange2);
|
||||
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText);
|
||||
|
||||
//扫码登录切换到账号登录
|
||||
var switchJsStr = "var clickItem = getElementWithText('账号登录'); " +
|
||||
"clickItem.click()";
|
||||
var switchResponse = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(switchJsStr);
|
||||
switchResponse.Wait(1000);
|
||||
Thread.Sleep(Randomx.GetId(300, 800));
|
||||
|
||||
string jsStr1 = "function getInputItem () {" +
|
||||
"var usernameId = document.getElementById('usernameId'); if (usernameId) return 'true';" +
|
||||
"} getInputItem();";
|
||||
Task<JavascriptResponse> response1 = null;
|
||||
while (response1?.Result?.Result == null || !response1.Result.Result.ParseToString().Contains("true"))
|
||||
{
|
||||
@@ -684,27 +696,28 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
return;
|
||||
}
|
||||
|
||||
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sInputValueChange2);
|
||||
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText);
|
||||
|
||||
//输入用户名
|
||||
jsStr1 = "var usernameId = document.getElementById('usernameId'); " +
|
||||
"changeReactInputValue(usernameId,'" + _account + "');";
|
||||
response1 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr1);
|
||||
response1.Wait(1000);
|
||||
Thread.Sleep(Randomx.GetId(500, 1000));
|
||||
|
||||
//输入密码
|
||||
string jsStr = "var passwordId = document.getElementById('passwordId'); "+
|
||||
"changeReactInputValue(passwordId,'" + _password + "');";
|
||||
var response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
|
||||
response.Wait(1000);
|
||||
Thread.Sleep(Randomx.GetId(500, 1000));
|
||||
|
||||
//点击阅读并同意框
|
||||
jsStr = "var clickBox = getElementWithText('我已阅读并同意'); " +
|
||||
"clickBox.click()";
|
||||
response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
|
||||
response.Wait(1000);
|
||||
Thread.Sleep(Randomx.GetId(500, 1000));
|
||||
|
||||
//点击登录
|
||||
jsStr = "var clickBox = getElementWithText('登录'); " +
|
||||
"clickBox.click()";
|
||||
response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
|
||||
|
||||
Reference in new issue
Block a user