1 修复淘宝拍单窗口可能崩溃问题
2 拼多多中转仓拍单随机地址支持随机繁体字
This commit is contained in:
1 parent
5b9ed01fa1
commit
ac93305d5f
8 files changed
+155
-21
No files matched your search
@@ -4,6 +4,7 @@ using AllBase.Model;
|
||||
using AllBase.Model.Config;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.Result;
|
||||
using AllBase.Util;
|
||||
using CefSharp;
|
||||
using CefSharp.DevTools;
|
||||
using CefSharp.DevTools.IO;
|
||||
@@ -94,10 +95,38 @@ namespace TemuKJD.ToolForms
|
||||
// (拍单后)回调函数,更新拍单余额
|
||||
private Action updateBalanceAction = null;
|
||||
|
||||
string _txtBuyTransitWarehouseStr = "";
|
||||
/// <summary>
|
||||
/// 拍单中转地址
|
||||
/// </summary>
|
||||
string txtBuyTransitWarehouseStr = "";
|
||||
string txtBuyTransitWarehouseStr
|
||||
{
|
||||
get { return _txtBuyTransitWarehouseStr; }
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && BuyType == "transit")
|
||||
{
|
||||
//txtBuyTransitWarehouseRandomStr = value;
|
||||
var numberDic = TransitWarehouseData.dicChineseNumberChar;
|
||||
var txtBuyTransitWarehouseRandomStrTmp = txtBuyTransitWarehouseRandomStr = transitWarehouse.TransFullAddress + Randomx.GetId(1, 35) + Randomx.GetId(1, 9).ToString().PadLeft(2, '0') + "室";
|
||||
if (BaseClass.Setting.SwitchEnablePddTransitTraditionalAddress == true)
|
||||
{
|
||||
for (int i = 0; i < 10 && txtBuyTransitWarehouseRandomStrTmp == txtBuyTransitWarehouseRandomStr; i++)
|
||||
{
|
||||
txtBuyTransitWarehouseRandomStrTmp = string.Join("", txtBuyTransitWarehouseRandomStrTmp.Select(c => Randomx.GetId(2) == 0 ? c.ToString() : ChineseStringConverter.ToTraditional(c.ToString())));
|
||||
txtBuyTransitWarehouseRandomStrTmp = string.Join("", txtBuyTransitWarehouseRandomStrTmp.Select(c => (Randomx.GetId(2) == 0 || !numberDic.Keys.Contains(c)) ? c : numberDic[c][Randomx.GetId(numberDic[c].Count)]));
|
||||
}
|
||||
txtBuyTransitWarehouseRandomStr = txtBuyTransitWarehouseRandomStrTmp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
txtBuyTransitWarehouseRandomStr = value;
|
||||
}
|
||||
_txtBuyTransitWarehouseStr = value;
|
||||
}
|
||||
}
|
||||
string txtBuyTransitWarehouseRandomStr = "";
|
||||
bool IsChangeAddress = false;
|
||||
bool HasChangeAddress = false;
|
||||
|
||||
@@ -377,7 +406,8 @@ namespace TemuKJD.ToolForms
|
||||
jObj["province_id"] = transitWarehouse.province_id;
|
||||
jObj["city_id"] = transitWarehouse.city_id;
|
||||
jObj["district_id"] = transitWarehouse.district_id;
|
||||
jObj["address"] = transitWarehouse.TransFullAddress + Randomx.GetId(1, 35) + Randomx.GetId(1, 9).ToString().PadLeft(2, '0') + "室" + txtSourceCode.Text;
|
||||
//jObj["address"] = transitWarehouse.TransFullAddress + Randomx.GetId(1, 35) + Randomx.GetId(1, 9).ToString().PadLeft(2, '0') + "室" + txtSourceCode.Text;
|
||||
jObj["address"] = txtBuyTransitWarehouseRandomStr + txtSourceCode.Text;
|
||||
jObj["mobile"] = TransitWaybillHelper.MobileHead[Randomx.GetId(TransitWaybillHelper.MobileHead.Count)] + Randomx.GetNumber(8);
|
||||
jObj["name"] = TransitWaybillHelper.LastName[Randomx.GetId(TransitWaybillHelper.LastName.Count)] + (Randomx.GetId(2) == 1 ? "先生" : "女士");
|
||||
postData = JsonHelper.SerializeObject(jObj);
|
||||
@@ -1029,7 +1059,7 @@ namespace TemuKJD.ToolForms
|
||||
jsStr1 = @"(function() { var elements = document.getElementsByTagName('div');
|
||||
for (i = elements.length - 1; i >= 0; i--){
|
||||
var element = elements[i];
|
||||
if (element.innerHTML.indexOf('" + txtBuyTransitWarehouseStr + @"') >= 0 && element.innerHTML.indexOf('" + txtSourceCode.Text.Trim() + @"') >= 0) {
|
||||
if (element.innerHTML.indexOf('" + txtBuyTransitWarehouseRandomStr + @"') >= 0 && element.innerHTML.indexOf('" + txtSourceCode.Text.Trim() + @"') >= 0) {
|
||||
element.click();
|
||||
return 'success';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user