fix(c2c-bot): 水单移除交易哈希,仅保留在分类账中

水单图片不再显示交易哈希(txHash),减少对终端用户暴露的链上细节。
txHash 仍保留在 ProofData 接口和数据库中,供分类账和审计使用。
同时缩小 SVG 高度(480→420)并重新排列剩余字段。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-02 19:35:48 -08:00
parent 0fe0f3b72a
commit bf11a269a4
1 changed files with 8 additions and 19 deletions

View File

@ -41,22 +41,16 @@ export class PaymentProofService {
private buildSvg(data: ProofData): string {
const time = data.completedAt.toISOString().replace('T', ' ').slice(0, 19);
const shortTx = data.txHash.length > 20
? `${data.txHash.slice(0, 10)}...${data.txHash.slice(-10)}`
: data.txHash;
const shortAddr = data.sellerAddress.length > 20
? `${data.sellerAddress.slice(0, 10)}...${data.sellerAddress.slice(-10)}`
: data.sellerAddress;
return `<svg xmlns="http://www.w3.org/2000/svg" width="600" height="480">
return `<svg xmlns="http://www.w3.org/2000/svg" width="600" height="420">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#f8fafc"/>
<stop offset="100%" stop-color="#e2e8f0"/>
</linearGradient>
</defs>
<rect width="600" height="480" rx="16" fill="url(#bg)"/>
<rect x="20" y="20" width="560" height="440" rx="12" fill="white" stroke="#cbd5e1" stroke-width="1"/>
<rect width="600" height="420" rx="16" fill="url(#bg)"/>
<rect x="20" y="20" width="560" height="380" rx="12" fill="white" stroke="#cbd5e1" stroke-width="1"/>
<!-- Header -->
<rect x="20" y="20" width="560" height="70" rx="12" fill="#1e40af"/>
@ -79,21 +73,16 @@ export class PaymentProofService {
<line x1="60" y1="248" x2="540" y2="248" stroke="#e2e8f0" stroke-width="1"/>
<text x="60" y="275" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="13" fill="#64748b"></text>
<text x="60" y="298" font-family="monospace,Noto Sans CJK SC,sans-serif" font-size="14" fill="#1e293b">${this.esc(shortTx)}</text>
<text x="60" y="275" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="13" fill="#64748b">ID</text>
<text x="60" y="298" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="16" font-weight="bold" fill="#1e293b">${this.esc(data.sellerId)}</text>
<line x1="60" y1="315" x2="540" y2="315" stroke="#e2e8f0" stroke-width="1"/>
<text x="60" y="340" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="13" fill="#64748b">ID</text>
<text x="60" y="363" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="16" font-weight="bold" fill="#1e293b">${this.esc(data.sellerId)}</text>
<line x1="60" y1="380" x2="540" y2="380" stroke="#e2e8f0" stroke-width="1"/>
<text x="60" y="405" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="13" fill="#64748b"></text>
<text x="60" y="428" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="15" fill="#1e293b">${this.esc(time)}</text>
<text x="60" y="340" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="13" fill="#64748b"></text>
<text x="60" y="363" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="15" fill="#1e293b">${this.esc(time)}</text>
<!-- Footer -->
<text x="300" y="458" text-anchor="middle" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="11" fill="#94a3b8"> · RWAdurian C2C Bot</text>
<text x="300" y="395" text-anchor="middle" font-family="Noto Sans CJK SC,Noto Sans SC,sans-serif" font-size="11" fill="#94a3b8"> · RWAdurian C2C Bot</text>
</svg>`;
}