dsh-metaphysics 0.46.5 → 0.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +100 -0
- package/README.md +11 -6
- package/client.js +571 -54
- package/engine/almanac.js +7 -6
- package/engine/bazi.js +62 -0
- package/engine/classics.js +40 -3
- package/engine/crosscheck.js +29 -3
- package/engine/geju.js +49 -5
- package/engine/index.js +24 -6
- package/engine/interpret-knowledge.js +17 -8
- package/engine/interpret-plain.js +15 -2
- package/engine/interpret.js +41 -4
- package/engine/liuyao.js +100 -0
- package/package.json +2 -2
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +522 -76
package/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({
|
|
2
2
|
id: 'dsh-metaphysics',
|
|
3
|
-
version: '0.
|
|
3
|
+
version: '0.50.1',
|
|
4
4
|
factory(require) {
|
|
5
5
|
const React = (function () {
|
|
6
6
|
try { return require('react'); } catch (e) { return globalThis.React; }
|
|
@@ -2629,6 +2629,16 @@ const CLASSICS = [
|
|
|
2629
2629
|
plain: '成格不等于一路顺:成中带忌(官逢财又逢伤、官被合之类)就打了折;败格也未必无救——印来解伤、合来清煞,败中还能转成。',
|
|
2630
2630
|
url: 'https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53629.html',
|
|
2631
2631
|
},
|
|
2632
|
+
{
|
|
2633
|
+
id: 'zp-zaji',
|
|
2634
|
+
book: 'ziping',
|
|
2635
|
+
chapter: '十六、论杂气如何取用',
|
|
2636
|
+
scene: '用神',
|
|
2637
|
+
tags: [],
|
|
2638
|
+
quote: '何谓透干?如甲生辰月,透戊则用偏财,透癸则用正印,透乙则用月劫是也。何谓会支?如甲生辰月,逢申与子会局,则用水印是也。一透则一用,兼透则兼用,透而又会,则透与会并用。',
|
|
2639
|
+
plain: '四墓(辰戌丑未)所藏不止一气,所以叫杂气:取用先看哪一藏干透到天干,透一个用一个;没有透干,再看地支有没有与月支会成三合局,会成什么局就取局中那一气。透干与会支同时成立时两样并用。原文对「兼透」只给原则,没有给取舍次序。',
|
|
2640
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53636.html',
|
|
2641
|
+
},
|
|
2632
2642
|
{
|
|
2633
2643
|
id: 'zp-bianhua',
|
|
2634
2644
|
book: 'ziping',
|
|
@@ -2899,6 +2909,16 @@ const CLASSICS = [
|
|
|
2899
2909
|
plain: '从财格要财会成局、日干无气;一见根气就破格,原文用「命损无猜」这种重话写明。以丁生酉月、柱多庚辛为例:只能弃命相从,行北方财官旺地为入格,南行则灾。',
|
|
2900
2910
|
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7652.html',
|
|
2901
2911
|
},
|
|
2912
|
+
{
|
|
2913
|
+
id: 'smt-suiyun',
|
|
2914
|
+
book: 'sanming',
|
|
2915
|
+
chapter: '卷二·总论岁运',
|
|
2916
|
+
scene: '岁运',
|
|
2917
|
+
tags: [],
|
|
2918
|
+
quote: '行运以生月为运元,最怕行运与太岁冲克,若岁运冲月必祸;若岁运与日相对,谓之返吟,岁运压日,谓之伏吟,二者不利六亲,非横破财,不为吉兆。',
|
|
2919
|
+
plain: '大运以生月为起点,最怕与流年(太岁)冲克:原文说岁运冲月为祸,又把「岁运与日柱相对」叫返吟、「岁运压日」叫伏吟。这两句是按「对日柱」说的,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义(本插件取后者);末句「不利六亲、破财」是旧说的重话,只作变动提示,不作断语。',
|
|
2920
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html',
|
|
2921
|
+
},
|
|
2902
2922
|
];
|
|
2903
2923
|
|
|
2904
2924
|
const BY_ID = CLASSICS.reduce((m, e) => { m[e.id] = e; return m; }, {});
|
|
@@ -2932,6 +2952,12 @@ function classicOf(id) {
|
|
|
2932
2952
|
return BY_ID[id] || null;
|
|
2933
2953
|
}
|
|
2934
2954
|
|
|
2955
|
+
function suiyunClassicOf(r) {
|
|
2956
|
+
const liunian = r && Array.isArray(r.liunian) ? r.liunian : [];
|
|
2957
|
+
const hit = liunian.some((l) => l && l.suiyun && Array.isArray(l.suiyun.signals) && l.suiyun.signals.length);
|
|
2958
|
+
return hit ? classicOf('smt-suiyun') : null;
|
|
2959
|
+
}
|
|
2960
|
+
|
|
2935
2961
|
function tagOf(gejuName) {
|
|
2936
2962
|
const name = String(gejuName || '');
|
|
2937
2963
|
if (GEJU_KEY[name]) return GEJU_KEY[name];
|
|
@@ -2984,8 +3010,12 @@ function classicsFor(r, limit = 5) {
|
|
|
2984
3010
|
}
|
|
2985
3011
|
const huagi = gejuList.find((g) => g && g.kind === '化气格');
|
|
2986
3012
|
const combo = gejuList.find((g) => g && g.kind === '组合');
|
|
3013
|
+
const monthBranch = r.monthBranch || (r.frame && r.frame.monthBranch) || (r.pillars && r.pillars.month && r.pillars.month.branch);
|
|
3014
|
+
const zaMonth = ['辰', '未', '戌', '丑'].includes(monthBranch);
|
|
2987
3015
|
if (huagi) {
|
|
2988
3016
|
push(classicOf('zp-bianhua'), `本盘列有「${huagi.name}」:用神由月令合化而变,总纲一位改取${CLASSIC_BOOKS.ziping.name}论用神变化`);
|
|
3017
|
+
} else if (zaMonth) {
|
|
3018
|
+
push(classicOf('zp-zaji'), `月令${monthBranch}属四墓杂气,取用先看透干、再看会支,总纲一位取${CLASSIC_BOOKS.ziping.name}论杂气如何取用`);
|
|
2989
3019
|
} else if (combo) {
|
|
2990
3020
|
push(classicOf('zp-chengbai'), `本盘另有「${combo.name}」组合:成格还要看带忌与救应,总纲一位改取${CLASSIC_BOOKS.ziping.name}论用神成败救应`);
|
|
2991
3021
|
} else {
|
|
@@ -2999,13 +3029,14 @@ function classicsText(rows) {
|
|
|
2999
3029
|
return rows.map((e) => `《${CLASSIC_BOOKS[e.book].name}·${e.chapter}》「${e.quote}」`).join('\n');
|
|
3000
3030
|
}
|
|
3001
3031
|
|
|
3002
|
-
return { CLASSIC_BOOKS, CLASSICS, classicOf, classicsFor, classicsText };
|
|
3032
|
+
return { CLASSIC_BOOKS, CLASSICS, classicOf, suiyunClassicOf, classicsFor, classicsText };
|
|
3003
3033
|
})();
|
|
3004
3034
|
|
|
3005
3035
|
__mods.geju = (function () {
|
|
3006
3036
|
|
|
3007
3037
|
const { judgeClimate, arbitrate } = __mods.tiaohou;
|
|
3008
3038
|
const { qtOf } = __mods.qiongtong;
|
|
3039
|
+
const { sanheGroupOf } = __mods.sanhe;
|
|
3009
3040
|
|
|
3010
3041
|
const STEMS = ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'];
|
|
3011
3042
|
const BRANCHES = ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥'];
|
|
@@ -3079,6 +3110,23 @@ function elementRoles(dayStem) {
|
|
|
3079
3110
|
return { me, inMe, shi: GENERATES[me], cai: OVERCOMES[me], guan };
|
|
3080
3111
|
}
|
|
3081
3112
|
|
|
3113
|
+
const ZA_MONTHS = ['辰', '未', '戌', '丑'];
|
|
3114
|
+
|
|
3115
|
+
function huiCandidate(pillars, monthBranch, cands) {
|
|
3116
|
+
if (!ZA_MONTHS.includes(monthBranch)) return null;
|
|
3117
|
+
const group = sanheGroupOf(monthBranch);
|
|
3118
|
+
if (!group) return null;
|
|
3119
|
+
const others = ['year', 'day', 'hour'];
|
|
3120
|
+
const need = group.branches.filter((b) => b !== monthBranch);
|
|
3121
|
+
if (!need.every((b) => others.some((k) => pillars[k].branch === b))) return null;
|
|
3122
|
+
const cand = cands.find((c) => STEM_ELEMENT[c.stem] === group.element);
|
|
3123
|
+
if (!cand) return null;
|
|
3124
|
+
const where = others
|
|
3125
|
+
.filter((k) => need.includes(pillars[k].branch))
|
|
3126
|
+
.map((k) => `${({ year: '年', day: '日', hour: '时' })[k]}支${pillars[k].branch}`);
|
|
3127
|
+
return { ...cand, group, where };
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3082
3130
|
function monthPattern(pillars, dayStem, monthBranch) {
|
|
3083
3131
|
const hidden = HIDDEN[monthBranch] || [];
|
|
3084
3132
|
const cands = hidden.map((stem, i) => ({
|
|
@@ -3090,10 +3138,12 @@ function monthPattern(pillars, dayStem, monthBranch) {
|
|
|
3090
3138
|
const others = ['year', 'month', 'hour'];
|
|
3091
3139
|
const exposedKey = others.find((k) => cands.some((c) => c.stem === pillars[k].stem));
|
|
3092
3140
|
const base = cands[0];
|
|
3093
|
-
const
|
|
3141
|
+
const hui = exposedKey ? null : huiCandidate(pillars, monthBranch, cands);
|
|
3142
|
+
const use = exposedKey ? cands.find((c) => c.stem === pillars[exposedKey].stem) : (hui || base);
|
|
3143
|
+
const usedBy = exposedKey ? '透干' : (hui ? '会支' : '本气');
|
|
3094
3144
|
const exposedPos = exposedKey ? { year: '年', month: '月', hour: '时' }[exposedKey] : null;
|
|
3095
3145
|
|
|
3096
|
-
if (base.god === '比肩') {
|
|
3146
|
+
if (base.god === '比肩' && LUSHEN_BRANCH[dayStem] === monthBranch) {
|
|
3097
3147
|
return {
|
|
3098
3148
|
name: '建禄格',
|
|
3099
3149
|
kind: '月令格',
|
|
@@ -3110,10 +3160,30 @@ function monthPattern(pillars, dayStem, monthBranch) {
|
|
|
3110
3160
|
}
|
|
3111
3161
|
return { name: '月劫格', kind: '月令格', evidence: `月令${monthBranch}本气${base.stem}为劫财` };
|
|
3112
3162
|
}
|
|
3163
|
+
if (usedBy === '本气' && base.god === '比肩') {
|
|
3164
|
+
return {
|
|
3165
|
+
name: '比肩格',
|
|
3166
|
+
kind: '月令格',
|
|
3167
|
+
evidence: `月令${monthBranch}藏${hidden.join('')},本气${base.stem}为比肩,但${dayStem}禄在${LUSHEN_BRANCH[dayStem]}、不在${monthBranch},属杂气月比肩当权`,
|
|
3168
|
+
};
|
|
3169
|
+
}
|
|
3170
|
+
if (usedBy !== '本气' && use.god === '劫财') {
|
|
3171
|
+
const via = exposedKey ? `透于${exposedPos}干` : `${hui.where.join('、')}会成${hui.group.element}局`;
|
|
3172
|
+
return {
|
|
3173
|
+
name: '月劫格',
|
|
3174
|
+
kind: '月令格',
|
|
3175
|
+
evidence: `月令${monthBranch}藏${hidden.join('')},${use.pos}${use.stem}(劫财)${via},劫财为用,作月劫论`,
|
|
3176
|
+
};
|
|
3177
|
+
}
|
|
3113
3178
|
const name = `${use.god}格`;
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3179
|
+
let ex;
|
|
3180
|
+
if (exposedKey) {
|
|
3181
|
+
ex = `月令${monthBranch}藏${hidden.join('')},${use.pos}${use.stem}(${use.god})透于${exposedPos}干`;
|
|
3182
|
+
} else if (hui) {
|
|
3183
|
+
ex = `月令${monthBranch}藏${hidden.join('')},本气${base.stem}(${base.god})未透干,而${hui.where.join('、')}会成${hui.group.element}局,取${use.pos}${use.stem}(${use.god})为用`;
|
|
3184
|
+
} else {
|
|
3185
|
+
ex = `月令${monthBranch}藏${hidden.join('')},本气${base.stem}(${base.god})未透干,以月令本气取格`;
|
|
3186
|
+
}
|
|
3117
3187
|
return { name, kind: '月令格', evidence: ex };
|
|
3118
3188
|
}
|
|
3119
3189
|
|
|
@@ -3400,6 +3470,21 @@ const HIDDEN_STEMS = {
|
|
|
3400
3470
|
亥: ['壬', '甲'],
|
|
3401
3471
|
};
|
|
3402
3472
|
|
|
3473
|
+
const RENYUAN_TABLE = {
|
|
3474
|
+
寅: [['戊', 7], ['丙', 7], ['甲', 16]],
|
|
3475
|
+
卯: [['甲', 10], ['乙', 20]],
|
|
3476
|
+
辰: [['乙', 9], ['癸', 3], ['戊', 18]],
|
|
3477
|
+
巳: [['戊', 5], ['庚', 9], ['丙', 16]],
|
|
3478
|
+
午: [['丙', 10], ['己', 9], ['丁', 11]],
|
|
3479
|
+
未: [['丁', 9], ['乙', 3], ['己', 18]],
|
|
3480
|
+
申: [['戊', 7], ['壬', 3], ['庚', 20]],
|
|
3481
|
+
酉: [['庚', 10], ['辛', 20]],
|
|
3482
|
+
戌: [['辛', 9], ['丁', 3], ['戊', 18]],
|
|
3483
|
+
亥: [['戊', 7], ['甲', 5], ['壬', 18]],
|
|
3484
|
+
子: [['壬', 10], ['癸', 20]],
|
|
3485
|
+
丑: [['癸', 9], ['辛', 3], ['己', 18]],
|
|
3486
|
+
};
|
|
3487
|
+
|
|
3403
3488
|
const STEM_ELEMENT = {
|
|
3404
3489
|
甲: '木', 乙: '木', 丙: '火', 丁: '火', 戊: '土',
|
|
3405
3490
|
己: '土', 庚: '金', 辛: '金', 壬: '水', 癸: '水',
|
|
@@ -3563,6 +3648,36 @@ function applyTrueSolar(jd, longitude) {
|
|
|
3563
3648
|
};
|
|
3564
3649
|
}
|
|
3565
3650
|
|
|
3651
|
+
function renyuanOf(monthBranch, birthJdn, termJd) {
|
|
3652
|
+
const table = RENYUAN_TABLE[monthBranch];
|
|
3653
|
+
if (!table) return null;
|
|
3654
|
+
const segments = [];
|
|
3655
|
+
let from = 1;
|
|
3656
|
+
for (const [stem, days] of table) {
|
|
3657
|
+
segments.push({ stem, element: STEM_ELEMENT[stem], from, to: from + days - 1 });
|
|
3658
|
+
from += days;
|
|
3659
|
+
}
|
|
3660
|
+
const tableDays = from - 1;
|
|
3661
|
+
const day = Math.max(1, Math.floor(birthJdn) - Math.floor(termJd + 0.5) + 1);
|
|
3662
|
+
const beyond = day > tableDays;
|
|
3663
|
+
const idx = beyond ? segments.length - 1 : segments.findIndex((s) => day >= s.from && day <= s.to);
|
|
3664
|
+
const seg = segments[idx] || segments[segments.length - 1];
|
|
3665
|
+
const next = segments[idx + 1] || null;
|
|
3666
|
+
return {
|
|
3667
|
+
month: monthBranch,
|
|
3668
|
+
day,
|
|
3669
|
+
tableDays,
|
|
3670
|
+
segments,
|
|
3671
|
+
active: seg.stem,
|
|
3672
|
+
activeElement: seg.element,
|
|
3673
|
+
segment: { from: seg.from, to: seg.to },
|
|
3674
|
+
next: next ? { stem: next.stem, element: next.element, from: next.from, inDays: next.from - day } : null,
|
|
3675
|
+
inHidden: (HIDDEN_STEMS[monthBranch] || []).includes(seg.stem),
|
|
3676
|
+
beyond,
|
|
3677
|
+
note: '人元司权按「节」当日起算,节当日为第 1 日,日差用本盘所用时刻(含真太阳时)所在日计;本插件固定 30 日表(余气 → 中气 → 本气),第 31 日以后按本气算。只作解释层的一层细节,不改取格。',
|
|
3678
|
+
};
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3566
3681
|
function buildBazi(input) {
|
|
3567
3682
|
assertCivil(input);
|
|
3568
3683
|
let { year, month, day, hour = 0, minute = 0, gender = 'male' } = input;
|
|
@@ -3844,6 +3959,9 @@ function buildBazi(input) {
|
|
|
3844
3959
|
const bodyStemIdx = (yinStem + ((bodyIdx - 2 + 12) % 12)) % 10;
|
|
3845
3960
|
const shengong = ganzhiName(sexagenaryIndex(bodyStemIdx, bodyIdx));
|
|
3846
3961
|
|
|
3962
|
+
const renyuan = renyuanOf(BRANCHES[monthBranchIdx], jdnBase, prevJieTerm.jd);
|
|
3963
|
+
if (renyuan) renyuan.term = { name: prevJieTerm.name, time: formatJd(prevJieTerm.jd) };
|
|
3964
|
+
|
|
3847
3965
|
return {
|
|
3848
3966
|
system: 'bazi',
|
|
3849
3967
|
relations: buildRelations(pillars),
|
|
@@ -3874,6 +3992,7 @@ function buildBazi(input) {
|
|
|
3874
3992
|
next: { name: nextJieTerm.name, time: formatJd(nextJieTerm.jd) },
|
|
3875
3993
|
nearBoundaryMinutes: Math.round(Math.min(jd - prevJieTerm.jd, nextJieTerm.jd - jd) * 1440),
|
|
3876
3994
|
},
|
|
3995
|
+
renyuan,
|
|
3877
3996
|
pillars,
|
|
3878
3997
|
dayMaster: { stem: dayStem, element: STEM_ELEMENT[dayStem], yinYang: isYangStem(dayStem) ? '阳' : '阴' },
|
|
3879
3998
|
wuxing,
|
|
@@ -3905,7 +4024,7 @@ function buildBazi(input) {
|
|
|
3905
4024
|
};
|
|
3906
4025
|
}
|
|
3907
4026
|
|
|
3908
|
-
return { HIDDEN_STEMS, STEM_ELEMENT, BRANCH_ELEMENT, buildRelations, tenGod, nayin, applyTrueSolar, buildBazi };
|
|
4027
|
+
return { HIDDEN_STEMS, RENYUAN_TABLE, STEM_ELEMENT, BRANCH_ELEMENT, buildRelations, tenGod, nayin, applyTrueSolar, renyuanOf, buildBazi };
|
|
3909
4028
|
})();
|
|
3910
4029
|
|
|
3911
4030
|
__mods.liuyao = (function () {
|
|
@@ -3962,6 +4081,7 @@ const LIUSHEN_START = { 甲: 0, 乙: 0, 丙: 1, 丁: 1, 戊: 2, 己: 3, 庚: 4,
|
|
|
3962
4081
|
const ZHI_CHONG_PAIRS = [['子', '午'], ['丑', '未'], ['寅', '申'], ['卯', '酉'], ['辰', '戌'], ['巳', '亥']];
|
|
3963
4082
|
const ZHI_HE_PAIRS = [['子', '丑'], ['寅', '亥'], ['卯', '戌'], ['辰', '酉'], ['巳', '申'], ['午', '未']];
|
|
3964
4083
|
const CHONG_OF = Object.fromEntries(ZHI_CHONG_PAIRS.flatMap(([a, b]) => [[a, b], [b, a]]));
|
|
4084
|
+
const HE_OF = Object.fromEntries(ZHI_HE_PAIRS.flatMap(([a, b]) => [[a, b], [b, a]]));
|
|
3965
4085
|
const TRIGRAM_OPPOSITE = { 乾: '巽', 巽: '乾', 坎: '离', 离: '坎', 艮: '坤', 坤: '艮', 震: '兑', 兑: '震' };
|
|
3966
4086
|
|
|
3967
4087
|
const JIN_TUI_PAIRS = [['寅', '卯'], ['巳', '午'], ['申', '酉'], ['亥', '子'], ['丑', '辰'], ['辰', '未'], ['未', '戌'], ['戌', '丑']];
|
|
@@ -4732,7 +4852,95 @@ function jinTuiPower(result, opts = {}) {
|
|
|
4732
4852
|
};
|
|
4733
4853
|
}
|
|
4734
4854
|
|
|
4735
|
-
|
|
4855
|
+
const YINGQI_TEMPO = ['偏速', '偏缓', '待解', '未定'];
|
|
4856
|
+
const TEMPO_SAY = {
|
|
4857
|
+
偏速: '用神得月令之气,应期偏近',
|
|
4858
|
+
偏缓: '用神失月令之气,应期偏远',
|
|
4859
|
+
待解: '有月破或旬空的用神,先等条件解除',
|
|
4860
|
+
未定: '快慢不定(缺月建,或用神两现而旺衰不一)',
|
|
4861
|
+
};
|
|
4862
|
+
const TRIGGER_ORDER = ['逢值', '逢冲', '逢合', '出空填实', '冲空'];
|
|
4863
|
+
|
|
4864
|
+
function yingqiWindow(result, useGod, opts = {}) {
|
|
4865
|
+
if (!useGod || !useGod.liuqin) return null;
|
|
4866
|
+
const found = Array.isArray(useGod.found) ? useGod.found : [];
|
|
4867
|
+
const fushen = Array.isArray(useGod.fushen) ? useGod.fushen : [];
|
|
4868
|
+
const viaFushen = !found.length && fushen.length > 0;
|
|
4869
|
+
const source = found.length ? found : fushen;
|
|
4870
|
+
if (!source.length) return null;
|
|
4871
|
+
const monthBranch = opts.monthBranch || null;
|
|
4872
|
+
const monthElement = monthBranch ? zhiElementOf(monthBranch) : null;
|
|
4873
|
+
const kong = Array.isArray(result && result.xunKong)
|
|
4874
|
+
? result.xunKong
|
|
4875
|
+
: (result && typeof result.xunKong === 'string' ? result.xunKong.split('') : []);
|
|
4876
|
+
|
|
4877
|
+
const items = source.map((l) => {
|
|
4878
|
+
const branch = l.branch;
|
|
4879
|
+
const element = l.element || zhiElementOf(branch);
|
|
4880
|
+
const monthState = monthStateOf(element, monthElement);
|
|
4881
|
+
const isEmpty = kong.includes(branch);
|
|
4882
|
+
const monthChong = !!(monthBranch && CHONG_OF[branch] === monthBranch);
|
|
4883
|
+
const tempo = monthChong ? '待解'
|
|
4884
|
+
: isEmpty ? '待解'
|
|
4885
|
+
: monthState === 'unknown' ? '未定'
|
|
4886
|
+
: (monthState === '旺' || monthState === '相') ? '偏速' : '偏缓';
|
|
4887
|
+
const tempoSay = monthChong ? `遭${monthBranch}冲(月破),先待出月或填实`
|
|
4888
|
+
: isEmpty ? '用神旬空,先待出空填实'
|
|
4889
|
+
: monthState === 'unknown' ? '缺月建,快慢不定'
|
|
4890
|
+
: `月建${monthState},${tempo === '偏速' ? '应期偏近' : '应期偏远'}`;
|
|
4891
|
+
const triggers = [
|
|
4892
|
+
{ branch, labels: ['逢值'] },
|
|
4893
|
+
{ branch: CHONG_OF[branch] || null, labels: ['逢冲'] },
|
|
4894
|
+
{ branch: HE_OF[branch] || null, labels: ['逢合'] },
|
|
4895
|
+
];
|
|
4896
|
+
if (isEmpty) {
|
|
4897
|
+
triggers[0].labels.push('出空填实');
|
|
4898
|
+
triggers[1].labels.push('冲空');
|
|
4899
|
+
}
|
|
4900
|
+
return {
|
|
4901
|
+
position: l.position,
|
|
4902
|
+
branch,
|
|
4903
|
+
element,
|
|
4904
|
+
monthState,
|
|
4905
|
+
monthChong,
|
|
4906
|
+
kong: isEmpty,
|
|
4907
|
+
tempo,
|
|
4908
|
+
tempoSay,
|
|
4909
|
+
triggers,
|
|
4910
|
+
};
|
|
4911
|
+
});
|
|
4912
|
+
|
|
4913
|
+
const merged = new Map();
|
|
4914
|
+
for (const it of items) {
|
|
4915
|
+
for (const t of it.triggers) {
|
|
4916
|
+
if (!t.branch) continue;
|
|
4917
|
+
const cur = merged.get(t.branch) || { branch: t.branch, labels: [] };
|
|
4918
|
+
for (const lb of t.labels) if (!cur.labels.includes(lb)) cur.labels.push(lb);
|
|
4919
|
+
merged.set(t.branch, cur);
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
const triggers = [...merged.values()].map((t) => ({
|
|
4923
|
+
branch: t.branch,
|
|
4924
|
+
labels: [...t.labels].sort((a, b) => TRIGGER_ORDER.indexOf(a) - TRIGGER_ORDER.indexOf(b)),
|
|
4925
|
+
}));
|
|
4926
|
+
const tempos = items.map((x) => x.tempo);
|
|
4927
|
+
const tempo = tempos.includes('待解') ? '待解'
|
|
4928
|
+
: tempos.every((t) => t === '偏速') ? '偏速'
|
|
4929
|
+
: tempos.every((t) => t === '偏缓') ? '偏缓' : '未定';
|
|
4930
|
+
|
|
4931
|
+
return {
|
|
4932
|
+
month: monthBranch ? { branch: monthBranch, element: monthElement } : null,
|
|
4933
|
+
viaFushen,
|
|
4934
|
+
tempo,
|
|
4935
|
+
tempoSay: TEMPO_SAY[tempo],
|
|
4936
|
+
items,
|
|
4937
|
+
triggers,
|
|
4938
|
+
labels: [`应期${tempo}`, ...triggers.map((t) => `${t.labels.join('/')}${t.branch}`)],
|
|
4939
|
+
note: '应期只给「该留意哪一支」与快慢方向:用神逢值、逢冲、逢合,旬空另标出空与冲空。不换算成日期、不排先后、不判忌神受制;近事以日计、远事以月计,用哪把尺由事情远近决定,本插件不代选。',
|
|
4940
|
+
};
|
|
4941
|
+
}
|
|
4942
|
+
|
|
4943
|
+
return { jinTuiOf, hexBody, bodyRelations, bodyLabels, HEXAGRAM_COUNT, hexagramFromBits, YONGSHEN_RULES, yongshenOf, tossLines, buildLiuyao, zhiElementOf, monthStateOf, dayRelationOf, yongshenStrength, FUSHEN_VERDICTS, fushenAccess, hexagramStrength, jinTuiPower, YINGQI_TEMPO, yingqiWindow };
|
|
4736
4944
|
})();
|
|
4737
4945
|
|
|
4738
4946
|
__mods.ziwei = (function () {
|
|
@@ -9539,9 +9747,9 @@ const MANSIONS = {
|
|
|
9539
9747
|
箕: { luck: '吉', zheng: '水', animal: '豹', gong: '东' }, 斗: { luck: '吉', zheng: '木', animal: '獬', gong: '北' },
|
|
9540
9748
|
牛: { luck: '凶', zheng: '金', animal: '牛', gong: '北' }, 女: { luck: '凶', zheng: '土', animal: '蝠', gong: '北' },
|
|
9541
9749
|
虚: { luck: '凶', zheng: '日', animal: '鼠', gong: '北' }, 危: { luck: '凶', zheng: '月', animal: '燕', gong: '北' },
|
|
9542
|
-
室: { luck: '吉', zheng: '火', animal: '猪', gong: '北' }, 壁: { luck: '吉', zheng: '水', animal: '
|
|
9750
|
+
室: { luck: '吉', zheng: '火', animal: '猪', gong: '北' }, 壁: { luck: '吉', zheng: '水', animal: '貐', gong: '北' },
|
|
9543
9751
|
奎: { luck: '凶', zheng: '木', animal: '狼', gong: '西' }, 娄: { luck: '吉', zheng: '金', animal: '狗', gong: '西' },
|
|
9544
|
-
胃: { luck: '吉', zheng: '土', animal: '
|
|
9752
|
+
胃: { luck: '吉', zheng: '土', animal: '雉', gong: '西' }, 昴: { luck: '凶', zheng: '日', animal: '鸡', gong: '西' },
|
|
9545
9753
|
毕: { luck: '吉', zheng: '月', animal: '乌', gong: '西' }, 觜: { luck: '凶', zheng: '火', animal: '猴', gong: '西' },
|
|
9546
9754
|
参: { luck: '吉', zheng: '水', animal: '猿', gong: '西' }, 井: { luck: '吉', zheng: '木', animal: '犴', gong: '南' },
|
|
9547
9755
|
鬼: { luck: '凶', zheng: '金', animal: '羊', gong: '南' }, 柳: { luck: '凶', zheng: '土', animal: '獐', gong: '南' },
|
|
@@ -10883,6 +11091,18 @@ function jinTuiPlain(r) {
|
|
|
10883
11091
|
return `动爻的进退还要看时令:${jp.lines.map((l) => `${l.position}爻${l.from}→${l.to}${l.type},${sayOf(l)}`).join(';')}。`;
|
|
10884
11092
|
}
|
|
10885
11093
|
|
|
11094
|
+
function yingqiPlain(r) {
|
|
11095
|
+
const yq = r && r.yingqi;
|
|
11096
|
+
if (!yq || !Array.isArray(yq.triggers) || !yq.triggers.length) return '';
|
|
11097
|
+
const when = yq.tempo === '偏速' ? '大体偏近,近事更容易先见分晓'
|
|
11098
|
+
: yq.tempo === '偏缓' ? '大体偏远,别指望立刻见分晓'
|
|
11099
|
+
: yq.tempo === '待解' ? '眼下还有月破或旬空,得先等条件解除'
|
|
11100
|
+
: '缺月建,快慢暂不定';
|
|
11101
|
+
const branches = yq.triggers.map((t) => t.branch).join('、');
|
|
11102
|
+
const fu = yq.viaFushen ? '(用神是伏神,先要出得来)' : '';
|
|
11103
|
+
return `应期上${when};传统会留意${branches}这几个地支${fu}——这只是提示,不换算成具体哪天。`;
|
|
11104
|
+
}
|
|
11105
|
+
|
|
10886
11106
|
function hexStrengthPlain(hs) {
|
|
10887
11107
|
if (!hs || !hs.counts) return '';
|
|
10888
11108
|
const up = (hs.counts.旺 || 0) + (hs.counts.相 || 0);
|
|
@@ -10982,7 +11202,7 @@ function buildAnswer(r, ask, ctx = {}) {
|
|
|
10982
11202
|
head + `先说结论:本卦是${s(ben.name, '—')}` +
|
|
10983
11203
|
`${ben.palace ? `(${ben.palace})` : ''}` +
|
|
10984
11204
|
`${moving.length ? `,第 ${moving.join('、')} 爻动,变为${s(bian.name, '—')}` : ',六爻安静没有动爻'}。` +
|
|
10985
|
-
`${plainBody}${usePlainOf(r.useGod, r.fushenAccess)}${useStrengthPlain(r.useGodStrength)}${jinTuiPlain(r)}${hexStrengthPlain(r.hexStrength)}`,
|
|
11205
|
+
`${plainBody}${usePlainOf(r.useGod, r.fushenAccess)}${useStrengthPlain(r.useGodStrength)}${jinTuiPlain(r)}${yingqiPlain(r)}${hexStrengthPlain(r.hexStrength)}`,
|
|
10986
11206
|
'断卦的落点在「世爻」(代表你)和「动爻」(事情的推动点),下面「看盘顺序」就按这个次序展开。',
|
|
10987
11207
|
].join('');
|
|
10988
11208
|
}
|
|
@@ -11045,7 +11265,7 @@ function buildPlain(r, ask, ctx = {}) {
|
|
|
11045
11265
|
const plainBody = bodyPlainOf(labels);
|
|
11046
11266
|
return `${s(ben.name, '这一卦')}讲的是一个「${moving.length ? '正在动、还会变' : '暂时不动、先看清'}」的局面——` +
|
|
11047
11267
|
`${moving.length ? '有动爻,说明事情还有转圜空间,不是死局。' : '六爻安静,说明当下更该观察而不是硬推。'}` +
|
|
11048
|
-
`${plainBody}${usePlainOf(r.useGod, r.fushenAccess)}${useStrengthPlain(r.useGodStrength)}${jinTuiPlain(r)}${hexStrengthPlain(r.hexStrength)}`;
|
|
11268
|
+
`${plainBody}${usePlainOf(r.useGod, r.fushenAccess)}${useStrengthPlain(r.useGodStrength)}${jinTuiPlain(r)}${yingqiPlain(r)}${hexStrengthPlain(r.hexStrength)}`;
|
|
11049
11269
|
}
|
|
11050
11270
|
return '';
|
|
11051
11271
|
}
|
|
@@ -11148,10 +11368,10 @@ const KNOWLEDGE = [
|
|
|
11148
11368
|
id: 'bazi-yueling-siquan',
|
|
11149
11369
|
system: 'bazi', dims: ['overall', 'career'],
|
|
11150
11370
|
gist: '月令不是「一个月」,是当月最有权的那一个字。',
|
|
11151
|
-
detail: '
|
|
11371
|
+
detail: '月令藏干按本气、中气、余气分日用事,本气当权的时间最长。所以判旺衰先看日主在月令是得令还是失令——得令者未看全局,已有三分底气。本插件按 30 日表算出「生在本月第几日、哪一干当权」,给的是月内轮值这一层细节;旺衰与取格仍以月令本气、透干与会支为主,不随轮值改判。',
|
|
11152
11372
|
source: '《子平真诠》论用神;人元司权分日之说见《渊海子平》',
|
|
11153
11373
|
status: 'variant',
|
|
11154
|
-
note: '各家对中气、余气各主几日分法不同(有 7/7/16、9/3/18
|
|
11374
|
+
note: '各家对中气、余气各主几日分法不同(有 7/7/16、9/3/18 等多说);本插件固定通行 30 日表(如寅月戊7丙7甲16),节当日为第 1 日,第 31 日以后按本气算、不硬分摊。司权表与本柱藏干表口径不同(子月壬、卯月甲、午月丙、酉月庚、亥月戊只出现在司权表里),两表各照原样;取格不随轮值改判。',
|
|
11155
11375
|
},
|
|
11156
11376
|
{
|
|
11157
11377
|
id: 'bazi-tonggen-tougan',
|
|
@@ -11199,8 +11419,8 @@ const KNOWLEDGE = [
|
|
|
11199
11419
|
id: 'bazi-suiyun',
|
|
11200
11420
|
system: 'bazi', dims: ['overall', 'career'],
|
|
11201
11421
|
gist: '大运管十年基调,流年管当年触发。',
|
|
11202
|
-
detail: '
|
|
11203
|
-
source: '
|
|
11422
|
+
detail: '大运像换了条路,流年像这条路上某一段的天气。岁运并临(当值大运与流年干支相同)、运年反吟(大运与流年天克地冲)、流年伏吟(流年与原局某柱干支相同)与流年反吟(流年与原局某柱天克地冲),是传统上标记「变动较大」的年份,属于提示而非断语。本插件逐年标出四类信号:当值大运按该年立春到次年立春的区间取,交运落在年内时前后两步并列;只标干支重复与对冲,不折分数。原文里「返吟」指岁运与日柱相对、「伏吟」指岁运压日,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义,两者并列、不合并。',
|
|
11423
|
+
source: '《三命通会》卷二·总论岁运(https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html);岁运并临之说出自《渊海子平》',
|
|
11204
11424
|
status: 'variant',
|
|
11205
11425
|
note: '「岁运并临主大凶」是流传最广也最被滥用的说法,本插件只作变动提示,不断吉凶;大运与原局之间的伏吟反吟未逐年标注,四柱十神层面的引化也未叠入。',
|
|
11206
11426
|
},
|
|
@@ -11258,6 +11478,15 @@ const KNOWLEDGE = [
|
|
|
11258
11478
|
status: 'variant',
|
|
11259
11479
|
note: '化气格成立条件各家宽严不一(是否要求月令为化神、日主是否允许有根),本插件只列条件、附原文,不据此断定化气已成。',
|
|
11260
11480
|
},
|
|
11481
|
+
{
|
|
11482
|
+
id: 'bazi-zaji-quyong',
|
|
11483
|
+
system: 'bazi', dims: ['overall', 'career'],
|
|
11484
|
+
gist: '辰戌丑未是杂气月:先看透干,再看会支。',
|
|
11485
|
+
detail: '四墓(辰戌丑未)每个字都藏着不止一气,用神不一,所以叫杂气。子平真诠的取法是:藏干透到天干的先用(甲生辰月,透戊用偏财、透癸用正印、透乙用月劫);没有透干,再看地支有没有与月支会成三合局(辰月逢申子会水,就取水印)。本插件按「透干 → 三合会支 → 本气」的次序取格,依据里写明走的是哪一条,并把《论杂气如何取用》附在结果里。',
|
|
11486
|
+
source: '《子平真诠》十六、论杂气如何取用',
|
|
11487
|
+
status: 'variant',
|
|
11488
|
+
note: '原文说「兼透则兼用」,但只给一个格名时总要落到一个藏干;本插件只取最先透出的那一干,会支也只认三合、不认三会方,且不判原文所说的「有情 / 无情」,取舍次序各家另有说法。',
|
|
11489
|
+
},
|
|
11261
11490
|
{
|
|
11262
11491
|
id: 'bazi-zhuanwang-yuanwen',
|
|
11263
11492
|
system: 'bazi', dims: ['overall', 'career'],
|
|
@@ -11421,10 +11650,10 @@ const KNOWLEDGE = [
|
|
|
11421
11650
|
id: 'liuyao-yingqi',
|
|
11422
11651
|
system: 'liuyao', dims: ['overall', 'career'],
|
|
11423
11652
|
gist: '应期是「什么时候见分晓」,不是「哪天」。',
|
|
11424
|
-
detail: '
|
|
11653
|
+
detail: '近事以日计、远事以月计;常见取法是等用神逢值、逢冲、逢合之期,或等忌神受制之期。本插件只做前一半:把用神(不上卦则取伏神)的逢值、逢冲、逢合三支列出,旬空另标出空与冲空,再按月建五态给「偏速 / 偏缓 / 待解 / 未定」一个快慢方向;忌神受制与具体日期仍未做。应期法各家互有出入,同一卦不同取法可以差出很远,所以只作时间窗口的提示。',
|
|
11425
11654
|
source: '《卜筮正宗》应期章;《增删卜易》',
|
|
11426
11655
|
status: 'variant',
|
|
11427
|
-
note: '
|
|
11656
|
+
note: '应期取法(值日、冲、合、填实、旬空出空)各家优先级不同,本插件只并列触发支、不排先后,也不换算日期;近事以日计、远事以月计,用哪把尺由事情远近决定,不代选。',
|
|
11428
11657
|
},
|
|
11429
11658
|
{
|
|
11430
11659
|
id: 'liuyao-liushen',
|
|
@@ -11579,10 +11808,10 @@ const KNOWLEDGE = [
|
|
|
11579
11808
|
id: 'liuyao-yingqi-exact',
|
|
11580
11809
|
system: 'liuyao', dims: [],
|
|
11581
11810
|
gist: '具体应期(哪一天应验)本插件尚未推算。',
|
|
11582
|
-
detail: '
|
|
11811
|
+
detail: '应期需要综合用神旺衰、动变、旬空出空、日月冲合多层条件,且各家取法不同。当前只给时间窗口的方向性提示(逢值 / 逢冲 / 逢合的触发支,加一个快慢方向),不给具体日期——与其给一个看起来精确、实则拍脑袋的日子,不如留白。',
|
|
11583
11812
|
source: '待补:《卜筮正宗》应期章逐条实现 + 已录 128 条卦例对拍(源 138 条)',
|
|
11584
11813
|
status: 'todo',
|
|
11585
|
-
note: '扩展方向:用《卜筮正宗》卦例里有明确应验日期的条目做回归,先验证再输出。',
|
|
11814
|
+
note: '扩展方向:用《卜筮正宗》卦例里有明确应验日期的条目做回归,先验证再输出。0.50.0 已给出触发支与快慢方向,仍不输出日期。',
|
|
11586
11815
|
},
|
|
11587
11816
|
];
|
|
11588
11817
|
|
|
@@ -12329,6 +12558,19 @@ function baziInterpret(r) {
|
|
|
12329
12558
|
`⑤ 落到维度:工作看喜用五行与十神权重;感情看配偶星与日支;健康看最旺与最弱的五行。五维度都只是这套推导的应用,不是另一套算法。`,
|
|
12330
12559
|
].join('\n'),
|
|
12331
12560
|
},
|
|
12561
|
+
...(r.renyuan ? [(() => {
|
|
12562
|
+
const ry = r.renyuan;
|
|
12563
|
+
const table = ry.segments.map((s) => `${s.stem}${s.from}–${s.to}`).join(' / ');
|
|
12564
|
+
const nextSeg = ry.next ? `,第 ${ry.next.from} 日起交 ${ry.next.stem}${ry.next.element}` : '';
|
|
12565
|
+
const outside = ry.inHidden ? '' : ` 表里的 ${ry.active} 不在本柱藏干表中(属余气口径),两表各照原样,不互相改写。`;
|
|
12566
|
+
const beyond = ry.beyond ? ' 你生在第 31 日以后,已超出 30 日表,按本气算,不硬分摊。' : '';
|
|
12567
|
+
return {
|
|
12568
|
+
key: 'renyuan', label: '人元司权',
|
|
12569
|
+
text: `生于${ry.month}月第 ${ry.day} 日(从${ry.term ? ry.term.name : '节'}起算,节当日为第 1 日,日差按本盘所用时刻所在日计):这一日由 **${ry.active}${ry.activeElement}** 司权,第 ${ry.segment.from}–${ry.segment.to} 日属它${nextSeg}。\n`
|
|
12570
|
+
+ '月令这一个月里,余气、中气、本气轮值,不是整月同一个五行当值——所以「月令是什么」,还要看生在第几日。\n'
|
|
12571
|
+
+ `**口径**:本插件固定 30 日表(${table});另有 7/7/16、9/3/18 等分法,各家不一。分日只作解释层的一层细节,**不改取格**:取格仍按本气、透干与会支判定。${outside}${beyond}`,
|
|
12572
|
+
};
|
|
12573
|
+
})()] : []),
|
|
12332
12574
|
{
|
|
12333
12575
|
key: 'timeline', label: '时间窗',
|
|
12334
12576
|
text: (() => {
|
|
@@ -12349,6 +12591,8 @@ function baziInterpret(r) {
|
|
|
12349
12591
|
{ key: 'advice', label: '专业建议', text: adviceText },
|
|
12350
12592
|
(() => {
|
|
12351
12593
|
const hits = (r.liunian || []).filter((l) => l.suiyun && Array.isArray(l.suiyun.signals) && l.suiyun.signals.length);
|
|
12594
|
+
const e = suiyunClassicOf(r);
|
|
12595
|
+
const src = e ? `\n原文:《${CLASSIC_BOOKS[e.book].name}·${e.chapter}》「${e.quote}」\n白话:${e.plain}` : '';
|
|
12352
12596
|
return {
|
|
12353
12597
|
key: 'suiyun', label: '岁运提示',
|
|
12354
12598
|
text: hits.length
|
|
@@ -12356,7 +12600,7 @@ function baziInterpret(r) {
|
|
|
12356
12600
|
const stem = (l.suiyun.dayun || []).map((d) => `第${d.step}步${d.ganzhi}`).join('、');
|
|
12357
12601
|
return `${l.year} ${l.ganzhi}(${stem || '未到起运'}):${l.suiyun.signals.map((s) => s.detail).join(';')}`;
|
|
12358
12602
|
}).join('\n') +
|
|
12359
|
-
'\n读法:岁运并临、运年反吟与流年伏吟/反吟只说明干支层面重复或对冲,传统上当作「变动感较强」的信号;本插件不据此判吉凶,要落到具体年份,仍看该年是否动到用神。'
|
|
12603
|
+
'\n读法:岁运并临、运年反吟与流年伏吟/反吟只说明干支层面重复或对冲,传统上当作「变动感较强」的信号;本插件不据此判吉凶,要落到具体年份,仍看该年是否动到用神。' + src
|
|
12360
12604
|
: '近十年没有岁运并临、运年反吟或流年伏吟/反吟。「岁运并临主大凶」这类说法流传很广,本插件只把它当变动提示,没有命中就不作额外解读。',
|
|
12361
12605
|
};
|
|
12362
12606
|
})(),
|
|
@@ -13088,10 +13332,31 @@ function liuyaoInterpret(r, ask) {
|
|
|
13088
13332
|
useText.push(`时令对用神:${head},日辰 ${strength.day ? `${strength.day.branch}(${strength.day.element})` : '—'}。${body.join(';')}。`);
|
|
13089
13333
|
useText.push('月建看这一段时令站在哪一边,日辰看当天那股力量是扶还是克;两处同时看,只报状态,不折成分数。');
|
|
13090
13334
|
}
|
|
13091
|
-
useText.push('
|
|
13335
|
+
useText.push('这一层只把用神、卦体与时令对起来,不折成分数、不断成败;应期另在「应期线索」一节只给触发支与快慢。');
|
|
13092
13336
|
sections.push({ key: 'yongshen', label: '用神落位与卦体', text: useText.join('\n') });
|
|
13093
13337
|
}
|
|
13094
13338
|
|
|
13339
|
+
{
|
|
13340
|
+
const yq = r.yingqi;
|
|
13341
|
+
if (yq && Array.isArray(yq.items) && yq.items.length) {
|
|
13342
|
+
const rows = yq.items.map((it) => {
|
|
13343
|
+
const flags = [
|
|
13344
|
+
it.monthState && it.monthState !== 'unknown' ? `月建${it.monthState}` : '',
|
|
13345
|
+
it.monthChong ? '月破' : '',
|
|
13346
|
+
it.kong ? '旬空' : '',
|
|
13347
|
+
].filter(Boolean).join('、');
|
|
13348
|
+
return `${it.position}爻${it.branch}${it.element}${flags ? `(${flags})` : ''}:${it.tempoSay}`;
|
|
13349
|
+
});
|
|
13350
|
+
sections.push({
|
|
13351
|
+
key: 'yingqi',
|
|
13352
|
+
label: '应期线索',
|
|
13353
|
+
text: `应期快慢:${yq.tempoSay}。${rows.join(';')}。可留意的地支:${yq.triggers.map((t) => `${t.branch}(${t.labels.join('、')})`).join(';')}。` +
|
|
13354
|
+
`${yq.viaFushen ? '用神不上卦,这里的支取自伏神;伏神要先得出才算数。' : ''}` +
|
|
13355
|
+
'这一节只把传统的「逢值、逢冲、逢合」与旬空的出空、冲空摆出来,不换算成具体日期、不排先后、也不判忌神受制;近事以日计、远事以月计,用哪把尺取决于事情本身。',
|
|
13356
|
+
});
|
|
13357
|
+
}
|
|
13358
|
+
}
|
|
13359
|
+
|
|
13095
13360
|
{
|
|
13096
13361
|
const hs = r.hexStrength;
|
|
13097
13362
|
if (hs && Array.isArray(hs.lines) && hs.lines.length) {
|
|
@@ -13120,7 +13385,7 @@ function liuyaoInterpret(r, ask) {
|
|
|
13120
13385
|
|
|
13121
13386
|
sections.push({
|
|
13122
13387
|
key: 'limits', label: '未纳入',
|
|
13123
|
-
text: '
|
|
13388
|
+
text: '本卦没有计算:用神两现时该取哪一爻的权重、应期的具体日期(只给逢值/逢冲/逢合的触发支与快慢方向)、忌神受制的时点、动变连环。化进/化退的力重只按月建五态给「得令/失令」这类档位,不折成加权分数;这些都会改变"旺不旺"的判断,所以这里只给取象与方向。',
|
|
13124
13389
|
});
|
|
13125
13390
|
|
|
13126
13391
|
const dimensions = [
|
|
@@ -13523,7 +13788,7 @@ const BUILDERS = {
|
|
|
13523
13788
|
const { interpretQimen } = __mods['qimen-interpret'];
|
|
13524
13789
|
const { buildAnswer, buildPlain, buildGlossary, buildFollowups, dimensionPlain } = __mods['interpret-plain'];
|
|
13525
13790
|
const { knowledgeFor, caveatsFor, STATUS_LABEL } = __mods['interpret-knowledge'];
|
|
13526
|
-
const { CLASSIC_BOOKS } = __mods.classics;
|
|
13791
|
+
const { CLASSIC_BOOKS, suiyunClassicOf } = __mods.classics;
|
|
13527
13792
|
|
|
13528
13793
|
function enrichPlain(result, r, ask) {
|
|
13529
13794
|
if (!result) return result;
|
|
@@ -13992,16 +14257,32 @@ function crossCheck(bazi, zw) {
|
|
|
13992
14257
|
const bad = ['忌', '大忌'];
|
|
13993
14258
|
const baziGood = good.includes(t);
|
|
13994
14259
|
const baziBad = bad.includes(t);
|
|
14260
|
+
const baziKnown = t !== '—';
|
|
13995
14261
|
const ziweiHeavy = sha >= 2;
|
|
14262
|
+
const ziweiKnown = !!d;
|
|
13996
14263
|
let stance = '有张力';
|
|
13997
|
-
let note = '
|
|
13998
|
-
if (
|
|
14264
|
+
let note = '';
|
|
14265
|
+
if (!baziKnown || !ziweiKnown) {
|
|
14266
|
+
stance = '互补';
|
|
14267
|
+
const missing = !baziKnown && !ziweiKnown
|
|
14268
|
+
? '八字当前大运与紫微当前大限都没取到'
|
|
14269
|
+
: !baziKnown
|
|
14270
|
+
? `八字当前大运未取到(${t}),只有紫微一侧可参考`
|
|
14271
|
+
: '紫微当前大限未取到,只有八字一侧可参考';
|
|
14272
|
+
note = `${missing}:这一项只作提醒,不下两边对照的结论`;
|
|
14273
|
+
} else if (baziGood && ziweiHeavy) {
|
|
14274
|
+
note = '八字这边顺、紫微大限煞星偏多:大方向可参考八字,具体动作按紫微标出的位置收一收';
|
|
14275
|
+
} else if (baziBad && !ziweiHeavy) {
|
|
14276
|
+
note = '八字这边偏紧、紫微大限没见到明显煞星:先按八字收着走,紫微一侧的平静不等于没有压力';
|
|
14277
|
+
} else if (!baziGood && !baziBad && ziweiHeavy) {
|
|
14278
|
+
note = '八字大运为平、紫微大限煞星偏多:只把紫微这一侧当作提醒,不据此判断阶段好坏';
|
|
14279
|
+
} else {
|
|
13999
14280
|
stance = '同向';
|
|
14000
14281
|
note = '两边对当前阶段的松紧判断接近';
|
|
14001
14282
|
}
|
|
14002
14283
|
push('rhythm', '当前节奏',
|
|
14003
14284
|
`大运档位 ${t}`,
|
|
14004
|
-
|
|
14285
|
+
d ? `大限在${d.palace}${sha ? `;煞星 ${sha} 颗` : ';无煞星'}` : '大限未取到',
|
|
14005
14286
|
stance, note);
|
|
14006
14287
|
}
|
|
14007
14288
|
|
|
@@ -14015,7 +14296,12 @@ function crossText(cross) {
|
|
|
14015
14296
|
.join('\n');
|
|
14016
14297
|
}
|
|
14017
14298
|
|
|
14018
|
-
|
|
14299
|
+
function crossSection(cross) {
|
|
14300
|
+
const items = cross && Array.isArray(cross.items) ? cross.items : [];
|
|
14301
|
+
return { key: 'crossSystem', label: '八字 × 紫微 交叉验证', text: crossText(cross), items };
|
|
14302
|
+
}
|
|
14303
|
+
|
|
14304
|
+
return { crossCheck, crossText, crossSection };
|
|
14019
14305
|
})();
|
|
14020
14306
|
|
|
14021
14307
|
__mods.verify = (function () {
|
|
@@ -14184,7 +14470,7 @@ return { matchEvent, rectifyBirth, RECTIFY_KINDS };
|
|
|
14184
14470
|
|
|
14185
14471
|
__mods.index = (function () {
|
|
14186
14472
|
const { buildBazi } = __mods.bazi;
|
|
14187
|
-
const { buildLiuyao, tossLines, bodyLabels, yongshenOf, yongshenStrength, fushenAccess, hexagramStrength, jinTuiPower } = __mods.liuyao;
|
|
14473
|
+
const { buildLiuyao, tossLines, bodyLabels, yongshenOf, yongshenStrength, fushenAccess, hexagramStrength, jinTuiPower, yingqiWindow } = __mods.liuyao;
|
|
14188
14474
|
const { buildZiwei, BRIGHTNESS, flowOf, asOfParts, ZIWEI_SCHOOL_DEFAULTS } = __mods.ziwei;
|
|
14189
14475
|
const { drawTarot } = __mods.tarot;
|
|
14190
14476
|
const { buildMeihua } = __mods.meihua;
|
|
@@ -14197,7 +14483,7 @@ const { toJDN, ganzhiName, dayGanzhiIndex } = __mods.calendar;
|
|
|
14197
14483
|
const { randomOf, isSeed } = __mods.random;
|
|
14198
14484
|
const { interpret, DIRECTIONS, DIRECTION_DEFAULT } = __mods.interpret;
|
|
14199
14485
|
const { followup, askPrompt } = __mods.followup;
|
|
14200
|
-
const { crossCheck, crossText } = __mods.crosscheck;
|
|
14486
|
+
const { crossCheck, crossText, crossSection } = __mods.crosscheck;
|
|
14201
14487
|
const { pastSignals, verifyFit } = __mods.verify;
|
|
14202
14488
|
const { rectifyBirth } = __mods.rectify;
|
|
14203
14489
|
const { buildAlmanac } = __mods.almanac;
|
|
@@ -14208,7 +14494,7 @@ const { buildStar } = __mods.star;
|
|
|
14208
14494
|
const { buildNumerology } = __mods.numerology;
|
|
14209
14495
|
const { buildMbti, mbtiPaper } = __mods.mbti;
|
|
14210
14496
|
const { buildConvert } = __mods.convert;
|
|
14211
|
-
const { classicsFor, classicsText } = __mods.classics;
|
|
14497
|
+
const { classicsFor, classicsText, suiyunClassicOf, CLASSIC_BOOKS } = __mods.classics;
|
|
14212
14498
|
const { buildTrend } = __mods.trend;
|
|
14213
14499
|
const { buildFengshui } = __mods.fengshui;
|
|
14214
14500
|
const { buildName } = __mods.name;
|
|
@@ -14298,6 +14584,10 @@ function baziText(r) {
|
|
|
14298
14584
|
? `神煞(${r.shensha.count} 见):` + r.shensha.groups.map((g) =>
|
|
14299
14585
|
`${g.cat}|` + g.items.map((i) => `${i.name}(${i.pillars.map((k) => SHORT[k]).join('')})`).join('、')).join(';')
|
|
14300
14586
|
: '神煞:—';
|
|
14587
|
+
const ry = r.renyuan;
|
|
14588
|
+
const renyuanLine = ry
|
|
14589
|
+
? `人元:${ry.month}月第${ry.day}日,${ry.active}${ry.activeElement}司权(${ry.segments.map((s) => `${s.stem}${s.from}–${s.to}`).join(' ')})${ry.beyond ? ';已过 30 日表,按本气算' : ''}`
|
|
14590
|
+
: '';
|
|
14301
14591
|
const gejuLine = r.frame ? [
|
|
14302
14592
|
`格局:${r.frame.primary ? `${r.frame.primary.name}(${r.frame.primary.evidence})` : '—'}`,
|
|
14303
14593
|
` ${r.frame.geju.map((g) => `${g.name}[${g.kind}]`).join(' ')}`,
|
|
@@ -14320,6 +14610,7 @@ function baziText(r) {
|
|
|
14320
14610
|
shenshaLine,
|
|
14321
14611
|
`真太阳时:${r.solarTime.trueSolarText}(${r.input.geo ? r.input.geo.note + ';' : ''}${r.solarTime.note}) 晚子时:${r.input.lateZi ? '23:00 后算次日' : '23:00 后仍算当日'}`,
|
|
14322
14612
|
`节气:上一节 ${r.jieqi.previous.name} ${r.jieqi.previous.time} 下一节 ${r.jieqi.next.name} ${r.jieqi.next.time}`,
|
|
14613
|
+
...(renyuanLine ? [renyuanLine] : []),
|
|
14323
14614
|
`大运:${r.dayun.rule}(${r.dayun.direction}),${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月起运${jiao}`,
|
|
14324
14615
|
` ${dayun}`,
|
|
14325
14616
|
`流年:${r.liunian.slice(0, 10).map((l) => `${l.year}${l.ganzhi}(${l.stemTenGod})${l.luck ? `·${l.luck.tier}` : ''}`).join(' ')}`,
|
|
@@ -14327,8 +14618,10 @@ function baziText(r) {
|
|
|
14327
14618
|
const hits = r.liunian.filter((l) => l.suiyun && l.suiyun.signals && l.suiyun.signals.length);
|
|
14328
14619
|
if (!hits.length) return '岁运提示:近十年无岁运并临、运年反吟或流年伏吟/反吟(只标干支,不判吉凶)';
|
|
14329
14620
|
const label = (s) => `${s.type}${s.type.startsWith('流年') && s.target ? `(${s.target})` : ''}`;
|
|
14621
|
+
const e = suiyunClassicOf(r);
|
|
14622
|
+
const src = e ? `|古籍见《${CLASSIC_BOOKS[e.book].name}·${e.chapter}》` : '';
|
|
14330
14623
|
return '岁运提示(只标干支变动,不判吉凶):' + hits
|
|
14331
|
-
.map((l) => `${l.year}${l.ganzhi} ${l.suiyun.signals.map(label).join('/')}`).join(';');
|
|
14624
|
+
.map((l) => `${l.year}${l.ganzhi} ${l.suiyun.signals.map(label).join('/')}`).join(';') + src;
|
|
14332
14625
|
})(),
|
|
14333
14626
|
'(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)',
|
|
14334
14627
|
].join('\n') + near;
|
|
@@ -14570,6 +14863,10 @@ function liuyaoText(r) {
|
|
|
14570
14863
|
if (jt && Array.isArray(jt.lines) && jt.lines.length) {
|
|
14571
14864
|
out.push(`进退力重:${jt.lines.map((l) => `${l.position}爻${l.from}→${l.to}${l.type}·${l.verdict}`).join(' · ')}`);
|
|
14572
14865
|
}
|
|
14866
|
+
const yq = r.yingqi;
|
|
14867
|
+
if (yq && Array.isArray(yq.triggers) && yq.triggers.length) {
|
|
14868
|
+
out.push(`应期线索:${yq.tempo} · ${yq.triggers.map((t) => `${t.labels.join('/')}${t.branch}`).join(' · ')}(只列地支,不出日期)`);
|
|
14869
|
+
}
|
|
14573
14870
|
return out.filter(Boolean).join('\n');
|
|
14574
14871
|
}
|
|
14575
14872
|
|
|
@@ -14583,6 +14880,8 @@ function compute(args = {}) {
|
|
|
14583
14880
|
r.classics = classicsFor(r);
|
|
14584
14881
|
const ct = classicsText(r.classics);
|
|
14585
14882
|
if (ct) r.summary = `${r.summary}\n【古籍】\n${ct}`;
|
|
14883
|
+
const syc = suiyunClassicOf(r);
|
|
14884
|
+
if (syc) r.suiyunClassic = { ...syc, bookName: CLASSIC_BOOKS[syc.book].name };
|
|
14586
14885
|
}
|
|
14587
14886
|
if (r && r.precision && r.precision.level === 'approx' && r.summary) {
|
|
14588
14887
|
r.summary = `⚠ ${r.precision.note}\n${r.summary}`;
|
|
@@ -14613,7 +14912,7 @@ function compute(args = {}) {
|
|
|
14613
14912
|
: buildBazi({ ...common, lateZi: args.lateZi !== false, nowYear: asOf ? asOf.year : undefined });
|
|
14614
14913
|
r.cross = crossCheck(r.system === 'bazi' ? r : other, r.system === 'ziwei' ? r : other);
|
|
14615
14914
|
if (r.interpret) {
|
|
14616
|
-
r.interpret.sections.push(
|
|
14915
|
+
r.interpret.sections.push(crossSection(r.cross));
|
|
14617
14916
|
}
|
|
14618
14917
|
}
|
|
14619
14918
|
if (Number.isInteger(args.verifyPast) && args.verifyPast > 0 && r.system === 'bazi') {
|
|
@@ -14871,6 +15170,8 @@ function computeRaw(args = {}) {
|
|
|
14871
15170
|
if (strength) result.useGodStrength = strength;
|
|
14872
15171
|
const chufu = fushenAccess(result, ug, { monthBranch, dayBranch: result.dayGanZhi.branch });
|
|
14873
15172
|
if (chufu) result.fushenAccess = chufu;
|
|
15173
|
+
const yq = yingqiWindow(result, ug, { monthBranch });
|
|
15174
|
+
if (yq) result.yingqi = yq;
|
|
14874
15175
|
}
|
|
14875
15176
|
if (args.seed !== undefined && args.seed !== null && args.seed !== '') result.seed = Number(args.seed);
|
|
14876
15177
|
return { ...result, ...(asOf ? { asOf } : {}), summary: liuyaoText(result) };
|
|
@@ -15299,12 +15600,13 @@ function renderText(result) {
|
|
|
15299
15600
|
return parts.filter(Boolean).join('\n\n');
|
|
15300
15601
|
}
|
|
15301
15602
|
|
|
15302
|
-
return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAddress, resolveAddress, buildBazi, buildLiuyao, tossLines, followup, askPrompt, pastSignals, verifyFit, rectifyBirth, crossCheck, crossText, buildAlmanac, buildZeri, buildChenggu, buildXiaoliuren, buildStar, buildNumerology, buildConvert, buildTrend, buildFengshui, buildName, parseDateTime, compute, interpretText, renderText };
|
|
15603
|
+
return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAddress, resolveAddress, buildBazi, buildLiuyao, tossLines, followup, askPrompt, pastSignals, verifyFit, rectifyBirth, crossCheck, crossText, crossSection, buildAlmanac, buildZeri, buildChenggu, buildXiaoliuren, buildStar, buildNumerology, buildConvert, buildTrend, buildFengshui, buildName, parseDateTime, compute, interpretText, renderText };
|
|
15303
15604
|
})();
|
|
15304
15605
|
|
|
15305
15606
|
const Engine = __mods.index;
|
|
15306
15607
|
window.Engine = Engine;
|
|
15307
|
-
window.__MP_VER = '0.
|
|
15608
|
+
window.__MP_VER = '0.50.1';
|
|
15609
|
+
window.__MPGroups = [{"title":"问一件事","hint":"心里有一件具体的事,起一卦再决定","items":[{"k":"liuyao","label":"六爻","tip":"摇六次,问一件事"},{"k":"meihua","label":"梅花","tip":"见闻起卦,看当下"},{"k":"tarot","label":"塔罗","tip":"抽牌,看关系与选择"},{"k":"qimen","label":"奇门","tip":"看方位、时机与取舍"},{"k":"daliuren","label":"六壬","tip":"占事,断来意与结果"},{"k":"xiaoliuren","label":"小六壬","tip":"掐指一算,快速断"}]},{"title":"看一个人","hint":"看自己或身边人的性情、格局与运程","items":[{"k":"bazi","label":"八字","tip":"四柱看一生格局"},{"k":"ziwei","label":"紫微","tip":"十二宫细看"},{"k":"hepan","label":"合盘","tip":"两个人合不合"},{"k":"mbti","label":"人格","tip":"16 型性格问卷"},{"k":"chenggu","label":"称骨","tip":"按生辰称命重"},{"k":"numerology","label":"数字","tip":"生日数字看性格"},{"k":"trend","label":"人生K","tip":"一生高低走势","wide":true}]},{"title":"查日子","hint":"挑时间、换农历,顺带看看家里和名字","items":[{"k":"almanac","label":"黄历","tip":"今天宜忌、时辰吉凶"},{"k":"zeri","label":"择日","tip":"挑个办事的好日子"},{"k":"convert","label":"农历","tip":"公历农历互转"},{"k":"star","label":"星座","tip":"星座性格与今日运"},{"k":"fengshui","label":"风水","tip":"房屋朝向与布置"},{"k":"name","label":"起名","tip":"按八字选字"}]}];
|
|
15308
15610
|
(function () {
|
|
15309
15611
|
const NEED_ASK = { liuyao: true, meihua: true, daliuren: true, tarot: true };
|
|
15310
15612
|
const needAsk = (kind) => !!NEED_ASK[kind];
|
|
@@ -15431,6 +15733,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15431
15733
|
.pp-str b{color:var(--red);font-size:15px;margin:0 4px}
|
|
15432
15734
|
.pp-drel{font-style:normal;color:var(--red);font-size:12px}
|
|
15433
15735
|
.pp-dim{color:var(--muted)}
|
|
15736
|
+
.pp-sy-src{margin-top:6px;font-size:11.5px;line-height:1.55}
|
|
15434
15737
|
.pp-r{display:none}
|
|
15435
15738
|
.pp-modes{display:flex;align-items:center;border-bottom:1px solid var(--line);font-family:system-ui,sans-serif}
|
|
15436
15739
|
.pp-modes label{min-height:44px;display:inline-flex;align-items:center;padding:3px 20px;font-size:12.5px;color:var(--muted);cursor:pointer;border-right:1px solid var(--line);user-select:none}
|
|
@@ -15711,7 +16014,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15711
16014
|
.mp-tt-ta{width:100%;border:1px solid var(--line);background:var(--card);color:var(--ink);padding:8px;font-size:13px;font-family:inherit;line-height:1.7;resize:vertical;outline:none}
|
|
15712
16015
|
.mp-tt-ta:focus{border-color:var(--red)}
|
|
15713
16016
|
|
|
15714
|
-
.mp-it{margin-top:14px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:12px;overflow:hidden;box-shadow:var(--shadow);
|
|
16017
|
+
.mp-it{margin-top:14px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:12px;overflow:hidden;box-shadow:var(--shadow);container-type:inline-size;
|
|
15715
16018
|
font-family:"Songti SC","SimSun","Microsoft YaHei",serif;font-size:13px;line-height:1.75}
|
|
15716
16019
|
.mp-it *{box-sizing:border-box}
|
|
15717
16020
|
.mp-it-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap;width:100%;padding:12px 16px;border:none;border-bottom:1px solid var(--line);background:var(--card);color:inherit;font:inherit;font-family:inherit;text-align:left;cursor:pointer;-webkit-appearance:none;appearance:none}
|
|
@@ -15797,13 +16100,25 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15797
16100
|
.mp-it-conf.c-强{color:var(--lu);border-color:rgba(var(--lu-rgb),.4)}
|
|
15798
16101
|
.mp-it-conf.c-中{color:var(--label);border-color:var(--line)}
|
|
15799
16102
|
.mp-it-conf.c-弱{color:var(--red);border-color:rgba(var(--red-rgb),.4)}
|
|
16103
|
+
.mp-cross{display:flex;flex-direction:column;gap:8px;font-family:system-ui,sans-serif}
|
|
16104
|
+
.mp-cross-row{border:1px solid var(--line);border-radius:8px;background:var(--card);padding:9px 11px}
|
|
16105
|
+
.mp-cross-h{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
16106
|
+
.mp-cross-l{font-size:13px;font-weight:700;color:var(--ink);letter-spacing:.02em}
|
|
16107
|
+
.mp-cross-tag{font-size:11px;line-height:1.5;padding:1px 8px;border:1px solid currentColor;border-radius:999px;color:var(--muted)}
|
|
16108
|
+
.mp-cross-tag.t-good{color:var(--lu)}
|
|
16109
|
+
.mp-cross-tag.t-watch{color:var(--quan)}
|
|
16110
|
+
.mp-cross-tag.t-alt{color:var(--ke)}
|
|
16111
|
+
.mp-cross-b{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 14px;margin-top:7px}
|
|
16112
|
+
.mp-cross-cell{font-size:12.5px;line-height:1.75;color:var(--ink2)}
|
|
16113
|
+
.mp-cross-cell b{display:block;font-size:10.5px;letter-spacing:.1em;color:var(--muted);font-weight:600;margin-bottom:1px}
|
|
16114
|
+
.mp-cross-note{margin-top:7px;padding-top:6px;border-top:1px dashed var(--line);font-size:12px;line-height:1.7;color:var(--muted)}
|
|
15800
16115
|
.mp-tables{border-top:1px solid var(--line);padding:12px 16px 4px;background:var(--card)}
|
|
15801
16116
|
.mp-table-wrap{margin-bottom:12px}
|
|
15802
16117
|
.mp-table-h{font-size:12px;font-weight:700;letter-spacing:.1em;color:var(--lu);margin-bottom:5px;font-family:system-ui,sans-serif}
|
|
15803
16118
|
.mp-table-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:8px}
|
|
15804
16119
|
.mp-table{width:100%;border-collapse:collapse;font-size:12px;line-height:1.6;color:var(--ink2);font-family:system-ui,sans-serif}
|
|
15805
16120
|
.mp-table th,.mp-table td{padding:5px 9px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line);white-space:nowrap}
|
|
15806
|
-
.mp-table th{background:var(--band);color:var(--
|
|
16121
|
+
.mp-table th{background:var(--band);color:var(--ink2);font-weight:600;font-size:11px;letter-spacing:.06em}
|
|
15807
16122
|
.mp-table tbody tr:last-child td{border-bottom:none}
|
|
15808
16123
|
.mp-table tbody tr:nth-child(even) td{background:rgba(0,0,0,.02)}
|
|
15809
16124
|
@media print{
|
|
@@ -15814,6 +16129,52 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15814
16129
|
.mp-table-wrap,.mp-it-sec,.mp-it-dim{break-inside:avoid}
|
|
15815
16130
|
.mp-table-wrap{page-break-inside:avoid}
|
|
15816
16131
|
}
|
|
16132
|
+
@media (max-width:640px){
|
|
16133
|
+
.mp-tables{padding:10px 11px 2px}
|
|
16134
|
+
.mp-table-wrap{margin-bottom:14px}
|
|
16135
|
+
.mp-table-scroll{overflow:visible;border:0;border-radius:0}
|
|
16136
|
+
.mp-table{display:block;width:100%}
|
|
16137
|
+
.mp-table thead{display:none}
|
|
16138
|
+
.mp-table tbody{display:block}
|
|
16139
|
+
.mp-table tr{display:block;border:1px solid var(--line);border-radius:8px;background:var(--card);padding:7px 10px;margin:0 0 8px}
|
|
16140
|
+
.mp-table td{display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;border-bottom:0;padding:2px 0;white-space:normal;font-size:12.5px;line-height:1.65}
|
|
16141
|
+
.mp-table td::before{content:attr(data-label);color:var(--muted);font-size:11px;line-height:1.9}
|
|
16142
|
+
.mp-table td:first-child{display:block;padding-bottom:3px;font-size:13px;font-weight:700;color:var(--ink)}
|
|
16143
|
+
.mp-table td:first-child::before{content:none}
|
|
16144
|
+
.mp-table tbody tr:nth-child(even) td{background:none}
|
|
16145
|
+
.mp-table tbody tr:last-child{margin-bottom:0}
|
|
16146
|
+
.mp-cross-b{grid-template-columns:1fr;gap:6px}
|
|
16147
|
+
.mp-cross-cell b{display:inline;margin-right:6px;letter-spacing:.06em}
|
|
16148
|
+
.mp-toc{flex-wrap:nowrap;overflow-x:auto;gap:8px;margin:10px 0 0;padding:6px 11px;border:0;border-bottom:1px solid var(--line);border-radius:0;scrollbar-width:none}
|
|
16149
|
+
.mp-toc::-webkit-scrollbar{display:none}
|
|
16150
|
+
.mp-toc a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:999px;color:var(--lu);text-decoration:none}
|
|
16151
|
+
.mp-toc a:hover{color:var(--ink)}
|
|
16152
|
+
.mp-it-ev>summary{display:flex;align-items:center;min-height:44px;padding:0 9px}
|
|
16153
|
+
.mp-it-gloss summary{display:flex;align-items:center;min-height:44px;margin-bottom:2px}
|
|
16154
|
+
}
|
|
16155
|
+
@container (max-width:640px){
|
|
16156
|
+
.mp-tables{padding:10px 11px 2px}
|
|
16157
|
+
.mp-table-wrap{margin-bottom:14px}
|
|
16158
|
+
.mp-table-scroll{overflow:visible;border:0;border-radius:0}
|
|
16159
|
+
.mp-table{display:block;width:100%}
|
|
16160
|
+
.mp-table thead{display:none}
|
|
16161
|
+
.mp-table tbody{display:block}
|
|
16162
|
+
.mp-table tr{display:block;border:1px solid var(--line);border-radius:8px;background:var(--card);padding:7px 10px;margin:0 0 8px}
|
|
16163
|
+
.mp-table td{display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;border-bottom:0;padding:2px 0;white-space:normal;font-size:12.5px;line-height:1.65}
|
|
16164
|
+
.mp-table td::before{content:attr(data-label);color:var(--muted);font-size:11px;line-height:1.9}
|
|
16165
|
+
.mp-table td:first-child{display:block;padding-bottom:3px;font-size:13px;font-weight:700;color:var(--ink)}
|
|
16166
|
+
.mp-table td:first-child::before{content:none}
|
|
16167
|
+
.mp-table tbody tr:nth-child(even) td{background:none}
|
|
16168
|
+
.mp-table tbody tr:last-child{margin-bottom:0}
|
|
16169
|
+
.mp-cross-b{grid-template-columns:1fr;gap:6px}
|
|
16170
|
+
.mp-cross-cell b{display:inline;margin-right:6px;letter-spacing:.06em}
|
|
16171
|
+
.mp-toc{flex-wrap:nowrap;overflow-x:auto;gap:8px;margin:10px 0 0;padding:6px 11px;border:0;border-bottom:1px solid var(--line);border-radius:0;scrollbar-width:none}
|
|
16172
|
+
.mp-toc::-webkit-scrollbar{display:none}
|
|
16173
|
+
.mp-toc a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:999px;color:var(--lu);text-decoration:none}
|
|
16174
|
+
.mp-toc a:hover{color:var(--ink)}
|
|
16175
|
+
.mp-it-ev>summary{display:flex;align-items:center;min-height:44px;padding:0 9px}
|
|
16176
|
+
.mp-it-gloss summary{display:flex;align-items:center;min-height:44px;margin-bottom:2px}
|
|
16177
|
+
}
|
|
15817
16178
|
.mp-fu{margin:12px 16px;border:1px solid var(--line);border-left:3px solid var(--lu);border-radius:8px;background:var(--card);padding:10px 12px;font-size:13px;line-height:1.8;color:var(--ink2)}
|
|
15818
16179
|
.mp-fu.miss{border-left-color:var(--red)}
|
|
15819
16180
|
.mp-fu-h{font-size:12px;font-weight:700;letter-spacing:.08em;color:var(--lu);margin-bottom:4px;font-family:system-ui,sans-serif}
|
|
@@ -16617,6 +16978,13 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
16617
16978
|
return `<span class="pp-chip ${cls}">伏神${esc(l)}</span>`;
|
|
16618
16979
|
}).join('')}</div>`
|
|
16619
16980
|
: '';
|
|
16981
|
+
const yq = r.yingqi && Array.isArray(r.yingqi.labels) ? r.yingqi : null;
|
|
16982
|
+
const yingqiRow = yq && yq.labels.length
|
|
16983
|
+
? `<div class="pp-chips">${yq.labels.map((l) => {
|
|
16984
|
+
const cls = /应期偏速/.test(l) ? 'ok' : /应期待解/.test(l) ? 'warn' : '';
|
|
16985
|
+
return `<span class="pp-chip ${cls}" title="只列地支,不出日期">${esc(l)}</span>`;
|
|
16986
|
+
}).join('')}</div>`
|
|
16987
|
+
: '';
|
|
16620
16988
|
const jp = r.jinTuiPower && Array.isArray(r.jinTuiPower.labels) ? r.jinTuiPower : null;
|
|
16621
16989
|
const jinRow = jp && jp.labels.length
|
|
16622
16990
|
? `<div class="pp-chips">${jp.labels.map((l) => {
|
|
@@ -16639,6 +17007,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
16639
17007
|
${useRow}
|
|
16640
17008
|
${strengthRow}
|
|
16641
17009
|
${fushenRow}
|
|
17010
|
+
${yingqiRow}
|
|
16642
17011
|
${jinRow}
|
|
16643
17012
|
${hexRow}
|
|
16644
17013
|
</div>`;
|
|
@@ -17361,8 +17730,10 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
17361
17730
|
return `<span class="pp-chip ${lk ? tierCls(lk.tier) : ''}" title="${esc(lk ? `${lk.tier} ${lk.score}|${(lk.reasons || []).join(';')}${syTip}` : syTip.replace(/^|/, ''))}">${l.year} ${l.ganzhi}${lk ? ` ${lk.tier}` : ''}</span>`;
|
|
17362
17731
|
}).join('')}</div>` : '';
|
|
17363
17732
|
const sy = (r.liunian || []).filter((l) => l.suiyun && Array.isArray(l.suiyun.signals) && l.suiyun.signals.length);
|
|
17733
|
+
const syc = r.suiyunClassic;
|
|
17734
|
+
const sySrc = syc ? `<div class="pp-dim pp-sy-src" title="${esc(syc.plain || '')}">《${esc(syc.bookName || '')}·${esc(syc.chapter || '')}》「${esc(syc.quote || '')}」</div>` : '';
|
|
17364
17735
|
const syRow = sy.length ? `<div class="pp-tl pp-dim">岁运提示(只标干支变动,不判吉凶)</div><div class="pp-chips">${sy.map((l) =>
|
|
17365
|
-
`<span class="pp-chip" title="${esc(`${l.suiyun.signals.map((x) => x.detail).join(';')}|${l.suiyun.note || ''}`)}">${l.year} ${esc(l.suiyun.signals.map((x) => `${x.type}${x.type.startsWith('流年') && x.target ? `·${x.target}` : ''}`).join('/'))}</span>`).join('')}</div
|
|
17736
|
+
`<span class="pp-chip" title="${esc(`${l.suiyun.signals.map((x) => x.detail).join(';')}|${l.suiyun.note || ''}`)}">${l.year} ${esc(l.suiyun.signals.map((x) => `${x.type}${x.type.startsWith('流年') && x.target ? `·${x.target}` : ''}`).join('/'))}</span>`).join('')}</div>${sySrc}` : '';
|
|
17366
17737
|
const str = r.strength ? `<div class="pp-str">日主强弱:<b>${r.strength.level}</b>${r.strength.score} <span class="pp-dim">${r.strength.detail}</span></div>` : '';
|
|
17367
17738
|
const ssGroups = (r.shensha && r.shensha.groups) || [];
|
|
17368
17739
|
const ssx = ssGroups.length ? `
|
|
@@ -17402,6 +17773,19 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
17402
17773
|
|
|
17403
17774
|
const MT_LABEL = { natal: '命盘解析', divination: '卦象解析', card: '牌阵解析' };
|
|
17404
17775
|
|
|
17776
|
+
const STANCE_TONE = { 同向: 'good', 有张力: 'watch', 互补: 'alt' };
|
|
17777
|
+
const crossHTML = (items) => `<div class="mp-cross">${items.map((c) => {
|
|
17778
|
+
const tone = STANCE_TONE[c.stance] || 'plain';
|
|
17779
|
+
return `<div class="mp-cross-row">
|
|
17780
|
+
<div class="mp-cross-h"><span class="mp-cross-l">${esc(c.label)}</span><span class="mp-cross-tag t-${tone}">${esc(c.stance || '—')}</span></div>
|
|
17781
|
+
<div class="mp-cross-b">
|
|
17782
|
+
<div class="mp-cross-cell"><b>八字</b><span>${esc(c.bazi || '—')}</span></div>
|
|
17783
|
+
<div class="mp-cross-cell"><b>紫微</b><span>${esc(c.ziwei || '—')}</span></div>
|
|
17784
|
+
</div>
|
|
17785
|
+
${c.note ? `<div class="mp-cross-note">${esc(c.note)}</div>` : ''}
|
|
17786
|
+
</div>`;
|
|
17787
|
+
}).join('')}</div>`;
|
|
17788
|
+
|
|
17405
17789
|
pp.interpretHTML = function (it, opt) {
|
|
17406
17790
|
if (!it) return '';
|
|
17407
17791
|
const hasBody = (it.dimensions && it.dimensions.length) || (it.sections && it.sections.length);
|
|
@@ -17425,8 +17809,8 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
17425
17809
|
? `<div class="mp-tables">${it.tables.filter((t) => Array.isArray(t.rows) && t.rows.length).map((t) => `<div class="mp-table-wrap">
|
|
17426
17810
|
<div class="mp-table-h">${esc(t.title)}</div>
|
|
17427
17811
|
<div class="mp-table-scroll"><table class="mp-table">
|
|
17428
|
-
<thead><tr>${t.columns.map((c) => `<th>${esc(c)}</th>`).join('')}</tr></thead>
|
|
17429
|
-
<tbody>${t.rows.map((row) => `<tr>${row.map((c) => `<td>${esc(c)}</td>`).join('')}</tr>`).join('')}</tbody>
|
|
17812
|
+
<thead><tr>${t.columns.map((c) => `<th scope="col">${esc(c)}</th>`).join('')}</tr></thead>
|
|
17813
|
+
<tbody>${t.rows.map((row) => `<tr>${row.map((c, ci) => `<td data-label="${esc(t.columns[ci] || '')}">${esc(c)}</td>`).join('')}</tr>`).join('')}</tbody>
|
|
17430
17814
|
</table></div>
|
|
17431
17815
|
</div>`).join('')}</div>`
|
|
17432
17816
|
: '';
|
|
@@ -17437,7 +17821,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
17437
17821
|
const secs = (it.sections && it.sections.length)
|
|
17438
17822
|
? `<div class="mp-it-secs">${it.sections.map((s) => `<div class="mp-it-sec${s.tone ? ` tone-${esc(s.tone)}` : ''}" id="mp-sec-${esc(s.key)}">
|
|
17439
17823
|
<div class="mp-it-sh">${esc(s.label)}</div>
|
|
17440
|
-
<div class="mp-it-stext">${richText(s.text)}</div>
|
|
17824
|
+
<div class="mp-it-stext">${(Array.isArray(s.items) && s.items.length) ? crossHTML(s.items) : richText(s.text)}</div>
|
|
17441
17825
|
</div>`).join('')}</div>`
|
|
17442
17826
|
: '';
|
|
17443
17827
|
const tags = [it.systemLabel, MT_LABEL[it.moduleType] || it.moduleType].filter(Boolean);
|
|
@@ -17814,7 +18198,7 @@ function HISTORY_LABEL(kind, r) {
|
|
|
17814
18198
|
}
|
|
17815
18199
|
const PP = window.__PP;
|
|
17816
18200
|
const CSS = `
|
|
17817
|
-
.mp-wrap{height:100%;overflow:auto;padding:20px 24px 40px;color:var(--dsw-alias-label-primary);font-size:14px}
|
|
18201
|
+
.mp-wrap{height:100%;width:100%;box-sizing:border-box;overflow:auto;padding:20px 24px 40px;color:var(--dsw-alias-label-primary);font-size:14px}
|
|
17818
18202
|
.mp-wrap>*{max-width:940px;margin-left:auto;margin-right:auto}
|
|
17819
18203
|
.mp-panel{background:linear-gradient(180deg,var(--dsw-alias-bg-layer-2),color-mix(in srgb,var(--dsw-alias-bg-layer-2) 88%,var(--dsw-alias-bg-layer-1)));border:1px solid var(--dsw-alias-border-l1);border-radius:16px;padding:18px 20px 16px;margin-bottom:16px;
|
|
17820
18204
|
box-shadow:0 1px 2px color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent),0 16px 34px -30px color-mix(in srgb,var(--dsw-alias-label-primary) 45%,transparent)}
|
|
@@ -17824,10 +18208,53 @@ const CSS = `
|
|
|
17824
18208
|
.mp-checks label{display:inline-flex;align-items:center;gap:6px;cursor:pointer}
|
|
17825
18209
|
.mp-askblock{margin-top:14px;display:flex;flex-direction:column;gap:5px}
|
|
17826
18210
|
.mp-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
|
|
17827
|
-
.mp-
|
|
17828
|
-
.mp-
|
|
17829
|
-
.mp-
|
|
17830
|
-
.mp-
|
|
18211
|
+
.mp-start{margin-bottom:14px;container-type:inline-size}
|
|
18212
|
+
.mp-start-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
|
|
18213
|
+
.mp-recent{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
18214
|
+
.mp-recent[hidden]{display:none}
|
|
18215
|
+
.mp-recent-lbl{font-size:11.5px;font-weight:700;letter-spacing:.1em;color:var(--dsw-alias-brand-primary)}
|
|
18216
|
+
.mp-recent-list{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
18217
|
+
.mp-rc{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);
|
|
18218
|
+
background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 72%,transparent);color:var(--dsw-alias-label-primary);
|
|
18219
|
+
font-family:inherit;font-size:12.5px;cursor:pointer;transition:border-color .14s,background .14s}
|
|
18220
|
+
.mp-rc:hover{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-2)}
|
|
18221
|
+
.mp-rc i{font-style:normal;font-size:11px;color:var(--dsw-alias-label-secondary)}
|
|
18222
|
+
.mp-viewsw{margin-left:auto;display:inline-flex;padding:3px;border:1px solid var(--dsw-alias-border-l1);border-radius:999px;background:var(--dsw-alias-bg-layer-2)}
|
|
18223
|
+
.mp-viewsw button{border:none;background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;padding:4px 11px;border-radius:999px;cursor:pointer;transition:background .14s,color .14s}
|
|
18224
|
+
.mp-viewsw button:hover{color:var(--dsw-alias-label-primary)}
|
|
18225
|
+
.mp-viewsw button.on{background:var(--dsw-alias-brand-primary);color:#fff}
|
|
18226
|
+
.mp-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(228px,1fr));gap:10px}
|
|
18227
|
+
.mp-tgroup{padding:12px 12px 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:14px;
|
|
18228
|
+
background:linear-gradient(180deg,var(--dsw-alias-bg-layer-2),color-mix(in srgb,var(--dsw-alias-bg-layer-2) 88%,var(--dsw-alias-bg-layer-1)));
|
|
18229
|
+
box-shadow:0 1px 2px color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent)}
|
|
18230
|
+
.mp-tgroup-head h2{display:flex;align-items:center;gap:7px;margin:0;font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary);letter-spacing:.06em}
|
|
18231
|
+
.mp-tgroup-head h2::before{content:"";flex:none;width:7px;height:7px;border-radius:2px;background:var(--dsw-alias-brand-primary)}
|
|
18232
|
+
.mp-tgroup-head p{margin:3px 0 9px;font-size:11.5px;line-height:1.55;color:var(--dsw-alias-label-secondary)}
|
|
18233
|
+
.mp-ttools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
|
|
18234
|
+
.mp-tool{display:flex;flex-direction:column;gap:1px;padding:7px 9px;text-align:left;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;
|
|
18235
|
+
background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 72%,transparent);color:var(--dsw-alias-label-primary);font-family:inherit;cursor:pointer;
|
|
18236
|
+
transition:border-color .14s,background .14s,box-shadow .14s}
|
|
18237
|
+
.mp-tool b{font-size:13px;font-weight:600;letter-spacing:.02em}
|
|
18238
|
+
.mp-tool span{font-size:11px;line-height:1.4;color:var(--dsw-alias-label-secondary)}
|
|
18239
|
+
.mp-tool:hover{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-1)}
|
|
18240
|
+
.mp-tool.on{border-color:transparent;background:var(--dsw-alias-brand-primary);box-shadow:0 8px 18px -12px var(--dsw-alias-brand-primary)}
|
|
18241
|
+
.mp-tool.on b,.mp-tool.on span{color:#fff}
|
|
18242
|
+
.mp-tool.wide{grid-column:1/-1}
|
|
18243
|
+
.mp-tmore{display:none;grid-column:1/-1;align-items:center;justify-content:center;gap:6px;padding:7px;border:1px dashed var(--dsw-alias-border-l1);border-radius:9px;
|
|
18244
|
+
background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;cursor:pointer}
|
|
18245
|
+
.mp-tmore:hover{color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}
|
|
18246
|
+
@container (max-width:560px){
|
|
18247
|
+
.mp-start-top{flex-direction:column;align-items:stretch;gap:8px}
|
|
18248
|
+
.mp-viewsw{margin-left:0;align-self:flex-end}
|
|
18249
|
+
.mp-tgroup:not(.open) .mp-ttools>.mp-tool:nth-child(n+5){display:none}
|
|
18250
|
+
.mp-tmore{display:flex}
|
|
18251
|
+
}
|
|
18252
|
+
.mp-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(74px,1fr));gap:6px;margin-bottom:14px;width:100%;max-width:940px}
|
|
18253
|
+
.mp-tabs.hide{display:none}
|
|
18254
|
+
.mp-tab{padding:7px 10px;border-radius:999px;border:1px solid transparent;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 62%,transparent);color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:13px;white-space:nowrap;
|
|
18255
|
+
transition:background .16s,color .16s,border-color .16s,box-shadow .16s}
|
|
18256
|
+
.mp-tab:hover{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary)}
|
|
18257
|
+
.mp-tab.on{background:var(--dsw-alias-brand-primary);border-color:transparent;color:#fff;font-weight:600;box-shadow:0 8px 18px -12px var(--dsw-alias-brand-primary)}
|
|
17831
18258
|
.mp-field{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--dsw-alias-label-secondary);min-width:0}
|
|
17832
18259
|
.mp-input{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);border-radius:9px;padding:7px 11px;font-size:14px;outline:none;width:100%;min-width:0;height:36px;
|
|
17833
18260
|
transition:border-color .14s,box-shadow .14s,background .14s}
|
|
@@ -17929,8 +18356,10 @@ const CSS = `
|
|
|
17929
18356
|
}
|
|
17930
18357
|
@media (max-width:720px){
|
|
17931
18358
|
.mp-wrap{padding:14px 14px 36px}
|
|
17932
|
-
.mp-tabs{display:
|
|
17933
|
-
.mp-
|
|
18359
|
+
.mp-tabs{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;margin:0 -14px 12px;padding:2px 14px 6px;scrollbar-width:none}
|
|
18360
|
+
.mp-tabs::-webkit-scrollbar{display:none}
|
|
18361
|
+
.mp-tab{flex:0 0 auto;min-height:44px;padding:10px 16px;font-size:13.5px;text-align:center}
|
|
18362
|
+
.mp-rc{min-height:36px}
|
|
17934
18363
|
.mp-input,.mp-textarea{padding:10px 12px;font-size:16px;min-height:44px;height:auto}
|
|
17935
18364
|
.mp-textarea{min-height:76px}
|
|
17936
18365
|
.mp-quiz-q{padding:9px 10px}
|
|
@@ -17949,7 +18378,8 @@ const CSS = `
|
|
|
17949
18378
|
}
|
|
17950
18379
|
@media (max-width:420px){
|
|
17951
18380
|
.mp-wrap{padding:12px 10px 32px}
|
|
17952
|
-
.mp-
|
|
18381
|
+
.mp-tabs{margin-left:-10px;margin-right:-10px;padding-left:10px;padding-right:10px}
|
|
18382
|
+
.mp-tab{font-size:13px;padding:9px 13px}
|
|
17953
18383
|
}
|
|
17954
18384
|
:where(.mp-btn,.mp-tab,.mp-chip,.mp-hist-item,.mp-hist-clear,.mp-qmopt,.seg button):focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}
|
|
17955
18385
|
@media (prefers-reduced-motion:reduce){
|
|
@@ -18066,6 +18496,28 @@ function pad(n) { return String(n).padStart(2, '0'); }
|
|
|
18066
18496
|
|
|
18067
18497
|
const QUICK_TABS = ['almanac', 'convert', 'zeri', 'chenggu', 'xiaoliuren', 'star', 'numerology', 'trend', 'fengshui', 'name'];
|
|
18068
18498
|
|
|
18499
|
+
const GROUPS = Array.isArray(window.__MPGroups) ? window.__MPGroups : [];
|
|
18500
|
+
|
|
18501
|
+
const RECENT_KEY = 'mp.recent.tabs';
|
|
18502
|
+
const VIEW_KEY = 'mp.first.view';
|
|
18503
|
+
const RECENT_MAX = 3;
|
|
18504
|
+
|
|
18505
|
+
function storeGet(key) {
|
|
18506
|
+
try { return JSON.parse(window.localStorage.getItem(key) || 'null'); } catch (e) { return null; }
|
|
18507
|
+
}
|
|
18508
|
+
function storeSet(key, val) {
|
|
18509
|
+
try { window.localStorage.setItem(key, JSON.stringify(val)); } catch (e) { /* 存不了不影响使用 */ }
|
|
18510
|
+
}
|
|
18511
|
+
function dayLabel(ts) {
|
|
18512
|
+
const d = new Date(ts);
|
|
18513
|
+
if (Number.isNaN(d.getTime())) return '';
|
|
18514
|
+
const day = (x) => new Date(x.getFullYear(), x.getMonth(), x.getDate()).getTime();
|
|
18515
|
+
const diff = Math.round((day(new Date()) - day(d)) / 86400000);
|
|
18516
|
+
if (diff <= 0) return '今天';
|
|
18517
|
+
if (diff === 1) return '昨天';
|
|
18518
|
+
return `${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
18519
|
+
}
|
|
18520
|
+
|
|
18069
18521
|
function nowParts() {
|
|
18070
18522
|
const d = new Date();
|
|
18071
18523
|
return { date: `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`, time: `${pad(d.getHours())}:${pad(d.getMinutes())}` };
|
|
@@ -18214,6 +18666,12 @@ function App() {
|
|
|
18214
18666
|
if (result && result.r) { LAST.r = result.r; LAST.q = askText.trim(); LAST.it = result.it || null; }
|
|
18215
18667
|
}, [result, askText]);
|
|
18216
18668
|
const [hist, setHist] = useState(() => loadHistory());
|
|
18669
|
+
const [view, setView] = useState(() => (storeGet(VIEW_KEY) === 'flat' ? 'flat' : 'group'));
|
|
18670
|
+
const [recent, setRecent] = useState(() => {
|
|
18671
|
+
const v = storeGet(RECENT_KEY);
|
|
18672
|
+
return Array.isArray(v) ? v : [];
|
|
18673
|
+
});
|
|
18674
|
+
const [openGroups, setOpenGroups] = useState({});
|
|
18217
18675
|
const [replayArgs, setReplayArgs] = useState(null);
|
|
18218
18676
|
const [error, setError] = useState('');
|
|
18219
18677
|
const [notice, setNotice] = useState('');
|
|
@@ -18391,8 +18849,8 @@ function App() {
|
|
|
18391
18849
|
? { question: needAsk(k) ? question.trim() : '', direction }
|
|
18392
18850
|
: undefined;
|
|
18393
18851
|
const it = Engine.interpret ? Engine.interpret(r, ask) : null;
|
|
18394
|
-
if (it && r.cross && Engine.
|
|
18395
|
-
it.sections = [...(it.sections || []),
|
|
18852
|
+
if (it && r.cross && Engine.crossSection) {
|
|
18853
|
+
it.sections = [...(it.sections || []), Engine.crossSection(r.cross)];
|
|
18396
18854
|
}
|
|
18397
18855
|
const timed = kindOf(k) === 'cast' && (k !== 'meihua' || mh === 'time');
|
|
18398
18856
|
setResult({ kind: k, r, it, at: dt, timed, trend });
|
|
@@ -18437,6 +18895,25 @@ function App() {
|
|
|
18437
18895
|
run(next, v);
|
|
18438
18896
|
};
|
|
18439
18897
|
|
|
18898
|
+
const recordRecent = (k) => {
|
|
18899
|
+
if (!TABS.some((t) => t.k === k)) return;
|
|
18900
|
+
setRecent((prev) => {
|
|
18901
|
+
const list = (prev || []).filter((x) => x && x.tab && x.tab !== k);
|
|
18902
|
+
const next = [{ tab: k, at: Date.now() }].concat(list).slice(0, RECENT_MAX);
|
|
18903
|
+
storeSet(RECENT_KEY, next);
|
|
18904
|
+
return next;
|
|
18905
|
+
});
|
|
18906
|
+
};
|
|
18907
|
+
const changeView = (v) => {
|
|
18908
|
+
const next = v === 'flat' ? 'flat' : 'group';
|
|
18909
|
+
setView(next);
|
|
18910
|
+
storeSet(VIEW_KEY, next);
|
|
18911
|
+
};
|
|
18912
|
+
const activate = (k) => {
|
|
18913
|
+
recordRecent(k);
|
|
18914
|
+
switchTo(k);
|
|
18915
|
+
};
|
|
18916
|
+
|
|
18440
18917
|
const editDate = (value) => {
|
|
18441
18918
|
setDate(value);
|
|
18442
18919
|
if (timeKind !== 'none') setManual((m) => Object.assign({}, m, { [timeKind]: { date: value, time } }));
|
|
@@ -18641,15 +19118,55 @@ function App() {
|
|
|
18641
19118
|
run(k);
|
|
18642
19119
|
}, [replayArgs]);
|
|
18643
19120
|
|
|
19121
|
+
const recentList = (recent || []).filter((x) => x && TABS.some((t) => t.k === x.tab)).slice(0, RECENT_MAX);
|
|
19122
|
+
const tabLabel = (k) => (TABS.find((t) => t.k === k) || {}).label || k;
|
|
19123
|
+
const toolOf = ({ k, label, tip, wide }) => h('button', {
|
|
19124
|
+
key: k, type: 'button', className: 'mp-tool' + (wide ? ' wide' : '') + (tab === k ? ' on' : ''), 'data-tab': k,
|
|
19125
|
+
onClick: () => activate(k),
|
|
19126
|
+
}, h('b', null, label), h('span', null, tip));
|
|
19127
|
+
|
|
18644
19128
|
const children = [
|
|
18645
|
-
h('
|
|
19129
|
+
h('section', { key: 'start', className: 'mp-start', 'aria-label': '选择要算的事' },
|
|
19130
|
+
h('div', { className: 'mp-start-top' },
|
|
19131
|
+
h('div', { className: 'mp-recent', hidden: recentList.length === 0 },
|
|
19132
|
+
h('span', { className: 'mp-recent-lbl' }, '最近用过'),
|
|
19133
|
+
h('span', { className: 'mp-recent-list' }, recentList.map((x) => h('button', {
|
|
19134
|
+
key: x.tab, type: 'button', className: 'mp-rc', onClick: () => activate(x.tab),
|
|
19135
|
+
}, tabLabel(x.tab), h('i', null, dayLabel(x.at)))))),
|
|
19136
|
+
h('div', { className: 'mp-viewsw', role: 'group', 'aria-label': '首屏视图' },
|
|
19137
|
+
h('button', {
|
|
19138
|
+
type: 'button', className: view === 'group' ? 'on' : '',
|
|
19139
|
+
'aria-pressed': view === 'group' ? 'true' : 'false',
|
|
19140
|
+
onClick: () => changeView('group'),
|
|
19141
|
+
}, '分组'),
|
|
19142
|
+
h('button', {
|
|
19143
|
+
type: 'button', className: view === 'flat' ? 'on' : '',
|
|
19144
|
+
'aria-pressed': view === 'flat' ? 'true' : 'false',
|
|
19145
|
+
onClick: () => changeView('flat'),
|
|
19146
|
+
}, '平铺'))),
|
|
19147
|
+
view === 'group' ? h('div', { className: 'mp-groups' },
|
|
19148
|
+
GROUPS.map((g) => {
|
|
19149
|
+
const open = !!openGroups[g.title];
|
|
19150
|
+
const extra = Math.max(0, g.items.length - 4);
|
|
19151
|
+
return h('section', { key: g.title, className: 'mp-tgroup' + (open ? ' open' : '') },
|
|
19152
|
+
h('div', { className: 'mp-tgroup-head' }, h('h2', null, g.title), h('p', null, g.hint)),
|
|
19153
|
+
h('div', { className: 'mp-ttools' },
|
|
19154
|
+
g.items.map(toolOf),
|
|
19155
|
+
extra > 0 ? h('button', {
|
|
19156
|
+
key: 'more', type: 'button', className: 'mp-tmore',
|
|
19157
|
+
'aria-expanded': open ? 'true' : 'false',
|
|
19158
|
+
onClick: () => setOpenGroups((o) => Object.assign({}, o, { [g.title]: !open })),
|
|
19159
|
+
}, open ? '收起' : `还有 ${extra} 个`) : null));
|
|
19160
|
+
})) : null),
|
|
19161
|
+
|
|
19162
|
+
h('div', { key: 'tabs', className: 'mp-tabs' + (view === 'flat' ? '' : ' hide'), role: 'tablist', 'aria-label': '命理体系' }, TABS.map((t) =>
|
|
18646
19163
|
h('button', {
|
|
18647
19164
|
key: t.k,
|
|
18648
19165
|
role: 'tab',
|
|
18649
19166
|
'aria-selected': tab === t.k ? 'true' : 'false',
|
|
18650
19167
|
tabIndex: tab === t.k ? 0 : -1,
|
|
18651
19168
|
className: 'mp-tab' + (tab === t.k ? ' on' : ''),
|
|
18652
|
-
onClick: () =>
|
|
19169
|
+
onClick: () => activate(t.k),
|
|
18653
19170
|
}, t.label))),
|
|
18654
19171
|
|
|
18655
19172
|
h('div', { key: 'head', className: 'mp-panel' },
|