实现用户咨询接口

This commit is contained in:
2025-12-18 14:23:23 +08:00
parent 040ddd674b
commit fe5a9d2d48
2 changed files with 9 additions and 4 deletions

View File

@@ -12,5 +12,10 @@ export async function submitInquiry(data: {
usage: string
purpose: string
}) {
return await callByDevice('/api/customization/submit', data)
return await callByDevice('/api/inquiry/create', {
company: data.company,
name: data.name,
phone: data.phone,
content: `[${data.usage}] ${data.purpose}`,
})
}

View File

@@ -63,7 +63,7 @@ export default function CustomPage() {
}
const scrollToForm = () => {
const formElement = document.getElementById('inquery-form')
const formElement = document.getElementById('inquiry-form')
if (formElement) {
formElement.scrollIntoView({behavior: 'smooth', block: 'start'})
}
@@ -78,11 +78,11 @@ export default function CustomPage() {
<Wrap className="flex flex-col gap-16">
{/* 1. 顶部介绍区 */}
<SelfDesc onInquiry={() => {
document.getElementById('inquery-form')?.scrollIntoView({behavior: 'smooth', block: 'start'})
document.getElementById('inquiry-form')?.scrollIntoView({behavior: 'smooth', block: 'start'})
}}/>
{/* 2. 表单区 */}
<section id="inquery-form" className="bg-white rounded-lg p-6 lg:p-12">
<section id="inquiry-form" className="bg-white rounded-lg p-6 lg:p-12">
<div className="text-center mb-8 lg:mb-12">
<h2 className="text-2xl lg:text-3xl font-semibold"></h2>
<p className="text-gray-500 mt-2 text-sm lg:text-base">