diff --git a/apps/web/src/app/propose/success/WalletCheckout.tsx b/apps/web/src/app/propose/success/WalletCheckout.tsx index ed7638d..3bbf029 100644 --- a/apps/web/src/app/propose/success/WalletCheckout.tsx +++ b/apps/web/src/app/propose/success/WalletCheckout.tsx @@ -1,6 +1,6 @@ "use client"; -import { Copy, ExternalLink, Wallet } from "lucide-react"; +import { AlertTriangle, CheckCircle2, Copy, ExternalLink, QrCode, ShieldCheck, Wallet } from "lucide-react"; import { useState } from "react"; type WalletCheckoutProps = { @@ -44,6 +44,12 @@ function CopyRow({ label, value, copyValue, copiedKey, copied, onCopy }: CopyRow ); } +function shortAddress(value: string) { + if (!value) return ""; + if (value.length <= 18) return value; + return `${value.slice(0, 10)}...${value.slice(-8)}`; +} + export function WalletCheckout({ amountUsdc, network, @@ -59,6 +65,19 @@ export function WalletCheckout({ const [copied, setCopied] = useState(""); const paymentMemo = `VibeWork Proposal ${proposalId}`; const walletReady = Boolean(walletAddress); + const qrData = paymentUri || walletAddress; + const qrCodeUrl = qrData + ? `https://api.qrserver.com/v1/create-qr-code/?size=220x220&margin=12&data=${encodeURIComponent(qrData)}` + : ""; + const checkoutDetails = [ + `VibeWork wallet checkout`, + `Amount: ${amountUsdc} USDC`, + `Network: ${network}`, + `Wallet: ${walletAddress}`, + `Chain ID: ${chainId}`, + `USDC token: ${tokenAddress}`, + `Memo: ${paymentMemo}`, + ].join("\n"); const copyValue = async (key: string, value: string) => { try { @@ -71,26 +90,37 @@ export function WalletCheckout({ }; return ( -
- 請使用 Base USDC 轉帳,完成後貼上 tx hash 進入人工確認。 + 請用自己的錢包確認金額、鏈與收款地址後付款。完成後貼上 tx hash,系統會先自動驗證 Base USDC。
+ 掃碼後仍請在錢包內確認網路、金額與收款地址。 +
+瀏覽器阻擋自動複製,請手動選取付款資訊。
diff --git a/apps/web/src/app/propose/success/page.tsx b/apps/web/src/app/propose/success/page.tsx index eb55a0d..f62341f 100644 --- a/apps/web/src/app/propose/success/page.tsx +++ b/apps/web/src/app/propose/success/page.tsx @@ -218,6 +218,18 @@ export default async function ProposalSuccessPage({ searchParams }: { searchPara placeholder={`建議填:VibeWork Proposal ${task?.id || taskId}`} /> +