更新 发票助手 按照时间正序

This commit is contained in:
chfei committed 2026-09-11 18:02:47 +08:00
1 parent 786697c5a6
commit 330ccf3983
3 files changed
+17 -11

No files matched your search

@@ -23,11 +23,11 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
public partial class PDDInvoiceViewModel
{
/// <summary>
/// 订单列表浏览器
/// 霈W��𡑒”瘚讛��?
/// </summary>
public ChromiumWebBrowser Browser { get; private set; }
/// <summary>
/// 内容浏览器
/// ��捆瘚讛��?
/// 霈W�霂行�
/// �𤑳巨霂行�
/// �唾窈�𤑳巨
@@ -98,9 +98,9 @@ public partial class PDDInvoiceViewModel
}
/// <summary>
/// 注入发票填写脚本并执行。
/// 单张申请模式保持原有行为;批量开票模式下轮询脚本写入的
/// <c>window.__invoiceApplyResult</c>,完成后通过 <see cref="_currentInvoiceTcs"/> 回传结果。
/// 瘜典��𤑳巨憛怠��𡁏𧋦撟嗆�銵䎚�?
/// �訫��唾窈璅∪�靽脲����銵䔶蛹嚗𥟇鸌�誩�蟡冽芋撘譍�頧株砭�𡁏𧋦�坔��?
/// <c>window.__invoiceApplyResult</c>嚗���𣂼��朞� <see cref="_currentInvoiceTcs"/> �硺�蝏𤘪��?
/// </summary>
private async Task ExecuteInvoiceApplyScriptAsync(ChromiumWebBrowser b)
{
@@ -111,10 +111,10 @@ public partial class PDDInvoiceViewModel
await b.EvaluateScriptAsync(content);
if (_currentInvoiceTcs == null) return; // 单张申请模式:保持原有行为
if (_currentInvoiceTcs == null) return; // �訫��唾窈璅∪�嚗帋�����㕑�銝?
// 批量模式:等待异步脚本执行完成
// 捕获当前 TCS,避免批量循环超时进入下一个订单后,迟到的轮询误触发新订单的结果
// �寥�璅∪�嚗𡁶�敺��甇亥��祆�銵���?
// �閗繮敶枏� TCS嚗屸��齿鸌�誩儐�航��嗉��乩�銝�銝芾恥�訫�嚗諹��啁�頧株砭霂航圻�烐鰵霈W�����?
var tcs = _currentInvoiceTcs;
for (int i = 0; i < 120; i++)
{
@@ -224,7 +224,7 @@ public partial class PDDInvoiceViewModel
var jsStr = @"window.scroll({
top: " + top + @",
left: 0,
behavior: 'smooth' // 可选,使滚动平滑
behavior: 'smooth' // �舫�㚁�雿踵��典像皛?
});";
var client = Browser.GetDevToolsClient();