page.tsx 3.87 KB

import Carousel from '@/components/Carousel';
import Header from '@/components/Header';
import FourCard from '@/components/MainTitleList/FourCard';
import MainTitleThreeCard from '@/components/MainTitleList/ThreeCard';
import { Container } from '@mui/material';
import React from 'react';
// import MainTitleListOdd from '@/components/MainTitleListOdd'; 
// import { isMobile } from '@/utils'; 
const BATTERIES = [
  { name: 'Material Evaluation', imageUrl: '/imgs/pc/home/batteries/1.png', href: '/customize' },
  { name: 'R&D Foundry', imageUrl: '/imgs/pc/home/batteries/2.png', href: '/customize' },
  { name: 'Chemical System', imageUrl: '/imgs/pc/home/batteries/3.png', href: '/customize' },
  {
    name: 'Semi Product Customization',
    imageUrl: '/imgs/pc/home/batteries/4.png',
    href: '/customize'
  }
]
const PACKS = [
  { name: 'Power bank', imageUrl: '/imgs/pc/home/packs/1.png', href: '/pack' },
  { name: 'Energy storage', imageUrl: '/imgs/pc/home/packs/2.png', href: '/pack' },
  { name: 'power tool', imageUrl: '/imgs/pc/home/packs/3.png', href: '/pack' },
  {
    name: 'portable energy storage',
    imageUrl: '/imgs/pc/home/packs/4.png',
    href: '/pack'
  }
]

const TESTS = [
  {
    name: 'Electrochemical performance',
    imageUrl: '/imgs/pc/home/tests/1.svg',
    href: '/test'
  },
  { name: 'Reliability testing', imageUrl: '/imgs/pc/home/tests/2.svg', href: '/test' },
  { name: 'Material testing', imageUrl: '/imgs/pc/home/tests/3.svg', href: '/test' },
  { name: 'Calibration', imageUrl: '/imgs/pc/home/tests/4.svg', href: '/test' }
]

const Page = async () => {
  let category = []
  const response = await fetch('http://39.108.227.113:8002/shop/product/category', {
    method: 'POST',
    body: JSON.stringify({})
  })
  const result = await response.json();
  if (result.result === 0) {
    category = result.data?.rootCategoryList || []
    console.log('%c [  ]-18', 'font-size:13px; background:pink; color:#bf2c9f;', category)
  }
  return (
    <div className="w-full">
      <Header />
      <div className='h-[600px] w-full'>
        <Carousel />
        <div className="py-8 py-sm-16">
          <Container>
            <MainTitleThreeCard title={"Material Reagents"} desc={'Leading global provider of energy storage research materials and providing other professional/universal experimental materials.'} list={undefined} href={undefined} />
          </Container>
          {/* Lab Device */}
          <Container>
            <FourCard
              title="Lab Device"
              list={category?.[3]?.list.map((item) => ({ ...item, href: '/products' }))}
              desc="Self-built High-precision Machining Center with Powerful Design and Manufacturing Capabilities. "
              href="/equipment"
            />
          </Container>
          {/* Customized Battery */}
          <Container>
            <FourCard
              title="Customized Battery"
              list={BATTERIES}
              desc="200mAh~10Ah, Winding/Stacking, Unfilled/Filled Electrolyte Cells, Three-Electrode, and More."
              href="/equipment"
            />
          </Container>
          {/* Testing */}
          <Container>
            <FourCard
              title="Testing"
              list={TESTS.map((item) => ({ ...item, href: '/products' }))}
              desc="Self built testing center and signed strategic cooperation with ATL, Tsinghua and other units. "
              href="/test"
            />
          </Container>
          {/* pack */}
          <Container>
            <FourCard
              title="Pack"
              list={PACKS.map((item) => ({ ...item, href: '/products' }))}
              desc="Focusing on energy materials/new energy storage systems/modules and other fields, mastering advanced technologies to provide high-quality services."
              href="/pack"
            />
          </Container>
        </div>
      </div>
    </div>
  );
};

export default Page;