/** * # 路由 联系页 /contact-us/ * 有 Elementor 内容则渲染;否则标准布局:联系方式卡片 + 询盘表单。 */ import { createFileRoute } from "@tanstack/react-router"; import { createServerFn } from "@tanstack/react-start"; import { getLayoutData, Layout } from "~/components/website/Layout"; import { ElementorRenderer, extractElementor } from "~/components/elementor/Renderer"; import { InquiryForm } from "~/components/website/InquiryForm"; import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator } from "~/components/ui/breadcrumb"; import { getPublishedContent } from "~/server/data"; export const Route = createFileRoute("/contact-us")({ // loader 本体抽为 Server Function(客户端导航在浏览器重跑 loader,db 依赖必须在服务端执行) loader: () => loadContactData(), head: ({ loaderData }) => ({ meta: [ { title: loaderData?.page?.seoTitle || "Contact Us | Dusun IoT" }, { name: "description", content: loaderData?.page?.seoDescription || "Contact Dusun IoT for IoT gateway solutions, OEM/ODM customization and technical support. Email sales@dusuniot.com." }, ], }), component: ContactPage, }); /** # 函数 联系页数据加载(Server Function:客户端导航时由服务端执行) */ const loadContactData = createServerFn({ method: "GET" }).handler(async (): Promise => { const [layout, page] = await Promise.all([ getLayoutData(), getPublishedContent("contact-us", "page").catch(() => null), ]); const meta = (page?.meta ?? null) as Record | null; return { layout, page, meta }; }); /** # 组件 联系页(原站为 full-canvas Elementor 模板:hero 通栏 + 表单卡叠压,不加 site-container) */ function ContactPage() { const data = Route.useLoaderData(); const elementor = extractElementor(data.meta); return ( {elementor ? ( ) : (
Home Contact Us

Contact Us

Sales & Inquiries

Email: sales@dusuniot.com
Tel: +86 755 2643 0850

Visit Us

5F, Building B, Henglong Industrial Park,
Xili, Nanshan District, Shenzhen, Guangdong, China

Support

24/7 technical support for OEM/ODM partners. Response within 24 hours on business days.

)}
); }