diff --git a/components/ShareCard.tsx b/components/ShareCard.tsx index c31b8d4..91c58d8 100644 --- a/components/ShareCard.tsx +++ b/components/ShareCard.tsx @@ -463,6 +463,7 @@ const generatePersonalizedComments = (props: ShareCardProps) => { const ShareCard: React.FC = (props) => { const reportRef = useRef(null); + const simpleReportRef = useRef(null); // 添加简化版报告的引用 const [isDownloading, setIsDownloading] = useState(false); const [fadeIn, setFadeIn] = useState(false); @@ -474,20 +475,20 @@ const ShareCard: React.FC = (props) => { // 生成个性化评价 const personalizedComments = generatePersonalizedComments(props); - // 处理下载图片 + // 处理下载图片 - 使用简化版报告 const handleDownload = async () => { - if (!reportRef.current || isDownloading) return; + if (!simpleReportRef.current || isDownloading) return; try { setIsDownloading(true); - // 获取报告元素 - const element = reportRef.current; + // 获取简化版报告元素 + const element = simpleReportRef.current; // 使用html2canvas生成图片 const canvas = await html2canvas(element, { scale: 2, - backgroundColor: null, + backgroundColor: '#FFFFFF', useCORS: true, allowTaint: true, logging: false, @@ -530,39 +531,39 @@ const ShareCard: React.FC = (props) => { -
+
{/* 标题 */}
{getEmoji(parseFloat(props.value))}
-

+

你的工作性价比报告

{props.value} - {props.assessment} + {props.assessment}
{/* 性价比评语卡片 */}
{personalizedComments.map((comment, index) => ( -
+
{comment.emoji}
-

{comment.title}

-

{comment.content}

+

{comment.title}

+

{comment.content}

{/* 用户选项详情 */} {comment.details && comment.details.length > 0 && ( -
+
{comment.details.map((detail, i) => (
- {detail.label} - {detail.value} + {detail.label} + {detail.value}
))}
@@ -575,7 +576,7 @@ const ShareCard: React.FC = (props) => {
{/* 底部信息 */} -
+
由"这b班上得值不值·测算版"精心定制
jobworth.zippland.com
@@ -592,6 +593,160 @@ const ShareCard: React.FC = (props) => { {isDownloading ? '生成中...' : '下载报告'}
+ + {/* 简化版报告,仅用于下载,在页面中隐藏 */} +
+
+
+ {/* 报告标题 */} +
+

工作性价比报告

+
+ + {props.value} - {props.assessment} + +
+
+ + {/* 数据表格 */} +
+ {/* 基础信息 */} +
+

基础信息

+
+
+
+
工作城市
+
{getCityName(props.cityFactor)}
+
+
+
是否家乡
+
{props.homeTown === 'yes' ? '是' : '否'}
+
+
+
日薪
+
{props.isYuan ? '¥' : '$'}{props.dailySalary}/天
+
+
+
年工作天数
+
{props.workDaysPerYear} 天
+
+
+ + {/* 工作时间 */} +
+

工作时间

+
+
+
+
每天工作
+
{props.workHours} 小时
+
+
+
每天通勤
+
{props.commuteHours} 小时
+
+
+
午休与休息
+
{props.restTime} 小时
+
+
+
每周工作天数
+
{props.workDaysPerWeek} 天
+
+
+
远程办公
+
{props.wfhDaysPerWeek}/{props.workDaysPerWeek} 天/周
+
+
+
班车服务
+
{getShuttleDesc(props.shuttle)}
+
+
+
年假
+
{props.annualLeave} 天/年
+
+
+
带薪病假
+
{props.paidSickLeave} 天/年
+
+
+ + {/* 工作环境 */} +
+

工作环境

+
+
+
+
办公环境
+
{getWorkEnvironmentDesc(props.workEnvironment)}
+
+
+
领导关系
+
{getLeadershipDesc(props.leadership)}
+
+
+
同事关系
+
{getTeamworkDesc(props.teamwork)}
+
+
+
食堂情况
+
{getCanteenDesc(props.canteen)}
+
+
+ + {/* 教育背景 */} +
+

教育与工作经验

+
+
+
+
最高学历
+
{getDegreeDesc(props.degreeType)}
+
+
+
学校类型
+
{getSchoolTypeDesc(props.schoolType, props.degreeType)}
+
+
+
工作年限
+
{getWorkYearsDesc(props.workYears)}
+
+
+
合同类型
+
{getJobStabilityDesc(props.jobStability)}
+
+
+ + {/* 结论 */} +
+

最终评估

+
+
+
+
{getEmoji(parseFloat(props.value))}
+
+ {props.value} - {props.assessment} +
+
+

+ {parseFloat(props.value) < 1.0 + ? "当前工作性价比较低,建议积累经验后考虑寻找新机会。" + : parseFloat(props.value) <= 2.0 + ? "工作性价比处于中等水平,有发展潜力。" + : "高性价比工作,值得珍惜和长期发展。" + } +

+
+
+ + {/* 页脚 */} +
+
jobworth.zippland.com
+
+
+
+
); }; diff --git a/components/calculator.tsx b/components/calculator.tsx index 18c5d30..96f3ff0 100644 --- a/components/calculator.tsx +++ b/components/calculator.tsx @@ -313,7 +313,7 @@ const SalaryCalculator = () => {

这b班上得值不值·测算版 - v4.1.1 + v4.2.1

{/* GitHub 链接和访问量计数 */}