ALIEZ 1 mēnesi atpakaļ
vecāks
revīzija
b0dca0c96d

+ 0 - 5
src/app/[locale]/account/withdraw-apply/page.tsx

@@ -525,11 +525,6 @@ export default function WithdrawApplyPage() {
             </div>
           ))}
         </div>
-        {selectedChannel ? (
-          <p className="mt-3 text-sm text-emerald-700">
-            已选择通道:{selectedChannel.name || selectedChannel.enName || selectedChannel.code}
-          </p>
-        ) : null}
       </section>
 
       <p className="mt-8 text-center text-sm">

+ 16 - 20
src/app/[locale]/checkout/checkout-form.tsx

@@ -43,8 +43,6 @@ export function CheckoutForm() {
   const [bankOptionsError, setBankOptionsError] = useState<string | null>(null);
   const [selectedBankCode, setSelectedBankCode] = useState("");
   const [depositAmount, setDepositAmount] = useState("");
-  const [name, setName] = useState("");
-  const [phone, setPhone] = useState("");
   const [msg, setMsg] = useState<string | null>(null);
   const [submitting, setSubmitting] = useState(false);
   const [submitDialog, setSubmitDialog] = useState<{
@@ -127,8 +125,8 @@ export function CheckoutForm() {
         amount: finalAmount,
         bankCode: selectedBankCode || undefined,
         goodIds: [goodsId],
-        payName: name.trim(),
-        payPhone: phone.trim(),
+        payName: "",
+        payPhone: "",
       });
       if (!resultUrl) {
         throw new Error("下单成功但未返回支付地址");
@@ -251,9 +249,7 @@ export function CheckoutForm() {
                         <tr className="text-left text-[var(--muted)]">
                           <th className="px-4 py-3 font-medium">付款方式</th>
                           <th className="px-4 py-3 font-medium">描述</th>
-                          <th className="px-4 py-3 font-medium">金额范围</th>
                           <th className="px-4 py-3 font-medium">处理时间</th>
-                          <th className="px-4 py-3 font-medium">费用</th>
                           <th className="px-4 py-3 font-medium text-right">操作</th>
                         </tr>
                       </thead>
@@ -275,9 +271,7 @@ export function CheckoutForm() {
                                 )}
                               </td>
                               <td className="px-4 py-3 text-[var(--muted)]">{channel.description}</td>
-                              <td className="px-4 py-3">{channel.amountRange}</td>
                               <td className="px-4 py-3">{channel.processingTime}</td>
-                              <td className="px-4 py-3">{channel.fee}</td>
                               <td className="px-4 py-3 text-right">
                                 <button
                                   type="button"
@@ -451,21 +445,25 @@ export function CheckoutForm() {
 
             <div className="mt-5 grid gap-4 md:grid-cols-2">
               <div>
-                <label className="text-sm font-medium">{t("payerName")}</label>
+                <label className="text-sm font-medium text-slate-400">{t("payerName")}</label>
                 <input
-                  required
-                  value={name}
-                  onChange={(e) => setName(e.target.value)}
-                  className="mt-1 w-full rounded-lg border border-[var(--border)] px-3 py-2 text-sm"
+                  type="text"
+                  value=""
+                  readOnly
+                  disabled
+                  aria-disabled
+                  className="mt-1 w-full cursor-not-allowed rounded-lg border border-slate-200 bg-slate-100 px-3 py-2 text-sm text-slate-500"
                 />
               </div>
               <div>
-                <label className="text-sm font-medium">{t("payerPhone")}</label>
+                <label className="text-sm font-medium text-slate-400">{t("payerPhone")}</label>
                 <input
-                  required
-                  value={phone}
-                  onChange={(e) => setPhone(e.target.value)}
-                  className="mt-1 w-full rounded-lg border border-[var(--border)] px-3 py-2 text-sm"
+                  type="text"
+                  value=""
+                  readOnly
+                  disabled
+                  aria-disabled
+                  className="mt-1 w-full cursor-not-allowed rounded-lg border border-slate-200 bg-slate-100 px-3 py-2 text-sm text-slate-500"
                 />
               </div>
             </div>
@@ -480,8 +478,6 @@ export function CheckoutForm() {
                   submitting ||
                   !selectedChannelId ||
                   (shouldShowBankSelector && !selectedBankCode) ||
-                  !name.trim() ||
-                  !phone.trim() ||
                   !(Number(depositAmount) > 0)
                 }
                 className="ui-interactive-btn w-full rounded-full bg-[var(--navy)] py-3 text-sm font-semibold text-white hover:bg-[var(--navy-soft)] disabled:cursor-not-allowed disabled:opacity-50"

+ 27 - 8
src/lib/checkout-api.ts

@@ -195,6 +195,14 @@ export async function fetchBankChannelOptions(channelCode?: string): Promise<Ban
   return normalizeBankChannelList(raw);
 }
 
+/**
+ * 银联 / 电汇等走 `/telegraphic/pay` 的通道:金额、银行等参数放在请求体,不拼在 `.../pay/...` 路径后面。
+ */
+export function isTelegraphicStylePayRequestUrl(requestUrl: string): boolean {
+  const n = `/${requestUrl.replace(/^\/+|\/+$/g, "")}`.toLowerCase();
+  return n.includes("telegraphic");
+}
+
 export async function submitXfgPayOrder(input: {
   requestUrl: string;
   amount: number;
@@ -209,14 +217,25 @@ export async function submitXfgPayOrder(input: {
     ? "/xfgpay/pay"
     : normalizedRequestUrl;
   const amount = String(input.amount);
-  const path = input.bankCode
-    ? `${payRequestPath}/1/${encodeURIComponent(amount)}/${encodeURIComponent(input.bankCode)}/0`
-    : `${payRequestPath}/1/${encodeURIComponent(amount)}/0`;
-  const body = {
-    goodIds: input.goodIds,
-    payName: input.payName,
-    payPhone: input.payPhone,
-  };
+  const useBodyForPayParams = isTelegraphicStylePayRequestUrl(payRequestPath);
+  const path = useBodyForPayParams
+    ? payRequestPath
+    : input.bankCode
+      ? `${payRequestPath}/1/${encodeURIComponent(amount)}/${encodeURIComponent(input.bankCode)}/0`
+      : `${payRequestPath}/1/${encodeURIComponent(amount)}/0`;
+  const body = useBodyForPayParams
+    ? {
+        goodIds: input.goodIds,
+        payName: input.payName,
+        payPhone: input.payPhone,
+        amount: input.amount,
+        ...(input.bankCode ? { bankCode: input.bankCode } : {}),
+      }
+    : {
+        goodIds: input.goodIds,
+        payName: input.payName,
+        payPhone: input.payPhone,
+      };
   const data = await postRemittance<unknown>(path, body);
   return { raw: data, resultUrl: pickResultUrl(data) };
 }