v1.9.0: 试用策略改为 3 天/30 条(任一先到即止)+ 价值时刻提示 + 到期 24h 内 8 折 + 过期只锁评论

This commit is contained in:
personal82555 committed 2026-10-14 21:29:55 +08:00
1 parent 557f75fc54
commit 6a697a2663
6 files changed
+97 -18

No files matched your search

+12 -1
View File
@@ -855,7 +855,11 @@
function finish(task, ok, reason) {
clearTask();
running = false;
relay({ type: "finished", ok: !!ok, reason: reason || "", done: task ? (task.sent || 0) : 0, failed: task ? (task.failed || 0) : 0 });
let avgGapSec = 0;
if (task && task.firstSentAt && task.lastSentAt && (task.sent || 0) >= 2) {
avgGapSec = Math.round((task.lastSentAt - task.firstSentAt) / ((task.sent || 1) - 1) / 1000);
}
relay({ type: "finished", ok: !!ok, reason: reason || "", done: task ? (task.sent || 0) : 0, failed: task ? (task.failed || 0) : 0, avgGapSec: avgGapSec });
step((ok ? "✅ " : "⏹ ") + (reason || (ok ? "执行完成" : "已停止")), ok ? "ok" : "fail");
}
@@ -966,6 +970,11 @@
const doDm = (what === "dm" || what === "both");
if (doComment) {
// 试用额度检查:发到额度就自动停,不用等用户发现
if (cfg.trialQuota != null && (task.sent || 0) >= cfg.trialQuota) {
finish(task, true, "试用期 " + cfg.trialQuota + " 条额度已用完,购买卡密激活后不限量");
return;
}
step("评论[" + (SRC_LABEL[video.src] || "模板") + "]:" + text.slice(0, 30) + (text.length > 30 ? "…" : ""));
const r = await sendOne(video, text, cfg.sendMode !== "api");
@@ -974,6 +983,8 @@
if (r.ok) {
step(r.verified ? "✅ 评论成功" : "⚠️ 已发送但未在页面确认,记为已评论", r.verified ? "ok" : "fail");
if (!task.firstSentAt) task.firstSentAt = Date.now();
task.lastSentAt = Date.now();
await recordOne(task, video, text, true);
} else {
step("❌ 失败:" + r.error, "fail");