feat: 全站预发布模式——所有产品标注研发中状态,移除定价与交付承诺
- 产品页:添加 status 字段与研发中状态徽章,移除定价信息,功能描述改为规划措辞 - 产品详情:CTA 从立即购买改为预约体验,新增定价待公布区域 - 解决方案详情:关联产品卡片补充研发中状态徽章 - 关于页:更新发展历程里程碑、统计数据、核心价值观,确保与研发阶段逻辑自洽 - 首页:更新社会证明、客户评价、解决方案等区块文案 - 新闻页:分类从产品发布调整为研发动态 - 全站品牌名统一为睿新致远,移除重复文案,规范标点与编码 - 修复 FlipCard 组件 useReducer 替代 useEffect+setState
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useReducer } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
|
||||
interface FlipCardProps {
|
||||
@@ -84,24 +84,24 @@ function FlipDigit({ digit, prevDigit }: FlipDigitProps) {
|
||||
}
|
||||
|
||||
function FlipCard({ value, label, maxDigits = 2 }: FlipCardProps) {
|
||||
const [prevValue, setPrevValue] = useState(value);
|
||||
const [currentValue, setCurrentValue] = useState(value);
|
||||
const [state, dispatch] = useReducer(
|
||||
(prev: { current: number; previous: number }, next: number) => {
|
||||
if (next === prev.current) {
|
||||
return prev;
|
||||
}
|
||||
return { current: next, previous: prev.current };
|
||||
},
|
||||
{ current: value, previous: value }
|
||||
);
|
||||
dispatch(value);
|
||||
|
||||
useEffect(() => {
|
||||
if (value !== currentValue) {
|
||||
setPrevValue(currentValue);
|
||||
setCurrentValue(value);
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
// 将数字转换为数组,每个数字一位
|
||||
const formatNumber = (num: number) => {
|
||||
const str = num.toString().padStart(maxDigits, '0');
|
||||
return str.split('').map(c => parseInt(c));
|
||||
};
|
||||
|
||||
const currentDigits = formatNumber(currentValue);
|
||||
const prevDigits = formatNumber(prevValue);
|
||||
const currentDigits = formatNumber(state.current);
|
||||
const prevDigits = formatNumber(state.previous);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center">
|
||||
@@ -142,7 +142,7 @@ export function FlipClock({ years, months, days }: FlipClockProps) {
|
||||
</div>
|
||||
|
||||
<p className="text-[#5C5C5C] leading-relaxed font-medium">
|
||||
持续为客户提供优质的数字化转型服务
|
||||
持续打磨产品,致力于为企业提供优质的数字化转型服务
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user