feat: 更新产品类型和内容,优化产品展示功能
- 重构产品类型定义,新增desc、models、content字段 - 更新所有语言的产品内容,包括详细规格和化学/机械性能 - 修改产品展示组件,支持MDX内容渲染和模型列表展示 - 调整产品详情页布局,优化信息展示方式 - 更新i18n翻译文件,同步产品名称变更 - 修改默认主题配置为light模式 - 修复公司简介中的格式问题
This commit is contained in:
@@ -8,10 +8,11 @@ type ProductTabsClientProps = {
|
||||
spec: string[];
|
||||
packaging: string;
|
||||
locale: string;
|
||||
models: string[];
|
||||
};
|
||||
|
||||
// 纯客户端交互组件(仅处理标签页切换)
|
||||
export default function ProductTabsClient({ detail, spec, packaging, locale }: ProductTabsClientProps) {
|
||||
export default function ProductTabsClient({ detail, models, spec, packaging, locale }: ProductTabsClientProps) {
|
||||
const [activeTab, setActiveTab] = useState('spec'); // 仅客户端使用状态
|
||||
const t = useTranslations("Product");
|
||||
|
||||
@@ -23,7 +24,7 @@ export default function ProductTabsClient({ detail, spec, packaging, locale }: P
|
||||
className={`px-4 py-2 border-r transition-colors ${activeTab === 'detail' ? 'bg-orange-50 text-orange-600 font-medium' : 'hover:bg-gray-50'}`}
|
||||
onClick={() => setActiveTab('detail')}
|
||||
>
|
||||
{t('productDetail')}
|
||||
{t('productModel')}
|
||||
</button>
|
||||
<button
|
||||
className={`px-4 py-2 border-r transition-colors ${activeTab === 'spec' ? 'bg-orange-50 text-orange-600 font-medium' : 'hover:bg-gray-50'}`}
|
||||
@@ -40,7 +41,9 @@ export default function ProductTabsClient({ detail, spec, packaging, locale }: P
|
||||
</div>
|
||||
{/* 内容区 */}
|
||||
<div className="p-4">
|
||||
{activeTab === 'detail' && <div className="text-gray-800">{detail || t('productNoDetail')}</div>}
|
||||
{activeTab === 'detail' && <div className="text-gray-800">
|
||||
{models.map((item, idx) => <div key={idx}>{item}</div>) || t('productNoDetail')}
|
||||
</div>}
|
||||
{activeTab === 'spec' && (
|
||||
spec.length > 0 ? (
|
||||
<div className="space-y-1 text-gray-800">
|
||||
|
||||
Reference in New Issue
Block a user