mirror of
https://github.com/patdelphi/suanming.git
synced 2026-02-28 05:33:11 +08:00
feat: 完善紫微斗数分析系统 - 增加四化飞星和大限分析详细解释
主要更新内容: 1. 修复大限分析岁数计算问题,使用真实出生年份 2. 增加命宫主星详细解释,包含性格、事业、财运分析 3. 完善四化飞星解释系统,详细说明化禄、化权、化科、化忌 4. 增加十二宫位大限分析,提供重点领域、机会、挑战、建议 5. 优化前端显示效果,改进布局和视觉设计 6. 修复大限显示限制问题,现在显示完整的12个大限 7. 提升用户体验,增加专业性和实用性 技术改进: - 重构大限计算方法,传递真实出生年份参数 - 建立完整的星曜和宫位解释数据库 - 优化前端组件结构和样式设计 - 增强响应式布局和交互效果
This commit is contained in:
BIN
numerology.db
BIN
numerology.db
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import CompleteBaziAnalysis from './CompleteBaziAnalysis';
|
import CompleteBaziAnalysis from './CompleteBaziAnalysis';
|
||||||
|
import CompleteZiweiAnalysis from './CompleteZiweiAnalysis';
|
||||||
import BaziAnalysisDisplay from './BaziAnalysisDisplay';
|
import BaziAnalysisDisplay from './BaziAnalysisDisplay';
|
||||||
|
|
||||||
interface AnalysisResultDisplayProps {
|
interface AnalysisResultDisplayProps {
|
||||||
@@ -70,13 +71,29 @@ const AnalysisResultDisplay: React.FC<AnalysisResultDisplayProps> = ({ analysisR
|
|||||||
|
|
||||||
// 渲染紫微斗数分析
|
// 渲染紫微斗数分析
|
||||||
const renderZiweiAnalysis = () => {
|
const renderZiweiAnalysis = () => {
|
||||||
// 处理新的数据结构: { type: 'ziwei', data: analysisResult }
|
// 如果有 birthDate,使用新的 CompleteZiweiAnalysis 组件
|
||||||
|
if (birthDate) {
|
||||||
|
return <CompleteZiweiAnalysis birthDate={birthDate} />;
|
||||||
|
}
|
||||||
|
// 如果有分析结果但没有 birthDate,尝试从结果中提取出生信息
|
||||||
|
if (analysisResult && analysisResult.data) {
|
||||||
|
const basicInfo = analysisResult.data.basic_info;
|
||||||
|
if (basicInfo && basicInfo.personal_data) {
|
||||||
|
const extractedBirthDate = {
|
||||||
|
date: basicInfo.personal_data.birth_date || '',
|
||||||
|
time: basicInfo.personal_data.birth_time || '12:00',
|
||||||
|
name: basicInfo.personal_data.name || '',
|
||||||
|
gender: basicInfo.personal_data.gender === '男性' ? 'male' : 'female'
|
||||||
|
};
|
||||||
|
return <CompleteZiweiAnalysis birthDate={extractedBirthDate} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 回退到旧的渲染方式(向后兼容)
|
||||||
const data = analysisResult?.data || analysisResult;
|
const data = analysisResult?.data || analysisResult;
|
||||||
const ziweiData = data?.ziwei_analysis || data?.ziwei || data;
|
const ziweiData = data?.ziwei_analysis || data?.ziwei || data;
|
||||||
const analysisData = data?.detailed_analysis || data?.analysis || data;
|
const analysisData = data?.detailed_analysis || data?.analysis || data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-8">
|
<div className="space-y-8">
|
||||||
{/* 命宫信息 */}
|
{/* 命宫信息 */}
|
||||||
|
|||||||
1134
src/components/CompleteZiweiAnalysis.tsx
Normal file
1134
src/components/CompleteZiweiAnalysis.tsx
Normal file
File diff suppressed because it is too large
Load Diff
0
test-ziwei.js
Normal file
0
test-ziwei.js
Normal file
Reference in New Issue
Block a user