下单页:撕凭证改为亲手撕;失败单能重渲没出图的模板;确认收货后不能再免费重渲
- 撕凭证:按住存根往外拉,拉够才撕下(没拉够弹回);撕下那一刻才发确认收货, 关弹窗 / 先不收货 = 没发生。留「直接撕下」按钮和回车键兜底。 - 重渲弹窗:把应出未出的模板列成「没出图」项(miss_tpls),失败单不再卡在「至少勾一张」; 什么信息都没有的老失败单直接整单重渲。服务器只认本单模板。 - 确认收货后:前端不再给免费重渲按钮,/api/redo 同样拒(直发单不受影响)。 - 状态接口给 files[].tpl、direct、accepted_by_buyer。 - 测试 +4(回执复现 33 条全过;数据库 38、内容后台 86 全过);浏览器实测 24 项全过。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2047,6 +2047,7 @@ class H(BaseHTTPRequestHandler):
|
|||||||
"name": f.get("name"),
|
"name": f.get("name"),
|
||||||
"size": fsz,
|
"size": fsz,
|
||||||
"skin": f.get("skin"),
|
"skin": f.get("skin"),
|
||||||
|
"tpl": f.get("tpl") or "", # 重渲弹窗要知道哪个模板已经出图(2026-10-07)
|
||||||
"is_raw": ("无压缩" in (f.get("name") or "")),
|
"is_raw": ("无压缩" in (f.get("name") or "")),
|
||||||
# 收货前:给预览地址;收货后:给原图地址
|
# 收货前:给预览地址;收货后:给原图地址
|
||||||
# ⚠️ 必须带 v=<文件 mtime>:重渲会把同名文件原地覆盖,URL 不变的话
|
# ⚠️ 必须带 v=<文件 mtime>:重渲会把同名文件原地覆盖,URL 不变的话
|
||||||
@@ -2103,6 +2104,10 @@ class H(BaseHTTPRequestHandler):
|
|||||||
"accepted": accepted,
|
"accepted": accepted,
|
||||||
# 买家自助重渲:用过没有 + 上次选了什么(页面按钮据此置灰)
|
# 买家自助重渲:用过没有 + 上次选了什么(页面按钮据此置灰)
|
||||||
"redo_used": bool(m.get("redo_used")),
|
"redo_used": bool(m.get("redo_used")),
|
||||||
|
# 直发单没有收货这一步(accepted 恒为真),免费重渲照样给;
|
||||||
|
# 买家亲手点过「确认收货」的单才关掉重渲 —— 前端靠这个区分(2026-10-07)
|
||||||
|
"direct": bool(m.get("direct")),
|
||||||
|
"accepted_by_buyer": bool(m.get("accepted")),
|
||||||
"redo_files": m.get("redo_files") or [],
|
"redo_files": m.get("redo_files") or [],
|
||||||
"amount": amount,
|
"amount": amount,
|
||||||
"amount": amount,
|
"amount": amount,
|
||||||
@@ -2636,7 +2641,14 @@ class H(BaseHTTPRequestHandler):
|
|||||||
return self.err("这一单还没渲完(或正在渲),等它停下来再说")
|
return self.err("这一单还没渲完(或正在渲),等它停下来再说")
|
||||||
if m.get("redo_used"):
|
if m.get("redo_used"):
|
||||||
return self.err("这一单已经用过一次免费重渲了。还不行的话进官方群找金钻,他看着办。")
|
return self.err("这一单已经用过一次免费重渲了。还不行的话进官方群找金钻,他看着办。")
|
||||||
|
# ⚠️ 2026-10-07:确认收货 = 买家认可了成品、原图已经放出去了。以前收货后照样能点免费重渲,
|
||||||
|
# 等于原图拿走了还能再白出一套。直发单(没有收货这一步)不受影响。
|
||||||
|
if m.get("accepted") and not m.get("direct"):
|
||||||
|
return self.err("这一单已经确认收货了,免费重渲只能在确认收货之前用。图有问题请进官方群找金钻。")
|
||||||
files = [str(x)[:60] for x in (d.get("files") or [])][:12]
|
files = [str(x)[:60] for x in (d.get("files") or [])][:12]
|
||||||
|
# 没渲出来的模板(渲染失败的那几张根本没有成品文件,勾不了文件名 → 直接报模板 key)
|
||||||
|
miss = [t for t in (d.get("miss_tpls") or []) if t in TPL_KEYS
|
||||||
|
and t in (m.get("templates") or [])][:MAX_IMAGES]
|
||||||
note = str(d.get("note") or "").strip()[:200]
|
note = str(d.get("note") or "").strip()[:200]
|
||||||
# 换皮肤(金钻 2026-10-02:「或者他皮肤填错了重新换」)——
|
# 换皮肤(金钻 2026-10-02:「或者他皮肤填错了重新换」)——
|
||||||
# 传错了很正常,他上传时只看到 512 预览,不该卡在这儿。
|
# 传错了很正常,他上传时只看到 512 预览,不该卡在这儿。
|
||||||
@@ -2700,12 +2712,15 @@ class H(BaseHTTPRequestHandler):
|
|||||||
for f in (m.get("files") or []):
|
for f in (m.get("files") or []):
|
||||||
if (f.get("name") or "") in want and f.get("tpl") and f["tpl"] not in redo_tpls:
|
if (f.get("name") or "") in want and f.get("tpl") and f["tpl"] not in redo_tpls:
|
||||||
redo_tpls.append(f["tpl"])
|
redo_tpls.append(f["tpl"])
|
||||||
|
for t in miss:
|
||||||
|
if t not in redo_tpls:
|
||||||
|
redo_tpls.append(t)
|
||||||
if not redo_tpls and files:
|
if not redo_tpls and files:
|
||||||
# 勾的图找不到模板(老单缺 tpl 字段)→ 退回整单,别让玩家点了没反应
|
# 勾的图找不到模板(老单缺 tpl 字段)→ 退回整单,别让玩家点了没反应
|
||||||
redo_tpls = []
|
redo_tpls = []
|
||||||
m["redo_tpls"] = redo_tpls
|
m["redo_tpls"] = redo_tpls
|
||||||
# 没换皮肤、只重渲一部分 → **保留**其它成品(claim 里清了就再也找不回来了)
|
# 没换皮肤、只重渲一部分 → **保留**其它成品(claim 里清了就再也找不回来了)
|
||||||
if files and redo_tpls:
|
if redo_tpls:
|
||||||
log("免费重渲 %s:只重出 %s" % (oid, "、".join(redo_tpls)))
|
log("免费重渲 %s:只重出 %s" % (oid, "、".join(redo_tpls)))
|
||||||
# 重渲中的那几张先从列表里撤掉(渲染机交新的回来时同名字覆盖)
|
# 重渲中的那几张先从列表里撤掉(渲染机交新的回来时同名字覆盖)
|
||||||
if files:
|
if files:
|
||||||
@@ -2713,8 +2728,8 @@ class H(BaseHTTPRequestHandler):
|
|||||||
m["state"] = "waiting"
|
m["state"] = "waiting"
|
||||||
m["started"] = m["finished"] = None
|
m["started"] = m["finished"] = None
|
||||||
m["note"] = "买家申请免费重渲%s:%s" % (
|
m["note"] = "买家申请免费重渲%s:%s" % (
|
||||||
("(只重出 %d 张:%s)" % (len(files), "、".join(files))
|
("(只重出:%s)" % "、".join((files or []) + ["%s(上次没出来)" % t for t in miss])
|
||||||
if (files and redo_tpls) else "(整单重出)"),
|
if redo_tpls else "(整单重出)"),
|
||||||
note or "(没写原因)")
|
note or "(没写原因)")
|
||||||
with LOCK:
|
with LOCK:
|
||||||
write_meta(oid, m)
|
write_meta(oid, m)
|
||||||
|
|||||||
Reference in New Issue
Block a user