Витрина: телефон в заказе обязателен, предзаполнен из профиля
payment-router с 20261111 требует телефон (слово владельца: писать покупателю в Telegram, если оплата не прошла). Поле видимое, обязательное, подставляется User.phone, если есть. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ export default async function StudentDashboard() {
|
||||
|
||||
const dbUser = await prisma.user.findUnique({
|
||||
where: { id: session.user.id },
|
||||
select: { archetype: true },
|
||||
select: { archetype: true, phone: true },
|
||||
});
|
||||
|
||||
const enrollments = await prisma.courseEnrollment.findMany({
|
||||
@@ -168,7 +168,7 @@ export default async function StudentDashboard() {
|
||||
{locked.length > 0 && (
|
||||
<StoreShowcase
|
||||
courses={locked}
|
||||
buyer={{ name: session.user.name, email: session.user.email }}
|
||||
buyer={{ name: session.user.name, email: session.user.email, phone: dbUser?.phone }}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ interface PayMethod {
|
||||
interface Props {
|
||||
course: LockedCourse;
|
||||
entry: StoreCatalogEntry;
|
||||
buyer: { name: string; email: string };
|
||||
buyer: { name: string; email: string; phone?: string | null };
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
@@ -257,6 +257,34 @@ export function StoreCheckoutModal({ course, entry, buyer, onClose }: Props) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Phone — required by payment-router since 20261111 (owner messages buyers in Telegram) */}
|
||||
<div className="mb-4">
|
||||
<label
|
||||
className={labelClass}
|
||||
style={{ color: "var(--muted-foreground)" }}
|
||||
htmlFor={`${titleId}-phone`}
|
||||
>
|
||||
Телефон
|
||||
</label>
|
||||
<input
|
||||
id={`${titleId}-phone`}
|
||||
type="tel"
|
||||
name="phone"
|
||||
required
|
||||
maxLength={30}
|
||||
autoComplete="tel"
|
||||
inputMode="tel"
|
||||
defaultValue={buyer.phone ?? ""}
|
||||
placeholder="+7 900 000-00-00"
|
||||
style={inputStyle}
|
||||
onFocus={(e) => (e.currentTarget.style.borderColor = "var(--foreground)")}
|
||||
onBlur={(e) => (e.currentTarget.style.borderColor = "var(--border)")}
|
||||
/>
|
||||
<p className="text-xs mt-1" style={{ color: "var(--muted-foreground)" }}>
|
||||
Напишу в Telegram, если с оплатой что-то пойдёт не так.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Promo code */}
|
||||
<div className="mb-4">
|
||||
<label
|
||||
|
||||
@@ -6,7 +6,7 @@ import { StoreCheckoutModal, type LockedCourse } from "./store-checkout-modal";
|
||||
|
||||
interface Props {
|
||||
courses: LockedCourse[];
|
||||
buyer: { name: string; email: string };
|
||||
buyer: { name: string; email: string; phone?: string | null };
|
||||
}
|
||||
|
||||
// Blurred card body shared by both the modal-trigger button and the
|
||||
|
||||
Reference in New Issue
Block a user