فهرست منبع

refactor: 迁移咨询表单组件并优化字段校验

nahida 1 ماه پیش
والد
کامیت
f72d1b6d15
2فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 3 3
      src/app/support/page.tsx
  2. 2 3
      src/components/support/ServiceFormClient.tsx

+ 3 - 3
src/app/support/page.tsx

@@ -2,7 +2,7 @@ import SubTitle from "@/components/subTitle";
 import Image from "next/image";
 import {serverGet} from "@/utils/request";
 import AnimatedSection from "@/components/AnimatedSection";
-import ServiceFormClient from "./ServiceFormClient";
+import ServiceFormClient from "@/components/support/ServiceFormClient";
 
 export default async function ServicePage() {
   const res = await serverGet("/webSite/getBasicInfo");
@@ -107,12 +107,12 @@ export default async function ServicePage() {
 
               {/* Right Side - Light Effects Area */}
               <div className="hidden lg:block space-y-8 pl-12">
-                <div className="text-white">
+                {/* <div className="text-white">
                   <p className="text-gray-300 mb-2">中科盛阳服务热线:</p>
                   <p className="text-5xl font-black text-blue-400 drop-shadow-lg tracking-tight">
                     {basicInfo.serviceHotline}
                   </p>
-                </div>
+                </div> */}
 
                 <div className="space-y-4">
                   <p className="text-gray-300 text-lg font-medium leading-relaxed">

+ 2 - 3
src/app/support/ServiceFormClient.tsx → src/components/support/ServiceFormClient.tsx

@@ -7,7 +7,7 @@ import { clientPost } from "@/utils/clientRequest"
 const { TextArea } = Input
 
 interface ServiceFormValues {
-  name: string
+  name?: string
   phone: string
   content: string
 }
@@ -48,10 +48,9 @@ function ServiceForm() {
             label={<span className="text-gray-300 font-medium text-sm">联系人姓名</span>}
             name="name"
             className="mb-4"
-            rules={[{ required: true, message: "请输入您的姓名" }]}
           >
             <Input 
-              placeholder="请输入您的姓名" 
+              placeholder="请输入您的姓名(选填)" 
               className="h-10 border-white/20 bg-white/5 text-white placeholder:text-gray-500 text-sm"
             />
           </Form.Item>