Release Shijian 0.1.19 with automatic Douyin reply receipts
Add content type rules, reply quotas, and multi-image templates. Verify published replies in the original comment thread and record automatic receipts. Document uninterrupted physical-device acceptance.
This commit is contained in:
+284
-118
@@ -150,8 +150,27 @@
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
#photo-binding [hidden] { display: none; }
|
||||
#photo-binding button { border: 0; cursor: pointer; }
|
||||
[hidden] { display: none !important; }
|
||||
button.action { border: 0; cursor: pointer; }
|
||||
button.action:disabled { opacity: .48; cursor: default; }
|
||||
#photo-items { display: grid; gap: 10px; margin-top: 8px; }
|
||||
.photo-item img { display: block; width: 96px; height: 76px; object-fit: contain; }
|
||||
.library-actions, .photo-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
|
||||
.library-level { margin-top: 14px; }
|
||||
.library-level label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 700; }
|
||||
#photo-binding { margin-top: 14px; }
|
||||
dialog {
|
||||
width: min(390px, calc(100% - 32px));
|
||||
padding: 20px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 18px;
|
||||
color: var(--ink);
|
||||
}
|
||||
dialog::backdrop { background: #172a2460; }
|
||||
dialog h2 { margin-bottom: 12px; font-size: 20px; }
|
||||
dialog .library-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
|
||||
#library-status { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
|
||||
#library-error, #library-status.error { color: var(--alert); font-size: 14px; }
|
||||
|
||||
.action.primary, .app-nav [aria-current="page"] {
|
||||
color: #fff;
|
||||
@@ -222,22 +241,6 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
min-height: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.checkbox::before {
|
||||
content: "";
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
flex: 0 0 15px;
|
||||
border: 1.5px solid var(--muted);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
code { font-size: .92em; overflow-wrap: anywhere; }
|
||||
|
||||
.entries {
|
||||
@@ -283,7 +286,7 @@
|
||||
<span class="mark" aria-hidden="true"><i></i><i></i><i></i></span>
|
||||
<div>
|
||||
<h1>拾见 · 界面预览</h1>
|
||||
<p>离线预览,可编辑话术并试用本机图片绑定。日志为演示数据。</p>
|
||||
<p>离线预览,可编辑内容库并试用图片绑定。修改仅在本页保留。</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -296,10 +299,10 @@
|
||||
<div class="card">
|
||||
<h3>准备运行</h3>
|
||||
<p class="mode">抖音 · 仅浏览</p>
|
||||
<p>关键词 1 个 · 单次 3 条</p>
|
||||
<progress value="0" max="3" aria-label="已处理 0 条,共 3 条"></progress>
|
||||
<p class="summary">已处理 0 / 3 · 已确认发送 0</p>
|
||||
<p>关键词 国外大模型充值</p>
|
||||
<p>内容类型 1 个 · 单次 3 个视频</p>
|
||||
<progress value="0" max="3" aria-label="已处理 0 个视频,共 3 个"></progress>
|
||||
<p class="summary">已处理视频 0 / 3 · 已确认回复 0 条</p>
|
||||
<p>内容类型 · 模型服务</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>无障碍服务未连接</h3>
|
||||
@@ -308,6 +311,13 @@
|
||||
</div>
|
||||
<span class="action primary" aria-disabled="true">开始任务</span>
|
||||
<span class="action">启用通知栏暂停按钮</span>
|
||||
<details class="card" id="pending-receipt-preview">
|
||||
<summary>等待核对状态</summary>
|
||||
<p>到抖音核对这条评论</p>
|
||||
<span class="action primary">自动核对回复</span>
|
||||
<span class="action primary">确认已发送</span>
|
||||
<span class="action">跳过此回复</span>
|
||||
</details>
|
||||
</div>
|
||||
<nav class="app-nav" aria-label="任务页导航">
|
||||
<a href="#task" aria-current="page">任务</a>
|
||||
@@ -326,8 +336,8 @@
|
||||
<h3>任务范围</h3>
|
||||
<dl class="fields">
|
||||
<div><dt>平台</dt><dd class="control select">抖音</dd></div>
|
||||
<div><dt>搜索关键词</dt><dd class="control multiline">国外大模型充值</dd></div>
|
||||
<div><dt>单次任务总数</dt><dd class="control">3</dd></div>
|
||||
<div><dt><label for="search-scope">搜索范围</label></dt><dd><select id="search-scope" class="control settings-input"></select></dd></div>
|
||||
<div><dt><label for="video-limit">单次任务视频上限</label></dt><dd><input id="video-limit" class="control settings-input" type="number" inputmode="numeric" min="1" max="100" value="3" required></dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card">
|
||||
@@ -344,57 +354,60 @@
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>评论</h3>
|
||||
<h3>评论设置</h3>
|
||||
<dl class="fields">
|
||||
<div>
|
||||
<dt><label for="reply-mode">处理方式</label></dt>
|
||||
<dd><select id="reply-mode" class="control settings-input">
|
||||
<option>仅浏览</option>
|
||||
<option>随机使用话术并发送</option>
|
||||
<option>话术优先,DeepSeek 兜底</option>
|
||||
<option>匹配评论并回复</option>
|
||||
</select></dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt><label for="template-group">话术分组</label></dt>
|
||||
<dd><select id="template-group" class="control settings-input">
|
||||
<option value="common">通用</option>
|
||||
<option value="keyword-0">关键词 · 国外大模型充值</option>
|
||||
</select></dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt><label for="template-editor">话术库</label></dt>
|
||||
<dd><textarea id="template-editor" class="control multiline settings-input" rows="2" placeholder="每行一条话术" autocomplete="off"></textarea></dd>
|
||||
</div>
|
||||
<div><dt><label for="replies-per-video">每条视频回复上限</label></dt><dd><input id="replies-per-video" class="control settings-input" type="number" inputmode="numeric" min="1" max="100" value="1" required></dd></div>
|
||||
</dl>
|
||||
<p class="hint">先从当前关键词分组随机选一条。该分组为空时使用通用分组。支持 <code>{keyword}</code> 和 <code>{title}</code>。</p>
|
||||
<dl class="fields">
|
||||
<div>
|
||||
<dt><label for="photo-phrase">绑定到话术</label></dt>
|
||||
<dd><select id="photo-phrase" class="control settings-input" disabled></select></dd>
|
||||
<p class="hint">达到回复上限或找不到更多匹配评论时,进入下一个视频。</p>
|
||||
</div>
|
||||
<div class="card" id="content-library">
|
||||
<h3>内容库</h3>
|
||||
<p class="hint">按内容类型搜索视频,按关键词匹配评论。每个关键词可配置多条话术。</p>
|
||||
<div class="library-level" id="type-level">
|
||||
<label for="content-type">内容类型</label>
|
||||
<select id="content-type" class="control settings-input"></select>
|
||||
<div class="library-actions">
|
||||
<button type="button" class="action" data-level="type" data-action="add" aria-label="新增内容类型">新增</button>
|
||||
<button type="button" class="action" data-level="type" data-action="edit" aria-label="编辑内容类型">编辑</button>
|
||||
<button type="button" class="action" data-level="type" data-action="delete" aria-label="删除内容类型">删除</button>
|
||||
</div>
|
||||
</dl>
|
||||
<div id="photo-binding" hidden>
|
||||
<p id="photo-name" class="hint" hidden></p>
|
||||
<img id="photo-thumbnail" alt="已绑定图片预览" width="96" height="76" style="object-fit: contain" hidden>
|
||||
<input id="template-photo" type="file" accept="image/jpeg,image/png" hidden>
|
||||
<button id="photo-choose" type="button" class="action">选择本机图片</button>
|
||||
<button id="photo-remove" type="button" class="action" hidden>移除图片</button>
|
||||
</div>
|
||||
<p class="hint">每条话术可绑定一张本机照片。改写话术后需重新绑定。</p>
|
||||
<div class="library-level" id="rule-level">
|
||||
<label for="keyword-rule">关键词</label>
|
||||
<select id="keyword-rule" class="control settings-input"></select>
|
||||
<div class="library-actions">
|
||||
<button type="button" class="action" data-level="rule" data-action="add" aria-label="新增关键词">新增</button>
|
||||
<button type="button" class="action" data-level="rule" data-action="edit" aria-label="编辑关键词">编辑</button>
|
||||
<button type="button" class="action" data-level="rule" data-action="delete" aria-label="删除关键词">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-level" id="phrase-level">
|
||||
<label for="reply-phrase">回复话术</label>
|
||||
<select id="reply-phrase" class="control settings-input"></select>
|
||||
<div class="library-actions">
|
||||
<button type="button" class="action" data-level="phrase" data-action="add" aria-label="新增话术">新增</button>
|
||||
<button type="button" class="action" data-level="phrase" data-action="edit" aria-label="编辑话术">编辑</button>
|
||||
<button type="button" class="action" data-level="phrase" data-action="delete" aria-label="删除话术">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="photo-binding" hidden>
|
||||
<p id="photo-count" class="hint"></p>
|
||||
<div id="photo-items"></div>
|
||||
<input id="template-photo" type="file" accept="image/jpeg,image/png" multiple hidden>
|
||||
<button id="photo-choose" type="button" class="action">添加本机图片</button>
|
||||
<p id="photo-status" class="hint" role="status" hidden></p>
|
||||
<p class="hint">支持 JPEG 和 PNG。修改名称、关键词或话术时,保留已绑定图片。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>DeepSeek</h3>
|
||||
<p class="hint">启用兜底后,没有可用话术时才调用 DeepSeek。请求包含关键词、视频标题和可见评论样本。缺少话术且未设置 API Key 时跳过该视频。</p>
|
||||
<dl class="fields">
|
||||
<div><dt>API Key</dt><dd class="control hint">粘贴 API Key</dd></div>
|
||||
</dl>
|
||||
<div class="checkbox">清除已保存的 API Key</div>
|
||||
<dl class="fields">
|
||||
<div><dt>模型</dt><dd class="control">deepseek-flash</dd></div>
|
||||
<div><dt>生成说明</dt><dd class="control multiline">根据视频内容提供一句具体、有帮助的中文评论。</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
<span class="action primary">保存配置</span>
|
||||
<button type="button" class="action primary" id="save-preview">保存配置</button>
|
||||
<p id="library-status" role="status" hidden></p>
|
||||
</div>
|
||||
<nav class="app-nav" aria-label="配置页导航">
|
||||
<a href="#task">任务</a>
|
||||
@@ -412,9 +425,11 @@
|
||||
<div class="card">
|
||||
<h3>运行日志</h3>
|
||||
<ul class="entries">
|
||||
<li><time datetime="2026-11-26T12:56:05+08:00">11-26 12:56:05</time> 运行 任务完成 · 处理 1 条 · 确认发送 1 条</li>
|
||||
<li><time datetime="2026-11-26T12:56:05+08:00">11-26 12:56:05</time> 运行 第 1 条视频已确认 1/1 条回复</li>
|
||||
<li class="warning"><time datetime="2026-11-25T15:22:14+08:00">11-25 15:22:14</time> 异常 抖音评论未回读到完整内容或未看到唯一发送按钮</li>
|
||||
<li><time datetime="2026-11-25T15:22:01+08:00">11-25 15:22:01</time> 运行 搜索关键词 国外大模型充值</li>
|
||||
<li><time datetime="2026-11-25T15:22:00+08:00">11-25 15:22:00</time> 运行 开始任务 · 话术优先,DeepSeek 兜底 · 上限 3 条</li>
|
||||
<li><time datetime="2026-11-25T15:22:01+08:00">11-25 15:22:01</time> 运行 搜索内容类型 模型服务</li>
|
||||
<li><time datetime="2026-11-25T15:22:00+08:00">11-25 15:22:00</time> 运行 开始任务 · 匹配评论并回复 · 上限 3 条</li>
|
||||
<li><time datetime="2026-11-25T15:19:09+08:00">11-25 15:19:09</time> 运行 任务完成 · 处理 3 条 · 确认发送 0 条</li>
|
||||
<li><time datetime="2026-11-25T15:19:02+08:00">11-25 15:19:02</time> 运行 观看第 3 条 · 7 秒</li>
|
||||
<li><time datetime="2026-11-25T15:18:47+08:00">11-25 15:18:47</time> 运行 观看第 2 条 · 11 秒</li>
|
||||
@@ -431,77 +446,228 @@
|
||||
</figure>
|
||||
</div>
|
||||
</main>
|
||||
<dialog id="library-editor" aria-labelledby="editor-title">
|
||||
<form id="library-form">
|
||||
<h2 id="editor-title"></h2>
|
||||
<input id="library-value" class="control settings-input" autocomplete="off">
|
||||
<textarea id="library-phrase-text" class="control multiline settings-input" rows="3" autocomplete="off" hidden></textarea>
|
||||
<p id="library-error" role="alert" hidden></p>
|
||||
<div class="library-actions">
|
||||
<button type="button" class="action" id="edit-cancel">取消</button>
|
||||
<button type="submit" class="action primary">完成</button>
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
<dialog id="library-delete" aria-labelledby="delete-message">
|
||||
<p id="delete-message"></p>
|
||||
<div class="library-actions">
|
||||
<button type="button" class="action" id="delete-cancel">取消</button>
|
||||
<button type="button" class="action primary" id="delete-confirm">删除</button>
|
||||
</div>
|
||||
</dialog>
|
||||
<script>
|
||||
const groups = document.getElementById("template-group");
|
||||
const editor = document.getElementById("template-editor");
|
||||
const photoPhrase = document.getElementById("photo-phrase");
|
||||
const byId = id => document.getElementById(id);
|
||||
const scope = byId("search-scope");
|
||||
const typePicker = byId("content-type");
|
||||
const rulePicker = byId("keyword-rule");
|
||||
const phrasePicker = byId("reply-phrase");
|
||||
const editDialog = byId("library-editor");
|
||||
const deleteDialog = byId("library-delete");
|
||||
const singleLine = byId("library-value");
|
||||
const multiLine = byId("library-phrase-text");
|
||||
const editError = byId("library-error");
|
||||
const photoBinding = document.getElementById("photo-binding");
|
||||
const photoName = document.getElementById("photo-name");
|
||||
const thumbnail = document.getElementById("photo-thumbnail");
|
||||
const photoCount = document.getElementById("photo-count");
|
||||
const photoItems = document.getElementById("photo-items");
|
||||
const fileInput = document.getElementById("template-photo");
|
||||
const choosePhoto = document.getElementById("photo-choose");
|
||||
const removePhoto = document.getElementById("photo-remove");
|
||||
const drafts = new Map([["keyword-0", "这条视频里提到的方式适用于哪些地区?"]]);
|
||||
const photos = new Map();
|
||||
let activeGroup = groups.value;
|
||||
const photoStatus = document.getElementById("photo-status");
|
||||
const maxPhotos = 9;
|
||||
const types = [{ id: "model-services", name: "模型服务", rules: [
|
||||
{ id: "model-recharge", keyword: "国外大模型充值", phrases: [
|
||||
{ id: "recharge-regions", text: "这条视频里提到的方式适用于哪些地区?", photos: [] },
|
||||
] },
|
||||
] }];
|
||||
const pick = (list, picker) => list.find(item => item.id === picker.value);
|
||||
const activeType = () => pick(types, typePicker);
|
||||
const activeRule = () => pick(activeType()?.rules ?? [], rulePicker);
|
||||
const activePhrase = () => pick(activeRule()?.phrases ?? [], phrasePicker);
|
||||
const normalizeKeyword = keyword => keyword.normalize("NFKC").toLowerCase().trim().replace(/\s+/gu, " ");
|
||||
const levels = {
|
||||
type: { picker: typePicker, name: "内容类型", key: "name", entries: () => types, extra: () => ({ rules: [] }) },
|
||||
rule: { picker: rulePicker, name: "关键词", key: "keyword", entries: () => activeType()?.rules ?? [], extra: () => ({ phrases: [] }) },
|
||||
phrase: { picker: phrasePicker, name: "话术", key: "text", entries: () => activeRule()?.phrases ?? [], extra: () => ({ photos: [] }) },
|
||||
};
|
||||
let nextId = 0;
|
||||
let editing;
|
||||
let deleting;
|
||||
let photoTarget;
|
||||
|
||||
const photoKey = () => JSON.stringify([activeGroup, photoPhrase.value]);
|
||||
const redrawPhoto = () => {
|
||||
const attachment = photos.get(photoKey());
|
||||
photoBinding.hidden = photoPhrase.disabled;
|
||||
photoName.hidden = thumbnail.hidden = removePhoto.hidden = !attachment;
|
||||
if (attachment) {
|
||||
photoName.textContent = "图片 · " + attachment.name;
|
||||
thumbnail.src = attachment.url;
|
||||
} else {
|
||||
thumbnail.removeAttribute("src");
|
||||
}
|
||||
choosePhoto.textContent = attachment ? "更换图片" : "选择本机图片";
|
||||
const fillPicker = (picker, options, selected, placeholder) => {
|
||||
picker.replaceChildren(...(options.length ? options.map(([id, title]) => new Option(title, id)) : [new Option(placeholder, "")]));
|
||||
if (options.some(([id]) => id === selected)) picker.value = selected;
|
||||
picker.disabled = !options.length;
|
||||
};
|
||||
const redrawPhrases = () => {
|
||||
const previous = photoPhrase.value;
|
||||
const phrases = [...new Set(editor.value.split(/\r?\n/).map(line => line.trim()).filter(Boolean))];
|
||||
photoPhrase.replaceChildren(...(phrases.length ? phrases.map(phrase => new Option(phrase, phrase)) :
|
||||
[new Option("先填写一条话术", "")]));
|
||||
if (phrases.includes(previous)) photoPhrase.value = previous;
|
||||
photoPhrase.disabled = !phrases.length;
|
||||
const setStatus = (message = "") => {
|
||||
photoStatus.textContent = message;
|
||||
photoStatus.hidden = !message;
|
||||
};
|
||||
const photoItem = (phrase, entry, index) => {
|
||||
const item = document.createElement("div");
|
||||
item.className = "photo-item";
|
||||
const name = document.createElement("p");
|
||||
name.textContent = `图片 ${index + 1} · ${entry.name}`;
|
||||
const thumbnail = document.createElement("img");
|
||||
thumbnail.alt = `第 ${index + 1} 张图片预览`;
|
||||
thumbnail.src = entry.url;
|
||||
const actions = document.createElement("div");
|
||||
actions.className = "photo-actions";
|
||||
for (const [title, position, disabled] of [["上移", index - 1, index === 0], ["下移", index + 1, index === phrase.photos.length - 1], ["移除图片", null, false]]) {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = "action";
|
||||
button.textContent = title;
|
||||
button.setAttribute("aria-label", `${title === "移除图片" ? "移除" : title}第 ${index + 1} 张图片`);
|
||||
button.disabled = disabled;
|
||||
button.addEventListener("click", () => {
|
||||
const [selected] = phrase.photos.splice(index, 1);
|
||||
if (position === null) URL.revokeObjectURL(selected.url);
|
||||
else phrase.photos.splice(position, 0, selected);
|
||||
setStatus();
|
||||
redrawPhoto();
|
||||
});
|
||||
actions.append(button);
|
||||
}
|
||||
item.append(name, thumbnail, actions);
|
||||
return item;
|
||||
};
|
||||
const redrawPhoto = () => {
|
||||
const phrase = activePhrase();
|
||||
const entries = phrase?.photos ?? [];
|
||||
photoBinding.hidden = !phrase;
|
||||
photoCount.textContent = `已绑定 ${entries.length} / ${maxPhotos} 张图片`;
|
||||
photoItems.replaceChildren(...entries.map((entry, index) => photoItem(phrase, entry, index)));
|
||||
choosePhoto.disabled = entries.length >= maxPhotos;
|
||||
};
|
||||
const redrawLibrary = (typeId = typePicker.value, ruleId = rulePicker.value, phraseId = phrasePicker.value) => {
|
||||
const typeOptions = types.map(type => [type.id, type.name]);
|
||||
fillPicker(scope, [["", "全部内容类型"], ...typeOptions], scope.value, "");
|
||||
fillPicker(typePicker, typeOptions, typeId, "请先新增内容类型");
|
||||
fillPicker(rulePicker, (activeType()?.rules ?? []).map(rule => [rule.id, rule.keyword]), ruleId, "请先新增关键词");
|
||||
fillPicker(phrasePicker, (activeRule()?.phrases ?? []).map((phrase, index) => [phrase.id, `${index + 1}. ${phrase.text.replace(/\s+/gu, " ")}`]), phraseId, "请先新增话术");
|
||||
byId("rule-level").hidden = !activeType();
|
||||
byId("phrase-level").hidden = !activeRule();
|
||||
for (const button of document.querySelectorAll("[data-level][data-action]")) {
|
||||
button.disabled = button.dataset.action !== "add" && levels[button.dataset.level].picker.disabled;
|
||||
}
|
||||
redrawPhoto();
|
||||
};
|
||||
|
||||
for (const button of document.querySelectorAll("[data-level][data-action]")) {
|
||||
button.addEventListener("click", () => {
|
||||
const level = button.dataset.level;
|
||||
const config = levels[level];
|
||||
const entries = config.entries();
|
||||
const existing = pick(entries, config.picker);
|
||||
if (button.dataset.action === "delete") {
|
||||
if (!existing) return;
|
||||
const messages = {
|
||||
type: () => `删除「${existing.name}」及其中的关键词、话术和图片绑定?`,
|
||||
rule: () => `删除关键词「${existing.keyword}」及其话术和图片绑定?`,
|
||||
phrase: () => "删除这条话术及其图片绑定?",
|
||||
};
|
||||
deleting = { entries, existing };
|
||||
byId("delete-message").textContent = messages[level]();
|
||||
deleteDialog.showModal();
|
||||
return;
|
||||
}
|
||||
const edit = button.dataset.action === "edit";
|
||||
editing = { level, config, entries, item: edit ? existing : undefined };
|
||||
byId("editor-title").textContent = `${edit ? "编辑" : "新增"}${config.name}`;
|
||||
const isPhrase = level === "phrase";
|
||||
singleLine.hidden = isPhrase;
|
||||
multiLine.hidden = !isPhrase;
|
||||
editError.hidden = true;
|
||||
const field = isPhrase ? multiLine : singleLine;
|
||||
field.value = editing.item?.[config.key] ?? "";
|
||||
field.placeholder = isPhrase ? "输入回复文字" : level === "type" ? "内容类型名称" : "一个关键词";
|
||||
field.setAttribute("aria-label", field.placeholder);
|
||||
editDialog.showModal();
|
||||
field.focus();
|
||||
});
|
||||
}
|
||||
byId("edit-cancel").addEventListener("click", () => editDialog.close());
|
||||
byId("delete-cancel").addEventListener("click", () => deleteDialog.close());
|
||||
byId("library-form").addEventListener("submit", event => {
|
||||
event.preventDefault();
|
||||
const { level, config, entries, item } = editing;
|
||||
const field = level === "phrase" ? multiLine : singleLine;
|
||||
const value = field.value.trim();
|
||||
const error = !value ? `请填写${field.placeholder}。`
|
||||
: level === "type" && value.length > 120 ? "内容类型名称最多 120 个字符。"
|
||||
: level === "rule" && (value.length > 120 || /[\r\n]/u.test(value)) ? "每个关键词最多 120 个字符,请填一行。"
|
||||
: level === "rule" && entries.some(entry => entry !== item && normalizeKeyword(entry.keyword) === normalizeKeyword(value)) ? "这个内容类型已有相同的关键词。"
|
||||
: level === "phrase" && [...value].length > 120 ? "每条话术最多 120 个字符。"
|
||||
: level === "phrase" && !item && entries.length >= 100 ? "每个关键词最多 100 条话术。" : "";
|
||||
if (error) {
|
||||
editError.textContent = error;
|
||||
editError.hidden = false;
|
||||
return;
|
||||
}
|
||||
const updated = item ?? { id: `preview-${++nextId}`, ...config.extra() };
|
||||
updated[config.key] = value;
|
||||
if (!item) entries.push(updated);
|
||||
editDialog.close();
|
||||
setStatus();
|
||||
redrawLibrary(level === "type" ? updated.id : typePicker.value,
|
||||
level === "rule" ? updated.id : rulePicker.value, level === "phrase" ? updated.id : phrasePicker.value);
|
||||
});
|
||||
byId("delete-confirm").addEventListener("click", () => {
|
||||
const { entries, existing } = deleting;
|
||||
const affected = existing.rules ? existing.rules.flatMap(rule => rule.phrases) : existing.phrases ?? [existing];
|
||||
for (const phrase of affected) phrase.photos.forEach(photo => URL.revokeObjectURL(photo.url));
|
||||
entries.splice(entries.indexOf(existing), 1);
|
||||
deleteDialog.close();
|
||||
setStatus();
|
||||
redrawLibrary();
|
||||
});
|
||||
|
||||
choosePhoto.addEventListener("click", () => {
|
||||
photoTarget = photoKey();
|
||||
photoTarget = activePhrase();
|
||||
fileInput.click();
|
||||
});
|
||||
fileInput.addEventListener("change", () => {
|
||||
const file = fileInput.files[0];
|
||||
if (photoTarget && file && ["image/jpeg", "image/png"].includes(file.type)) {
|
||||
const previous = photos.get(photoTarget);
|
||||
if (previous) URL.revokeObjectURL(previous.url);
|
||||
photos.set(photoTarget, { name: file.name, url: URL.createObjectURL(file) });
|
||||
const stillPresent = types.some(type => type.rules.some(rule => rule.phrases.includes(photoTarget)));
|
||||
if (stillPresent && fileInput.files.length) {
|
||||
const current = photoTarget.photos;
|
||||
const available = maxPhotos - current.length;
|
||||
const selected = [...fileInput.files].slice(0, available);
|
||||
const imported = selected.filter(file => ["image/jpeg", "image/png"].includes(file.type));
|
||||
current.push(...imported.map(file => ({ name: file.name, url: URL.createObjectURL(file) })));
|
||||
const issues = [];
|
||||
if (selected.length > imported.length) issues.push(`${selected.length - imported.length} 张图片无法导入。`);
|
||||
if (fileInput.files.length > available) issues.push(`超出数量上限的 ${fileInput.files.length - available} 张图片未导入。`);
|
||||
setStatus(issues.join(" "));
|
||||
}
|
||||
photoTarget = undefined;
|
||||
fileInput.value = "";
|
||||
redrawPhoto();
|
||||
});
|
||||
removePhoto.addEventListener("click", () => {
|
||||
const key = photoKey();
|
||||
const attachment = photos.get(key);
|
||||
if (attachment) URL.revokeObjectURL(attachment.url);
|
||||
photos.delete(key);
|
||||
redrawPhoto();
|
||||
});
|
||||
photoPhrase.addEventListener("change", redrawPhoto);
|
||||
editor.addEventListener("input", redrawPhrases);
|
||||
|
||||
editor.value = drafts.get(activeGroup) ?? "";
|
||||
redrawPhrases();
|
||||
groups.addEventListener("change", () => {
|
||||
drafts.set(activeGroup, editor.value);
|
||||
activeGroup = groups.value;
|
||||
editor.value = drafts.get(activeGroup) ?? "";
|
||||
redrawPhrases();
|
||||
for (const picker of [typePicker, rulePicker, phrasePicker]) {
|
||||
picker.addEventListener("change", () => {
|
||||
setStatus();
|
||||
redrawLibrary();
|
||||
});
|
||||
}
|
||||
byId("save-preview").addEventListener("click", () => {
|
||||
const status = byId("library-status");
|
||||
const invalid = [byId("video-limit"), byId("replies-per-video")].find(input => !input.validity.valid);
|
||||
status.textContent = invalid ? `${invalid.labels[0].textContent}须为 1–100 的整数。` : "预览配置已更新。";
|
||||
status.classList.toggle("error", Boolean(invalid));
|
||||
status.hidden = false;
|
||||
invalid?.focus();
|
||||
});
|
||||
redrawLibrary();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+99
-1
@@ -1,6 +1,104 @@
|
||||
# 拾见开发进度
|
||||
|
||||
最近更新于 2026-11-26 10:05(UTC+8)。以下按开发轮次倒序记录。
|
||||
最近更新于 2026-11-26 13:50(UTC+8)。以下按开发轮次倒序记录。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.19 连续实发验收
|
||||
|
||||
- 发送前核对原评论的旧回复,跳过基线不完整或已有相同正文的候选。绑定图无法读取时停止提交。发布后等待评论编辑框收起,再核对本人回复。
|
||||
- 首次回读证据不足且已保存可靠发送记录时,由同一次任务重新搜索并复核原回复。复核只读取已发布内容,同一次任务最多触发一次该条回复的发送。
|
||||
- vivo Android 12、抖音 39.8.0。沿用手机保存的 3 组关键词、话术及绑定图,在原检查点增加一个验收视频名额。13:48:23 单次启动后自动打开抖音并搜索,13:49:37 在第 8 个视频的评论区第 8 屏命中关键词,实发 1 条定向图文回复。
|
||||
- 13:49:52 在命中原评论下核对同一条本人回复的正文及 1 张绑定图,同一次任务自动写入 `SENT`。从启动日志到回执用时 89 秒。任务完成 8/8,新增回执 1 条,待核对为 0。启动后全程只读观察,无单独复核启动或人工确认。
|
||||
- 离线构建、APK v2 签名校验和 45 项 JVM 单测通过。Lint 为 0 个错误、2 个兼容性警告。0.1.19 已覆盖安装,原配置和历史回执已保留,无障碍设置已恢复,任务服务和暂存图已清理。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.18 分页后继续定位图片
|
||||
|
||||
- 原评论位于长列表中时,展开两页后,新回复可能仍在屏幕底部。增加同一评论串内的有限调整次数,使读完分页后仍能继续定位完整正文及图片。
|
||||
- 13:33 在 vivo Android 12、抖音 39.8.0 上启动对 13:06 已发布回复的自动复核。拾见重新搜索并定位原视频及原评论,自动展开两级回复分页并调整位置。在同一条本人回复中核对完整正文和 1 张绑定图。
|
||||
- 13:34:35 拾见自动写入 1 条 `SENT` 回执,任务完成 7/7,待核对为 0,后台任务已停止。本轮共实发 1 条,复核期间未再次发布。首次实发和自动回执分两段验收,最新版本从一次启动到实发并记回执的连续真机流程仍待验证。
|
||||
- 离线构建、APK v2 签名校验和 43 项 JVM 单测通过。Lint 为 0 个错误、2 个兼容性警告。0.1.18 已覆盖安装,校验安装包与本机产物一致。原配置和历史回执已保留,暂存图片已清理,无障碍设置已恢复。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.17 原生回复展开回退
|
||||
|
||||
- 复核时沿原评论的回复行定位分页控件。常规节点读取缺少控件时,用原生控件 ID 查找并核对归属。确认标签仍在同一评论串内后,点击标签中心展开。
|
||||
- 离线构建、APK v2 签名和 43 项 JVM 单测通过。13:30 真机验证已点开两级回复分页,并看到同一条已发布回复的原生节点。新回复的正文和图片仍在屏幕底部,待核对记录保留。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.16 调整图文回执的可视范围
|
||||
|
||||
- 按原评论作者仍可见的范围计算滚动距离,让原评论和回复图片同时进入可视范围。日期控件被裁切时,读取同一条本人回复的无障碍描述。符合发送前基线的近期回执可在 30 分钟内复核。
|
||||
- 离线构建、APK v2 签名和 43 项 JVM 单测通过。13:24 真机继续核对同一条回复,定位到原评论,仍有一页子回复未打开,待核对记录保留。此轮没有新的发布。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.15 读取折叠的后续回复
|
||||
|
||||
- 0.1.14 复核到正确的原评论。抖音把新回复折叠在该评论串的「展开更多」后。0.1.15 新增识别此控件。13:20 真机对同一条回复复核时,已自动展开并读到正文,图片下方仍被裁切,回执保留待核对。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.14 展开评论区并复核回执
|
||||
|
||||
- 原评论下有多条旧回复时,半屏评论区容易把原评论或新回复挤出视野。先核对抖音原生「放大评论区」控件,再在同一条评论串内调整位置,重新核对原评论身份、本人回复、正文及图片。
|
||||
- 发送前能排除已有相同正文的回复时,记录提交时间。新增「自动核对回复」,可对近期待核对项重新定位原视频和原评论,校验本人回复的发布时间、正文及图片。该操作只核对既有回复。
|
||||
- 离线构建、APK v2 签名校验及 43 项 JVM 单测通过。离线预览在 1440 和 390 像素宽度下通过自动核对入口和日志检查。
|
||||
- 13:15 在真机启动对同一条已发布回复的复核。拾见定位到原视频和原评论,回复仍折叠在「展开更多」中,待核对保留。为旧版测试记录补入实际提交时间,未写入回执或再次发布。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.13 抖音图文自动回执
|
||||
|
||||
- 发送前读取命中原评论的旧回复,必要时展开其回复列表。发送后定位原评论及紧邻的本人子回复,校验完整正文,并逐张比对该回复里的图片。原评论被滚出视野时,重新打开同一视频的评论区定位。
|
||||
- Android 11 及以上通过无障碍截图在内存中读取图片区域。允许平台缩放和裁剪造成的像素差异。旧回复无法完整核对、页面变化或图片不足以比对时保留待核对记录,避免重复发送。
|
||||
- 离线构建、APK v2 签名校验和 41 项 JVM 单测通过,其中 6 项覆盖图片比对。Lint 为 0 个错误、2 个兼容性警告。离线预览在 1440 和 390 像素宽度下验证新增的回执日志示例。
|
||||
- 0.1.13 已覆盖安装到 vivo Android 12 真机。13:00 使用手机已保存的配置启动实发验收,测试检查点只增加一个视频名额,每个视频最多回复 1 条。
|
||||
- 前三条新增测试视频均未找到可回复的匹配评论,拾见自动跳过。13:06 在下一条视频的评论区第 3 屏命中,实发 1 条图文回复。放大评论区后,人工观察原评论下的同一条本人回复,核对正文与绑定图。拾见仍保留待核对记录。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.12 深层播放控件识别
|
||||
|
||||
- 恢复旧任务(2/3 个视频已处理)时复现抖音滑动起点核对失败,两次均停在发送前。真机节点记录显示,分享、作者、标题及评论控件位于较深的播放器节点内。
|
||||
- 滑动前重新读取两次相同的视频身份。常规节点读取缺少锚点时,沿同一播放器容器核对分享、作者和标题,再确定滑动起点。手动验证下一条视频的评论区存在符合已保存配置的原评论。
|
||||
- 评论入口的常规节点读取失效时,在已核对身份的播放器内查找唯一的原生评论控件。离线 APK 构建、APK v2 签名校验和 35 项 JVM 单测通过。Lint 为 0 个错误、1 个已有警告。0.1.12 已覆盖安装到原应用。
|
||||
- 12:45–12:46 在 vivo Android 12、抖音 39.8.0 上使用手机原配置恢复任务,自动滑到第 3 个视频,在评论区第 1 屏命中关键字并实发 1 条定向回复。重新打开评论区,在命中的原评论下核对到标记「我」的子回复,正文与话术一致,同一回复内的一张图与绑定原图匹配。
|
||||
- 12:48 在拾见登记人工确认回执 `USER_CONFIRMED`。原任务完成 3/3,待核对为空,后台任务已停止。原配置和历史回执均已保留,暂存图片已清理,无障碍设置已恢复。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.11 每条视频回复上限
|
||||
|
||||
- 「配置」新增「每条视频回复上限」,默认 1 条,可设为 1–100 条。按视频分别累计已确认的回复。达标、评论列表到末尾或扫描范围内没有更多匹配时,继续浏览下一个视频。检查点保留当前视频及逐条回复状态,恢复后跳过已处理的原评论。
|
||||
- 回执核对到原评论下新增「我」回复且正文、图片数量匹配时可自动确认。评论折叠、原评论被裁切或证据不足时保留待核对状态。可跳过该回复后继续扫描同一视频。
|
||||
- 35 项 JVM 单测通过,覆盖多条回复计数、短评论区跳过、达标换视频、恢复去重、旧记录兼容。静态界面在 1440 px 和 390 px 下验证两个上限可独立设置,默认值和非法值处理正确。
|
||||
- 12:02、12:04 用原配置的话术和绑定图,在同一抖音视频的两条不同原评论下分别实发 1 条图文回复。在原评论下核对对应正文和各自的图片,记录 2 条人工确认回执。12:05 在达到 2 条上限后恢复任务,拾见自行打开下一条视频。
|
||||
- 12:06–12:08 单独测试无匹配分支。拾见扫描第一个视频后自动切到第二个视频,两条视频都记为 `NO_REPLY`,实际发布 0 条。
|
||||
- 真机发布测试在隔离的验收应用内完成,验收应用和暂存图已清理。正式 0.1.11 APK 已覆盖安装并通过 APK v2 签名校验,Lint 为 0 个错误、1 个已有警告。核对了正式应用的原配置和检查点,真机配置页可见新字段及旧配置的默认值 1。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.10 定向图文实发
|
||||
|
||||
- 11:35–11:36 在 vivo Android 12、抖音 39.8.0 上沿用用户保存的内容类型、关键字、话术和绑定图片。首个视频未命中并跳过,在第二个视频的评论区第 7 屏命中关键字,实发 1 条定向回复。
|
||||
- 重新定位命中的原评论后,在紧接该评论的子回复中核对到「我」标记、完全匹配的正文及一张图片。该图片缩略图与绑定原图经居中裁剪对齐后匹配。
|
||||
- 11:40 在拾见确认回执,新增 1 条 `USER_CONFIRMED`,待核对记录清空。原配置仍为单次 3 条,本轮已处理 2 条并暂停,确认发送 1 条。核对了原配置及无障碍设置,已清理暂存图。
|
||||
|
||||
## 2026-11-26 · 使用用户保存的配置复验
|
||||
|
||||
- 11:28–11:29 在 vivo Android 12、抖音 39.8.0 上读取手机当前配置,使用已保存的内容类型、评论关键字、话术及一张绑定图片。首个视频的评论区第 1 屏命中关键字,按原评论定位回复框,图文通过发送前校验。
|
||||
- 真机回读的草稿正文与配置话术一致,所选临时图片的 SHA-256 与绑定原图一致。测试拦截发送,实际发布 0 条。实际发布记录和回执仍待验收。
|
||||
- 清理本次草稿及暂存图片,恢复 0.1.10 APK 和原任务检查点,核对原配置及无障碍设置。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.10 定向回复真机联调
|
||||
|
||||
- vivo Android 12、抖音 39.8.0。升级后配置页可直接读取旧版内容类型、话术和原有的一张绑定图片。
|
||||
- 真机确认评论行的「回复」入口会打开带原评论作者的输入框。写入正文后抖音会隐藏作者提示,应用改为从写入前确认的原生输入框和外层容器持续校验焦点、正文及附件。
|
||||
- 抖音相册默认单选,显式开启「多选」后可将两张合成图带回同一个定向回复。回复框的列表总数会包含末尾「添加图片」格,已改为验证末尾节点属于照片或添加控件后计算实际照片数。
|
||||
- 11:13 恢复此前的测试检查点,按内容类型搜索,在评论区第 3 屏命中关键字,将测试文字与 2 张图片填入同一个原评论回复框。11:16 复测 7 张图片,横向滚动到附件列表末尾,完整图文通过发送前校验。两轮均由联调包拦截发送,实际发布 0 条。另验证了无匹配时跳过视频,确认发送为 0。
|
||||
- 清除测试草稿、图片和测试配置,逐份核对用户原设置、检查点、日志的 SHA-256,并恢复无障碍设置。0.1.10 APK 已覆盖安装,安装包与本机产物哈希一致。
|
||||
- 离线构建、APK v2 签名校验和 26 项 JVM 单元测试通过。Lint 为 0 个错误、1 个已有警告。实际发布及发布后回执留待另行验收。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.9 按内容类型匹配原评论
|
||||
|
||||
- 配置页按内容类型、评论关键字、话术和绑定图片管理资源。增删改在保存后生效。原关键词和图文绑定可迁移到同名类型,改名或改写话术会保留图片。
|
||||
- 任务用类型名称搜索。抖音评论列表使用分段变速曲线滑动,限制在列表可视区域内,并在每屏读取评论正文。匹配兼容全角半角和中英文空格,重叠时优先选更长的词。每个视频最多回复一次,最多滑动 12 次。
|
||||
- 同一关键字库按已使用话术分散抽取,图片按所选话术绑定顺序使用。提交前重新校验当前库和原评论身份,保存带原评论作者的待核对记录。现阶段定向回复提交后保留人工核对,下一轮真机联调验证原评论下的自动回读。
|
||||
- 离线 Chrome 在 1440 px 和 390 px 宽度验证配置层级、内容改名、同类型重复关键字保护、跨类型隔离、批量选图、图片排序和移除。
|
||||
- 离线构建及 APK v2 签名校验通过。26 项 JVM 单测全部通过,覆盖关键词匹配、跨类型隔离、话术轮换、运行中改配置、提交前复核和待核对恢复。Lint 为 0 个错误、1 个已有警告。
|
||||
- 真机联调待开始,需验证 Android 配置迁移、抖音回复对象回读、滑动后的评论刷新、原评论下的图文位置和发送回执。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.8 每条话术绑定多张图片
|
||||
|
||||
- 每个关键词组可维护多条话术,每条独立绑定最多 9 张本机图片。支持批量添加、逐张预览、调整顺序和移除。保存后,新任务快照保留完整图片列表,待核对页面列出全部绑定图片。
|
||||
- Android 真机使用合成配置验证旧单图绑定、旧待核对记录、纯文字配置兼容,以及新版多图的顺序回写。离线 Chrome 验证桌面和移动预览、批量绑定、跨话术隔离、排序和移除。
|
||||
- 10:35 在 vivo Android 12 上使用禁止发送的测试包恢复任务。拾见按绑定顺序选中 9 张合成图,并将测试文字和全部图片带入同一条抖音评论草稿。临时相册选中数量和编辑框附件总数均通过校验,实际发布 0 条。测试资源已清理,原配置和检查点已恢复。
|
||||
- 最终 APK 通过离线构建、17 项 JVM 单测及 APK v2 签名校验。Lint 为 0 个错误、1 个已有警告。已覆盖安装真机。
|
||||
|
||||
## 2026-11-26 · 拾见 0.1.7 单条图文实发验收
|
||||
|
||||
|
||||
Reference in New Issue
Block a user