|
|
@@ -2,28 +2,26 @@
|
|
|
|
|
|
import React, {useState} from "react"
|
|
|
import Image from "next/image"
|
|
|
-import {Pagination, Modal, Form, Input, Button, message} from "antd"
|
|
|
+import {Button, Form, Input, message, Modal, Pagination} from "antd"
|
|
|
import Link from "next/link";
|
|
|
import {serverPost} from "@/utils/request";
|
|
|
|
|
|
-// 定义产品项接口
|
|
|
-interface ProductItem {
|
|
|
- productId: string | number;
|
|
|
- productName: string;
|
|
|
- productUrl?: string;
|
|
|
- productIntroduction: string;
|
|
|
- productModel: string;
|
|
|
-}
|
|
|
-
|
|
|
// 留言表单数据接口(移除quantity字段)
|
|
|
interface QuoteFormValues {
|
|
|
name: string;
|
|
|
phone: string;
|
|
|
message: string;
|
|
|
- productId: string | number;
|
|
|
+ productId: string;
|
|
|
productName: string;
|
|
|
}
|
|
|
|
|
|
+interface SaveQuotePayload {
|
|
|
+ content: string;
|
|
|
+ deviceName: string;
|
|
|
+ name: string;
|
|
|
+ phone: string;
|
|
|
+}
|
|
|
+
|
|
|
interface ProductGridProps {
|
|
|
products: ProductItem[]
|
|
|
}
|
|
|
@@ -74,7 +72,7 @@ export default function ProductGrid({products}: ProductGridProps) {
|
|
|
try {
|
|
|
// 1. 设置提交中状态,禁用按钮
|
|
|
setSubmitting(true)
|
|
|
- const response = await serverPost<Page<QuoteFormValues>, {}>(
|
|
|
+ const response = await serverPost<Page<QuoteFormValues>, SaveQuotePayload>(
|
|
|
"/webSite/save",
|
|
|
{
|
|
|
content: values.message,
|
|
|
@@ -232,4 +230,4 @@ export default function ProductGrid({products}: ProductGridProps) {
|
|
|
</Modal>
|
|
|
</div>
|
|
|
)
|
|
|
-}
|
|
|
+}
|