fix: 修复回填更新与截图刷新
This commit is contained in:
@@ -127,6 +127,11 @@ function statusLabel(item: Assignment, taskType = "content_publish") {
|
||||
}
|
||||
|
||||
const MAX_TASK_RESULT_SCREENSHOTS = 9;
|
||||
const PUBLISH_BACKFILL_SUCCESS = "这篇笔记的发布记录回填成功啦~";
|
||||
|
||||
function toastClassName(message: string) {
|
||||
return message === PUBLISH_BACKFILL_SUCCESS ? "toast success" : "toast";
|
||||
}
|
||||
|
||||
function resultScreenshotKeys(value: string | null) {
|
||||
const text = String(value ?? "").trim();
|
||||
@@ -594,6 +599,11 @@ export default function Home() {
|
||||
index: "1",
|
||||
kind,
|
||||
});
|
||||
const evidenceKey =
|
||||
kind === "publish"
|
||||
? item.publish_screenshot_key
|
||||
: item.creator_screenshot_key;
|
||||
if (evidenceKey) params.set("v", evidenceKey);
|
||||
if (delegationToken) params.set("share", delegationToken);
|
||||
else {
|
||||
params.set("task", taskToken);
|
||||
@@ -1013,7 +1023,7 @@ export default function Home() {
|
||||
});
|
||||
}, 120);
|
||||
}
|
||||
setToast("这篇笔记已回填,不会与其他笔记错配");
|
||||
setToast(PUBLISH_BACKFILL_SUCCESS);
|
||||
} catch (reason) {
|
||||
setToast(reason instanceof Error ? reason.message : "回填失败");
|
||||
} finally {
|
||||
@@ -1283,7 +1293,7 @@ export default function Home() {
|
||||
</form>
|
||||
</div>
|
||||
<ImageLightbox image={previewImage} onClose={() => setPreviewImage(null)} />
|
||||
{toast && <div className="toast">{toast}</div>}
|
||||
{toast && <div className={toastClassName(toast)}>{toast}</div>}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1610,7 +1620,6 @@ export default function Home() {
|
||||
value={creatorExposure}
|
||||
onChange={(event) => setCreatorExposure(event.target.value)}
|
||||
placeholder="填写截图中的曝光量"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
@@ -1624,7 +1633,6 @@ export default function Home() {
|
||||
value={creatorViews}
|
||||
onChange={(event) => setCreatorViews(event.target.value)}
|
||||
placeholder="填写截图中的阅读量"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
@@ -1650,7 +1658,7 @@ export default function Home() {
|
||||
</form>
|
||||
</div>
|
||||
<ImageLightbox image={previewImage} onClose={() => setPreviewImage(null)} />
|
||||
{toast && <div className="toast">{toast}</div>}
|
||||
{toast && <div className={toastClassName(toast)}>{toast}</div>}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1957,7 +1965,7 @@ export default function Home() {
|
||||
? "请保存当前分享链接;完成任务后通过此链接上传截图即可。"
|
||||
: "请保存当前分享链接;发布后仍需通过此链接回填第7天截图、曝光量和阅读量。"}
|
||||
</div>
|
||||
{toast && <div className="toast">{toast}</div>}
|
||||
{toast && <div className={toastClassName(toast)}>{toast}</div>}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -2104,7 +2112,7 @@ export default function Home() {
|
||||
<div><span>3</span><strong>{payload.task.type === "screenshot_collect" ? "上传截图" : "单篇回填"}</strong><p>{payload.task.type === "screenshot_collect" ? "每份任务与截图一一对应" : "昵称、链接、截图一一对应"}</p></div>
|
||||
</section>
|
||||
<footer>由 KOC LOOP 提供任务与数据安全保障</footer>
|
||||
{toast && <div className="toast">{toast}</div>}
|
||||
{toast && <div className={toastClassName(toast)}>{toast}</div>}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user