Explorar o código

1.完善侧边栏

chenhg hai 1 día
pai
achega
7b2b3a5636

+ 2 - 0
App.tsx

@@ -3,6 +3,7 @@ import React from 'react';
 import { HashRouter as Router, Routes, Route } from 'react-router-dom';
 import Home from '@/src/pages/Home';
 import Ships from '@/src/pages/Ships';
+import AboutUs from '@/src/pages/AhoutUs';
 import { LanguageProvider } from '@/src/contexts/LanguageContext';
 import { ThemeProvider } from '@/src/contexts/ThemeContext';
 
@@ -14,6 +15,7 @@ const App: React.FC = () => {
           <Routes>
             <Route path="/" element={<Home />} />
             <Route path="/ships" element={<Ships />} />
+            <Route path="/about" element={<AboutUs />} />
             <Route path="*" element={<Home />} />
           </Routes>
         </Router>

src/images/Socialmedia/dy.png → src/assets/QRPicture/Tiktok-QR.png


src/images/Socialmedia/xhs.png → src/assets/QRPicture/redbook-QR.png


src/images/Socialmedia/gzh.png → src/assets/QRPicture/wechat-QR.png


BIN=BIN
src/assets/logo/company.png


BIN=BIN
src/assets/logo/redbook.png


BIN=BIN
src/assets/logo/tiktok.png


BIN=BIN
src/assets/logo/wechat.png


+ 58 - 11
src/components/Sidebar.tsx

@@ -1,7 +1,12 @@
 import React, { useState } from 'react';
-import { Phone, MessageCircle, ArrowUp, Send, Settings } from 'lucide-react';
+import { Phone, ArrowUp, Send, Settings } from 'lucide-react';
 import ThemeSettings from './ThemeSettings.tsx';
-import MiniProgramQRCode from '../images/Socialmedia/gzh.png';
+import MiniProgramQRCode from '@/src/assets/QRPicture/wechat-QR.png';
+import TiktokQRCode from '@/src/assets/QRPicture/Tiktok-QR.png';
+import RedBookQRCode from '@/src/assets/QRPicture/redbook-QR.png';
+import WeChatIcon from '@/src/assets/logo/wechat.png';
+import TiktokIcon from '@/src/assets/logo/tiktok.png';
+import RedBook from '@/src/assets/logo/redbook.png';
 
 const Sidebar: React.FC = () => {
   const [settingsOpen, setSettingsOpen] = useState(false);
@@ -29,36 +34,78 @@ const Sidebar: React.FC = () => {
               {/* Placeholder for QR Code */}
             <div
                 className="w-24 h-24 bg-vista-darkblue/5 flex items-center justify-center text-xs text-vista-darkblue/60">
-              公众号二维码
               <img
-                  src="../images/Socialmedia/gzh.png"  // 修改为你的图片路径
+                  src={MiniProgramQRCode as string}  // 替换为你的图片路径
                   alt="公众号二维码"
                   className="w-24 h-24 object-cover rounded"
               />
             </div>
+
           </div>
           <button
               className="w-12 h-12 bg-white rounded-full shadow-lg flex items-center justify-center text-vista-darkblue hover:bg-vista-gold hover:text-white transition-colors border border-vista-darkblue/10">
-            <MessageCircle size={20} />
+            <img
+              src={WeChatIcon as string}
+              alt="微信"
+              className="w-5 h-5 object-contain"
+            />
           </button>
         </div>
 
-        {/* Mini Program */}
+  {/* RedBook */}
         <div className="group relative flex items-center">
           <div className="absolute right-12 bg-white p-2 shadow-lg rounded opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-40">
-              <img src={MiniProgramQRCode} alt="小程序二维码" className="w-24 h-24 object-contain" />
+              {/* Placeholder for QR Code */}
+            <div
+                className="w-24 h-24 bg-vista-darkblue/5 flex items-center justify-center text-xs text-vista-darkblue/60">
+              <img
+                  src={RedBookQRCode as string}  // 替换为你的图片路径
+                  alt="公众号二维码"
+                  className="w-24 h-24 object-cover rounded"
+              />
+            </div>
+
           </div>
-          <button className="w-12 h-12 bg-white rounded-full shadow-lg flex items-center justify-center text-vista-darkblue hover:bg-vista-gold hover:text-white transition-colors border border-vista-darkblue/10">
-            <Send size={20} />
+          <button
+              className="w-12 h-12 bg-white rounded-full shadow-lg flex items-center justify-center text-vista-darkblue hover:bg-vista-gold hover:text-white transition-colors border border-vista-darkblue/10">
+            <img
+              src={RedBook as string}
+              alt="小红书"
+              className="w-8 h-8 object-contain"
+            />
+          </button>
+        </div>
+
+        {/* tiktok */}
+        <div className="group relative flex items-center">
+          <div className="absolute right-12 bg-white p-2 shadow-lg rounded opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-40">
+            {/* Placeholder for QR Code */}
+            <div
+                className="w-24 h-24 bg-vista-darkblue/5 flex items-center justify-center text-xs text-vista-darkblue/60">
+              <img
+                  src={TiktokQRCode as string}  // 替换为你的图片路径
+                  alt="公众号二维码"
+                  className="w-24 h-24 object-cover rounded"
+              />
+            </div>
+          </div>
+          <button
+              className="w-12 h-12 bg-white rounded-full shadow-lg flex items-center justify-center text-vista-darkblue hover:bg-vista-gold hover:text-white transition-colors border border-vista-darkblue/10">
+            <img
+                src={TiktokIcon as string}
+                alt="抖音"
+                className="w-8 h-8 object-contain"
+            />
           </button>
         </div>
 
+
         {/* Customization Settings Trigger (New) */}
         <div className="group relative flex items-center">
            <div className="absolute right-12 bg-vista-darkblue text-white text-xs px-3 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none">
             自定义设置
           </div>
-          <button 
+          <button
             onClick={() => setSettingsOpen(true)}
             className="w-12 h-12 bg-white rounded-full shadow-lg flex items-center justify-center text-vista-darkblue hover:bg-vista-gold hover:text-white transition-colors border border-vista-darkblue/10"
           >
@@ -67,7 +114,7 @@ const Sidebar: React.FC = () => {
         </div>
 
         {/* Back to Top */}
-        <button 
+        <button
           onClick={scrollToTop}
           className="w-12 h-12 bg-vista-darkblue text-white rounded-full shadow-lg flex items-center justify-center hover:bg-vista-gold transition-colors"
         >

+ 12 - 7
src/constants.ts

@@ -6,10 +6,15 @@ export const PHONE_NUMBER = "400-696-0666";
 // 1. Interior Dining/Lounge
 // 2. Deck with Umbrellas
 // 3. Ship/Lock/Gorge view
+// export const HERO_IMAGES = [
+//   "https://images.unsplash.com/photo-1578474843222-9593bc88d8b0?q=80&w=1920&auto=format&fit=crop", // Dining/Lounge feel
+//   "https://images.unsplash.com/photo-1599640845513-2627a35c602a?q=80&w=1920&auto=format&fit=crop", // Deck/Ocean feel
+//   "https://images.unsplash.com/photo-1534055691060-0382f646016c?q=80&w=1920&auto=format&fit=crop"  // Gorge/River feel
+// ];
 export const HERO_IMAGES = [
   "https://images.unsplash.com/photo-1578474843222-9593bc88d8b0?q=80&w=1920&auto=format&fit=crop", // Dining/Lounge feel
   "https://images.unsplash.com/photo-1599640845513-2627a35c602a?q=80&w=1920&auto=format&fit=crop", // Deck/Ocean feel
-  "https://images.unsplash.com/photo-1534055691060-0382f646016c?q=80&w=1920&auto=format&fit=crop"  // Gorge/River feel
+  "https://images.unsplash.com/photo-1534055691060-0382f646016c?q=80&w=1920&auto=format&fit=crop", // Gorge/River feel
 ];
 
 export const CONTENT = {
@@ -65,10 +70,10 @@ export const CONTENT = {
         },
         { 
           title: "关于我们", 
-          link: "#about",
+          link: "#/about",
           submenu: [
-            { title: "企业简介", link: "#about-intro" },
-            { title: "官方媒体", link: "#about-media" },
+            { title: "企业简介", link: "#/about?section=intro" },
+            { title: "官方媒体", link: "#/about?section=media" },
           ]
         },
       ]
@@ -261,10 +266,10 @@ export const CONTENT = {
         },
         { 
           title: "ABOUT US", 
-          link: "#about",
+          link: "#/about",
           submenu: [
-            { title: "Introduction", link: "#about-intro" },
-            { title: "Media", link: "#about-media" },
+            { title: "Introduction", link: "#/about?section=intro" },
+            { title: "Media", link: "#/about?section=media" },
           ]
         },
       ]

+ 260 - 0
src/pages/AhoutUs.tsx

@@ -0,0 +1,260 @@
+import React, { useEffect, useState } from 'react';
+import Navbar from '@/src/components/Navbar.tsx';
+import Sidebar from '@/src/components/Sidebar.tsx';
+import Footer from '@/src/components/Footer.tsx';
+import { CONTENT } from '../constants.ts';
+import { useLanguage } from '@/src/contexts/LanguageContext.tsx';
+import { useTheme } from '@/src/contexts/ThemeContext.tsx';
+import { useLocation } from 'react-router-dom';
+import { X } from 'lucide-react';
+import WeChatIcon from '@/src/assets/logo/wechat.png';
+import TiktokIcon from '@/src/assets/logo/tiktok.png';
+import RedBook from '@/src/assets/logo/redbook.png';
+import MiniProgramQRCode from '@/src/assets/QRPicture/wechat-QR.png';
+import TiktokQRCode from '@/src/assets/QRPicture/Tiktok-QR.png';
+import RedBookQRCode from '@/src/assets/QRPicture/redbook-QR.png';
+import CompanyLogo from '@/src/assets/logo/company.png';
+
+
+const AboutUs: React.FC = () => {
+  const { language } = useLanguage();
+  const { aboutHeroImage } = useTheme();
+  const location = useLocation();
+  const t = CONTENT[language];
+
+  useEffect(() => {
+    const params = new URLSearchParams(location.search);
+    const section = params.get('section');
+    
+    let elementId = '';
+    if (section === 'intro') {
+      elementId = 'about-intro';
+    } else if (section === 'media') {
+      elementId = 'official-media';
+    }
+    
+    if (elementId) {
+      setTimeout(() => {
+        const element = document.getElementById(elementId);
+        if (element) {
+          element.scrollIntoView({ behavior: 'smooth' });
+        }
+      }, 100);
+    }
+  }, [location.search]);
+
+  // Modal state
+  const [modalOpen, setModalOpen] = useState(false);
+  const [selectedMedia, setSelectedMedia] = useState<{name: string, nameEn: string, qrCode: string} | null>(null);
+
+  // Mock data for official media section
+  const socialMedia = [
+    {
+      name: '微信公众号',
+      nameEn: 'WeChat Official Account',
+      icon: WeChatIcon,
+      desc: '关注获取最新游轮资讯',
+      descEn: 'Follow for the latest cruise information',
+      link: '#',
+      qrCode: MiniProgramQRCode
+    },
+    {
+      name: '抖音',
+      nameEn: 'TikTok',
+      icon: TiktokIcon,
+      desc: '观看精彩游轮视频',
+      descEn: 'Watch exciting cruise videos',
+      link: '#',
+      qrCode: TiktokQRCode
+    },
+    {
+      name: '小红书',
+      nameEn: 'Xiaohongshu',
+      icon: RedBook,
+      desc: '查看真实用户体验',
+      descEn: 'Check real user experiences',
+      link: '#',
+      qrCode: RedBookQRCode
+    },
+    {
+      name: '微信视频号',
+      nameEn: 'WeChat Video Channel',
+      icon: WeChatIcon,
+      desc: '关注游轮直播动态',
+      descEn: 'Follow cruise live broadcasts',
+      link: '#',
+      qrCode: MiniProgramQRCode
+    }
+  ];
+
+  // Modal handlers
+  const openModal = (media: typeof socialMedia[0]) => {
+    setSelectedMedia({
+      name: media.name,
+      nameEn: media.nameEn,
+      qrCode: media.qrCode
+    });
+    setModalOpen(true);
+  };
+
+  const closeModal = () => {
+    setModalOpen(false);
+    setSelectedMedia(null);
+  };
+
+  return (
+    <div className="min-h-screen bg-white font-sans text-vista-darkblue overflow-x-hidden">
+      <Navbar />
+      <Sidebar />
+
+      {/* Hero Section */}
+      <section className="relative h-[50vh] w-full overflow-hidden">
+        <div className="absolute inset-0 z-0">
+          <img 
+            src={aboutHeroImage || "https://images.unsplash.com/photo-1578474843222-9593bc88d8b0?q=80&w=1920&auto=format&fit=crop"} 
+            alt="About Us" 
+            className="w-full h-full object-cover object-center" 
+          />
+          <div className="absolute inset-0 bg-black/40 pointer-events-none"></div>
+        </div>
+        <div className="relative z-10 h-full flex flex-col justify-center items-center text-center px-4 drop-shadow-md">
+          <h1 className="text-white text-4xl md:text-6xl font-serif leading-tight italic">
+            {language === 'zh' ? '关于我们' : 'About Us'}
+          </h1>
+        </div>
+      </section>
+
+      {/* Main Content */}
+      <main className="py-20">
+        {/* Company Introduction Section */}
+        <section id="about-intro" className="max-w-7xl mx-auto px-6 mb-24">
+          <div className="flex flex-col md:flex-row items-center gap-12">
+            <div className="md:w-1/2">
+              <div className="relative">
+                <img
+                    src={ CompanyLogo || "https://images.unsplash.com/photo-1599640845513-2627a35c602a?q=80&w=1920&auto=format&fit=crop"}
+                  alt="Company" 
+                  className="w-full h-auto rounded-lg shadow-xl"
+                />
+                <div className="absolute -bottom-6 -right-6 bg-vista-gold text-white p-6 rounded-lg shadow-lg">
+                  <span className="text-3xl font-serif">10+</span>
+                  <p className="text-sm uppercase tracking-widest mt-1">{language === 'zh' ? '年行业经验' : 'Years Experience'}</p>
+                </div>
+              </div>
+            </div>
+            <div className="md:w-1/2">
+              <span className="text-vista-gold uppercase tracking-widest text-sm font-bold">{language === 'zh' ? '企业简介' : 'Company Profile'}</span>
+              <h2 className="text-4xl font-serif text-vista-darkblue mt-3 mb-6">{language === 'zh' ? '长江行游轮' : 'Vista Cruises'}</h2>
+              <p className="text-vista-darkblue/70 leading-relaxed mb-6">  
+                {language === 'zh'
+                  ? '长江行游轮是三峡旅游集团旗下高端游轮品牌,致力于为宾客提供长江之上的奢华体验。我们的船队由多艘现代化游轮组成,每一艘都配备了顶级设施和专业服务团队,确保您的每一次航行都成为难忘的记忆。'
+                  : 'Vista Cruises is a premium cruise brand under the Three Gorges Tourism Group, dedicated to providing luxurious experiences on the Yangtze River. Our fleet consists of multiple modern cruise ships, each equipped with top-tier facilities and a professional service team to ensure every voyage becomes an unforgettable memory.'}
+              </p>
+              <p className="text-vista-darkblue/70 leading-relaxed mb-8">  
+                {language === 'zh'
+                  ? '我们秉承着"奢华与传承的完美交融"的理念,重新定义长江之旅。从精美的餐饮到丰富的岸上活动,从舒适的住宿到贴心的服务,每一个细节都旨在为您打造无与伦比的游轮体验。'
+                  : 'We uphold the philosophy of "perfect blend of luxury and heritage", redefining travel on the Yangtze River. From exquisite dining to rich shore activities, from comfortable accommodations to attentive service, every detail is designed to create an unparalleled cruise experience for you.'}
+              </p>
+              <div className="grid grid-cols-2 gap-6">
+                <div className="bg-vista-teal/5 p-4 rounded-lg">
+                  <span className="text-3xl font-serif text-vista-gold">17,000+</span>
+                  <p className="text-xs uppercase tracking-widest text-vista-darkblue/60 mt-1">{language === 'zh' ? '总吨位' : 'Total Tonnage'}</p>
+                </div>
+                <div className="bg-vista-teal/5 p-4 rounded-lg">
+                  <span className="text-3xl font-serif text-vista-gold">500+</span>
+                  <p className="text-xs uppercase tracking-widest text-vista-darkblue/60 mt-1">{language === 'zh' ? '客房数量' : 'Rooms'}</p>
+                </div>
+              </div>
+            </div>
+          </div>
+        </section>
+
+        {/* Official Media Section */}
+        <section id="official-media" className="py-24 bg-vista-teal">
+          <div className="max-w-7xl mx-auto px-6">
+            <div className="text-center mb-16">
+              <span className="text-white uppercase tracking-widest text-sm font-bold">{language === 'zh' ? '官方媒体' : 'Official Media'}</span>
+              <h2 className="text-4xl font-serif text-white mt-3">{language === 'zh' ? '关注我们' : 'Follow Us'}</h2>
+            </div>
+            <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8">
+              {socialMedia.map((media, index) => (
+                <div 
+                  key={index} 
+                  className="bg-white rounded-lg shadow-xl p-8 text-center hover:shadow-2xl transition-shadow duration-300"
+                >
+                  <div className="w-16 h-16 mx-auto mb-6 bg-vista-teal/10 rounded-full flex items-center justify-center">
+                    <img 
+                      src={media.icon} 
+                      alt={media.name} 
+                      className="w-8 h-8 object-contain"
+                    />
+                  </div>
+                  <h3 className="text-xl font-serif text-vista-darkblue mb-2">
+                    {language === 'zh' ? media.name : media.nameEn}
+                  </h3>
+                  <p className="text-vista-darkblue/70 text-sm mb-6">
+                    {language === 'zh' ? media.desc : media.descEn}
+                  </p>
+                  <button 
+                    onClick={() => openModal(media)} 
+                    className="inline-block px-6 py-3 bg-vista-gold text-white font-bold tracking-widest uppercase text-xs hover:bg-white hover:text-vista-darkblue hover:border hover:border-vista-gold transition-all cursor-pointer"
+                  >
+                    {language === 'zh' ? '关注' : 'Follow'}
+                  </button>
+                </div>
+              ))}
+            </div>
+          </div>
+        </section>
+      </main>
+
+      {/* QR Code Modal */}
+      {modalOpen && selectedMedia && (
+        <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4">
+          <div className="bg-white rounded-lg shadow-2xl max-w-md w-full mx-auto">
+            {/* Modal Header */}
+            <div className="flex justify-between items-center p-6 border-b">
+              <h3 className="text-xl font-serif text-vista-darkblue">
+                {language === 'zh' ? selectedMedia.name : selectedMedia.nameEn}
+              </h3>
+              <button 
+                onClick={closeModal} 
+                className="text-vista-darkblue/70 hover:text-vista-darkblue transition-colors"
+              >
+                <X size={24} />
+              </button>
+            </div>
+            
+            {/* Modal Body */}
+            <div className="p-8 text-center">
+              <p className="text-vista-darkblue/70 mb-6">
+                {language === 'zh' ? '扫描二维码关注我们' : 'Scan the QR code to follow us'}
+              </p>
+              <div className="flex justify-center items-center">
+                <img 
+                  src={selectedMedia.qrCode as string} 
+                  alt={`${language === 'zh' ? selectedMedia.name : selectedMedia.nameEn} QR Code`} 
+                  className="w-64 h-64 object-contain border border-vista-gold/30 p-4"
+                />
+              </div>
+            </div>
+            
+            {/* Modal Footer */}
+            <div className="flex justify-center p-6 border-t">
+              <button 
+                onClick={closeModal} 
+                className="px-8 py-3 bg-vista-gold text-white font-bold tracking-widest uppercase text-xs hover:bg-white hover:text-vista-darkblue hover:border hover:border-vista-gold transition-all"
+              >
+                {language === 'zh' ? '关闭' : 'Close'}
+              </button>
+            </div>
+          </div>
+        </div>
+      )}
+
+      <Footer />
+    </div>
+  );
+};
+
+export default AboutUs;

src/api/index.ts → src/services/index.ts