Browse Source

refactor(config): 更新生产环境配置和解决方案页面链接结构

- 将生产环境API基础URL从远程地址更改为本地地址
- 修改TypeScript配置中的JSX编译选项为react-jsx
- 更新Next.js类型定义文件引用路径
- 移除解决方案列表项上的重复尾随分号
- 将解决方案卡片包装在Link组件中以实现可点击导航
- 替换按钮组件为箭头图标并移除href属性
- 修复分页组件数据源使用正确的总数字段
- 简化解决方案页面的代码结构和样式类名
nahida 3 months ago
parent
commit
11e492868f
5 changed files with 56 additions and 55 deletions
  1. 2 2
      .env.production
  2. 1 1
      next-env.d.ts
  3. 51 50
      src/app/solutions/page.tsx
  4. 1 1
      src/components/about/ContactUs.tsx
  5. 1 1
      tsconfig.json

+ 2 - 2
.env.production

@@ -1,5 +1,5 @@
-NEXT_PUBLIC_API_BASE=http://47.107.107.47:8040
-NEXT_PUBLIC_BASE_URL=http://47.107.107.47:8040
+NEXT_PUBLIC_API_BASE=http://localhost:8040
+NEXT_PUBLIC_BASE_URL=http://localhost:8040
 NEXT_PUBLIC_REMOTE_BASE_URL=http://47.107.107.47:8040
 NEXT_PUBLIC_BASE_WS_URL = 'ws://47.107.107.47:8081/ws'
 NEXT_PUBLIC_CLIENT_URL=http://47.107.107.47:8040

+ 1 - 1
next-env.d.ts

@@ -1,6 +1,6 @@
 /// <reference types="next" />
 /// <reference types="next/image-types/global" />
-/// <reference path="./.next/types/routes.d.ts" />
+import "./.next/dev/types/routes.d.ts";
 
 // NOTE: This file should not be edited
 // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

+ 51 - 50
src/app/solutions/page.tsx

@@ -1,4 +1,4 @@
-import {Button} from "antd"
+import Link from "next/link"
 import {ArrowRightOutlined} from "@ant-design/icons"
 import MainTitle from "@/components/MainTitle"
 import Image from "next/image"
@@ -26,7 +26,6 @@ export default async function SolutionsPage({
     cache: "force-cache"
   })
   const solutionsData = res.data.records
-
   return (
     <>
       <AnimatedSection effect="slide" direction="left">
@@ -44,64 +43,66 @@ export default async function SolutionsPage({
         <div className="w-9/10 sm:w-7/10 mx-auto px-3 sm:px-4 py-4 sm:py-8">
           <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-6 mb-4 sm:mb-8">
             {solutionsData.map((solution, index) => (
-              <div
+              <Link
                 key={solution.id}
-                className="h-full shadow-md hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1 rounded-xl overflow-hidden bg-white relative"
-                style={{
-                  backgroundImage: `url("/assets/solutions/2.png")`,
-                  backgroundSize: "cover",
-                }}
+                href={`/solutions/${solution.id}`}
+                className="block h-full cursor-pointer group"
               >
-                {/* 内容容器 */}
-                <div className="p-4 sm:p-6 h-full flex flex-col relative z-10">
-                  <div className="mb-2 sm:mb-3">
-                    <h3
-                      className="text-base sm:text-lg font-semibold text-black mb-1 sm:mb-2 line-clamp-2 leading-tight sm:leading-normal drop-shadow-sm">
-                      {solution.programName}
-                    </h3>
-                    <p className="text-xs sm:text-sm text-black/80 mb-2 sm:mb-3 drop-shadow-sm">
-                      {solution.releaseTime}
-                    </p>
-                  </div>
+                <div
+                  className="h-full shadow-md hover:shadow-lg transition-all duration-300 transform group-hover:-translate-y-1 rounded-xl overflow-hidden bg-white relative"
+                  style={{
+                    backgroundImage: `url("/assets/solutions/2.png")`,
+                    backgroundSize: "cover",
+                  }}
+                >
+                  {/* 内容容器 */}
+                  <div className="p-4 sm:p-6 h-full flex flex-col relative z-10">
+                    <div className="mb-2 sm:mb-3">
+                      <h3
+                        className="text-base sm:text-lg font-semibold text-black mb-1 sm:mb-2 line-clamp-2 leading-tight sm:leading-normal drop-shadow-sm">
+                        {solution.programName}
+                      </h3>
+                      <p className="text-xs sm:text-sm text-black/80 mb-2 sm:mb-3 drop-shadow-sm">
+                        {solution.releaseTime}
+                      </p>
+                    </div>
 
-                  <div className="flex-1 mb-4">
-                    <p
-                      className="text-black/90 text-xs sm:text-sm leading-relaxed line-clamp-3 sm:line-clamp-4 drop-shadow-sm">
-                      {removeHTMLTags(solution.programDetails)}
-                    </p>
-                  </div>
+                    <div className="flex-1 mb-4">
+                      <p
+                        className="text-black/90 text-xs sm:text-sm leading-relaxed line-clamp-3 sm:line-clamp-4 drop-shadow-sm">
+                        {removeHTMLTags(solution.programDetails)}
+                      </p>
+                    </div>
 
-                  {/* 按钮区域 */}
-                  <div className="mt-auto pt-3 border-t border-white/20">
-                    <Button
-                      href={`/solutions/${solution.id}`}
-                      type="link"
-                      icon={<ArrowRightOutlined/>}
-                      className="text-white hover:text-white/80 p-0 h-auto font-medium transition-colors duration-200"
-                      style={{
-                        color: "black",
-                        textShadow: "0 1px 2px rgba(0,0,0,0.3)",
-                      }}
-                    >
-                      了解更多
-                    </Button>
+                    {/* 按钮区域 */}
+                    <div className="mt-auto pt-3 border-t border-white/20">
+                      <div
+                        className="flex items-center gap-2 text-black font-medium transition-colors duration-200"
+                        style={{
+                          textShadow: "0 1px 2px rgba(0,0,0,0.3)",
+                        }}
+                      >
+                        了解更多
+                        <ArrowRightOutlined />
+                      </div>
+                    </div>
                   </div>
-                </div>
 
-                {/* 装饰性元素 */}
-                <div
-                  className="absolute top-0 right-0 w-20 h-20 opacity-10"
-                  style={{
-                    background: "radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%)",
-                    transform: "translate(25%, -25%)",
-                  }}
-                />
-              </div>
+                  {/* 装饰性元素 */}
+                  <div
+                    className="absolute top-0 right-0 w-20 h-20 opacity-10"
+                    style={{
+                      background: "radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%)",
+                      transform: "translate(25%, -25%)",
+                    }}
+                  />
+                </div>
+              </Link>
             ))}
           </div>
 
           <div className="flex justify-center">
-            <PaginationClient current={pageNum} total={solutionsData.length} pageSize={pageSize}/>
+            <PaginationClient current={pageNum} total={res.data.total} pageSize={pageSize}/>
           </div>
         </div>
       </div>

+ 1 - 1
src/components/about/ContactUs.tsx

@@ -81,4 +81,4 @@ function ContactUs({basicInfo, locationInfoList}: { basicInfo: BasicInfo, locati
   );
 }
 
-export default ContactUs;
+export default ContactUs;

+ 1 - 1
tsconfig.json

@@ -15,7 +15,7 @@
     "moduleResolution": "bundler",
     "resolveJsonModule": true,
     "isolatedModules": true,
-    "jsx": "preserve",
+    "jsx": "react-jsx",
     "incremental": true,
     "plugins": [
       {