|
@@ -43,8 +43,6 @@ export function CheckoutForm() {
|
|
|
const [bankOptionsError, setBankOptionsError] = useState<string | null>(null);
|
|
const [bankOptionsError, setBankOptionsError] = useState<string | null>(null);
|
|
|
const [selectedBankCode, setSelectedBankCode] = useState("");
|
|
const [selectedBankCode, setSelectedBankCode] = useState("");
|
|
|
const [depositAmount, setDepositAmount] = useState("");
|
|
const [depositAmount, setDepositAmount] = useState("");
|
|
|
- const [name, setName] = useState("");
|
|
|
|
|
- const [phone, setPhone] = useState("");
|
|
|
|
|
const [msg, setMsg] = useState<string | null>(null);
|
|
const [msg, setMsg] = useState<string | null>(null);
|
|
|
const [submitting, setSubmitting] = useState(false);
|
|
const [submitting, setSubmitting] = useState(false);
|
|
|
const [submitDialog, setSubmitDialog] = useState<{
|
|
const [submitDialog, setSubmitDialog] = useState<{
|
|
@@ -127,8 +125,8 @@ export function CheckoutForm() {
|
|
|
amount: finalAmount,
|
|
amount: finalAmount,
|
|
|
bankCode: selectedBankCode || undefined,
|
|
bankCode: selectedBankCode || undefined,
|
|
|
goodIds: [goodsId],
|
|
goodIds: [goodsId],
|
|
|
- payName: name.trim(),
|
|
|
|
|
- payPhone: phone.trim(),
|
|
|
|
|
|
|
+ payName: "",
|
|
|
|
|
+ payPhone: "",
|
|
|
});
|
|
});
|
|
|
if (!resultUrl) {
|
|
if (!resultUrl) {
|
|
|
throw new Error("下单成功但未返回支付地址");
|
|
throw new Error("下单成功但未返回支付地址");
|
|
@@ -251,9 +249,7 @@ export function CheckoutForm() {
|
|
|
<tr className="text-left text-[var(--muted)]">
|
|
<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">处理时间</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>
|
|
<th className="px-4 py-3 font-medium text-right">操作</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
@@ -275,9 +271,7 @@ export function CheckoutForm() {
|
|
|
)}
|
|
)}
|
|
|
</td>
|
|
</td>
|
|
|
<td className="px-4 py-3 text-[var(--muted)]">{channel.description}</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.processingTime}</td>
|
|
|
- <td className="px-4 py-3">{channel.fee}</td>
|
|
|
|
|
<td className="px-4 py-3 text-right">
|
|
<td className="px-4 py-3 text-right">
|
|
|
<button
|
|
<button
|
|
|
type="button"
|
|
type="button"
|
|
@@ -451,21 +445,25 @@ export function CheckoutForm() {
|
|
|
|
|
|
|
|
<div className="mt-5 grid gap-4 md:grid-cols-2">
|
|
<div className="mt-5 grid gap-4 md:grid-cols-2">
|
|
|
<div>
|
|
<div>
|
|
|
- <label className="text-sm font-medium">{t("payerName")}</label>
|
|
|
|
|
|
|
+ <label className="text-sm font-medium text-slate-400">{t("payerName")}</label>
|
|
|
<input
|
|
<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>
|
|
|
<div>
|
|
<div>
|
|
|
- <label className="text-sm font-medium">{t("payerPhone")}</label>
|
|
|
|
|
|
|
+ <label className="text-sm font-medium text-slate-400">{t("payerPhone")}</label>
|
|
|
<input
|
|
<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>
|
|
|
</div>
|
|
</div>
|
|
@@ -480,8 +478,6 @@ export function CheckoutForm() {
|
|
|
submitting ||
|
|
submitting ||
|
|
|
!selectedChannelId ||
|
|
!selectedChannelId ||
|
|
|
(shouldShowBankSelector && !selectedBankCode) ||
|
|
(shouldShowBankSelector && !selectedBankCode) ||
|
|
|
- !name.trim() ||
|
|
|
|
|
- !phone.trim() ||
|
|
|
|
|
!(Number(depositAmount) > 0)
|
|
!(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"
|
|
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"
|