dsh-metaphysics 0.38.2 → 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 +315 -8
- package/README.md +353 -342
- package/client.js +2699 -177
- package/engine/almanac.js +7 -6
- package/engine/bazi-words.js +174 -0
- package/engine/bazi.js +62 -0
- package/engine/classics.js +175 -9
- package/engine/crosscheck.js +29 -3
- package/engine/fengshui.js +197 -11
- package/engine/followup.js +29 -5
- package/engine/geju.js +90 -5
- package/engine/index.js +119 -13
- package/engine/interpret-knowledge.js +48 -12
- package/engine/interpret-plain.js +380 -322
- package/engine/interpret.js +328 -35
- package/engine/liuyao.js +185 -0
- package/engine/name-data.js +229 -0
- package/engine/name.js +234 -9
- package/engine/ziwei-words.js +245 -0
- package/engine/ziwei.js +254 -26
- package/index.js +65 -9
- package/package.json +2 -2
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +3419 -527
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; }
|
|
@@ -2544,7 +2544,7 @@ const CLASSICS = [
|
|
|
2544
2544
|
book: 'ziping',
|
|
2545
2545
|
chapter: '三十三、论财',
|
|
2546
2546
|
scene: '格局',
|
|
2547
|
-
tags: ['财'],
|
|
2547
|
+
tags: ['财', '正财', '偏财'],
|
|
2548
2548
|
quote: '财为我克,使用之物也,以能生官,所以为美。为财帛,为妻妾,为才能,为驿马,皆财类也。',
|
|
2549
2549
|
plain: '财是我所克、能为我用之物,因能生官而美;它同时代表钱财、配偶、才能、走动,不只「钱」一项。',
|
|
2550
2550
|
url: 'https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53653.html',
|
|
@@ -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',
|
|
@@ -2729,6 +2739,16 @@ const CLASSICS = [
|
|
|
2729
2739
|
plain: '看精神不能偏执一端,要在损益之间求其中。',
|
|
2730
2740
|
url: 'https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html',
|
|
2731
2741
|
},
|
|
2742
|
+
{
|
|
2743
|
+
id: 'dt-tongguan',
|
|
2744
|
+
book: 'ditian',
|
|
2745
|
+
chapter: '通神论·通关',
|
|
2746
|
+
scene: '用神',
|
|
2747
|
+
tags: [],
|
|
2748
|
+
quote: '关内有织女,关外有牛郎,此关若通也,相邀入洞房。',
|
|
2749
|
+
plain: '两股力隔着一道关相望:一边织女、一边牛郎,中间若有一行能把两边接上(一方生它、它再生另一方),对峙就化成相生。原文只给取象,哪一行为关要按五行生克定。',
|
|
2750
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html',
|
|
2751
|
+
},
|
|
2732
2752
|
{
|
|
2733
2753
|
id: 'smt-zhenguan',
|
|
2734
2754
|
book: 'sanming',
|
|
@@ -2744,11 +2764,21 @@ const CLASSICS = [
|
|
|
2744
2764
|
book: 'sanming',
|
|
2745
2765
|
chapter: '卷六·论正财',
|
|
2746
2766
|
scene: '格局',
|
|
2747
|
-
tags: ['财'],
|
|
2767
|
+
tags: ['财', '正财'],
|
|
2748
2768
|
quote: '正财者,乃甲见己、乙见戊之例。受我克制,为我之妻,譬人娶妻,妻赍财嫁我,我必精神康强,而后可享用,若衰微不振,虽妻财丰厚,但能目视,终不得用。',
|
|
2749
2769
|
plain: '正财是我克制之物,古人以「娶妻带财」作比:自身精神康强才受用得起,身弱不振,财再厚也只是看着。',
|
|
2750
2770
|
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7645.html',
|
|
2751
2771
|
},
|
|
2772
|
+
{
|
|
2773
|
+
id: 'smt-piancai',
|
|
2774
|
+
book: 'sanming',
|
|
2775
|
+
chapter: '卷六·论偏财',
|
|
2776
|
+
scene: '格局',
|
|
2777
|
+
tags: ['财', '偏财'],
|
|
2778
|
+
quote: '何谓偏财?乃甲见戊、乙见己之例。非妻所带,乃众人之财也。切忌有姊妹兄弟分夺,柱无官星,祸患百出。',
|
|
2779
|
+
plain: '偏财取「我克而阴阳不同」:不是妻家带来的私财,而是众人之财,宜流通不宜独占。原文最忌比肩劫财来分夺,又说柱中无官星则多事(旧说的重话照录,本插件只记原文、不作断语)。',
|
|
2780
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7650.html',
|
|
2781
|
+
},
|
|
2752
2782
|
{
|
|
2753
2783
|
id: 'smt-yinshou',
|
|
2754
2784
|
book: 'sanming',
|
|
@@ -2799,6 +2829,96 @@ const CLASSICS = [
|
|
|
2799
2829
|
plain: '月令建禄是日主临官之地,身旺而财官难取:古说难承祖业、见财不聚,但病少寿长;再走比肩运,古书说克妻妨父损子(属于旧说的重话,本插件只记原文、不作断语)。',
|
|
2800
2830
|
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7672.html',
|
|
2801
2831
|
},
|
|
2832
|
+
{
|
|
2833
|
+
id: 'smt-guansha-liu',
|
|
2834
|
+
book: 'sanming',
|
|
2835
|
+
chapter: '卷五·官煞去留杂论',
|
|
2836
|
+
scene: '格局',
|
|
2837
|
+
tags: ['七杀', '偏官'],
|
|
2838
|
+
quote: '凡看去留,要详柱中官煞孰重孰轻,天干透者易去,月支所藏者难去,须伤官食神去官煞之物众而有力,方才去得。',
|
|
2839
|
+
plain: '官煞混见时先比谁重谁轻:天干透出的容易去,月支藏着的难去;用来去官煞的伤官食神要成众、有根有力,才真去得掉。七杀格遇正官混杂,就按这一篇看取舍。',
|
|
2840
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7599.html',
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
id: 'smt-quzhi',
|
|
2844
|
+
book: 'sanming',
|
|
2845
|
+
chapter: '卷六·曲直',
|
|
2846
|
+
scene: '格局',
|
|
2847
|
+
tags: ['曲直格', '专旺'],
|
|
2848
|
+
quote: '甲乙日得亥卯未局,柱中须有亥字带印为入格,若无亥有卯,止是木之本气,却要见金土为贵,既无亥字,又无金土,则木不秀不实,难以言贵。',
|
|
2849
|
+
plain: '曲直格要木局成方(亥卯未)且带亥字为印,才算入格;只有卯、没有亥,只是木的本气,得另见金土才谈得上贵;两样都没有,木虽旺而无成,难称贵格。',
|
|
2850
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7630.html',
|
|
2851
|
+
},
|
|
2852
|
+
{
|
|
2853
|
+
id: 'smt-yanshang',
|
|
2854
|
+
book: 'sanming',
|
|
2855
|
+
chapter: '卷六·炎上',
|
|
2856
|
+
scene: '格局',
|
|
2857
|
+
tags: ['炎上格', '专旺'],
|
|
2858
|
+
quote: '丙丁日遇寅午戌局,柱中须有寅字带印为入格,无寅止是九流近贵之命,若火自旺,无亥水相济,不贵。喜东北方运,忌见辰丑戊己,晦火光明,多主眼疾,或患风气,柱有木制成贵,忌水金乡,怕冲。',
|
|
2859
|
+
plain: '炎上格要火局成方(寅午戌)且带寅字为印才入格;无寅只是偏贵的命。火自旺还要一点水相济,过燥不贵;行运喜东北、忌湿土晦火,也怕冲。原文另带「多主眼疾」一句,属于旧说,本插件只记原文、不作健康判断。',
|
|
2860
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7631.html',
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
id: 'smt-congge',
|
|
2864
|
+
book: 'sanming',
|
|
2865
|
+
chapter: '卷六·从革',
|
|
2866
|
+
scene: '格局',
|
|
2867
|
+
tags: ['从革格', '专旺'],
|
|
2868
|
+
quote: '庚辛日见巳酉丑局,须带丙丁巳午一二位方成其器,但不可火多。如辛巳、辛酉、辛丑三日不喜五月生,被火所伤,宜八月或水土养育食神印绶为吉。',
|
|
2869
|
+
plain: '从革格是金局成方(巳酉丑),但金要火炼才成器:须带丙丁或巳午一二位,火又不能多。辛巳、辛酉、辛丑三日出身在五月(火旺)被伤,原文说宜八月或水土养育。',
|
|
2870
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7632.html',
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
id: 'smt-runxia',
|
|
2874
|
+
book: 'sanming',
|
|
2875
|
+
chapter: '卷六·润下',
|
|
2876
|
+
scene: '格局',
|
|
2877
|
+
tags: ['润下格', '专旺'],
|
|
2878
|
+
quote: '壬癸日见申子辰全,忌引卯巳死绝之地,三刑四冲之乡,死绝则不流,冲刑则横流,岁运同。或曰水太泛须柱有土神一两位制之,得成堤岸,既有土怕会木为凶,如有木伤土要金印救解,终是一生成败。',
|
|
2879
|
+
plain: '润下格是水局三合全(申子辰),最忌卯巳死绝与三刑四冲:死绝水不流,冲刑水横流,行运也一样看。水太泛要一两位土作堤,有土又怕木来破堤,木伤土再用金印解救——原文把成败条件摊开讲。',
|
|
2880
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7633.html',
|
|
2881
|
+
},
|
|
2882
|
+
{
|
|
2883
|
+
id: 'smt-jiasi',
|
|
2884
|
+
book: 'sanming',
|
|
2885
|
+
chapter: '卷六·稼穑',
|
|
2886
|
+
scene: '格局',
|
|
2887
|
+
tags: ['稼穑格', '专旺'],
|
|
2888
|
+
quote: '赋云:戊己忻逢四季,乃为稼穑之名。是戊己生逢季月,喜见木为官,止得一木为妙,木多则土虚,主虚诈为破家不仁之人。',
|
|
2889
|
+
plain: '稼穑格取戊己生于四季月(辰戌丑未)。原文说喜见一木为官,木多则土虚;后半对木多之人的评语是旧说的重话,本插件只照录条件、不拿来评价人。',
|
|
2890
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7634.html',
|
|
2891
|
+
},
|
|
2892
|
+
{
|
|
2893
|
+
id: 'smt-congsha',
|
|
2894
|
+
book: 'sanming',
|
|
2895
|
+
chapter: '卷五·弃命从煞',
|
|
2896
|
+
scene: '格局',
|
|
2897
|
+
tags: ['从杀格'],
|
|
2898
|
+
quote: '《独步》云:弃命从煞,须要会煞从财,忌煞从煞。盖言从煞格,以煞神太重,身无所归,不得已从之,要行煞旺及财乡,四柱无一点比肩印绶方论,如遇运扶身旺,与煞为敌,从煞不专,故为祸患。',
|
|
2899
|
+
plain: '从煞格是煞太重、日主无所归才「弃命」相从:条件是四柱没有一点比肩印绶扶身,行运喜煞旺与财乡;一旦走扶身之运,与煞为敌,就从得不专。本插件只作结构说明,不据此断寿夭。',
|
|
2900
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7598.html',
|
|
2901
|
+
},
|
|
2902
|
+
{
|
|
2903
|
+
id: 'smt-congcai',
|
|
2904
|
+
book: 'sanming',
|
|
2905
|
+
chapter: '卷六·弃命从财',
|
|
2906
|
+
scene: '格局',
|
|
2907
|
+
tags: ['从财格'],
|
|
2908
|
+
quote: '《独步》云:弃命从财,须要会财,若逢根气,命损无猜。假如丁生酉月,柱多庚辛,日干无气,只得弃命相从,运入北方财官旺地,乃为入格,南行灾。',
|
|
2909
|
+
plain: '从财格要财会成局、日干无气;一见根气就破格,原文用「命损无猜」这种重话写明。以丁生酉月、柱多庚辛为例:只能弃命相从,行北方财官旺地为入格,南行则灾。',
|
|
2910
|
+
url: 'https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7652.html',
|
|
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
|
+
},
|
|
2802
2922
|
];
|
|
2803
2923
|
|
|
2804
2924
|
const BY_ID = CLASSICS.reduce((m, e) => { m[e.id] = e; return m; }, {});
|
|
@@ -2807,8 +2927,8 @@ const GEJU_KEY = {
|
|
|
2807
2927
|
正官格: '正官',
|
|
2808
2928
|
七杀格: '七杀',
|
|
2809
2929
|
偏官格: '偏官',
|
|
2810
|
-
正财格: '
|
|
2811
|
-
偏财格: '
|
|
2930
|
+
正财格: '正财',
|
|
2931
|
+
偏财格: '偏财',
|
|
2812
2932
|
正印格: '印',
|
|
2813
2933
|
偏印格: '印',
|
|
2814
2934
|
食神格: '食神',
|
|
@@ -2818,10 +2938,26 @@ const GEJU_KEY = {
|
|
|
2818
2938
|
建禄格: '建禄',
|
|
2819
2939
|
};
|
|
2820
2940
|
|
|
2941
|
+
const SPECIAL_CLASSIC = {
|
|
2942
|
+
曲直格: 'smt-quzhi',
|
|
2943
|
+
炎上格: 'smt-yanshang',
|
|
2944
|
+
从革格: 'smt-congge',
|
|
2945
|
+
润下格: 'smt-runxia',
|
|
2946
|
+
稼穑格: 'smt-jiasi',
|
|
2947
|
+
从财格: 'smt-congcai',
|
|
2948
|
+
从杀格: 'smt-congsha',
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2821
2951
|
function classicOf(id) {
|
|
2822
2952
|
return BY_ID[id] || null;
|
|
2823
2953
|
}
|
|
2824
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
|
+
|
|
2825
2961
|
function tagOf(gejuName) {
|
|
2826
2962
|
const name = String(gejuName || '');
|
|
2827
2963
|
if (GEJU_KEY[name]) return GEJU_KEY[name];
|
|
@@ -2847,6 +2983,10 @@ function classicsFor(r, limit = 5) {
|
|
|
2847
2983
|
out.push({ ...entry, why });
|
|
2848
2984
|
};
|
|
2849
2985
|
const gejuList = Array.isArray(r.geju) ? r.geju : (r.frame && Array.isArray(r.frame.geju) ? r.frame.geju : []);
|
|
2986
|
+
for (const g of gejuList) {
|
|
2987
|
+
const entry = g && SPECIAL_CLASSIC[g.name] ? classicOf(SPECIAL_CLASSIC[g.name]) : null;
|
|
2988
|
+
if (entry) push(entry, `本盘列有「${g.name}」,故取${CLASSIC_BOOKS[entry.book].name}「${chapterTitle(entry)}」一条`);
|
|
2989
|
+
}
|
|
2850
2990
|
for (const g of gejuList) {
|
|
2851
2991
|
if (!g || (g.kind && g.kind !== '月令格')) continue;
|
|
2852
2992
|
const tag = tagOf(g.name);
|
|
@@ -2856,17 +2996,26 @@ function classicsFor(r, limit = 5) {
|
|
|
2856
2996
|
if (alt) push(alt, `同是「${g.name}」,${CLASSIC_BOOKS[alt.book].name}「${chapterTitle(alt)}」另有取法,可对照读`);
|
|
2857
2997
|
}
|
|
2858
2998
|
const cli = r.climate || (r.frame && r.frame.yongshen && (r.frame.yongshen.climate || r.frame.yongshen.tiaohou));
|
|
2999
|
+
const tg = r.frame && r.frame.yongshen && r.frame.yongshen.tongguan;
|
|
3000
|
+
const tgEntry = tg && tg.usable ? classicOf('dt-tongguan') : null;
|
|
2859
3001
|
if (cli && cli.kind && cli.kind !== '平和') {
|
|
2860
3002
|
const cold = !!(cli.cold || cli.kind.indexOf('寒') >= 0);
|
|
2861
3003
|
const hot = !!(cli.hot || cli.kind.indexOf('热') >= 0);
|
|
2862
3004
|
push(classicOf(cold ? 'dt-hannuan' : 'dt-zaoshi'), `本盘气候判为「${cli.kind}」,故取${CLASSIC_BOOKS.ditian.name}寒暖燥湿一条`);
|
|
2863
|
-
push(classicOf('zp-qihou'), '气候与月令用神要互参,故取子平真诠「用神配气候」一条');
|
|
3005
|
+
if (!tgEntry) push(classicOf('zp-qihou'), '气候与月令用神要互参,故取子平真诠「用神配气候」一条');
|
|
2864
3006
|
if (hot) push(classicOf('dt-hannuan'), '本盘偏热,寒暖一条正对');
|
|
2865
3007
|
}
|
|
3008
|
+
if (tgEntry) {
|
|
3009
|
+
push(tgEntry, `本盘忌${tg.foe}克用${tg.use},局中${tg.bridge}${tg.weight}分可作通关,故取${CLASSIC_BOOKS.ditian.name}「通关」一条`);
|
|
3010
|
+
}
|
|
2866
3011
|
const huagi = gejuList.find((g) => g && g.kind === '化气格');
|
|
2867
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);
|
|
2868
3015
|
if (huagi) {
|
|
2869
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}论杂气如何取用`);
|
|
2870
3019
|
} else if (combo) {
|
|
2871
3020
|
push(classicOf('zp-chengbai'), `本盘另有「${combo.name}」组合:成格还要看带忌与救应,总纲一位改取${CLASSIC_BOOKS.ziping.name}论用神成败救应`);
|
|
2872
3021
|
} else {
|
|
@@ -2880,13 +3029,14 @@ function classicsText(rows) {
|
|
|
2880
3029
|
return rows.map((e) => `《${CLASSIC_BOOKS[e.book].name}·${e.chapter}》「${e.quote}」`).join('\n');
|
|
2881
3030
|
}
|
|
2882
3031
|
|
|
2883
|
-
return { CLASSIC_BOOKS, CLASSICS, classicOf, classicsFor, classicsText };
|
|
3032
|
+
return { CLASSIC_BOOKS, CLASSICS, classicOf, suiyunClassicOf, classicsFor, classicsText };
|
|
2884
3033
|
})();
|
|
2885
3034
|
|
|
2886
3035
|
__mods.geju = (function () {
|
|
2887
3036
|
|
|
2888
3037
|
const { judgeClimate, arbitrate } = __mods.tiaohou;
|
|
2889
3038
|
const { qtOf } = __mods.qiongtong;
|
|
3039
|
+
const { sanheGroupOf } = __mods.sanhe;
|
|
2890
3040
|
|
|
2891
3041
|
const STEMS = ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'];
|
|
2892
3042
|
const BRANCHES = ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥'];
|
|
@@ -2960,6 +3110,23 @@ function elementRoles(dayStem) {
|
|
|
2960
3110
|
return { me, inMe, shi: GENERATES[me], cai: OVERCOMES[me], guan };
|
|
2961
3111
|
}
|
|
2962
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
|
+
|
|
2963
3130
|
function monthPattern(pillars, dayStem, monthBranch) {
|
|
2964
3131
|
const hidden = HIDDEN[monthBranch] || [];
|
|
2965
3132
|
const cands = hidden.map((stem, i) => ({
|
|
@@ -2971,10 +3138,12 @@ function monthPattern(pillars, dayStem, monthBranch) {
|
|
|
2971
3138
|
const others = ['year', 'month', 'hour'];
|
|
2972
3139
|
const exposedKey = others.find((k) => cands.some((c) => c.stem === pillars[k].stem));
|
|
2973
3140
|
const base = cands[0];
|
|
2974
|
-
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 ? '会支' : '本气');
|
|
2975
3144
|
const exposedPos = exposedKey ? { year: '年', month: '月', hour: '时' }[exposedKey] : null;
|
|
2976
3145
|
|
|
2977
|
-
if (base.god === '比肩') {
|
|
3146
|
+
if (base.god === '比肩' && LUSHEN_BRANCH[dayStem] === monthBranch) {
|
|
2978
3147
|
return {
|
|
2979
3148
|
name: '建禄格',
|
|
2980
3149
|
kind: '月令格',
|
|
@@ -2991,10 +3160,30 @@ function monthPattern(pillars, dayStem, monthBranch) {
|
|
|
2991
3160
|
}
|
|
2992
3161
|
return { name: '月劫格', kind: '月令格', evidence: `月令${monthBranch}本气${base.stem}为劫财` };
|
|
2993
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
|
+
}
|
|
2994
3178
|
const name = `${use.god}格`;
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
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
|
+
}
|
|
2998
3187
|
return { name, kind: '月令格', evidence: ex };
|
|
2999
3188
|
}
|
|
3000
3189
|
|
|
@@ -3065,6 +3254,32 @@ function specialPatterns(pillars, dayStem, monthBranch, strength, wuxing, gods)
|
|
|
3065
3254
|
return out;
|
|
3066
3255
|
}
|
|
3067
3256
|
|
|
3257
|
+
const TONGGUAN_MIN = 1.5;
|
|
3258
|
+
function tongguanOf(favor = [], avoid = [], wuxing = {}) {
|
|
3259
|
+
const w = (el) => Math.round((Number(wuxing[el]) || 0) * 10) / 10;
|
|
3260
|
+
for (const use of favor) {
|
|
3261
|
+
if (w(use) < TONGGUAN_MIN) continue;
|
|
3262
|
+
for (const foe of avoid) {
|
|
3263
|
+
if (OVERCOMES[foe] !== use || w(foe) < TONGGUAN_MIN) continue;
|
|
3264
|
+
const bridge = GENERATES[foe];
|
|
3265
|
+
if (!bridge || GENERATES[bridge] !== use) continue;
|
|
3266
|
+
const weight = w(bridge);
|
|
3267
|
+
const bridgeIsAvoid = avoid.includes(bridge) && !favor.includes(bridge);
|
|
3268
|
+
const level = bridgeIsAvoid ? '为忌' : weight >= TONGGUAN_MIN ? '可通' : weight > 0 ? '关弱' : '未通';
|
|
3269
|
+
return {
|
|
3270
|
+
use, foe, bridge,
|
|
3271
|
+
weight,
|
|
3272
|
+
present: weight > 0,
|
|
3273
|
+
bridgeIsAvoid,
|
|
3274
|
+
level,
|
|
3275
|
+
usable: level === '可通',
|
|
3276
|
+
note: '相战=用神与忌神两行各在局中 ≥1.5 分且相克;通关一行=克方所生、又能生用神的那一行(五行里唯一),只报局中分量,不据此断吉凶',
|
|
3277
|
+
};
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
return null;
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3068
3283
|
function yongshenOf(dayStem, monthBranch, strength, wuxing, branches = []) {
|
|
3069
3284
|
const roles = elementRoles(dayStem);
|
|
3070
3285
|
const me = roles.me;
|
|
@@ -3094,6 +3309,7 @@ function yongshenOf(dayStem, monthBranch, strength, wuxing, branches = []) {
|
|
|
3094
3309
|
};
|
|
3095
3310
|
const favorTenGods = Array.from(new Set(favor.flatMap((el) => expand[roleName(el)] || [])));
|
|
3096
3311
|
const avoidTenGods = Array.from(new Set(avoid.flatMap((el) => expand[roleName(el)] || [])));
|
|
3312
|
+
const tongguan = tongguanOf(favor, avoid, wuxing);
|
|
3097
3313
|
|
|
3098
3314
|
const detail = [
|
|
3099
3315
|
`日主${dayStem}${me},${strength.level}(${strength.score} 分):`,
|
|
@@ -3104,6 +3320,15 @@ function yongshenOf(dayStem, monthBranch, strength, wuxing, branches = []) {
|
|
|
3104
3320
|
: '身中和,先取调候与通关,喜忌随大运流年动态变化。',
|
|
3105
3321
|
`调候:${climate.label}(${(climate.evidence || []).join('、')})${climate.need ? `,取${climate.need.stem}${climate.need.element},忌${climate.avoidElement}` : ',气候平和'}。`,
|
|
3106
3322
|
qt ? `穷通宝鉴:${qt.month}${dayStem}${me},用神${qt.yong.join('、')}(首取${qt.primary})。` : '',
|
|
3323
|
+
tongguan
|
|
3324
|
+
? `通关:忌${tongguan.foe}克用${tongguan.use},五行以${tongguan.bridge}为关;局中${tongguan.level === '可通'
|
|
3325
|
+
? `${tongguan.bridge} ${tongguan.weight} 分,关可通`
|
|
3326
|
+
: tongguan.level === '关弱'
|
|
3327
|
+
? `仅 ${tongguan.bridge} ${tongguan.weight} 分,关弱`
|
|
3328
|
+
: tongguan.level === '为忌'
|
|
3329
|
+
? `${tongguan.bridge} ${tongguan.weight} 分但此行为忌,通关力打折`
|
|
3330
|
+
: `未见${tongguan.bridge},关未通`}(只作结构提示,不据此断吉凶)。`
|
|
3331
|
+
: '',
|
|
3107
3332
|
arb.text,
|
|
3108
3333
|
arb.clash ? '取舍:本盘按「调候优先、扶抑次之」取用;若你更认同扶抑派,可把调候当环境偏好,强弱判断不受影响。' : '',
|
|
3109
3334
|
].filter(Boolean).join('');
|
|
@@ -3120,6 +3345,7 @@ function yongshenOf(dayStem, monthBranch, strength, wuxing, branches = []) {
|
|
|
3120
3345
|
tiaohou: { ...climate, ...arb, element: climate.need ? climate.need.element : null },
|
|
3121
3346
|
climate,
|
|
3122
3347
|
qt,
|
|
3348
|
+
tongguan,
|
|
3123
3349
|
detail,
|
|
3124
3350
|
};
|
|
3125
3351
|
}
|
|
@@ -3216,7 +3442,7 @@ function analyzeBaziFrame({ pillars, dayStem, monthBranch, strength, wuxing }) {
|
|
|
3216
3442
|
};
|
|
3217
3443
|
}
|
|
3218
3444
|
|
|
3219
|
-
return { tenGod, elementRoles, scoreLuck, analyzeBaziFrame };
|
|
3445
|
+
return { tenGod, elementRoles, tongguanOf, scoreLuck, analyzeBaziFrame };
|
|
3220
3446
|
})();
|
|
3221
3447
|
|
|
3222
3448
|
__mods.bazi = (function () {
|
|
@@ -3244,6 +3470,21 @@ const HIDDEN_STEMS = {
|
|
|
3244
3470
|
亥: ['壬', '甲'],
|
|
3245
3471
|
};
|
|
3246
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
|
+
|
|
3247
3488
|
const STEM_ELEMENT = {
|
|
3248
3489
|
甲: '木', 乙: '木', 丙: '火', 丁: '火', 戊: '土',
|
|
3249
3490
|
己: '土', 庚: '金', 辛: '金', 壬: '水', 癸: '水',
|
|
@@ -3407,6 +3648,36 @@ function applyTrueSolar(jd, longitude) {
|
|
|
3407
3648
|
};
|
|
3408
3649
|
}
|
|
3409
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
|
+
|
|
3410
3681
|
function buildBazi(input) {
|
|
3411
3682
|
assertCivil(input);
|
|
3412
3683
|
let { year, month, day, hour = 0, minute = 0, gender = 'male' } = input;
|
|
@@ -3688,6 +3959,9 @@ function buildBazi(input) {
|
|
|
3688
3959
|
const bodyStemIdx = (yinStem + ((bodyIdx - 2 + 12) % 12)) % 10;
|
|
3689
3960
|
const shengong = ganzhiName(sexagenaryIndex(bodyStemIdx, bodyIdx));
|
|
3690
3961
|
|
|
3962
|
+
const renyuan = renyuanOf(BRANCHES[monthBranchIdx], jdnBase, prevJieTerm.jd);
|
|
3963
|
+
if (renyuan) renyuan.term = { name: prevJieTerm.name, time: formatJd(prevJieTerm.jd) };
|
|
3964
|
+
|
|
3691
3965
|
return {
|
|
3692
3966
|
system: 'bazi',
|
|
3693
3967
|
relations: buildRelations(pillars),
|
|
@@ -3718,6 +3992,7 @@ function buildBazi(input) {
|
|
|
3718
3992
|
next: { name: nextJieTerm.name, time: formatJd(nextJieTerm.jd) },
|
|
3719
3993
|
nearBoundaryMinutes: Math.round(Math.min(jd - prevJieTerm.jd, nextJieTerm.jd - jd) * 1440),
|
|
3720
3994
|
},
|
|
3995
|
+
renyuan,
|
|
3721
3996
|
pillars,
|
|
3722
3997
|
dayMaster: { stem: dayStem, element: STEM_ELEMENT[dayStem], yinYang: isYangStem(dayStem) ? '阳' : '阴' },
|
|
3723
3998
|
wuxing,
|
|
@@ -3749,7 +4024,7 @@ function buildBazi(input) {
|
|
|
3749
4024
|
};
|
|
3750
4025
|
}
|
|
3751
4026
|
|
|
3752
|
-
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 };
|
|
3753
4028
|
})();
|
|
3754
4029
|
|
|
3755
4030
|
__mods.liuyao = (function () {
|
|
@@ -3806,6 +4081,7 @@ const LIUSHEN_START = { 甲: 0, 乙: 0, 丙: 1, 丁: 1, 戊: 2, 己: 3, 庚: 4,
|
|
|
3806
4081
|
const ZHI_CHONG_PAIRS = [['子', '午'], ['丑', '未'], ['寅', '申'], ['卯', '酉'], ['辰', '戌'], ['巳', '亥']];
|
|
3807
4082
|
const ZHI_HE_PAIRS = [['子', '丑'], ['寅', '亥'], ['卯', '戌'], ['辰', '酉'], ['巳', '申'], ['午', '未']];
|
|
3808
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]]));
|
|
3809
4085
|
const TRIGRAM_OPPOSITE = { 乾: '巽', 巽: '乾', 坎: '离', 离: '坎', 艮: '坤', 坤: '艮', 震: '兑', 兑: '震' };
|
|
3810
4086
|
|
|
3811
4087
|
const JIN_TUI_PAIRS = [['寅', '卯'], ['巳', '午'], ['申', '酉'], ['亥', '子'], ['丑', '辰'], ['辰', '未'], ['未', '戌'], ['戌', '丑']];
|
|
@@ -4373,6 +4649,80 @@ function yongshenStrength(result, useGod, opts = {}) {
|
|
|
4373
4649
|
};
|
|
4374
4650
|
}
|
|
4375
4651
|
|
|
4652
|
+
const FUSHEN_VERDICTS = ['可出', '有助有压', '受压难出', '未得助'];
|
|
4653
|
+
|
|
4654
|
+
function fushenAccess(result, useGod, opts = {}) {
|
|
4655
|
+
if (!useGod || !Array.isArray(useGod.fushen) || !useGod.fushen.length) return null;
|
|
4656
|
+
const monthBranch = opts.monthBranch || null;
|
|
4657
|
+
const dayBranch = opts.dayBranch || (result && result.dayGanZhi ? result.dayGanZhi.branch : null);
|
|
4658
|
+
const monthElement = monthBranch ? zhiElementOf(monthBranch) : null;
|
|
4659
|
+
const dayElement = dayBranch ? zhiElementOf(dayBranch) : null;
|
|
4660
|
+
const kong = Array.isArray(result && result.xunKong)
|
|
4661
|
+
? result.xunKong
|
|
4662
|
+
: (result && typeof result.xunKong === 'string' ? result.xunKong.split('') : []);
|
|
4663
|
+
|
|
4664
|
+
const items = useGod.fushen.map((f) => {
|
|
4665
|
+
const element = f.element || zhiElementOf(f.branch);
|
|
4666
|
+
const relation = f.relation || null;
|
|
4667
|
+
const monthState = monthStateOf(element, monthElement);
|
|
4668
|
+
const monthChong = !!(monthBranch && CHONG_OF[f.branch] === monthBranch);
|
|
4669
|
+
const dayRelation = dayRelationOf(element, dayElement);
|
|
4670
|
+
const kongz = kong.includes(f.branch);
|
|
4671
|
+
|
|
4672
|
+
const supports = [];
|
|
4673
|
+
if (relation === '飞生伏') supports.push('飞神生伏');
|
|
4674
|
+
if (relation === '伏克飞') supports.push('伏神克飞');
|
|
4675
|
+
if (dayRelation === '日生') supports.push('日辰生伏');
|
|
4676
|
+
if (dayRelation === '比和') supports.push('日辰比和');
|
|
4677
|
+
if (monthState === '旺') supports.push('月建同气');
|
|
4678
|
+
if (monthState === '相') supports.push('月建相生');
|
|
4679
|
+
|
|
4680
|
+
const pressures = [];
|
|
4681
|
+
if (relation === '飞克伏') pressures.push('飞神克伏');
|
|
4682
|
+
if (dayRelation === '日克') pressures.push('日辰克伏');
|
|
4683
|
+
if (monthChong) pressures.push('月破');
|
|
4684
|
+
|
|
4685
|
+
const verdict = !relation ? '飞伏未知'
|
|
4686
|
+
: supports.length && pressures.length ? '有助有压'
|
|
4687
|
+
: supports.length ? '可出'
|
|
4688
|
+
: pressures.length ? '受压难出' : '未得助';
|
|
4689
|
+
const basis = monthBranch && dayBranch ? '月建日辰' : monthBranch ? '月建' : dayBranch ? '日辰' : '飞伏';
|
|
4690
|
+
|
|
4691
|
+
const facts = [];
|
|
4692
|
+
if (relation) facts.push(`飞伏${relation}`);
|
|
4693
|
+
if (monthBranch) facts.push(`月建${monthBranch}(${monthElement})${monthState}${monthChong ? '、月破' : ''}`);
|
|
4694
|
+
if (dayBranch) facts.push(`日辰${dayBranch}(${dayElement})${dayRelation}`);
|
|
4695
|
+
if (kongz) facts.push('伏神旬空');
|
|
4696
|
+
const say = `第${f.position}爻${f.branch}${element}:${facts.join(',')} → ${verdict}` +
|
|
4697
|
+
`(助:${supports.join('、') || '无'};压:${pressures.join('、') || '无'})`;
|
|
4698
|
+
|
|
4699
|
+
return {
|
|
4700
|
+
position: f.position,
|
|
4701
|
+
branch: f.branch,
|
|
4702
|
+
element,
|
|
4703
|
+
relation,
|
|
4704
|
+
fei: f.fei || null,
|
|
4705
|
+
monthState,
|
|
4706
|
+
monthChong,
|
|
4707
|
+
dayRelation,
|
|
4708
|
+
kong: kongz,
|
|
4709
|
+
basis,
|
|
4710
|
+
supports,
|
|
4711
|
+
pressures,
|
|
4712
|
+
verdict,
|
|
4713
|
+
say,
|
|
4714
|
+
};
|
|
4715
|
+
});
|
|
4716
|
+
|
|
4717
|
+
return {
|
|
4718
|
+
month: monthBranch ? { branch: monthBranch, element: monthElement } : null,
|
|
4719
|
+
day: dayBranch ? { branch: dayBranch, element: dayElement } : null,
|
|
4720
|
+
items,
|
|
4721
|
+
labels: items.map((it) => `第${it.position}爻${it.verdict}`),
|
|
4722
|
+
note: '出伏只看「有没有助、有没有压」两件事:飞生伏、伏克飞、日辰生/比和、月建旺/相算助;飞克伏、日辰克、月破算压。四档只把条件并列,不排各家优先级;旬空只标出,不并入档位,也不出应期。',
|
|
4723
|
+
};
|
|
4724
|
+
}
|
|
4725
|
+
|
|
4376
4726
|
function hexagramStrength(result, opts = {}) {
|
|
4377
4727
|
const rows = (result && result.ben && Array.isArray(result.ben.lines))
|
|
4378
4728
|
? result.ben.lines
|
|
@@ -4502,7 +4852,95 @@ function jinTuiPower(result, opts = {}) {
|
|
|
4502
4852
|
};
|
|
4503
4853
|
}
|
|
4504
4854
|
|
|
4505
|
-
|
|
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 };
|
|
4506
4944
|
})();
|
|
4507
4945
|
|
|
4508
4946
|
__mods.ziwei = (function () {
|
|
@@ -4573,11 +5011,171 @@ const MUTAGEN = {
|
|
|
4573
5011
|
癸: { 破军: '禄', 巨门: '权', 太阴: '科', 贪狼: '忌' },
|
|
4574
5012
|
};
|
|
4575
5013
|
|
|
5014
|
+
const ZIWEI_SCHOOL_DEFAULTS = Object.freeze({
|
|
5015
|
+
brightnessSchool: 'default',
|
|
5016
|
+
gengYearSihua: 'GYWYT',
|
|
5017
|
+
tianmaSchool: 'year-branch',
|
|
5018
|
+
tiankongSchool: 'off',
|
|
5019
|
+
jiekongSchool: 'off',
|
|
5020
|
+
kuiyueSchool: 'qs1',
|
|
5021
|
+
tianshiTianshang: 'normal',
|
|
5022
|
+
changshengSchool: 'yin-yang-shun-ni',
|
|
5023
|
+
lateZishi: 'current-day',
|
|
5024
|
+
});
|
|
5025
|
+
|
|
5026
|
+
const ZIWEI_SCHOOL_OPTIONS = Object.freeze({
|
|
5027
|
+
brightnessSchool: ['default', 'QS', 'XD1', 'ZZ', 'XD2'],
|
|
5028
|
+
gengYearSihua: ['GYWYT', 'GYWTY', 'GYWFT', 'GYWFX', 'GYWTX'],
|
|
5029
|
+
tianmaSchool: ['year-branch', 'month-branch'],
|
|
5030
|
+
tiankongSchool: ['off', 'normal', 'shun-jia-shi'],
|
|
5031
|
+
jiekongSchool: ['off', 'double', 'single', 'zhanyan'],
|
|
5032
|
+
kuiyueSchool: ['qs1', 'qs2', 'zhong-yiming', 'network'],
|
|
5033
|
+
tianshiTianshang: ['normal', 'zhongzhou'],
|
|
5034
|
+
changshengSchool: ['yin-yang-shun-ni', 'shui-tu', 'huo-tu'],
|
|
5035
|
+
lateZishi: ['current-day', 'next-day', 'all-current', 'day-cur-time-next'],
|
|
5036
|
+
});
|
|
5037
|
+
|
|
5038
|
+
function ziweiSchoolsOf(input = {}) {
|
|
5039
|
+
const nested = input.schools && typeof input.schools === 'object' ? input.schools : {};
|
|
5040
|
+
const out = {};
|
|
5041
|
+
for (const [key, allowed] of Object.entries(ZIWEI_SCHOOL_OPTIONS)) {
|
|
5042
|
+
const raw = input[key] !== undefined ? input[key] : nested[key];
|
|
5043
|
+
out[key] = allowed.includes(raw) ? raw : ZIWEI_SCHOOL_DEFAULTS[key];
|
|
5044
|
+
}
|
|
5045
|
+
return out;
|
|
5046
|
+
}
|
|
5047
|
+
|
|
5048
|
+
const BRIGHTNESS_LEVELS_7 = ['', '庙', '旺', '得', '利', '平', '不', '陷'];
|
|
5049
|
+
const BRIGHTNESS_LEVELS_5 = ['', '庙', '旺', '平', '闲', '陷'];
|
|
5050
|
+
const BRIGHTNESS_SCHOOLS = {
|
|
5051
|
+
QS: {
|
|
5052
|
+
levels: BRIGHTNESS_LEVELS_7,
|
|
5053
|
+
rows: {
|
|
5054
|
+
紫微: [5, 1, 2, 2, 3, 2, 1, 1, 2, 2, 3, 2],
|
|
5055
|
+
天机: [1, 7, 3, 2, 4, 5, 1, 7, 3, 2, 4, 5],
|
|
5056
|
+
太阳: [7, 6, 2, 1, 2, 2, 2, 3, 3, 5, 6, 7],
|
|
5057
|
+
武曲: [2, 1, 3, 4, 1, 5, 2, 1, 3, 4, 1, 5],
|
|
5058
|
+
天同: [2, 6, 4, 5, 5, 1, 7, 6, 2, 5, 5, 1],
|
|
5059
|
+
廉贞: [5, 4, 1, 5, 4, 7, 5, 4, 1, 5, 4, 7],
|
|
5060
|
+
天府: [1, 1, 1, 3, 1, 3, 2, 1, 3, 2, 1, 3],
|
|
5061
|
+
太阴: [1, 1, 2, 7, 7, 7, 6, 6, 4, 2, 2, 1],
|
|
5062
|
+
贪狼: [2, 1, 5, 4, 1, 7, 2, 1, 5, 4, 1, 7],
|
|
5063
|
+
巨门: [2, 6, 1, 1, 7, 2, 2, 6, 1, 1, 7, 2],
|
|
5064
|
+
天相: [1, 1, 1, 7, 3, 3, 1, 3, 1, 7, 3, 3],
|
|
5065
|
+
天梁: [1, 2, 1, 1, 1, 3, 1, 2, 7, 3, 1, 7],
|
|
5066
|
+
七杀: [2, 1, 1, 2, 1, 5, 2, 1, 1, 2, 1, 5],
|
|
5067
|
+
破军: [1, 2, 3, 7, 2, 5, 1, 2, 3, 7, 2, 5],
|
|
5068
|
+
},
|
|
5069
|
+
},
|
|
5070
|
+
XD1: {
|
|
5071
|
+
levels: BRIGHTNESS_LEVELS_7,
|
|
5072
|
+
rows: {
|
|
5073
|
+
紫微: [5, 1, 1, 2, 3, 2, 1, 1, 2, 2, 3, 2],
|
|
5074
|
+
天机: [1, 7, 3, 2, 4, 5, 1, 7, 3, 2, 4, 5],
|
|
5075
|
+
太阳: [7, 6, 2, 1, 2, 2, 1, 3, 4, 5, 7, 7],
|
|
5076
|
+
武曲: [2, 1, 3, 4, 1, 5, 2, 1, 3, 4, 1, 5],
|
|
5077
|
+
天同: [2, 6, 4, 1, 5, 1, 7, 6, 2, 5, 5, 1],
|
|
5078
|
+
廉贞: [5, 4, 1, 5, 4, 7, 5, 4, 1, 5, 4, 7],
|
|
5079
|
+
天府: [1, 1, 1, 3, 2, 3, 2, 1, 3, 2, 2, 3],
|
|
5080
|
+
太阴: [1, 1, 6, 7, 7, 7, 7, 5, 4, 2, 2, 1],
|
|
5081
|
+
贪狼: [2, 1, 5, 3, 1, 7, 2, 1, 5, 4, 1, 7],
|
|
5082
|
+
巨门: [2, 6, 1, 1, 5, 5, 2, 5, 1, 1, 5, 2],
|
|
5083
|
+
天相: [1, 1, 1, 7, 5, 3, 3, 3, 1, 7, 3, 3],
|
|
5084
|
+
天梁: [1, 2, 1, 2, 1, 7, 1, 2, 7, 3, 1, 7],
|
|
5085
|
+
七杀: [2, 1, 1, 2, 3, 5, 2, 1, 1, 2, 1, 5],
|
|
5086
|
+
破军: [1, 2, 3, 7, 2, 5, 1, 2, 3, 7, 2, 5],
|
|
5087
|
+
},
|
|
5088
|
+
},
|
|
5089
|
+
ZZ: {
|
|
5090
|
+
levels: BRIGHTNESS_LEVELS_5,
|
|
5091
|
+
rows: {
|
|
5092
|
+
紫微: [3, 1, 1, 2, 5, 2, 1, 1, 2, 3, 4, 2],
|
|
5093
|
+
天机: [1, 5, 2, 2, 1, 3, 1, 5, 3, 2, 1, 3],
|
|
5094
|
+
太阳: [5, 5, 2, 1, 2, 2, 1, 3, 4, 4, 5, 5],
|
|
5095
|
+
武曲: [2, 1, 4, 5, 1, 3, 2, 1, 3, 2, 1, 3],
|
|
5096
|
+
天同: [2, 5, 4, 1, 3, 1, 5, 5, 2, 3, 3, 1],
|
|
5097
|
+
廉贞: [3, 2, 1, 4, 2, 5, 3, 1, 1, 3, 2, 5],
|
|
5098
|
+
天府: [1, 1, 1, 3, 1, 3, 2, 1, 3, 5, 1, 2],
|
|
5099
|
+
太阴: [1, 1, 4, 5, 4, 5, 5, 3, 3, 2, 2, 1],
|
|
5100
|
+
贪狼: [2, 1, 3, 4, 1, 5, 2, 1, 3, 3, 1, 5],
|
|
5101
|
+
巨门: [2, 2, 1, 1, 3, 3, 2, 5, 1, 1, 2, 2],
|
|
5102
|
+
天相: [1, 1, 1, 5, 2, 3, 2, 4, 1, 5, 4, 3],
|
|
5103
|
+
天梁: [1, 2, 1, 1, 2, 5, 1, 2, 5, 4, 2, 5],
|
|
5104
|
+
七杀: [2, 1, 1, 5, 2, 3, 2, 2, 1, 4, 1, 3],
|
|
5105
|
+
破军: [1, 2, 5, 2, 2, 4, 1, 1, 5, 5, 2, 3],
|
|
5106
|
+
},
|
|
5107
|
+
},
|
|
5108
|
+
XD2: {
|
|
5109
|
+
levels: BRIGHTNESS_LEVELS_5,
|
|
5110
|
+
rows: {
|
|
5111
|
+
紫微: [4, 1, 1, 2, 4, 2, 1, 1, 2, 3, 5, 2],
|
|
5112
|
+
天机: [1, 5, 2, 2, 2, 3, 1, 5, 2, 2, 2, 3],
|
|
5113
|
+
太阳: [5, 5, 2, 1, 2, 2, 1, 2, 3, 3, 5, 5],
|
|
5114
|
+
武曲: [2, 1, 3, 5, 1, 3, 2, 1, 3, 2, 1, 3],
|
|
5115
|
+
天同: [2, 5, 3, 1, 2, 1, 5, 5, 2, 3, 3, 1],
|
|
5116
|
+
廉贞: [3, 2, 1, 4, 2, 5, 3, 1, 1, 3, 2, 5],
|
|
5117
|
+
天府: [2, 1, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2],
|
|
5118
|
+
太阴: [1, 1, 5, 5, 5, 5, 5, 5, 2, 2, 1, 1],
|
|
5119
|
+
贪狼: [2, 1, 3, 2, 1, 5, 2, 1, 3, 2, 1, 5],
|
|
5120
|
+
巨门: [2, 5, 1, 2, 5, 1, 2, 5, 1, 2, 5, 1],
|
|
5121
|
+
天相: [1, 1, 1, 5, 2, 3, 2, 3, 1, 5, 5, 3],
|
|
5122
|
+
天梁: [1, 2, 1, 1, 2, 5, 1, 2, 5, 3, 2, 5],
|
|
5123
|
+
七杀: [2, 2, 1, 5, 1, 3, 2, 2, 1, 3, 1, 3],
|
|
5124
|
+
破军: [1, 1, 5, 2, 2, 3, 1, 1, 5, 5, 2, 3],
|
|
5125
|
+
},
|
|
5126
|
+
},
|
|
5127
|
+
};
|
|
5128
|
+
|
|
5129
|
+
function schoolBrightness(name, branchIndex, school = 'default') {
|
|
5130
|
+
const table = BRIGHTNESS_SCHOOLS[school];
|
|
5131
|
+
if (!table || !table.rows[name]) return BRIGHTNESS[name] ? BRIGHTNESS[name][fix(branchIndex)] : undefined;
|
|
5132
|
+
const level = table.rows[name][fix(branchIndex)];
|
|
5133
|
+
return level ? table.levels[level] : undefined;
|
|
5134
|
+
}
|
|
5135
|
+
|
|
5136
|
+
const GENG_MUTAGEN = {
|
|
5137
|
+
GYWYT: { 太阳: '禄', 武曲: '权', 太阴: '科', 天同: '忌' },
|
|
5138
|
+
GYWTY: { 太阳: '禄', 武曲: '权', 天同: '科', 太阴: '忌' },
|
|
5139
|
+
GYWFT: { 太阳: '禄', 武曲: '权', 天府: '科', 天同: '忌' },
|
|
5140
|
+
GYWFX: { 太阳: '禄', 武曲: '权', 天府: '科', 天相: '忌' },
|
|
5141
|
+
GYWTX: { 太阳: '禄', 武曲: '权', 天同: '科', 天相: '忌' },
|
|
5142
|
+
};
|
|
5143
|
+
|
|
5144
|
+
function mutagenOf(stem, schools) {
|
|
5145
|
+
if (stem === '庚') return GENG_MUTAGEN[schools.gengYearSihua] || MUTAGEN.庚;
|
|
5146
|
+
return MUTAGEN[stem] ?? {};
|
|
5147
|
+
}
|
|
5148
|
+
|
|
5149
|
+
const KUI_YUE_SCHOOLS = {
|
|
5150
|
+
qs2: {
|
|
5151
|
+
甲: [1, 7], 戊: [1, 7], 庚: [6, 2], 乙: [0, 8], 己: [0, 8],
|
|
5152
|
+
丙: [11, 9], 丁: [11, 9], 辛: [6, 2], 壬: [5, 3], 癸: [5, 3],
|
|
5153
|
+
},
|
|
5154
|
+
'zhong-yiming': {
|
|
5155
|
+
甲: [1, 7], 戊: [1, 7], 庚: [2, 6], 乙: [0, 8], 己: [0, 8],
|
|
5156
|
+
丙: [11, 9], 丁: [11, 9], 辛: [2, 6], 壬: [5, 3], 癸: [5, 3],
|
|
5157
|
+
},
|
|
5158
|
+
network: {
|
|
5159
|
+
甲: [1, 7], 戊: [1, 7], 庚: [1, 7], 乙: [0, 8], 己: [0, 8],
|
|
5160
|
+
丙: [11, 9], 丁: [11, 9], 辛: [6, 2], 壬: [3, 5], 癸: [3, 5],
|
|
5161
|
+
},
|
|
5162
|
+
};
|
|
5163
|
+
|
|
5164
|
+
const JIEKONG = {
|
|
5165
|
+
single: { 甲: 8, 乙: 6, 丙: 4, 丁: 2, 戊: 0, 己: 9, 庚: 7, 辛: 5, 壬: 3, 癸: 1 },
|
|
5166
|
+
double: {
|
|
5167
|
+
甲: [8, 9], 乙: [7, 6], 丙: [4, 5], 丁: [3, 2], 戊: [0, 1],
|
|
5168
|
+
己: [9, 8], 庚: [6, 7], 辛: [5, 4], 壬: [2, 3], 癸: [1, 0],
|
|
5169
|
+
},
|
|
5170
|
+
zhanyan: { 甲: 8, 乙: 6, 丙: 4, 丁: 2, 戊: 10, 己: 9, 庚: 7, 辛: 5, 壬: 3, 癸: 11 },
|
|
5171
|
+
};
|
|
5172
|
+
|
|
4576
5173
|
const LUCUN = { 甲: 2, 乙: 3, 丙: 5, 丁: 6, 戊: 5, 己: 6, 庚: 8, 辛: 9, 壬: 11, 癸: 0 };
|
|
4577
5174
|
const KUI_YUE = {
|
|
4578
5175
|
甲: [1, 7], 戊: [1, 7], 庚: [1, 7], 乙: [0, 8], 己: [0, 8],
|
|
4579
5176
|
丙: [11, 9], 丁: [11, 9], 辛: [6, 2], 壬: [3, 5], 癸: [3, 5],
|
|
4580
5177
|
};
|
|
5178
|
+
KUI_YUE_SCHOOLS.qs1 = KUI_YUE;
|
|
4581
5179
|
|
|
4582
5180
|
const MING_ZHU = {
|
|
4583
5181
|
子: '贪狼', 丑: '巨门', 寅: '禄存', 卯: '文曲', 辰: '廉贞', 巳: '武曲',
|
|
@@ -4676,8 +5274,23 @@ function xiaoxianAge(branchIndex, triad, gender) {
|
|
|
4676
5274
|
return gender === 'female' ? fix(start - b) + 1 : fix(b - start) + 1;
|
|
4677
5275
|
}
|
|
4678
5276
|
|
|
5277
|
+
const LEAP_POLICIES = ['split', 'next', 'prev'];
|
|
5278
|
+
|
|
5279
|
+
function leapPolicyOf(input) {
|
|
5280
|
+
if (input && LEAP_POLICIES.includes(input.leapMonth)) return input.leapMonth;
|
|
5281
|
+
return input && input.leapAsNext ? 'next' : 'split';
|
|
5282
|
+
}
|
|
5283
|
+
|
|
5284
|
+
function effectiveLunarMonth(raw, policy) {
|
|
5285
|
+
if (!raw || !raw.isLeap) return raw ? raw.month : 0;
|
|
5286
|
+
if (policy === 'next') return (raw.month % 12) + 1;
|
|
5287
|
+
if (policy === 'split') return raw.day <= 15 ? raw.month : (raw.month % 12) + 1;
|
|
5288
|
+
return raw.month;
|
|
5289
|
+
}
|
|
5290
|
+
|
|
4679
5291
|
function buildZiwei(input) {
|
|
4680
5292
|
assertCivil(input);
|
|
5293
|
+
const schools = ziweiSchoolsOf(input);
|
|
4681
5294
|
const { year: cy, month: cm, day: cd, hour: ch = 0, minute: cmin = 0, gender = 'male' } = input;
|
|
4682
5295
|
const useTrueSolar = input.trueSolar !== false;
|
|
4683
5296
|
const geo = input.geo || (input.address ? resolveAddress(input.address) : null);
|
|
@@ -4690,7 +5303,8 @@ function buildZiwei(input) {
|
|
|
4690
5303
|
const solar = useTrueSolar
|
|
4691
5304
|
? applyTrueSolar(civilJd, longitude)
|
|
4692
5305
|
: { offsetMinutes: 0, jd: civilJd, note: '未启用真太阳时' };
|
|
4693
|
-
|
|
5306
|
+
let eff = jdToParts(solar.jd);
|
|
5307
|
+
if (schools.lateZishi === 'next-day' && eff.hour >= 23) eff = jdToParts(solar.jd + 1);
|
|
4694
5308
|
const year = eff.year;
|
|
4695
5309
|
const month = eff.month;
|
|
4696
5310
|
const day = eff.day;
|
|
@@ -4698,9 +5312,8 @@ function buildZiwei(input) {
|
|
|
4698
5312
|
const minute = eff.minute;
|
|
4699
5313
|
|
|
4700
5314
|
const lunarRaw = solarToLunar(year, month, day);
|
|
4701
|
-
const
|
|
4702
|
-
|
|
4703
|
-
: lunarRaw.month;
|
|
5315
|
+
const leapPolicy = leapPolicyOf(input);
|
|
5316
|
+
const lunarMonth = effectiveLunarMonth(lunarRaw, leapPolicy);
|
|
4704
5317
|
const lunarDay = lunarRaw.day;
|
|
4705
5318
|
|
|
4706
5319
|
const hb = hourBranchIndex(hour, minute);
|
|
@@ -4710,6 +5323,9 @@ function buildZiwei(input) {
|
|
|
4710
5323
|
const yearStem = yearGanzhi.stem;
|
|
4711
5324
|
const yb = BRANCHES.indexOf(yearGanzhi.branch);
|
|
4712
5325
|
const triad = triadOf(yb);
|
|
5326
|
+
const yearYang = STEMS.indexOf(yearStem) % 2 === 0;
|
|
5327
|
+
const forward = (yearYang && gender === 'male') || (!yearYang && gender === 'female');
|
|
5328
|
+
const kuiyueTable = KUI_YUE_SCHOOLS[schools.kuiyueSchool] || KUI_YUE;
|
|
4713
5329
|
|
|
4714
5330
|
const soulIndex = fix(2 + (lunarMonth - 1) - hb);
|
|
4715
5331
|
const bodyIndex = fix(2 + (lunarMonth - 1) + hb);
|
|
@@ -4726,7 +5342,7 @@ function buildZiwei(input) {
|
|
|
4726
5342
|
const idx = fix(branch);
|
|
4727
5343
|
const star = { name, type };
|
|
4728
5344
|
if (type === '主星' && BRIGHTNESS[name]) {
|
|
4729
|
-
const b =
|
|
5345
|
+
const b = schoolBrightness(name, idx, schools.brightnessSchool);
|
|
4730
5346
|
if (b) star.brightness = b;
|
|
4731
5347
|
}
|
|
4732
5348
|
starsByBranch[idx].push(star);
|
|
@@ -4750,7 +5366,7 @@ function buildZiwei(input) {
|
|
|
4750
5366
|
put(lucun, '禄存', '吉星');
|
|
4751
5367
|
put(lucun + 1, '擎羊', '煞星');
|
|
4752
5368
|
put(lucun - 1, '陀罗', '煞星');
|
|
4753
|
-
const [kui, yue] =
|
|
5369
|
+
const [kui, yue] = kuiyueTable[yearStem];
|
|
4754
5370
|
put(kui, '天魁', '吉星');
|
|
4755
5371
|
put(yue, '天钺', '吉星');
|
|
4756
5372
|
|
|
@@ -4761,7 +5377,10 @@ function buildZiwei(input) {
|
|
|
4761
5377
|
put(6 + yb, '天虚', '煞星');
|
|
4762
5378
|
put(4 + yb, '龙池', '吉星');
|
|
4763
5379
|
put(10 - yb, '凤阁', '吉星');
|
|
4764
|
-
|
|
5380
|
+
const maTriad = schools.tianmaSchool === 'month-branch'
|
|
5381
|
+
? triadOf(fix(2 + (lunarMonth - 1)))
|
|
5382
|
+
: triad;
|
|
5383
|
+
put(TIANMA[maTriad], '天马', '吉星');
|
|
4765
5384
|
put(XIANCHI[triad], '咸池', '煞星');
|
|
4766
5385
|
put(HUAGAI[triad], '华盖', '杂曜');
|
|
4767
5386
|
const dirGroup = directionOf(yb);
|
|
@@ -4769,6 +5388,23 @@ function buildZiwei(input) {
|
|
|
4769
5388
|
put(GUASU[dirGroup], '寡宿', '煞星');
|
|
4770
5389
|
put(posuIndex(yb), '破碎', '煞星');
|
|
4771
5390
|
|
|
5391
|
+
if (schools.tiankongSchool !== 'off') {
|
|
5392
|
+
put(schools.tiankongSchool === 'shun-jia-shi' ? yb + hb : yb + 1, '天空', '杂曜');
|
|
5393
|
+
}
|
|
5394
|
+
if (schools.jiekongSchool !== 'off') {
|
|
5395
|
+
const jk = JIEKONG[schools.jiekongSchool][yearStem];
|
|
5396
|
+
if (Array.isArray(jk)) {
|
|
5397
|
+
put(jk[0], '截空', '杂曜');
|
|
5398
|
+
put(jk[1], '副截', '杂曜');
|
|
5399
|
+
} else {
|
|
5400
|
+
put(jk, '截空', '杂曜');
|
|
5401
|
+
}
|
|
5402
|
+
const nianIndex = (((lunarRaw.lunarYear - 4) % 60) + 60) % 60;
|
|
5403
|
+
const decadeStart = nianIndex - (nianIndex % 10);
|
|
5404
|
+
put(decadeStart + 10, '旬空', '杂曜');
|
|
5405
|
+
put(decadeStart + 11, '副旬', '杂曜');
|
|
5406
|
+
}
|
|
5407
|
+
|
|
4772
5408
|
put(9 + (lunarMonth - 1), '天刑', '煞星'); // 酉起正月顺行
|
|
4773
5409
|
put(1 + (lunarMonth - 1), '天姚', '煞星'); // 丑起正月顺行
|
|
4774
5410
|
|
|
@@ -4782,10 +5418,11 @@ function buildZiwei(input) {
|
|
|
4782
5418
|
put(11 + hb, '地劫', '煞星'); // 亥宫起子时,顺行
|
|
4783
5419
|
put(11 - hb, '地空', '煞星'); // 亥宫起子时,逆行
|
|
4784
5420
|
|
|
4785
|
-
|
|
4786
|
-
put(soulIndex - 5, '
|
|
5421
|
+
const swapTianshi = schools.tianshiTianshang === 'zhongzhou' && !forward;
|
|
5422
|
+
put(soulIndex - (swapTianshi ? 5 : 7), '天伤', '杂曜');
|
|
5423
|
+
put(soulIndex - (swapTianshi ? 7 : 5), '天使', '杂曜');
|
|
4787
5424
|
|
|
4788
|
-
const mutagenMap =
|
|
5425
|
+
const mutagenMap = mutagenOf(yearStem, schools);
|
|
4789
5426
|
for (const list of starsByBranch) {
|
|
4790
5427
|
for (const star of list) {
|
|
4791
5428
|
if (mutagenMap[star.name]) star.mutagen = mutagenMap[star.name];
|
|
@@ -4795,11 +5432,11 @@ function buildZiwei(input) {
|
|
|
4795
5432
|
const palaceNames = [];
|
|
4796
5433
|
for (let i = 0; i < 12; i++) palaceNames[fix(soulIndex - i)] = PALACE_NAMES[i];
|
|
4797
5434
|
|
|
4798
|
-
const yearYang = STEMS.indexOf(yearStem) % 2 === 0;
|
|
4799
|
-
const forward = (yearYang && gender === 'male') || (!yearYang && gender === 'female');
|
|
4800
5435
|
const startAge = bureau.number;
|
|
4801
5436
|
|
|
4802
|
-
const csStart =
|
|
5437
|
+
const csStart = schools.changshengSchool === 'huo-tu' && bureau.number === 5
|
|
5438
|
+
? 2
|
|
5439
|
+
: CHANGSHENG_START[bureau.number];
|
|
4803
5440
|
const shenshaAt = (branch) => {
|
|
4804
5441
|
const d = forward ? 1 : -1;
|
|
4805
5442
|
return {
|
|
@@ -4903,8 +5540,8 @@ function buildZiwei(input) {
|
|
|
4903
5540
|
liulu: BRANCHES[lu],
|
|
4904
5541
|
liuyang: BRANCHES[fix(lu + 1)],
|
|
4905
5542
|
liutuo: BRANCHES[fix(lu - 1)],
|
|
4906
|
-
liukui: BRANCHES[
|
|
4907
|
-
liuyue: BRANCHES[
|
|
5543
|
+
liukui: BRANCHES[kuiyueTable[gz.stem][0]],
|
|
5544
|
+
liuyue: BRANCHES[kuiyueTable[gz.stem][1]],
|
|
4908
5545
|
mutagen: Object.entries(MUTAGEN[gz.stem] ?? {}).map(([s, k]) => `${s}化${k}`),
|
|
4909
5546
|
daxian: dxPalace
|
|
4910
5547
|
? { palace: dxPalace.palace, start: dxPalace.daxian.start, end: dxPalace.daxian.end }
|
|
@@ -4918,13 +5555,16 @@ function buildZiwei(input) {
|
|
|
4918
5555
|
input: {
|
|
4919
5556
|
year: cy, month: cm, day: cd, hour: ch, minute: cmin,
|
|
4920
5557
|
gender,
|
|
4921
|
-
|
|
5558
|
+
leapMonth: leapPolicy,
|
|
5559
|
+
leapAsNext: leapPolicy === 'next',
|
|
4922
5560
|
longitude: longitude ?? null,
|
|
4923
5561
|
address: input.address || null,
|
|
4924
5562
|
geo,
|
|
4925
5563
|
trueSolar: useTrueSolar,
|
|
4926
5564
|
dst: { applied: !!dst.applied, note: dst.note || null },
|
|
5565
|
+
schools: { ...schools },
|
|
4927
5566
|
},
|
|
5567
|
+
schools: { ...schools },
|
|
4928
5568
|
solarTime: {
|
|
4929
5569
|
civilText: `${cy}-${String(cm).padStart(2, '0')}-${String(cd).padStart(2, '0')} ${String(ch).padStart(2, '0')}:${String(cmin).padStart(2, '0')}`,
|
|
4930
5570
|
trueSolarText: formatJd(solar.jd),
|
|
@@ -4934,10 +5574,16 @@ function buildZiwei(input) {
|
|
|
4934
5574
|
lunar: {
|
|
4935
5575
|
year: lunarRaw.lunarYear,
|
|
4936
5576
|
month: lunarMonth,
|
|
5577
|
+
monthRaw: lunarRaw.month,
|
|
4937
5578
|
day: lunarDay,
|
|
4938
5579
|
isLeap: lunarRaw.isLeap,
|
|
5580
|
+
leapPolicy,
|
|
4939
5581
|
monthStart: lunarRaw.monthStart,
|
|
4940
|
-
...(lunarRaw.isLeap ? {
|
|
5582
|
+
...(lunarRaw.isLeap ? {
|
|
5583
|
+
note: leapPolicy === 'split'
|
|
5584
|
+
? `闰${lunarRaw.month}月按日切分:1–15 按本月、16 起按次月;本盘闰月${lunarDay}日按${lunarMonth}月`
|
|
5585
|
+
: leapPolicy === 'next' ? '闰月整月按次月起盘' : '闰月整月按本月起盘',
|
|
5586
|
+
} : {}),
|
|
4941
5587
|
},
|
|
4942
5588
|
hourBranch,
|
|
4943
5589
|
yearGanzhi: yearGanzhi.name,
|
|
@@ -4973,8 +5619,9 @@ function buildZiwei(input) {
|
|
|
4973
5619
|
},
|
|
4974
5620
|
rules: {
|
|
4975
5621
|
ziweiPlacement: '借数法:局数除日数取商,商数自寅宫顺行,借数奇逆偶顺',
|
|
4976
|
-
mutagen: '
|
|
4977
|
-
|
|
5622
|
+
mutagen: '生年四化用中州派常用表;庚干可按流派切换(默认阳武阴同,另有同科阴忌、府科、府科相忌、同科相忌)',
|
|
5623
|
+
schools: `流派开关:亮度 ${schools.brightnessSchool}、庚干四化 ${schools.gengYearSihua}、天马 ${schools.tianmaSchool}、天空 ${schools.tiankongSchool}、截空 ${schools.jiekongSchool}、魁钺 ${schools.kuiyueSchool}、天伤天使 ${schools.tianshiTianshang}、长生 ${schools.changshengSchool}、晚子时 ${schools.lateZishi};庚干四化只作用于生年四化`,
|
|
5624
|
+
leapMonth: '闰月默认按日切分(1–15 归本月、16 起归次月,主流排盘口径);可传 leapMonth: next(整月归次月)或 prev(整月归本月),leapAsNext: true 等同 next',
|
|
4978
5625
|
auxStars: '火铃按年支三合起点顺数至生时;羊陀夹禄存;魁钺按年干;地空亥起子时逆行、地劫顺行;三台八座随辅弼;恩光天贵随昌曲退一位;台辅封诰按时支',
|
|
4979
5626
|
shensha: '长生、博士随大限顺逆;将前、岁前恒顺行;天伤恒在交友、天使恒在疾厄',
|
|
4980
5627
|
masters: '命主按命宫地支,身主按生年地支',
|
|
@@ -5367,8 +6014,7 @@ function flowOf(chart, asOf) {
|
|
|
5367
6014
|
const MI = a.minute === undefined ? now.getMinutes() : a.minute;
|
|
5368
6015
|
|
|
5369
6016
|
const lr = solarToLunar(Y, M, D);
|
|
5370
|
-
const
|
|
5371
|
-
const natalMonth = chart.lunar.isLeap && leapAsNext ? (chart.lunar.month % 12) + 1 : chart.lunar.month;
|
|
6017
|
+
const natalMonth = chart.lunar.month;
|
|
5372
6018
|
const natalHB = BRANCHES.indexOf(chart.hourBranch);
|
|
5373
6019
|
const hbNow = hourBranchIndex(H, MI);
|
|
5374
6020
|
|
|
@@ -5427,7 +6073,7 @@ function flowOf(chart, asOf) {
|
|
|
5427
6073
|
};
|
|
5428
6074
|
}
|
|
5429
6075
|
|
|
5430
|
-
return { PALACE_NAMES, BRIGHTNESS, MUTAGEN, LUCUN, KUI_YUE, MING_ZHU, SHEN_ZHU, triadOf, HUO_START, LING_START, TIANMA, XIANCHI, HUAGAI, JIANGXING, GUCHEN, GUASU, posuIndex, XIAOXIAN_START, CHANGSHENG_NAMES, BOSHI_NAMES, JIANGQIAN_NAMES, SUIQI_NAMES, CHANGSHENG_START, hourBranchIndex, ziweiTianfuIndex, xiaoxianAge, buildZiwei, detectPatterns, PATTERN_TONE, daxianList, FLY_TYPES, flyStarOf, flyStars, flyChain, flyChains, flyComposite, enrichLiunian, asOfParts, flowOf };
|
|
6076
|
+
return { PALACE_NAMES, BRIGHTNESS, MUTAGEN, ZIWEI_SCHOOL_DEFAULTS, ZIWEI_SCHOOL_OPTIONS, ziweiSchoolsOf, BRIGHTNESS_SCHOOLS, schoolBrightness, KUI_YUE_SCHOOLS, LUCUN, KUI_YUE, MING_ZHU, SHEN_ZHU, triadOf, HUO_START, LING_START, TIANMA, XIANCHI, HUAGAI, JIANGXING, GUCHEN, GUASU, posuIndex, XIAOXIAN_START, CHANGSHENG_NAMES, BOSHI_NAMES, JIANGQIAN_NAMES, SUIQI_NAMES, CHANGSHENG_START, hourBranchIndex, ziweiTianfuIndex, xiaoxianAge, LEAP_POLICIES, leapPolicyOf, effectiveLunarMonth, buildZiwei, detectPatterns, PATTERN_TONE, daxianList, FLY_TYPES, flyStarOf, flyStars, flyChain, flyChains, flyComposite, enrichLiunian, asOfParts, flowOf };
|
|
5431
6077
|
})();
|
|
5432
6078
|
|
|
5433
6079
|
__mods.tarot = (function () {
|
|
@@ -6646,6 +7292,7 @@ return { buildTrend };
|
|
|
6646
7292
|
__mods.fengshui = (function () {
|
|
6647
7293
|
const { partsToJd, termInstantJd } = __mods.calendar;
|
|
6648
7294
|
const { applyDst } = __mods.dst;
|
|
7295
|
+
const { fail } = __mods.fail;
|
|
6649
7296
|
|
|
6650
7297
|
const NINE_STARS = {
|
|
6651
7298
|
1: { name: '一白', color: '白', element: '水', star: '贪狼', lucky: true },
|
|
@@ -6695,7 +7342,7 @@ const MOUNTAIN_INDEX = new Map(MOUNTAINS_24.map((x, i) => [x.m, i]));
|
|
|
6695
7342
|
function mountainInfo(name) {
|
|
6696
7343
|
const i = MOUNTAIN_INDEX.get(name);
|
|
6697
7344
|
if (i === undefined) {
|
|
6698
|
-
throw
|
|
7345
|
+
throw fail('E_INPUT', `坐向必须是 24 山之一(${MOUNTAINS_24.map((x) => x.m).join('')}),收到「${name}」——请按罗盘 24 山报坐或报向,不要自造方位词。`);
|
|
6699
7346
|
}
|
|
6700
7347
|
return { ...MOUNTAINS_24[i], index: i };
|
|
6701
7348
|
}
|
|
@@ -6768,6 +7415,113 @@ function yearlyFlying(year) {
|
|
|
6768
7415
|
|
|
6769
7416
|
const pad2 = (n) => String(n).padStart(2, '0');
|
|
6770
7417
|
|
|
7418
|
+
function periodOfYear(year) {
|
|
7419
|
+
const k = Math.floor((year - 1864) / 20);
|
|
7420
|
+
const period = ((k % 9) + 9) % 9 + 1;
|
|
7421
|
+
const start = 1864 + 20 * k;
|
|
7422
|
+
return { period, start, end: start + 19, label: `${period}运(${start}–${start + 19})` };
|
|
7423
|
+
}
|
|
7424
|
+
|
|
7425
|
+
const YANG_MOUNTAINS = new Set(['乾', '巽', '艮', '坤', '甲', '庚', '壬', '丙', '寅', '申', '巳', '亥']);
|
|
7426
|
+
const YUAN_NAME = ['地元', '天元', '人元'];
|
|
7427
|
+
|
|
7428
|
+
const MOUNTAIN_META = {};
|
|
7429
|
+
MOUNTAINS_24.forEach((x, i) => {
|
|
7430
|
+
MOUNTAIN_META[x.m] = { ...x, yuan: YUAN_NAME[i % 3], yinYang: YANG_MOUNTAINS.has(x.m) ? '阳' : '阴' };
|
|
7431
|
+
});
|
|
7432
|
+
|
|
7433
|
+
const FLY_SEQ = ['中', '乾', '兑', '艮', '离', '坎', '坤', '震', '巽'];
|
|
7434
|
+
const NUM_TO_GUA = ['坎', '坤', '震', '巽', '中', '乾', '兑', '艮', '离']; // 洛书数 1–9 本位卦
|
|
7435
|
+
const YUAN_INDEX = { 地元: 0, 天元: 1, 人元: 2 };
|
|
7436
|
+
|
|
7437
|
+
const mountainsOfGua = (gua) => MOUNTAINS_24.filter((x) => x.gua === gua).map((x) => MOUNTAIN_META[x.m]);
|
|
7438
|
+
|
|
7439
|
+
function fly(center, forward) {
|
|
7440
|
+
const out = {};
|
|
7441
|
+
for (let i = 0; i < 9; i++) {
|
|
7442
|
+
const v = ((center - 1 + (forward ? i : -i)) % 9 + 9) % 9 + 1;
|
|
7443
|
+
out[FLY_SEQ[i]] = v;
|
|
7444
|
+
}
|
|
7445
|
+
return out;
|
|
7446
|
+
}
|
|
7447
|
+
|
|
7448
|
+
function flightOf(mount, center) {
|
|
7449
|
+
if (center === 5) {
|
|
7450
|
+
return { forward: mount.yinYang === '阳', basis: `五黄入中,按${mount.m}本山${mount.yuan}${mount.yinYang}论` };
|
|
7451
|
+
}
|
|
7452
|
+
const home = NUM_TO_GUA[center - 1];
|
|
7453
|
+
const hm = mountainsOfGua(home)[YUAN_INDEX[mount.yuan]];
|
|
7454
|
+
return { forward: hm.yinYang === '阳', basis: `${center}${home}宫取${mount.yuan}${hm.m}(${hm.yinYang})` };
|
|
7455
|
+
}
|
|
7456
|
+
|
|
7457
|
+
const WANG_SHAN_WANG_XIANG = {
|
|
7458
|
+
1: [],
|
|
7459
|
+
2: [['乾', '巽'], ['亥', '巳'], ['丑', '未']],
|
|
7460
|
+
3: [['卯', '酉'], ['乙', '辛'], ['辰', '戌']],
|
|
7461
|
+
4: [['艮', '坤'], ['寅', '申'], ['甲', '庚']],
|
|
7462
|
+
5: [['子', '午'], ['癸', '丁'], ['卯', '酉'], ['乙', '辛'], ['丑', '未'], ['辰', '戌']],
|
|
7463
|
+
6: [['艮', '坤'], ['寅', '申'], ['甲', '庚']],
|
|
7464
|
+
7: [['卯', '酉'], ['乙', '辛'], ['辰', '戌']],
|
|
7465
|
+
8: [['乾', '巽'], ['亥', '巳'], ['丑', '未']],
|
|
7466
|
+
9: [],
|
|
7467
|
+
};
|
|
7468
|
+
|
|
7469
|
+
const XUANKONG_SOURCES = [
|
|
7470
|
+
'三元九运(1864 年起一运、每运 20 年,九运 180 年一轮)',
|
|
7471
|
+
'玄空下卦挨星(运盘顺飞;山盘/向盘以入中运星本宫同元龙阴阳定顺逆,五黄入中按本山阴阳)',
|
|
7472
|
+
'二十四山旺山旺向通行表(每项含正反两向;一运、九运无局)',
|
|
7473
|
+
];
|
|
7474
|
+
|
|
7475
|
+
const XUANKONG_DISCLAIMER = '玄空下卦为传统通行口径的本地排盘,属民俗参考,不构成现场勘舆结论,仅供娱乐;替卦/兼向、年月日时飞星与形峦不在本工具范围内。';
|
|
7476
|
+
|
|
7477
|
+
function xuankongChart(period, sitting, facing) {
|
|
7478
|
+
const sit = MOUNTAIN_META[sitting];
|
|
7479
|
+
const face = MOUNTAIN_META[facing];
|
|
7480
|
+
const yun = fly(period, true);
|
|
7481
|
+
const sCenter = yun[sit.gua];
|
|
7482
|
+
const fCenter = yun[face.gua];
|
|
7483
|
+
const sFly = flightOf(sit, sCenter);
|
|
7484
|
+
const fFly = flightOf(face, fCenter);
|
|
7485
|
+
const shan = fly(sCenter, sFly.forward);
|
|
7486
|
+
const xiang = fly(fCenter, fFly.forward);
|
|
7487
|
+
const palaces = PALACE_ORDER.map((palace, i) => ({
|
|
7488
|
+
palace,
|
|
7489
|
+
direction: palace === '中' ? '中宫' : PALACE_DIRECTION[palace],
|
|
7490
|
+
luoshu: i + 1,
|
|
7491
|
+
yun: yun[palace],
|
|
7492
|
+
shan: shan[palace],
|
|
7493
|
+
xiang: xiang[palace],
|
|
7494
|
+
}));
|
|
7495
|
+
const wheres = (map) => PALACE_ORDER.filter((p) => map[p] === period);
|
|
7496
|
+
const pairs = WANG_SHAN_WANG_XIANG[period];
|
|
7497
|
+
const hit = pairs.find(([a, b]) => (sit.m === a && face.m === b) || (sit.m === b && face.m === a));
|
|
7498
|
+
const byChart = shan[sit.gua] === period && xiang[face.gua] === period;
|
|
7499
|
+
const note = byChart && hit
|
|
7500
|
+
? '盘面与表法一致:本局到山到向。'
|
|
7501
|
+
: byChart
|
|
7502
|
+
? '盘面到山到向,但不在通行表法所列之局(表法与盘面口径不同,并列不合并)。'
|
|
7503
|
+
: hit
|
|
7504
|
+
? '通行表法列为旺山旺向,但本盘当运山星/向星未同时落坐向(表法与盘面口径不同,并列不合并)。'
|
|
7505
|
+
: '本局既未到山到向,也不在表法旺山旺向之列。';
|
|
7506
|
+
return {
|
|
7507
|
+
palaces,
|
|
7508
|
+
sitting: sit,
|
|
7509
|
+
facing: face,
|
|
7510
|
+
yun,
|
|
7511
|
+
shan,
|
|
7512
|
+
xiang,
|
|
7513
|
+
yunCenter: period,
|
|
7514
|
+
shanCenter: { star: sCenter, ...sFly },
|
|
7515
|
+
xiangCenter: { star: fCenter, ...fFly },
|
|
7516
|
+
dangYun: { shan: wheres(shan), xiang: wheres(xiang) },
|
|
7517
|
+
heshi: {
|
|
7518
|
+
shan: PALACE_ORDER.filter((p) => shan[p] + yun[p] === 10),
|
|
7519
|
+
xiang: PALACE_ORDER.filter((p) => xiang[p] + yun[p] === 10),
|
|
7520
|
+
},
|
|
7521
|
+
wangShanWangXiang: { byChart, byTable: Boolean(hit), table: pairs.map(([a, b]) => `${a}${b}`), note },
|
|
7522
|
+
};
|
|
7523
|
+
}
|
|
7524
|
+
|
|
6771
7525
|
function civilDate(input) {
|
|
6772
7526
|
const dst = input.dst === false
|
|
6773
7527
|
? { year: input.year, month: input.month, day: input.day, hour: 0, minute: 0, applied: false, note: null }
|
|
@@ -6785,12 +7539,13 @@ const DISCLAIMER = '八宅与飞星为传统通行口径的本地计算,属民
|
|
|
6785
7539
|
|
|
6786
7540
|
function buildFengshui(input) {
|
|
6787
7541
|
if (input.action === 'advise') return buildAdvise(input);
|
|
7542
|
+
if (input.action === 'xuankong') return buildXuankong(input);
|
|
6788
7543
|
const gender = input.gender;
|
|
6789
7544
|
if (gender !== 'male' && gender !== 'female') {
|
|
6790
|
-
throw
|
|
7545
|
+
throw fail('E_INPUT', '风水命卦需要性别:男女命卦算法不同,不可缺省');
|
|
6791
7546
|
}
|
|
6792
7547
|
if (!Number.isInteger(input.year) || !Number.isInteger(input.month) || !Number.isInteger(input.day)) {
|
|
6793
|
-
throw
|
|
7548
|
+
throw fail('E_INPUT', '风水命卦需要完整出生年月日(公历)——只知道年份不够:命卦按立春界划分出生年');
|
|
6794
7549
|
}
|
|
6795
7550
|
const civil = civilDate(input);
|
|
6796
7551
|
const guaYear = guaYearOf(civil.year, civil.month, civil.day);
|
|
@@ -6808,7 +7563,7 @@ function buildFengshui(input) {
|
|
|
6808
7563
|
fortuneYear,
|
|
6809
7564
|
...(civil.dst.applied ? { dst: civil.dst.note } : {}),
|
|
6810
7565
|
...(fortuneYear === null ? { note: '未给流年:未算年紫白飞星(需要时补 fortuneYear)。' } : {}),
|
|
6811
|
-
scope: '八宅命卦 + 大游年八星 +
|
|
7566
|
+
scope: '八宅命卦 + 大游年八星 + 年紫白;玄空飞星见 action=xuankong;不含形峦与现场勘舆。',
|
|
6812
7567
|
},
|
|
6813
7568
|
mingGua: {
|
|
6814
7569
|
num,
|
|
@@ -6825,21 +7580,26 @@ function buildFengshui(input) {
|
|
|
6825
7580
|
};
|
|
6826
7581
|
}
|
|
6827
7582
|
|
|
6828
|
-
function
|
|
7583
|
+
function resolveSittingFacing(input) {
|
|
6829
7584
|
const hasSitting = typeof input.sitting === 'string' && input.sitting.trim() !== '';
|
|
6830
7585
|
const hasFacing = typeof input.facing === 'string' && input.facing.trim() !== '';
|
|
6831
7586
|
if (!hasSitting && !hasFacing) {
|
|
6832
|
-
throw
|
|
7587
|
+
throw fail('E_INPUT', '缺少坐向:sitting(坐山)或 facing(向山)至少给一个——按罗盘 24 山报坐或报向,例如「坐北朝南」对应坐子向午');
|
|
6833
7588
|
}
|
|
6834
7589
|
if (hasSitting && hasFacing) {
|
|
6835
7590
|
const s = mountainInfo(input.sitting.trim());
|
|
6836
7591
|
const f = mountainInfo(input.facing.trim());
|
|
6837
7592
|
if ((s.index + 12) % 24 !== f.index) {
|
|
6838
|
-
throw
|
|
7593
|
+
throw fail('E_INPUT', `坐向不自洽:坐${s.m}(${s.deg}°)与向${f.m}(${f.deg}°)不是对宫(相差应 180°,实测 ${((f.deg - s.deg) + 360) % 360}°)——请核对罗盘读数。`);
|
|
6839
7594
|
}
|
|
6840
7595
|
}
|
|
6841
7596
|
const sitting = hasSitting ? mountainInfo(input.sitting.trim()) : sittingFromFacing(input.facing.trim());
|
|
6842
7597
|
const facing = MOUNTAINS_24[(sitting.index + 12) % 24];
|
|
7598
|
+
return { sitting, facing };
|
|
7599
|
+
}
|
|
7600
|
+
|
|
7601
|
+
function buildAdvise(input) {
|
|
7602
|
+
const { sitting, facing } = resolveSittingFacing(input);
|
|
6843
7603
|
const houseGua = sitting.gua;
|
|
6844
7604
|
const stars = eightStars(houseGua);
|
|
6845
7605
|
const lucky = LUCKY_STARS.map((s) => stars[s]);
|
|
@@ -6893,7 +7653,7 @@ function buildAdvise(input) {
|
|
|
6893
7653
|
facing: `${facing.m}山(罗盘 ${facing.deg}°)`,
|
|
6894
7654
|
houseGua,
|
|
6895
7655
|
houseGroup: `${guaGroup(houseGua)}宅`,
|
|
6896
|
-
scope: '
|
|
7656
|
+
scope: '门主灶厕走向按八宅通行口径给倾向,玄空飞星见 action=xuankong;不含形峦、不是现场勘舆结论。',
|
|
6897
7657
|
},
|
|
6898
7658
|
houseStars: starChart,
|
|
6899
7659
|
layout,
|
|
@@ -6903,12 +7663,277 @@ function buildAdvise(input) {
|
|
|
6903
7663
|
};
|
|
6904
7664
|
}
|
|
6905
7665
|
|
|
6906
|
-
|
|
7666
|
+
function buildXuankong(input) {
|
|
7667
|
+
const { sitting, facing } = resolveSittingFacing(input);
|
|
7668
|
+
let period;
|
|
7669
|
+
let yearInfo = null;
|
|
7670
|
+
let note;
|
|
7671
|
+
if (input.period !== undefined && input.period !== null && !Number.isInteger(input.period)) {
|
|
7672
|
+
throw fail('E_INPUT', `运必须是 1–9 的整数(三元九运),收到「${input.period}」——一运 1864 起、九运 2024–2043。`);
|
|
7673
|
+
}
|
|
7674
|
+
if (Number.isInteger(input.period)) {
|
|
7675
|
+
if (input.period < 1 || input.period > 9) {
|
|
7676
|
+
throw fail('E_INPUT', `运必须是 1–9 的整数(三元九运),收到「${input.period}」——一运 1864 起、九运 2024–2043。`);
|
|
7677
|
+
}
|
|
7678
|
+
period = input.period;
|
|
7679
|
+
} else if (Number.isInteger(input.fortuneYear)) {
|
|
7680
|
+
yearInfo = periodOfYear(input.fortuneYear);
|
|
7681
|
+
period = yearInfo.period;
|
|
7682
|
+
} else {
|
|
7683
|
+
period = 9;
|
|
7684
|
+
note = '未给运:默认按九运(2024–2043)排盘;可传 period(1–9)或 fortuneYear 指定。';
|
|
7685
|
+
}
|
|
7686
|
+
const chart = xuankongChart(period, sitting.m, facing.m);
|
|
7687
|
+
const sitMeta = MOUNTAIN_META[sitting.m];
|
|
7688
|
+
const faceMeta = MOUNTAIN_META[facing.m];
|
|
7689
|
+
const center = (c) => ({ star: c.star, name: NINE_STARS[c.star].name, fly: c.forward ? '顺飞' : '逆飞', basis: c.basis });
|
|
7690
|
+
const where = (list) => list.map((p) => `${p}宫${PALACE_DIRECTION[p]}`).join('、') || '无';
|
|
7691
|
+
return {
|
|
7692
|
+
system: 'fengshui',
|
|
7693
|
+
meta: {
|
|
7694
|
+
action: 'xuankong',
|
|
7695
|
+
period,
|
|
7696
|
+
periodLabel: yearInfo ? yearInfo.label : `${period}运`,
|
|
7697
|
+
...(yearInfo ? { year: input.fortuneYear, periodStart: yearInfo.start, periodEnd: yearInfo.end } : {}),
|
|
7698
|
+
sitting: `${sitting.m}山(罗盘 ${sitting.deg}°)`,
|
|
7699
|
+
facing: `${facing.m}山(罗盘 ${facing.deg}°)`,
|
|
7700
|
+
sittingGua: sitting.gua,
|
|
7701
|
+
facingGua: facing.gua,
|
|
7702
|
+
sittingYuan: `${sitMeta.yuan}${sitMeta.yinYang}`,
|
|
7703
|
+
facingYuan: `${faceMeta.yuan}${faceMeta.yinYang}`,
|
|
7704
|
+
shanCenter: center(chart.shanCenter),
|
|
7705
|
+
xiangCenter: center(chart.xiangCenter),
|
|
7706
|
+
...(note ? { note } : {}),
|
|
7707
|
+
scope: '玄空下卦:运盘 + 山盘 + 向盘 + 当运星 + 合十 + 表法旺山旺向;不含替卦/兼向、不含年月日时飞星、不含形峦与现场勘舆。',
|
|
7708
|
+
},
|
|
7709
|
+
palaces: chart.palaces,
|
|
7710
|
+
dangYun: {
|
|
7711
|
+
shan: { palaces: chart.dangYun.shan, text: where(chart.dangYun.shan) },
|
|
7712
|
+
xiang: { palaces: chart.dangYun.xiang, text: where(chart.dangYun.xiang) },
|
|
7713
|
+
},
|
|
7714
|
+
heshi: { shan: chart.heshi.shan, xiang: chart.heshi.xiang },
|
|
7715
|
+
wangShanWangXiang: chart.wangShanWangXiang,
|
|
7716
|
+
sources: XUANKONG_SOURCES,
|
|
7717
|
+
disclaimer: XUANKONG_DISCLAIMER,
|
|
7718
|
+
};
|
|
7719
|
+
}
|
|
7720
|
+
|
|
7721
|
+
return { NINE_STARS, PALACE_DIRECTION, DAYOUTIAN, LUCKY_STARS, UNLUCKY_STARS, MOUNTAINS_24, mountainInfo, sittingFromFacing, STAR_LAYOUT_ROLE, mingGua, eightStars, guaYearOf, yearZibaiStar, yearlyFlying, periodOfYear, MOUNTAIN_META, WANG_SHAN_WANG_XIANG, XUANKONG_SOURCES, XUANKONG_DISCLAIMER, xuankongChart, buildFengshui };
|
|
7722
|
+
})();
|
|
7723
|
+
|
|
7724
|
+
__mods['name-data'] = (function () {
|
|
7725
|
+
|
|
7726
|
+
const READING = [
|
|
7727
|
+
['梓', 'zi', 3, 11], ['桐', 'tong', 2, 10], ['楠', 'nan', 2, 13], ['楷', 'kai', 3, 13],
|
|
7728
|
+
['松', 'song', 1, 8], ['柏', 'bai', 3, 9], ['枫', 'feng', 1, 13], ['榕', 'rong', 2, 14],
|
|
7729
|
+
['槿', 'jin', 3, 15], ['棠', 'tang', 2, 12], ['楚', 'chu', 3, 13], ['柯', 'ke', 1, 9],
|
|
7730
|
+
['桓', 'huan', 2, 10], ['榆', 'yu', 2, 13], ['栩', 'xu', 3, 10], ['榛', 'zhen', 1, 14],
|
|
7731
|
+
['芸', 'yun', 2, 10], ['芷', 'zhi', 3, 10], ['芮', 'rui', 4, 10], ['若', 'ruo', 4, 11],
|
|
7732
|
+
['茜', 'qian', 4, 12], ['茵', 'yin', 1, 12], ['茗', 'ming', 2, 12], ['莎', 'sha', 1, 13],
|
|
7733
|
+
['茉', 'mo', 4, 11], ['筱', 'xiao', 3, 13], ['蓉', 'rong', 2, 16], ['萱', 'xuan', 1, 15],
|
|
7734
|
+
['蕙', 'hui', 4, 18], ['蕊', 'rui', 3, 18], ['菲', 'fei', 1, 14], ['蔓', 'man', 4, 17],
|
|
7735
|
+
['荣', 'rong', 2, 14], ['茂', 'mao', 4, 11], ['栋', 'dong', 4, 12], ['梁', 'liang', 2, 11],
|
|
7736
|
+
['朴', 'pu', 3, 6], ['本', 'ben', 3, 5], ['林', 'lin', 2, 8], ['森', 'sen', 1, 12],
|
|
7737
|
+
['枝', 'zhi', 1, 8], ['果', 'guo', 3, 8], ['禾', 'he', 2, 5], ['秀', 'xiu', 4, 7],
|
|
7738
|
+
['穗', 'sui', 4, 17], ['稼', 'jia', 4, 15], ['颖', 'ying', 3, 16], ['苗', 'miao', 2, 8],
|
|
7739
|
+
['菁', 'jing', 1, 14], ['菡', 'han', 4, 14], ['蕴', 'yun', 4, 22], ['蕾', 'lei', 3, 19],
|
|
7740
|
+
['薇', 'wei', 1, 19], ['薏', 'yi', 4, 19], ['菀', 'wan', 3, 14], ['荷', 'he', 2, 13],
|
|
7741
|
+
['莲', 'lian', 2, 17], ['菱', 'ling', 2, 14], ['苇', 'wei', 3, 15], ['荻', 'di', 2, 13],
|
|
7742
|
+
['筠', 'yun', 2, 13], ['笛', 'di', 2, 11], ['杉', 'shan', 1, 7], ['柠', 'ning', 2, 18],
|
|
7743
|
+
['桢', 'zhen', 1, 13], ['樾', 'yue', 4, 16], ['柘', 'zhe', 4, 9], ['权', 'quan', 2, 22],
|
|
7744
|
+
['材', 'cai', 2, 7], ['杭', 'hang', 2, 8], ['枚', 'mei', 2, 8], ['梧', 'wu', 2, 11],
|
|
7745
|
+
['竹', 'zhu', 2, 6], ['简', 'jian', 3, 18], ['策', 'ce', 4, 12], ['筹', 'chou', 2, 20],
|
|
7746
|
+
['芬', 'fen', 1, 10], ['芳', 'fang', 1, 10], ['花', 'hua', 1, 10], ['菊', 'ju', 2, 14],
|
|
7747
|
+
['兰', 'lan', 2, 23], ['芝', 'zhi', 1, 10], ['芹', 'qin', 2, 10], ['荃', 'quan', 2, 12],
|
|
7748
|
+
['萃', 'cui', 4, 14], ['蓁', 'zhen', 1, 16], ['荞', 'qiao', 2, 18], ['莞', 'wan', 3, 13],
|
|
7749
|
+
['萦', 'ying', 2, 16], ['蔚', 'wei', 4, 17], ['芃', 'peng', 2, 9], ['芩', 'qin', 2, 10],
|
|
7750
|
+
['苡', 'yi', 3, 11], ['莱', 'lai', 2, 14], ['萌', 'meng', 2, 14], ['葆', 'bao', 3, 15],
|
|
7751
|
+
['萧', 'xiao', 1, 18], ['樟', 'zhang', 1, 15], ['樱', 'ying', 1, 21], ['栎', 'li', 4, 19],
|
|
7752
|
+
['棹', 'zhao', 4, 12], ['楸', 'qiu', 1, 13], ['槐', 'huai', 2, 14], ['橙', 'cheng', 2, 16],
|
|
7753
|
+
['檀', 'tan', 2, 17],
|
|
7754
|
+
['炎', 'yan', 2, 8], ['灿', 'can', 4, 17], ['炫', 'xuan', 4, 9], ['炜', 'wei', 3, 13],
|
|
7755
|
+
['烨', 'ye', 4, 14], ['煜', 'yu', 4, 13], ['熙', 'xi', 1, 13], ['煊', 'xuan', 1, 13],
|
|
7756
|
+
['焕', 'huan', 4, 13], ['熠', 'yi', 4, 15], ['炅', 'jiong', 3, 8], ['昱', 'yu', 4, 9],
|
|
7757
|
+
['晗', 'han', 2, 11], ['旭', 'xu', 4, 6], ['昊', 'hao', 4, 8], ['晟', 'sheng', 4, 11],
|
|
7758
|
+
['晨', 'chen', 2, 11], ['景', 'jing', 3, 12], ['曜', 'yao', 4, 18], ['曦', 'xi', 1, 20],
|
|
7759
|
+
['朗', 'lang', 3, 11], ['昭', 'zhao', 1, 9], ['昕', 'xin', 1, 8], ['昀', 'yun', 2, 8],
|
|
7760
|
+
['暖', 'nuan', 3, 13], ['灵', 'ling', 2, 24], ['丹', 'dan', 1, 4], ['彤', 'tong', 2, 7],
|
|
7761
|
+
['冉', 'ran', 3, 5], ['南', 'nan', 2, 9], ['丰', 'feng', 1, 18], ['日', 'ri', 4, 4],
|
|
7762
|
+
['阳', 'yang', 2, 17], ['光', 'guang', 1, 6], ['亮', 'liang', 4, 9], ['明', 'ming', 2, 8],
|
|
7763
|
+
['晶', 'jing', 1, 12], ['晴', 'qing', 2, 12], ['夏', 'xia', 4, 10], ['智', 'zhi', 4, 12],
|
|
7764
|
+
['卓', 'zhuo', 2, 8], ['乐', 'le', 4, 15], ['恺', 'kai', 3, 14], ['恬', 'tian', 2, 10],
|
|
7765
|
+
['甜', 'tian', 2, 11], ['亭', 'ting', 2, 9], ['俊', 'jun', 4, 9], ['丙', 'bing', 3, 5],
|
|
7766
|
+
['丁', 'ding', 1, 2], ['鼎', 'ding', 3, 13], ['陶', 'tao', 2, 16], ['熹', 'xi', 1, 16],
|
|
7767
|
+
['炀', 'yang', 2, 13], ['烜', 'xuan', 3, 10], ['暻', 'jing', 3, 16], ['晖', 'hui', 1, 13],
|
|
7768
|
+
['晔', 'ye', 4, 16], ['旻', 'min', 2, 8], ['晏', 'yan', 4, 10], ['晓', 'xiao', 3, 16],
|
|
7769
|
+
['暄', 'xuan', 1, 13], ['昆', 'kun', 1, 8], ['伶', 'ling', 2, 7],
|
|
7770
|
+
['坤', 'kun', 1, 8], ['垚', 'yao', 2, 9], ['培', 'pei', 2, 11], ['城', 'cheng', 2, 10],
|
|
7771
|
+
['域', 'yu', 4, 11], ['坚', 'jian', 1, 11], ['墨', 'mo', 4, 15], ['均', 'jun', 1, 7],
|
|
7772
|
+
['坦', 'tan', 3, 8], ['基', 'ji', 1, 11], ['堂', 'tang', 2, 11], ['圣', 'sheng', 4, 13],
|
|
7773
|
+
['在', 'zai', 4, 6], ['岳', 'yue', 4, 8], ['峰', 'feng', 1, 10], ['峻', 'jun', 4, 10],
|
|
7774
|
+
['岚', 'lan', 2, 12], ['岩', 'yan', 2, 8], ['崇', 'chong', 2, 11], ['岐', 'qi', 2, 7],
|
|
7775
|
+
['屿', 'yu', 3, 17], ['磊', 'lei', 3, 15], ['尧', 'yao', 2, 12], ['圆', 'yuan', 2, 13],
|
|
7776
|
+
['恩', 'en', 1, 10], ['惟', 'wei', 2, 11], ['轩', 'xuan', 1, 10], ['逸', 'yi', 4, 15],
|
|
7777
|
+
['山', 'shan', 1, 3], ['岸', 'an', 4, 8], ['岑', 'cen', 2, 7], ['巍', 'wei', 1, 21],
|
|
7778
|
+
['嵩', 'song', 1, 13], ['岭', 'ling', 3, 17], ['奥', 'ao', 4, 13], ['宜', 'yi', 2, 8],
|
|
7779
|
+
['容', 'rong', 2, 10], ['意', 'yi', 4, 13], ['依', 'yi', 1, 8], ['悠', 'you', 1, 11],
|
|
7780
|
+
['维', 'wei', 2, 14], ['纬', 'wei', 3, 15], ['永', 'yong', 3, 5], ['远', 'yuan', 3, 17],
|
|
7781
|
+
['辰', 'chen', 2, 7], ['壁', 'bi', 4, 16], ['田', 'tian', 2, 5], ['由', 'you', 2, 5],
|
|
7782
|
+
['画', 'hua', 4, 12], ['延', 'yan', 2, 7], ['建', 'jian', 4, 9], ['音', 'yin', 1, 9],
|
|
7783
|
+
['韵', 'yun', 4, 19], ['玮', 'wei', 3, 14], ['雍', 'yong', 1, 13], ['懿', 'yi', 4, 22],
|
|
7784
|
+
['宇', 'yu', 3, 6], ['亦', 'yi', 4, 6], ['安', 'an', 1, 6], ['宁', 'ning', 2, 14],
|
|
7785
|
+
['锋', 'feng', 1, 15], ['钢', 'gang', 1, 16], ['钧', 'jun', 1, 12], ['铭', 'ming', 2, 14],
|
|
7786
|
+
['锐', 'rui', 4, 15], ['锡', 'xi', 1, 16], ['锦', 'jin', 3, 16], ['鑫', 'xin', 1, 24],
|
|
7787
|
+
['键', 'jian', 4, 17], ['鉴', 'jian', 4, 22], ['钦', 'qin', 1, 12], ['镇', 'zhen', 4, 18],
|
|
7788
|
+
['铮', 'zheng', 1, 16], ['钰', 'yu', 4, 13], ['铠', 'kai', 3, 18], ['珊', 'shan', 1, 10],
|
|
7789
|
+
['珠', 'zhu', 1, 10], ['琳', 'lin', 2, 13], ['琦', 'qi', 2, 13], ['琪', 'qi', 2, 13],
|
|
7790
|
+
['瑜', 'yu', 2, 14], ['瑞', 'rui', 4, 14], ['瑄', 'xuan', 1, 14], ['璇', 'xuan', 2, 16],
|
|
7791
|
+
['璟', 'jing', 3, 17], ['璐', 'lu', 4, 18], ['瑾', 'jin', 3, 16], ['珏', 'jue', 2, 9],
|
|
7792
|
+
['环', 'huan', 2, 18], ['玲', 'ling', 2, 10], ['珑', 'long', 2, 21], ['瑶', 'yao', 2, 15],
|
|
7793
|
+
['莹', 'ying', 2, 15], ['铎', 'duo', 2, 21], ['金', 'jin', 1, 8], ['秋', 'qiu', 1, 9],
|
|
7794
|
+
['书', 'shu', 1, 10], ['舒', 'shu', 1, 12], ['善', 'shan', 4, 12], ['信', 'xin', 4, 9],
|
|
7795
|
+
['修', 'xiu', 1, 10], ['素', 'su', 4, 10], ['静', 'jing', 4, 16], ['心', 'xin', 1, 4],
|
|
7796
|
+
['新', 'xin', 1, 13], ['正', 'zheng', 4, 5], ['世', 'shi', 4, 5], ['少', 'shao', 3, 4],
|
|
7797
|
+
['西', 'xi', 1, 6], ['白', 'bai', 2, 5], ['辛', 'xin', 1, 7], ['成', 'cheng', 2, 7],
|
|
7798
|
+
['利', 'li', 4, 7], ['剑', 'jian', 4, 15], ['刚', 'gang', 1, 10], ['则', 'ze', 2, 9],
|
|
7799
|
+
['初', 'chu', 1, 7], ['硕', 'shuo', 4, 14], ['尚', 'shang', 4, 8], ['臣', 'chen', 2, 6],
|
|
7800
|
+
['川', 'chuan', 1, 3], ['舟', 'zhou', 1, 6], ['州', 'zhou', 1, 6], ['祖', 'zu', 3, 10],
|
|
7801
|
+
['祥', 'xiang', 2, 11], ['禄', 'lu', 4, 13], ['禧', 'xi', 3, 17], ['珍', 'zhen', 1, 10],
|
|
7802
|
+
['宣', 'xuan', 1, 9], ['序', 'xu', 4, 7], ['谦', 'qian', 1, 17], ['赞', 'zan', 4, 19],
|
|
7803
|
+
['超', 'chao', 1, 12], ['锴', 'kai', 3, 17], ['承', 'cheng', 2, 8], ['语', 'yu', 3, 14],
|
|
7804
|
+
['诺', 'nuo', 4, 16], ['诗', 'shi', 1, 13], ['梦', 'meng', 4, 14], ['思', 'si', 1, 9],
|
|
7805
|
+
['悦', 'yue', 4, 11], ['欣', 'xin', 1, 8], ['嘉', 'jia', 1, 14], ['佳', 'jia', 1, 8],
|
|
7806
|
+
['博', 'bo', 2, 12], ['睿', 'rui', 4, 14], ['知', 'zhi', 1, 8], ['星', 'xing', 1, 9],
|
|
7807
|
+
['言', 'yan', 2, 7], ['和', 'he', 2, 8],
|
|
7808
|
+
['江', 'jiang', 1, 7], ['河', 'he', 2, 9], ['海', 'hai', 3, 11], ['洋', 'yang', 2, 10],
|
|
7809
|
+
['波', 'bo', 1, 9], ['涛', 'tao', 1, 18], ['涵', 'han', 2, 12], ['清', 'qing', 1, 12],
|
|
7810
|
+
['澈', 'che', 4, 16], ['澄', 'cheng', 2, 16], ['润', 'run', 4, 16], ['泽', 'ze', 2, 17],
|
|
7811
|
+
['沛', 'pei', 4, 8], ['沁', 'qin', 4, 8], ['泓', 'hong', 2, 9], ['泉', 'quan', 2, 9],
|
|
7812
|
+
['汐', 'xi', 1, 7], ['淇', 'qi', 2, 12], ['鸿', 'hong', 2, 17], ['滋', 'zi', 1, 13],
|
|
7813
|
+
['淼', 'miao', 3, 12], ['雨', 'yu', 3, 8], ['雪', 'xue', 3, 11], ['霖', 'lin', 2, 16],
|
|
7814
|
+
['霏', 'fei', 1, 16], ['露', 'lu', 4, 21], ['霆', 'ting', 2, 15], ['雯', 'wen', 2, 12],
|
|
7815
|
+
['霓', 'ni', 2, 16], ['湉', 'tian', 2, 13], ['沐', 'mu', 4, 8], ['宸', 'chen', 2, 10],
|
|
7816
|
+
['然', 'ran', 2, 12], ['文', 'wen', 2, 4], ['月', 'yue', 4, 4], ['水', 'shui', 3, 4],
|
|
7817
|
+
['冰', 'bing', 1, 6], ['洁', 'jie', 2, 16], ['浩', 'hao', 4, 11], ['瀚', 'han', 4, 20],
|
|
7818
|
+
['渊', 'yuan', 1, 12], ['澜', 'lan', 2, 21], ['潮', 'chao', 2, 16], ['溪', 'xi', 1, 14],
|
|
7819
|
+
['湘', 'xiang', 1, 13], ['渝', 'yu', 2, 13], ['深', 'shen', 1, 12], ['湛', 'zhan', 4, 13],
|
|
7820
|
+
['汇', 'hui', 4, 13], ['洲', 'zhou', 1, 10], ['湾', 'wan', 1, 26], ['云', 'yun', 2, 12],
|
|
7821
|
+
['风', 'feng', 1, 9], ['北', 'bei', 3, 5], ['冬', 'dong', 1, 5], ['玄', 'xuan', 2, 5],
|
|
7822
|
+
['子', 'zi', 3, 3], ['平', 'ping', 2, 5], ['方', 'fang', 1, 4], ['帆', 'fan', 1, 6],
|
|
7823
|
+
['航', 'hang', 2, 10], ['敏', 'min', 3, 11], ['慧', 'hui', 4, 15], ['惠', 'hui', 4, 12],
|
|
7824
|
+
['霈', 'pei', 4, 15], ['灏', 'hao', 4, 25], ['湄', 'mei', 2, 13], ['滨', 'bin', 1, 18],
|
|
7825
|
+
['洛', 'luo', 4, 10], ['津', 'jin', 1, 10], ['泊', 'bo', 2, 9], ['沧', 'cang', 1, 14],
|
|
7826
|
+
['浦', 'pu', 3, 11],
|
|
7827
|
+
];
|
|
7828
|
+
|
|
7829
|
+
const SURNAME_STROKES = {
|
|
7830
|
+
王: 4, 李: 7, 张: 11, 刘: 15, 陈: 16, 杨: 13, 黄: 12, 赵: 14, 吴: 7, 周: 8,
|
|
7831
|
+
徐: 10, 孙: 10, 马: 10, 朱: 6, 胡: 11, 郭: 15, 何: 7, 高: 10, 林: 8, 罗: 20,
|
|
7832
|
+
郑: 19, 梁: 11, 谢: 17, 宋: 7, 唐: 10, 许: 11, 韩: 17, 冯: 12, 曹: 11, 彭: 12,
|
|
7833
|
+
曾: 12, 萧: 18, 田: 5, 董: 15, 潘: 16, 袁: 10, 蔡: 17, 余: 7, 于: 3, 杜: 7,
|
|
7834
|
+
叶: 15, 程: 12, 魏: 18, 吕: 7, 丁: 2, 任: 6, 姚: 9, 卢: 16, 姜: 9, 崔: 11,
|
|
7835
|
+
钟: 17, 谭: 19, 陆: 16, 范: 15, 金: 8, 石: 5, 廖: 14, 贾: 13, 夏: 10, 韦: 9,
|
|
7836
|
+
付: 5, 方: 4, 白: 5, 邹: 17, 孟: 8, 熊: 14, 秦: 10, 邱: 12, 江: 7, 尹: 4,
|
|
7837
|
+
薛: 19, 段: 9, 雷: 13, 侯: 9, 龙: 16, 史: 5, 陶: 16, 黎: 15, 贺: 12, 顾: 21,
|
|
7838
|
+
毛: 4, 郝: 14, 龚: 22, 邵: 12, 钱: 16, 严: 20, 武: 8, 戴: 18, 莫: 13, 孔: 4,
|
|
7839
|
+
向: 6, 常: 11, 康: 11, 易: 8, 文: 4, 施: 9, 洪: 10, 安: 6, 颜: 18, 温: 13,
|
|
7840
|
+
章: 11, 鲁: 15, 葛: 15, 伍: 6, 申: 5, 尤: 4, 焦: 12, 柳: 9, 邢: 11, 路: 13,
|
|
7841
|
+
岳: 8, 乔: 12, 赖: 20, 万: 15, 苏: 22, 蒋: 17, 沈: 8, 汪: 8, 邓: 19, 覃: 12,
|
|
7842
|
+
房: 8, 边: 22, 辛: 7, 涂: 11, 甘: 5, 封: 9, 储: 18, 邬: 17, 路: 13, 詹: 13,
|
|
7843
|
+
};
|
|
7844
|
+
|
|
7845
|
+
const SURNAME_READING = {
|
|
7846
|
+
王: ['wang', 2], 李: ['li', 3], 张: ['zhang', 1], 刘: ['liu', 2], 陈: ['chen', 2],
|
|
7847
|
+
杨: ['yang', 2], 黄: ['huang', 2], 赵: ['zhao', 4], 吴: ['wu', 2], 周: ['zhou', 1],
|
|
7848
|
+
徐: ['xu', 2], 孙: ['sun', 1], 马: ['ma', 3], 朱: ['zhu', 1], 胡: ['hu', 2],
|
|
7849
|
+
郭: ['guo', 1], 何: ['he', 2], 高: ['gao', 1], 林: ['lin', 2], 罗: ['luo', 2],
|
|
7850
|
+
郑: ['zheng', 4], 梁: ['liang', 2], 谢: ['xie', 4], 宋: ['song', 4], 唐: ['tang', 2],
|
|
7851
|
+
许: ['xu', 3], 韩: ['han', 2], 冯: ['feng', 2], 曹: ['cao', 2], 彭: ['peng', 2],
|
|
7852
|
+
曾: ['zeng', 1], 萧: ['xiao', 1], 田: ['tian', 2], 董: ['dong', 3], 潘: ['pan', 1],
|
|
7853
|
+
袁: ['yuan', 2], 蔡: ['cai', 4], 余: ['yu', 2], 于: ['yu', 2], 杜: ['du', 4],
|
|
7854
|
+
叶: ['ye', 4], 程: ['cheng', 2], 魏: ['wei', 4], 吕: ['lv', 3], 丁: ['ding', 1],
|
|
7855
|
+
任: ['ren', 2], 姚: ['yao', 2], 卢: ['lu', 2], 姜: ['jiang', 1], 崔: ['cui', 1],
|
|
7856
|
+
钟: ['zhong', 1], 谭: ['tan', 2], 陆: ['lu', 4], 范: ['fan', 4], 金: ['jin', 1],
|
|
7857
|
+
石: ['shi', 2], 廖: ['liao', 4], 贾: ['jia', 3], 夏: ['xia', 4], 韦: ['wei', 2],
|
|
7858
|
+
付: ['fu', 4], 方: ['fang', 1], 白: ['bai', 2], 邹: ['zou', 1], 孟: ['meng', 4],
|
|
7859
|
+
熊: ['xiong', 2], 秦: ['qin', 2], 邱: ['qiu', 1], 江: ['jiang', 1], 尹: ['yin', 3],
|
|
7860
|
+
薛: ['xue', 1], 段: ['duan', 4], 雷: ['lei', 2], 侯: ['hou', 2], 龙: ['long', 2],
|
|
7861
|
+
史: ['shi', 3], 陶: ['tao', 2], 黎: ['li', 2], 贺: ['he', 4], 顾: ['gu', 4],
|
|
7862
|
+
毛: ['mao', 2], 郝: ['hao', 3], 龚: ['gong', 1], 邵: ['shao', 4], 钱: ['qian', 2],
|
|
7863
|
+
严: ['yan', 2], 武: ['wu', 3], 戴: ['dai', 4], 莫: ['mo', 4], 孔: ['kong', 3],
|
|
7864
|
+
向: ['xiang', 4], 常: ['chang', 2], 康: ['kang', 1], 易: ['yi', 4], 文: ['wen', 2],
|
|
7865
|
+
施: ['shi', 1], 洪: ['hong', 2], 安: ['an', 1], 颜: ['yan', 2], 温: ['wen', 1],
|
|
7866
|
+
章: ['zhang', 1], 鲁: ['lu', 3], 葛: ['ge', 3], 伍: ['wu', 3], 申: ['shen', 1],
|
|
7867
|
+
尤: ['you', 2], 焦: ['jiao', 1], 柳: ['liu', 3], 邢: ['xing', 2], 路: ['lu', 4],
|
|
7868
|
+
岳: ['yue', 4], 乔: ['qiao', 2], 赖: ['lai', 4], 万: ['wan', 4], 苏: ['su', 1],
|
|
7869
|
+
蒋: ['jiang', 3], 沈: ['shen', 3], 汪: ['wang', 1], 邓: ['deng', 4], 覃: ['tan', 2],
|
|
7870
|
+
房: ['fang', 2], 边: ['bian', 1], 辛: ['xin', 1], 涂: ['tu', 2], 甘: ['gan', 1],
|
|
7871
|
+
封: ['feng', 1], 储: ['chu', 3], 邬: ['wu', 1], 詹: ['zhan', 1],
|
|
7872
|
+
欧: ['ou', 1],
|
|
7873
|
+
阳: ['yang', 2],
|
|
7874
|
+
司: ['si', 1],
|
|
7875
|
+
上: ['shang', 4],
|
|
7876
|
+
官: ['guan', 1],
|
|
7877
|
+
诸: ['zhu', 1],
|
|
7878
|
+
东: ['dong', 1],
|
|
7879
|
+
皇: ['huang', 2],
|
|
7880
|
+
甫: ['fu', 3],
|
|
7881
|
+
尉: ['yu', 4],
|
|
7882
|
+
迟: ['chi', 2],
|
|
7883
|
+
令: ['ling', 4],
|
|
7884
|
+
狐: ['hu', 2],
|
|
7885
|
+
慕: ['mu', 4],
|
|
7886
|
+
徒: ['tu', 2],
|
|
7887
|
+
公: ['gong', 1],
|
|
7888
|
+
};
|
|
7889
|
+
|
|
7890
|
+
const DOUBLE_SURNAMES = {
|
|
7891
|
+
欧阳: { s: [15, 17], py: 'ouyang', tone: 1 },
|
|
7892
|
+
司马: { s: [5, 10], py: 'sima', tone: 1 },
|
|
7893
|
+
上官: { s: [3, 8], py: 'shangguan', tone: 4 },
|
|
7894
|
+
诸葛: { s: [15, 15], py: 'zhuge', tone: 1 },
|
|
7895
|
+
东方: { s: [8, 4], py: 'dongfang', tone: 1 },
|
|
7896
|
+
皇甫: { s: [9, 7], py: 'huangfu', tone: 2 },
|
|
7897
|
+
尉迟: { s: [11, 19], py: 'yuchi', tone: 4 },
|
|
7898
|
+
令狐: { s: [5, 8], py: 'linghu', tone: 4 },
|
|
7899
|
+
慕容: { s: [14, 10], py: 'murong', tone: 4 },
|
|
7900
|
+
宇文: { s: [6, 4], py: 'yuwen', tone: 3 },
|
|
7901
|
+
司徒: { s: [5, 10], py: 'situ', tone: 1 },
|
|
7902
|
+
夏侯: { s: [10, 9], py: 'xiahou', tone: 4 },
|
|
7903
|
+
公孙: { s: [4, 10], py: 'gongsun', tone: 1 },
|
|
7904
|
+
};
|
|
7905
|
+
|
|
7906
|
+
const SHULI_81 = [null,
|
|
7907
|
+
['吉', '太极之数'], ['凶', '两仪之数'], ['吉', '三才之数'], ['凶', '四象之数'],
|
|
7908
|
+
['吉', '五行之数'], ['吉', '六爻之数'], ['吉', '七政之数'], ['吉', '八卦之数'],
|
|
7909
|
+
['凶', '大成之数'], ['凶', '终结之数'], ['吉', '旱苗逢雨'], ['凶', '掘井无泉'],
|
|
7910
|
+
['吉', '春日牡丹'], ['凶', '破兆之数'], ['吉', '福寿之数'], ['吉', '厚重之数'],
|
|
7911
|
+
['吉', '刚强之数'], ['吉', '铁镜重磨'], ['凶', '多难之数'], ['凶', '屋下藏金'],
|
|
7912
|
+
['吉', '明月中天'], ['凶', '秋草逢霜'], ['吉', '壮丽之数'], ['吉', '掘藏得金'],
|
|
7913
|
+
['吉', '荣俊之数'], ['凶', '变怪之数'], ['半吉', '增长之数'], ['凶', '阔水浮萍'],
|
|
7914
|
+
['吉', '智谋之数'], ['半吉', '非运之数'], ['吉', '春日花开'], ['吉', '宝马金鞍'],
|
|
7915
|
+
['吉', '旭日升天'], ['凶', '破家之数'], ['吉', '高楼望月'], ['凶', '波澜重叠'],
|
|
7916
|
+
['吉', '猛虎出林'], ['半吉', '磨铁成针'], ['吉', '富贵荣华'], ['半吉', '退安之数'],
|
|
7917
|
+
['吉', '有德之数'], ['半吉', '寒蝉在柳'], ['凶', '散财破产'], ['凶', '烦闷之数'],
|
|
7918
|
+
['吉', '顺风之数'], ['凶', '浪里淘金'], ['吉', '点石成金'], ['吉', '古松立鹤'],
|
|
7919
|
+
['半吉', '转变之数'], ['半吉', '小舟入海'], ['半吉', '沉浮之数'], ['吉', '先见之明'],
|
|
7920
|
+
['半吉', '曲卷难星'], ['凶', '石上栽花'], ['半吉', '善恶之数'], ['凶', '浪里行舟'],
|
|
7921
|
+
['吉', '日照春松'], ['半吉', '晚行遇月'], ['凶', '寒蝉悲风'], ['凶', '无谋之数'],
|
|
7922
|
+
['吉', '牡丹芙蓉'], ['凶', '衰败之数'], ['吉', '舟归平海'], ['凶', '非命之数'],
|
|
7923
|
+
['吉', '巨流归海'], ['凶', '岩头步马'], ['吉', '通达之数'], ['吉', '顺风吹帆'],
|
|
7924
|
+
['凶', '非业之数'], ['凶', '残菊经霜'], ['半吉', '石上金花'], ['凶', '劳苦之数'],
|
|
7925
|
+
['半吉', '志高力微'], ['凶', '残菊逢霜'], ['半吉', '退守之数'], ['凶', '离散之数'],
|
|
7926
|
+
['半吉', '半吉之数'], ['半吉', '晚苦之数'], ['凶', '云头望月'], ['半吉', '遁吉之数'],
|
|
7927
|
+
['吉', '万物回春'],
|
|
7928
|
+
];
|
|
7929
|
+
|
|
7930
|
+
return { READING, SURNAME_STROKES, SURNAME_READING, DOUBLE_SURNAMES, SHULI_81 };
|
|
6907
7931
|
})();
|
|
6908
7932
|
|
|
6909
7933
|
__mods.name = (function () {
|
|
6910
7934
|
const { buildBazi } = __mods.bazi;
|
|
6911
7935
|
const { assertCivil } = __mods.validate;
|
|
7936
|
+
const { READING, SURNAME_STROKES, SURNAME_READING, DOUBLE_SURNAMES, SHULI_81 } = __mods['name-data'];
|
|
6912
7937
|
|
|
6913
7938
|
const SHENG = { 木: '火', 火: '土', 土: '金', 金: '水', 水: '木' };
|
|
6914
7939
|
const KE = { 木: '土', 土: '水', 水: '火', 火: '金', 金: '木' };
|
|
@@ -7116,9 +8141,180 @@ const CHAR_LIB = [
|
|
|
7116
8141
|
['沧', '水', '沧海,苍茫', 'm'], ['浦', '水', '浦,水滨', 'n'],
|
|
7117
8142
|
];
|
|
7118
8143
|
|
|
7119
|
-
const EL_INDEX = new Map();
|
|
7120
|
-
|
|
7121
|
-
|
|
8144
|
+
const EL_INDEX = new Map();
|
|
8145
|
+
const EXTRA_INDEX = new Map();
|
|
8146
|
+
for (const [c, py, tone, st] of READING) {
|
|
8147
|
+
if (!EXTRA_INDEX.has(c)) EXTRA_INDEX.set(c, { py, tone, st });
|
|
8148
|
+
}
|
|
8149
|
+
for (const c of CHAR_LIB) {
|
|
8150
|
+
if (!EL_INDEX.has(c[0])) {
|
|
8151
|
+
const x = EXTRA_INDEX.get(c[0]) || {};
|
|
8152
|
+
EL_INDEX.set(c[0], {
|
|
8153
|
+
c: c[0], el: c[1], meaning: c[2], g: c[3], order: EL_INDEX.size,
|
|
8154
|
+
py: x.py || null, tone: x.tone || null, strokes: x.st || null,
|
|
8155
|
+
});
|
|
8156
|
+
}
|
|
8157
|
+
}
|
|
8158
|
+
|
|
8159
|
+
const NUM_ELEMENT = { 1: '木', 2: '木', 3: '火', 4: '火', 5: '土', 6: '土', 7: '金', 8: '金', 9: '水', 0: '水' };
|
|
8160
|
+
const WX_REL = (a, b) => (a === b ? '同' : SHENG[a] === b ? '生' : KE[a] === b ? '克' : SHENG[b] === a ? '被生' : '被克');
|
|
8161
|
+
|
|
8162
|
+
function shuliOf(n) {
|
|
8163
|
+
let x = n;
|
|
8164
|
+
while (x > 81) x -= 80;
|
|
8165
|
+
if (!(x >= 1)) return null;
|
|
8166
|
+
const row = SHULI_81[x];
|
|
8167
|
+
return row ? { num: x, level: row[0], name: row[1] } : null;
|
|
8168
|
+
}
|
|
8169
|
+
|
|
8170
|
+
function overridesOf(input) {
|
|
8171
|
+
const out = {};
|
|
8172
|
+
for (const src of [input && input.surnameStrokes, input && input.strokeOverrides]) {
|
|
8173
|
+
if (!src || typeof src !== 'object') continue;
|
|
8174
|
+
for (const [k, v] of Object.entries(src)) {
|
|
8175
|
+
if (Number.isInteger(v) && v > 0) out[k] = v;
|
|
8176
|
+
}
|
|
8177
|
+
}
|
|
8178
|
+
return Object.keys(out).length ? out : undefined;
|
|
8179
|
+
}
|
|
8180
|
+
|
|
8181
|
+
function strokeOf(ch, overrides, kind) {
|
|
8182
|
+
if (overrides && Number.isInteger(overrides[ch]) && overrides[ch] > 0) {
|
|
8183
|
+
return { strokes: overrides[ch], source: 'user' };
|
|
8184
|
+
}
|
|
8185
|
+
const info = EL_INDEX.get(ch);
|
|
8186
|
+
if (info && info.strokes) return { strokes: info.strokes, source: 'lib' };
|
|
8187
|
+
if (kind === 'surname' && SURNAME_STROKES[ch]) return { strokes: SURNAME_STROKES[ch], source: 'surname' };
|
|
8188
|
+
return null;
|
|
8189
|
+
}
|
|
8190
|
+
|
|
8191
|
+
function readingOf(ch, kind) { const info = EL_INDEX.get(ch);
|
|
8192
|
+
if (info && info.py) return { py: info.py, tone: info.tone };
|
|
8193
|
+
if (kind === 'surname' && SURNAME_READING[ch]) {
|
|
8194
|
+
const [py, tone] = SURNAME_READING[ch];
|
|
8195
|
+
return { py, tone };
|
|
8196
|
+
}
|
|
8197
|
+
return null;
|
|
8198
|
+
}
|
|
8199
|
+
|
|
8200
|
+
function wuge(surname, given, overrides) {
|
|
8201
|
+
const s = [...String(surname || '')];
|
|
8202
|
+
const g = [...String(given || '')];
|
|
8203
|
+
if (!s.length || !g.length) return { available: false, reason: '需要姓与名才能排五格' };
|
|
8204
|
+
if (s.length > 2) return { available: false, reason: '姓超过两字:五格只算单姓与常见复姓' };
|
|
8205
|
+
|
|
8206
|
+
const dbl = s.length === 2 ? DOUBLE_SURNAMES[surname] : null;
|
|
8207
|
+
const useDbl = dbl && !s.some((ch) => overrides && overrides[ch]);
|
|
8208
|
+
const sInfo = useDbl
|
|
8209
|
+
? dbl.s.map((n) => ({ strokes: n, source: 'table' }))
|
|
8210
|
+
: s.map((ch) => strokeOf(ch, overrides, 'surname'));
|
|
8211
|
+
const gInfo = g.map((ch) => strokeOf(ch, overrides, 'given'));
|
|
8212
|
+
const missing = [...s, ...g].filter((ch, i) => !(i < s.length ? sInfo[i] : gInfo[i - s.length]));
|
|
8213
|
+
if (missing.length) {
|
|
8214
|
+
return {
|
|
8215
|
+
available: false,
|
|
8216
|
+
reason: `这些字没有康熙笔画数据,五格算不了:${missing.join('、')}——可用 strokeOverrides 传入笔画后再算`,
|
|
8217
|
+
missing,
|
|
8218
|
+
};
|
|
8219
|
+
}
|
|
8220
|
+
|
|
8221
|
+
const sStroke = sInfo.map((x) => x.strokes);
|
|
8222
|
+
const gStroke = gInfo.map((x) => x.strokes);
|
|
8223
|
+
const sum = (a) => a.reduce((x, y) => x + y, 0);
|
|
8224
|
+
const isDouble = s.length === 2;
|
|
8225
|
+
const tian = isDouble ? sum(sStroke) : sStroke[0] + 1;
|
|
8226
|
+
const ren = sStroke[s.length - 1] + gStroke[0];
|
|
8227
|
+
const di = sum(gStroke) + (g.length === 1 ? 1 : 0);
|
|
8228
|
+
const zong = sum(sStroke) + sum(gStroke);
|
|
8229
|
+
const wai = s.length === 1 && g.length === 1 ? 2 : zong - ren + 1;
|
|
8230
|
+
|
|
8231
|
+
const rows = [['天格', tian], ['人格', ren], ['地格', di], ['外格', wai], ['总格', zong]].map(([key, n]) => ({
|
|
8232
|
+
key, strokes: n, ...shuliOf(n),
|
|
8233
|
+
}));
|
|
8234
|
+
const sancaiNums = [tian, ren, di].map((n) => n % 10);
|
|
8235
|
+
const sancaiEl = sancaiNums.map((n) => NUM_ELEMENT[n]);
|
|
8236
|
+
const rels = [
|
|
8237
|
+
{ pair: '天与人', rel: WX_REL(sancaiEl[0], sancaiEl[1]) },
|
|
8238
|
+
{ pair: '人与地', rel: WX_REL(sancaiEl[1], sancaiEl[2]) },
|
|
8239
|
+
];
|
|
8240
|
+
const ordered = sancaiEl[0] === sancaiEl[1] && sancaiEl[1] === sancaiEl[2]
|
|
8241
|
+
? '三才同气,气脉集中'
|
|
8242
|
+
: rels.every((x) => x.rel === '生' || x.rel === '同')
|
|
8243
|
+
? '一路相生,传统看作顺遂'
|
|
8244
|
+
: rels.every((x) => x.rel === '克' || x.rel === '被克')
|
|
8245
|
+
? '相连相克,传统看作内外拉扯'
|
|
8246
|
+
: `${rels.map((x) => `${x.pair}${x.rel}`).join('、')},吉凶各派看法不一`;
|
|
8247
|
+
|
|
8248
|
+
const source = [...sInfo, ...gInfo].some((x) => x.source === 'user') ? 'mixed' : 'table';
|
|
8249
|
+
return {
|
|
8250
|
+
available: true,
|
|
8251
|
+
surnameStyle: isDouble ? '复姓' : '单姓',
|
|
8252
|
+
strokes: [
|
|
8253
|
+
...s.map((ch, i) => ({ char: ch, strokes: sInfo[i].strokes, source: sInfo[i].source, kind: '姓' })),
|
|
8254
|
+
...g.map((ch, i) => ({ char: ch, strokes: gInfo[i].strokes, source: gInfo[i].source, kind: '名' })),
|
|
8255
|
+
],
|
|
8256
|
+
rows,
|
|
8257
|
+
sancai: {
|
|
8258
|
+
elements: sancaiEl,
|
|
8259
|
+
text: `${sancaiEl.join('')}(${ordered})`,
|
|
8260
|
+
relations: rels,
|
|
8261
|
+
},
|
|
8262
|
+
summary: rows.map((r) => `${r.key}${r.strokes}${r.level}`).join(' '),
|
|
8263
|
+
source,
|
|
8264
|
+
};
|
|
8265
|
+
}
|
|
8266
|
+
|
|
8267
|
+
const INITIALS = ['zh', 'ch', 'sh', 'b', 'p', 'm', 'f', 'd', 't', 'n', 'l', 'g', 'k', 'h', 'j', 'q', 'x', 'r', 'z', 'c', 's', 'y', 'w'];
|
|
8268
|
+
|
|
8269
|
+
function splitPinyin(py) {
|
|
8270
|
+
const p = String(py || '').toLowerCase();
|
|
8271
|
+
for (const ini of INITIALS) {
|
|
8272
|
+
if (p.startsWith(ini)) return { ini, fin: p.slice(ini.length) };
|
|
8273
|
+
}
|
|
8274
|
+
return { ini: '', fin: p };
|
|
8275
|
+
}
|
|
8276
|
+
|
|
8277
|
+
const TONE_LABEL = { 1: '一', 2: '二', 3: '三', 4: '四' };
|
|
8278
|
+
|
|
8279
|
+
function phonetics(fullName) {
|
|
8280
|
+
const chars = [...String(fullName || '')];
|
|
8281
|
+
if (chars.length < 2) return { available: false, reason: '至少两个字才谈得上音韵' };
|
|
8282
|
+
const items = chars.map((ch, i) => {
|
|
8283
|
+
const r = readingOf(ch, i === 0 ? 'surname' : 'given');
|
|
8284
|
+
return r ? { char: ch, py: r.py, tone: r.tone, ...splitPinyin(r.py) } : { char: ch, py: null, tone: null, ini: null, fin: null };
|
|
8285
|
+
});
|
|
8286
|
+
const missing = items.filter((x) => !x.py).map((x) => x.char);
|
|
8287
|
+
if (missing.length) {
|
|
8288
|
+
return { available: false, reason: `这些字没有读音数据:${missing.join('、')}`, missing };
|
|
8289
|
+
}
|
|
8290
|
+
|
|
8291
|
+
const issues = [];
|
|
8292
|
+
const tones = new Set(items.map((x) => x.tone));
|
|
8293
|
+
if (tones.size === 1 && items.length >= 2) {
|
|
8294
|
+
issues.push({ type: 'tone', text: `全名都是${TONE_LABEL[items[0].tone]}声,声调没有起伏` });
|
|
8295
|
+
}
|
|
8296
|
+
for (let i = 1; i < items.length; i++) {
|
|
8297
|
+
const a = items[i - 1];
|
|
8298
|
+
const b = items[i];
|
|
8299
|
+
if (a.py === b.py && a.tone === b.tone) {
|
|
8300
|
+
issues.push({ type: 'same', text: `「${a.char}${b.char}」同音同调(叠字或撞音)` });
|
|
8301
|
+
continue;
|
|
8302
|
+
}
|
|
8303
|
+
if (a.ini && a.ini === b.ini) issues.push({ type: 'initial', text: `「${a.char}${b.char}」同声母 ${a.ini}` });
|
|
8304
|
+
if (a.fin === b.fin) issues.push({ type: 'final', text: `「${a.char}${b.char}」同韵母 ${a.fin}` });
|
|
8305
|
+
}
|
|
8306
|
+
const inis = new Set(items.map((x) => x.ini).filter(Boolean));
|
|
8307
|
+
if (items.length >= 3 && inis.size === 1) {
|
|
8308
|
+
issues.push({ type: 'initial', text: `三字同声母 ${[...inis][0]},连着读容易黏在一起` });
|
|
8309
|
+
}
|
|
8310
|
+
const level = issues.length === 0 ? '顺口' : issues.length === 1 ? '略拗' : '拗口';
|
|
8311
|
+
return {
|
|
8312
|
+
available: true,
|
|
8313
|
+
chars: items.map((x) => ({ char: x.char, py: x.py, tone: x.tone })),
|
|
8314
|
+
tonePattern: items.map((x) => x.tone).join('-'),
|
|
8315
|
+
issues,
|
|
8316
|
+
level,
|
|
8317
|
+
};
|
|
7122
8318
|
}
|
|
7123
8319
|
|
|
7124
8320
|
function userElement(input, ch) {
|
|
@@ -7230,6 +8426,10 @@ function assessName(input) {
|
|
|
7230
8426
|
else if (favCount > 0) verdict = `部分用字合喜用(${favCount}/${judged}),其余可再斟酌;喜用为 ${favorable.list.join('、')}。`;
|
|
7231
8427
|
else verdict = `用字未落在喜用(${favorable.list.join('、')})上;不必然是坏名,但若想贴合命局可换字再看。`;
|
|
7232
8428
|
|
|
8429
|
+
const ov = overridesOf(input);
|
|
8430
|
+
const wu = wuge(surname, given, ov);
|
|
8431
|
+
const ph = phonetics(surname + given);
|
|
8432
|
+
|
|
7233
8433
|
return {
|
|
7234
8434
|
system: 'name',
|
|
7235
8435
|
action: 'assess',
|
|
@@ -7245,11 +8445,14 @@ function assessName(input) {
|
|
|
7245
8445
|
},
|
|
7246
8446
|
} : {}),
|
|
7247
8447
|
chars,
|
|
7248
|
-
|
|
8448
|
+
wuge: wu,
|
|
8449
|
+
phonetics: ph,
|
|
8450
|
+
stats: { chars: chars.length, known, unknown, favorableCount: favCount, libSize: CHAR_LIB.length, wugeReady: wu.available === true },
|
|
7249
8451
|
verdict,
|
|
7250
8452
|
notes: [
|
|
7251
8453
|
`字之五行按通行字义/偏旁归类,自建字库共 ${CHAR_LIB.length} 字(常用名用字为主);未收录的字不猜五行,如实标注,「用户指定」是你传入的归类。`,
|
|
7252
|
-
'
|
|
8454
|
+
'五格按康熙字典繁体笔画计(氵→水4、艹→艸6、华→華14 这类换算),81 数理取通行本、各派对少数数取法有出入;姓氏笔画表没覆盖的姓或你想按别派算,可传 strokeOverrides 覆盖。',
|
|
8455
|
+
'音韵只做机械检查(全名同调、相邻同声母/同韵母、叠字),不做语义谐音判断——谐音、方言读法还得自己读三遍。',
|
|
7253
8456
|
'起名只做用字参考,不替父母做决定。',
|
|
7254
8457
|
],
|
|
7255
8458
|
};
|
|
@@ -7278,6 +8481,14 @@ function generateNames(input) {
|
|
|
7278
8481
|
const fav = favorableElements(strength);
|
|
7279
8482
|
const pool = CHAR_LIB.filter((c) => fav.list.includes(c[1]) && c[0] !== surname);
|
|
7280
8483
|
const gPref = gender === 'male' ? 'm' : 'f';
|
|
8484
|
+
const sChars = [...surname];
|
|
8485
|
+
const ov = overridesOf(input);
|
|
8486
|
+
const sStroke = sChars.map((ch) => strokeOf(ch, ov, 'surname'));
|
|
8487
|
+
const sReady = sChars.length <= 2 && sStroke.every(Boolean);
|
|
8488
|
+
const sSum = sReady ? sStroke.reduce((x, y) => x + y.strokes, 0) : 0;
|
|
8489
|
+
const sLast = sReady ? sStroke[sStroke.length - 1].strokes : 0;
|
|
8490
|
+
const lv = (n) => { const r = shuliOf(n); return r ? (r.level === '吉' ? 2 : r.level === '半吉' ? 1 : 0) : 0; };
|
|
8491
|
+
const poolStroke = new Map(pool.map((c) => [c[0], (strokeOf(c[0], ov, 'given') || {}).strokes || 0]));
|
|
7281
8492
|
const scored = [];
|
|
7282
8493
|
for (let i = 0; i < pool.length; i++) {
|
|
7283
8494
|
for (let j = 0; j < pool.length; j++) {
|
|
@@ -7286,6 +8497,15 @@ function generateNames(input) {
|
|
|
7286
8497
|
const b = pool[j];
|
|
7287
8498
|
const fit = (x) => (x[3] === gPref || x[3] === 'n' ? 1 : 0);
|
|
7288
8499
|
const gScore = fit(a) + fit(b) - (a[3] !== gPref && a[3] !== 'n' && b[3] !== gPref && b[3] !== 'n' ? 2 : 0);
|
|
8500
|
+
const aSt = poolStroke.get(a[0]);
|
|
8501
|
+
const bSt = poolStroke.get(b[0]);
|
|
8502
|
+
let wuScore = 0;
|
|
8503
|
+
if (sReady && aSt && bSt) {
|
|
8504
|
+
const ren = sLast + aSt;
|
|
8505
|
+
const di = aSt + bSt;
|
|
8506
|
+
const zong = sSum + aSt + bSt;
|
|
8507
|
+
wuScore = lv(ren) + lv(di) + lv(zong) + lv(zong - ren + 1);
|
|
8508
|
+
}
|
|
7289
8509
|
scored.push({
|
|
7290
8510
|
name: a[0] + b[0],
|
|
7291
8511
|
chars: [
|
|
@@ -7295,12 +8515,14 @@ function generateNames(input) {
|
|
|
7295
8515
|
elements: [a[1], b[1]],
|
|
7296
8516
|
allFavorable: fav.list.includes(a[1]) && fav.list.includes(b[1]),
|
|
7297
8517
|
genderScore: gScore,
|
|
8518
|
+
wugeScore: wuScore,
|
|
7298
8519
|
order: (i * 7 + j * 13) % 9973,
|
|
7299
8520
|
});
|
|
7300
8521
|
}
|
|
7301
8522
|
}
|
|
7302
8523
|
const mixed = (c) => (c.elements[0] !== c.elements[1] ? 1 : 0);
|
|
7303
|
-
scored.sort((x, y) => (y.allFavorable - x.allFavorable) || (mixed(y) - mixed(x))
|
|
8524
|
+
scored.sort((x, y) => (y.allFavorable - x.allFavorable) || (mixed(y) - mixed(x))
|
|
8525
|
+
|| (y.wugeScore - x.wugeScore) || (y.genderScore - x.genderScore) || (x.order - y.order));
|
|
7304
8526
|
const out = [];
|
|
7305
8527
|
const usedNames = new Set();
|
|
7306
8528
|
const usedChars = new Set([surname]);
|
|
@@ -7314,7 +8536,11 @@ function generateNames(input) {
|
|
|
7314
8536
|
usedNames.add(key);
|
|
7315
8537
|
usedPairs.add(pair);
|
|
7316
8538
|
cand.chars.forEach((x) => usedChars.add(x.char));
|
|
7317
|
-
out.push({
|
|
8539
|
+
out.push({
|
|
8540
|
+
rank: out.length + 1, name: surname + cand.name, given: cand.name, chars: cand.chars,
|
|
8541
|
+
wuge: wuge(surname, cand.name, ov),
|
|
8542
|
+
phonetics: phonetics(surname + cand.name),
|
|
8543
|
+
});
|
|
7318
8544
|
return true;
|
|
7319
8545
|
};
|
|
7320
8546
|
for (const cand of scored) {
|
|
@@ -7338,8 +8564,11 @@ function generateNames(input) {
|
|
|
7338
8564
|
candidates: out,
|
|
7339
8565
|
notes: [
|
|
7340
8566
|
`字库共 ${CHAR_LIB.length} 字,只在喜用五行(${fav.list.join('、')})里选字;未覆盖的生僻好字可用 charElements 指定五行后评估。`,
|
|
7341
|
-
'
|
|
7342
|
-
|
|
8567
|
+
'候选排序依次看:合喜用 → 两字异行 → 五格(人格/地格/总格/外格 吉多者先)→ 性别倾向 → 字库序,是排序不是「吉名」判定。',
|
|
8568
|
+
sReady
|
|
8569
|
+
? '五格按康熙字典繁体笔画与通行本 81 数理算;姓的笔画取自内置姓氏表,没覆盖的姓可传 surnameStrokes 或 strokeOverrides。'
|
|
8570
|
+
: '姓的笔画不在内置姓氏表里,这一轮没按五格排序(不半算);可传 surnameStrokes 或 strokeOverrides 后重算。',
|
|
8571
|
+
'音韵只做机械检查(同调、相邻同声母/同韵母、叠字),不做语义谐音判断——候选的音韵结果随每条一起给出。',
|
|
7343
8572
|
],
|
|
7344
8573
|
};
|
|
7345
8574
|
}
|
|
@@ -7349,7 +8578,7 @@ function buildName(input) {
|
|
|
7349
8578
|
return assessName(input);
|
|
7350
8579
|
}
|
|
7351
8580
|
|
|
7352
|
-
return { CHAR_LIB, favorableElements, assessName, generateNames, buildName };
|
|
8581
|
+
return { CHAR_LIB, shuliOf, wuge, splitPinyin, phonetics, favorableElements, assessName, generateNames, buildName };
|
|
7353
8582
|
})();
|
|
7354
8583
|
|
|
7355
8584
|
__mods['ziwei-hepan'] = (function () {
|
|
@@ -8518,9 +9747,9 @@ const MANSIONS = {
|
|
|
8518
9747
|
箕: { luck: '吉', zheng: '水', animal: '豹', gong: '东' }, 斗: { luck: '吉', zheng: '木', animal: '獬', gong: '北' },
|
|
8519
9748
|
牛: { luck: '凶', zheng: '金', animal: '牛', gong: '北' }, 女: { luck: '凶', zheng: '土', animal: '蝠', gong: '北' },
|
|
8520
9749
|
虚: { luck: '凶', zheng: '日', animal: '鼠', gong: '北' }, 危: { luck: '凶', zheng: '月', animal: '燕', gong: '北' },
|
|
8521
|
-
室: { luck: '吉', zheng: '火', animal: '猪', gong: '北' }, 壁: { luck: '吉', zheng: '水', animal: '
|
|
9750
|
+
室: { luck: '吉', zheng: '火', animal: '猪', gong: '北' }, 壁: { luck: '吉', zheng: '水', animal: '貐', gong: '北' },
|
|
8522
9751
|
奎: { luck: '凶', zheng: '木', animal: '狼', gong: '西' }, 娄: { luck: '吉', zheng: '金', animal: '狗', gong: '西' },
|
|
8523
|
-
胃: { luck: '吉', zheng: '土', animal: '
|
|
9752
|
+
胃: { luck: '吉', zheng: '土', animal: '雉', gong: '西' }, 昴: { luck: '凶', zheng: '日', animal: '鸡', gong: '西' },
|
|
8524
9753
|
毕: { luck: '吉', zheng: '月', animal: '乌', gong: '西' }, 觜: { luck: '凶', zheng: '火', animal: '猴', gong: '西' },
|
|
8525
9754
|
参: { luck: '吉', zheng: '水', animal: '猿', gong: '西' }, 井: { luck: '吉', zheng: '木', animal: '犴', gong: '南' },
|
|
8526
9755
|
鬼: { luck: '凶', zheng: '金', animal: '羊', gong: '南' }, 柳: { luck: '凶', zheng: '土', animal: '獐', gong: '南' },
|
|
@@ -9814,7 +11043,15 @@ const PLAIN_BODY = {
|
|
|
9814
11043
|
化退神: '有一爻在往后退,别按原来的势头硬推。',
|
|
9815
11044
|
};
|
|
9816
11045
|
|
|
9817
|
-
|
|
11046
|
+
const FUSHEN_PLAIN = {
|
|
11047
|
+
可出: '眼下的条件算是有助无压,属于「出得来」的一档——这是条件,不等于马上应验。',
|
|
11048
|
+
有助有压: '眼下是一边有助、一边有压,出得来,但得费点劲。',
|
|
11049
|
+
受压难出: '眼下被上面的力量压着,不太容易露头,先别急着硬推。',
|
|
11050
|
+
未得助: '眼下暂时没借到力,还得等条件转过来。',
|
|
11051
|
+
飞伏未知: '飞伏关系看不全,这一层先不下判断。',
|
|
11052
|
+
};
|
|
11053
|
+
|
|
11054
|
+
function usePlainOf(ug, fa) {
|
|
9818
11055
|
if (!ug || !ug.liuqin) return '';
|
|
9819
11056
|
if (ug.found.length) {
|
|
9820
11057
|
const pos = ug.found.map((f) => `第${f.position}爻`).join('、');
|
|
@@ -9824,7 +11061,9 @@ function usePlainOf(ug) {
|
|
|
9824
11061
|
}
|
|
9825
11062
|
if (ug.fushen.length) {
|
|
9826
11063
|
const f = ug.fushen[0];
|
|
9827
|
-
|
|
11064
|
+
const hit = fa && Array.isArray(fa.items) ? fa.items.find((x) => x.position === f.position) : null;
|
|
11065
|
+
const tail = hit ? ` ${FUSHEN_PLAIN[hit.verdict] || ''}` : '';
|
|
11066
|
+
return `你问的这件事,卦面上没有直接露出来,得往深处找:它藏在第${f.position}爻下面(伏神),与上面的关系是「${f.relation || '—'}」,要借力才出得来。${tail}`;
|
|
9828
11067
|
}
|
|
9829
11068
|
return '';
|
|
9830
11069
|
}
|
|
@@ -9852,6 +11091,18 @@ function jinTuiPlain(r) {
|
|
|
9852
11091
|
return `动爻的进退还要看时令:${jp.lines.map((l) => `${l.position}爻${l.from}→${l.to}${l.type},${sayOf(l)}`).join(';')}。`;
|
|
9853
11092
|
}
|
|
9854
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
|
+
|
|
9855
11106
|
function hexStrengthPlain(hs) {
|
|
9856
11107
|
if (!hs || !hs.counts) return '';
|
|
9857
11108
|
const up = (hs.counts.旺 || 0) + (hs.counts.相 || 0);
|
|
@@ -9918,6 +11169,7 @@ function buildAnswer(r, ask, ctx = {}) {
|
|
|
9918
11169
|
: '',
|
|
9919
11170
|
`具体到你问的这件事,重点看${where}。`,
|
|
9920
11171
|
];
|
|
11172
|
+
if (!q) parts[parts.length - 1] = `没指定问题,就按${where}的顺序往下看。`;
|
|
9921
11173
|
return parts.filter(Boolean).join('');
|
|
9922
11174
|
}
|
|
9923
11175
|
|
|
@@ -9936,7 +11188,7 @@ function buildAnswer(r, ask, ctx = {}) {
|
|
|
9936
11188
|
`${body.lands ? `,身宫落在「${body.lands}」——这张盘的重心在这件事上` : ''}。`,
|
|
9937
11189
|
plainFly,
|
|
9938
11190
|
flyCompositePlain(r.flyComposite),
|
|
9939
|
-
`具体到你问的这件事,重点看${where}
|
|
11191
|
+
q ? `具体到你问的这件事,重点看${where}。` : `没指定问题,就按${where}的顺序往下看。`,
|
|
9940
11192
|
].filter(Boolean).join('');
|
|
9941
11193
|
}
|
|
9942
11194
|
|
|
@@ -9950,12 +11202,20 @@ function buildAnswer(r, ask, ctx = {}) {
|
|
|
9950
11202
|
head + `先说结论:本卦是${s(ben.name, '—')}` +
|
|
9951
11203
|
`${ben.palace ? `(${ben.palace})` : ''}` +
|
|
9952
11204
|
`${moving.length ? `,第 ${moving.join('、')} 爻动,变为${s(bian.name, '—')}` : ',六爻安静没有动爻'}。` +
|
|
9953
|
-
`${plainBody}${usePlainOf(r.useGod)}${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)}`,
|
|
9954
11206
|
'断卦的落点在「世爻」(代表你)和「动爻」(事情的推动点),下面「看盘顺序」就按这个次序展开。',
|
|
9955
11207
|
].join('');
|
|
9956
11208
|
}
|
|
9957
11209
|
|
|
9958
|
-
|
|
11210
|
+
if (head) return `${head}下面按五个维度拆开看,重点看${where}。`;
|
|
11211
|
+
if (r.system === 'qimen') {
|
|
11212
|
+
const dirTip = dir !== 'general' && ask && ask.directionLabel ? `,取「${ask.directionLabel}」方向的用神` : '';
|
|
11213
|
+
return `下面按排盘事实、用神、宫位条件几节展开${dirTip}。`;
|
|
11214
|
+
}
|
|
11215
|
+
if (dir !== 'general' && ask && ask.directionLabel) {
|
|
11216
|
+
return `下面按五个维度拆开看,重点看与「${ask.directionLabel}」方向最贴近的那一节。`;
|
|
11217
|
+
}
|
|
11218
|
+
return '下面按五个维度拆开看,没指定问题,就从头依次读。';
|
|
9959
11219
|
}
|
|
9960
11220
|
|
|
9961
11221
|
function buildPlain(r, ask, ctx = {}) {
|
|
@@ -9976,17 +11236,26 @@ function buildPlain(r, ask, ctx = {}) {
|
|
|
9976
11236
|
tiaohou + syPlain;
|
|
9977
11237
|
}
|
|
9978
11238
|
if (r.system === 'ziwei') {
|
|
9979
|
-
const soul = r.soul || {};
|
|
9980
11239
|
const body = r.body || {};
|
|
9981
11240
|
const ji = r.flyChains && r.flyChains.忌;
|
|
9982
|
-
const
|
|
9983
|
-
?
|
|
11241
|
+
const feltChain = ji && ji.steps.length
|
|
11242
|
+
? '你身上有个绕不开的规律:几件事是连着转的,一件卡住,后面就跟着慢下来。'
|
|
11243
|
+
: '';
|
|
11244
|
+
const fc = r.flyComposite;
|
|
11245
|
+
const hub = fc && Array.isArray(fc.targets) ? fc.targets.find((t) => t.count >= 2) : null;
|
|
11246
|
+
const feltComposite = !fc || !Array.isArray(fc.targets)
|
|
11247
|
+
? ''
|
|
11248
|
+
: hub
|
|
11249
|
+
? `再往深一层,四股力最后也压在「${String(hub.palace).replace(/宫$/, '')}」上——几个方面的劲都往这儿聚。`
|
|
11250
|
+
: '再往深一层,四股的力没有全挤到一处,这几件事之间牵连不深。';
|
|
11251
|
+
const focus = body.lands
|
|
11252
|
+
? `真正让你上心的,多半是「${body.lands}」这件事,做别的总会分心。`
|
|
9984
11253
|
: '';
|
|
9985
11254
|
return [
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
11255
|
+
`紫微讲的是「你与环境怎么互动」,不是谁好谁坏——同一件事换个环境、换个人配合,结果就不一样。`,
|
|
11256
|
+
focus,
|
|
11257
|
+
feltChain,
|
|
11258
|
+
feltComposite,
|
|
9990
11259
|
].filter(Boolean).join('');
|
|
9991
11260
|
}
|
|
9992
11261
|
if (r.system === 'liuyao') {
|
|
@@ -9996,7 +11265,7 @@ function buildPlain(r, ask, ctx = {}) {
|
|
|
9996
11265
|
const plainBody = bodyPlainOf(labels);
|
|
9997
11266
|
return `${s(ben.name, '这一卦')}讲的是一个「${moving.length ? '正在动、还会变' : '暂时不动、先看清'}」的局面——` +
|
|
9998
11267
|
`${moving.length ? '有动爻,说明事情还有转圜空间,不是死局。' : '六爻安静,说明当下更该观察而不是硬推。'}` +
|
|
9999
|
-
`${plainBody}${usePlainOf(r.useGod)}${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)}`;
|
|
10000
11269
|
}
|
|
10001
11270
|
return '';
|
|
10002
11271
|
}
|
|
@@ -10033,6 +11302,19 @@ const GLOSSARY = [
|
|
|
10033
11302
|
['纳甲', '给六个爻配上天干地支,六亲与生克才有依据。'],
|
|
10034
11303
|
['四化', '禄权科忌四种变化,标记星曜在这一步运里扮演什么角色。'],
|
|
10035
11304
|
['大限', '紫微里的十年阶段,作用类似八字的「大运」。'],
|
|
11305
|
+
['庙旺', '星曜落在某宫时的力量档位:庙、旺最强,得、利、平居中,不、陷最弱。'],
|
|
11306
|
+
['三方四正', '从命宫出发的三合三方加对宫,共四个宫位,是全盘最核心的势力范围。'],
|
|
11307
|
+
['命主', '紫微里另有一颗命主星,补命宫看不到的那一层底色。'],
|
|
11308
|
+
['身主', '紫微里另有一颗身主星,管后天的行动与身体那一面。'],
|
|
11309
|
+
['五行局', '用纳音给整张盘定一个局(水二局、木三局等),大限的起法以此为准。'],
|
|
11310
|
+
['自化', '宫干让本宫星曜自己生出四化,代表这一宫的事容易自己发酵。'],
|
|
11311
|
+
['飞星', '拿一个宫的宫干去四化别的宫,看事情从哪来、往哪走。'],
|
|
11312
|
+
['正曜', '十四主星。「无正曜」指命宫没有主星,要借对宫来看。'],
|
|
11313
|
+
['借对宫', '命宫无主星时借对宫主星来读,性格更依赖环境与身边的人。'],
|
|
11314
|
+
['双星', '两主星同宫,按组合读,不能只看其中一颗。'],
|
|
11315
|
+
['墓库', '地支里的仓库。五行入墓代表这股力量收着,不是没有。'],
|
|
11316
|
+
['伏吟', '干支重复出现,事情容易原地打转、反复。'],
|
|
11317
|
+
['反吟', '天克地冲,变动与对撞的意味更明显。'],
|
|
10036
11318
|
];
|
|
10037
11319
|
|
|
10038
11320
|
const GLOSSARY_BY_SYSTEM = {
|
|
@@ -10086,10 +11368,10 @@ const KNOWLEDGE = [
|
|
|
10086
11368
|
id: 'bazi-yueling-siquan',
|
|
10087
11369
|
system: 'bazi', dims: ['overall', 'career'],
|
|
10088
11370
|
gist: '月令不是「一个月」,是当月最有权的那一个字。',
|
|
10089
|
-
detail: '
|
|
11371
|
+
detail: '月令藏干按本气、中气、余气分日用事,本气当权的时间最长。所以判旺衰先看日主在月令是得令还是失令——得令者未看全局,已有三分底气。本插件按 30 日表算出「生在本月第几日、哪一干当权」,给的是月内轮值这一层细节;旺衰与取格仍以月令本气、透干与会支为主,不随轮值改判。',
|
|
10090
11372
|
source: '《子平真诠》论用神;人元司权分日之说见《渊海子平》',
|
|
10091
11373
|
status: 'variant',
|
|
10092
|
-
note: '各家对中气、余气各主几日分法不同(有 7/7/16、9/3/18
|
|
11374
|
+
note: '各家对中气、余气各主几日分法不同(有 7/7/16、9/3/18 等多说);本插件固定通行 30 日表(如寅月戊7丙7甲16),节当日为第 1 日,第 31 日以后按本气算、不硬分摊。司权表与本柱藏干表口径不同(子月壬、卯月甲、午月丙、酉月庚、亥月戊只出现在司权表里),两表各照原样;取格不随轮值改判。',
|
|
10093
11375
|
},
|
|
10094
11376
|
{
|
|
10095
11377
|
id: 'bazi-tonggen-tougan',
|
|
@@ -10137,8 +11419,8 @@ const KNOWLEDGE = [
|
|
|
10137
11419
|
id: 'bazi-suiyun',
|
|
10138
11420
|
system: 'bazi', dims: ['overall', 'career'],
|
|
10139
11421
|
gist: '大运管十年基调,流年管当年触发。',
|
|
10140
|
-
detail: '
|
|
10141
|
-
source: '
|
|
11422
|
+
detail: '大运像换了条路,流年像这条路上某一段的天气。岁运并临(当值大运与流年干支相同)、运年反吟(大运与流年天克地冲)、流年伏吟(流年与原局某柱干支相同)与流年反吟(流年与原局某柱天克地冲),是传统上标记「变动较大」的年份,属于提示而非断语。本插件逐年标出四类信号:当值大运按该年立春到次年立春的区间取,交运落在年内时前后两步并列;只标干支重复与对冲,不折分数。原文里「返吟」指岁运与日柱相对、「伏吟」指岁运压日,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义,两者并列、不合并。',
|
|
11423
|
+
source: '《三命通会》卷二·总论岁运(https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html);岁运并临之说出自《渊海子平》',
|
|
10142
11424
|
status: 'variant',
|
|
10143
11425
|
note: '「岁运并临主大凶」是流传最广也最被滥用的说法,本插件只作变动提示,不断吉凶;大运与原局之间的伏吟反吟未逐年标注,四柱十神层面的引化也未叠入。',
|
|
10144
11426
|
},
|
|
@@ -10173,8 +11455,8 @@ const KNOWLEDGE = [
|
|
|
10173
11455
|
id: 'bazi-sanming-duizhao',
|
|
10174
11456
|
system: 'bazi', dims: ['overall', 'career'],
|
|
10175
11457
|
gist: '同一个格,子平真诠讲怎么用,三命通会讲怎么取。',
|
|
10176
|
-
detail: '
|
|
10177
|
-
source: '
|
|
11458
|
+
detail: '两书不是谁替代谁:子平真诠以月令取用神、论顺逆成败,重「用」;三命通会按十神逐格立论,重「取」与「忌」。同看正官格,前者问财印护官、伤煞混杂,后者先说「止许一位,多则不宜」。此本正财、偏财分章,两格各取本格一条;七杀没有单列「论偏官」,取卷五「官煞去留杂论」讲混杂时的去留。本插件把两条并列,不合并成一句断语。',
|
|
11459
|
+
source: '《子平真诠》论正官等篇;《三命通会》卷五、卷六论十神与官煞去留',
|
|
10178
11460
|
status: 'variant',
|
|
10179
11461
|
note: '两书成书年代与流派不同,用语有出入;本插件照录通行本,不做校勘改字,也不替两家调和。',
|
|
10180
11462
|
},
|
|
@@ -10196,6 +11478,42 @@ const KNOWLEDGE = [
|
|
|
10196
11478
|
status: 'variant',
|
|
10197
11479
|
note: '化气格成立条件各家宽严不一(是否要求月令为化神、日主是否允许有根),本插件只列条件、附原文,不据此断定化气已成。',
|
|
10198
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
|
+
},
|
|
11490
|
+
{
|
|
11491
|
+
id: 'bazi-zhuanwang-yuanwen',
|
|
11492
|
+
system: 'bazi', dims: ['overall', 'career'],
|
|
11493
|
+
gist: '专旺五格各有专章:成格要看局全带印,不只看身强。',
|
|
11494
|
+
detail: '三命通会卷六曲直、炎上、从革、润下、稼穑五篇各立一格:曲直须亥卯未带亥,炎上须寅午戌带寅,从革须巳酉丑带丙丁巳午,润下须申子辰全,稼穑取四季土。原文的条件都比「身强」细:要局全、要带印或带火炼金,还要防冲刑死绝。本插件把命中的那一篇附在结果里,只作结构说明。',
|
|
11495
|
+
source: '《三命通会》卷六·曲直、炎上、从革、润下、稼穑',
|
|
11496
|
+
status: 'variant',
|
|
11497
|
+
note: '专旺是否必须成方局、是否允许一点官杀财,各家宽严不一;原文五篇之间条件也不齐(润下重忌冲刑、稼穑重四季土)。本插件只按「同类+印 ≥5、官杀财皆弱」列出并附原文,不据此断贵贱,也不补专旺的破格条件。',
|
|
11498
|
+
},
|
|
11499
|
+
{
|
|
11500
|
+
id: 'bazi-congge-yuanwen',
|
|
11501
|
+
system: 'bazi', dims: ['overall', 'career'],
|
|
11502
|
+
gist: '从格是身无归处才「弃命」相从:一见根气就破格。',
|
|
11503
|
+
detail: '三命通会卷五弃命从煞、卷六弃命从财各有一篇:从煞要煞重身柔、四柱无一点比肩印绶;从财要财会成局、日干无气,原文说「若逢根气,命损无猜」。两篇都说行运喜财煞旺地、忌扶身。本插件只在盘面出现从财格或从杀格时附上对应原文;从儿、从强没有单章,不硬凑。',
|
|
11504
|
+
source: '《三命通会》卷五·弃命从煞;卷六·弃命从财',
|
|
11505
|
+
status: 'variant',
|
|
11506
|
+
note: '从格成立条件各家分歧很大:是否允许日主有微根、阴阳干从与不从(原文说阳木不能从)、从儿与从强算不算正从,说法不一。本插件只列结构与原文,不据此断吉凶,也不补从儿、从强的原文。',
|
|
11507
|
+
},
|
|
11508
|
+
{
|
|
11509
|
+
id: 'bazi-tongguan',
|
|
11510
|
+
system: 'bazi', dims: ['overall', 'career'],
|
|
11511
|
+
gist: '两神相战要有中间一行接上,对峙才化成相生。',
|
|
11512
|
+
detail: '用神与忌神两行在局中各 ≥1.5 分、又正好相克时,五行里只有一行能接上:克方生它、它再生被克方(金克木则以水为关,土克水则以金为关)。滴天髓用织女、牛郎隔关相望作比,说「此关若通也,相邀入洞房」。本插件只按局中分量点出这一行,并写明它是不是忌神。',
|
|
11513
|
+
source: '《滴天髓》通神论·通关;五行生克为通行说',
|
|
11514
|
+
status: 'variant',
|
|
11515
|
+
note: '各家对「两神相战」取哪两神不一(有取日主与官杀、有取用神与忌神、有取局中最旺两行),本插件固定取「用神与克它的忌神,且两行各 ≥1.5 分」;通关一行只按五行生克唯一确定,不据此断吉凶,也不判通关之力是否够用。',
|
|
11516
|
+
},
|
|
10199
11517
|
|
|
10200
11518
|
{
|
|
10201
11519
|
id: 'ziwei-sanfang',
|
|
@@ -10305,10 +11623,10 @@ const KNOWLEDGE = [
|
|
|
10305
11623
|
id: 'liuyao-fushen',
|
|
10306
11624
|
system: 'liuyao', dims: ['overall'],
|
|
10307
11625
|
gist: '用神不上卦,就去本宫首卦的同位取伏神。',
|
|
10308
|
-
detail: '
|
|
11626
|
+
detail: '本卦六爻里没有用神那一类六亲,就叫用神不上卦。取法是回到本卦所属宫的首卦(八纯卦),找出该六亲所在的爻位,那一爻即伏神,本卦同一爻位上的爻叫飞神。伏神要「得出」才有用:飞神生伏神、伏神克飞神、日月生扶都算得力;飞神克伏神则受压难出。本插件给出伏神爻位、干支五行、飞伏生克,并按月建日辰归成四档出伏条件(可出 / 有助有压 / 受压难出 / 未得助);只判条件,不出应期日期。',
|
|
10309
11627
|
source: '《卜筮正宗》伏神章;《增删卜易》伏神篇',
|
|
10310
11628
|
status: 'variant',
|
|
10311
|
-
note: '
|
|
11629
|
+
note: '首卦里同一六亲也可能出现两次(如乾宫乾为天的父母在三爻与上爻),此时取哪一爻为伏神各家不一;本插件把候选都列出并标「伏神两现」,不代选。出伏条件的归并口径:飞生伏、伏克飞、日辰生/比和、月建旺/相算助,飞克伏、日辰克、月破算压;有助无压为「可出」,有助有压为「有助有压」,有压无助为「受压难出」,两者都无为「未得助」。四档只并列条件、不排各家优先级;旬空只标出,不并入档位。应期各家分歧更大,仍不输出日期。',
|
|
10312
11630
|
},
|
|
10313
11631
|
{
|
|
10314
11632
|
id: 'liuyao-yongshen-shuai',
|
|
@@ -10332,10 +11650,10 @@ const KNOWLEDGE = [
|
|
|
10332
11650
|
id: 'liuyao-yingqi',
|
|
10333
11651
|
system: 'liuyao', dims: ['overall', 'career'],
|
|
10334
11652
|
gist: '应期是「什么时候见分晓」,不是「哪天」。',
|
|
10335
|
-
detail: '
|
|
11653
|
+
detail: '近事以日计、远事以月计;常见取法是等用神逢值、逢冲、逢合之期,或等忌神受制之期。本插件只做前一半:把用神(不上卦则取伏神)的逢值、逢冲、逢合三支列出,旬空另标出空与冲空,再按月建五态给「偏速 / 偏缓 / 待解 / 未定」一个快慢方向;忌神受制与具体日期仍未做。应期法各家互有出入,同一卦不同取法可以差出很远,所以只作时间窗口的提示。',
|
|
10336
11654
|
source: '《卜筮正宗》应期章;《增删卜易》',
|
|
10337
11655
|
status: 'variant',
|
|
10338
|
-
note: '
|
|
11656
|
+
note: '应期取法(值日、冲、合、填实、旬空出空)各家优先级不同,本插件只并列触发支、不排先后,也不换算日期;近事以日计、远事以月计,用哪把尺由事情远近决定,不代选。',
|
|
10339
11657
|
},
|
|
10340
11658
|
{
|
|
10341
11659
|
id: 'liuyao-liushen',
|
|
@@ -10490,10 +11808,10 @@ const KNOWLEDGE = [
|
|
|
10490
11808
|
id: 'liuyao-yingqi-exact',
|
|
10491
11809
|
system: 'liuyao', dims: [],
|
|
10492
11810
|
gist: '具体应期(哪一天应验)本插件尚未推算。',
|
|
10493
|
-
detail: '
|
|
11811
|
+
detail: '应期需要综合用神旺衰、动变、旬空出空、日月冲合多层条件,且各家取法不同。当前只给时间窗口的方向性提示(逢值 / 逢冲 / 逢合的触发支,加一个快慢方向),不给具体日期——与其给一个看起来精确、实则拍脑袋的日子,不如留白。',
|
|
10494
11812
|
source: '待补:《卜筮正宗》应期章逐条实现 + 已录 128 条卦例对拍(源 138 条)',
|
|
10495
11813
|
status: 'todo',
|
|
10496
|
-
note: '扩展方向:用《卜筮正宗》卦例里有明确应验日期的条目做回归,先验证再输出。',
|
|
11814
|
+
note: '扩展方向:用《卜筮正宗》卦例里有明确应验日期的条目做回归,先验证再输出。0.50.0 已给出触发支与快慢方向,仍不输出日期。',
|
|
10497
11815
|
},
|
|
10498
11816
|
];
|
|
10499
11817
|
|
|
@@ -10514,10 +11832,390 @@ const STATUS_LABEL = {
|
|
|
10514
11832
|
return { KNOWLEDGE, knowledgeFor, caveatsFor, STATUS_LABEL };
|
|
10515
11833
|
})();
|
|
10516
11834
|
|
|
11835
|
+
__mods['ziwei-words'] = (function () {
|
|
11836
|
+
|
|
11837
|
+
const PALACE_FIELD = {
|
|
11838
|
+
命宫: { field: '你自己、性格与选择的出发点', ask: '我是个什么样的人、遇事怎么反应', drift: '整个人的状态与主见', huaJi: '容易对自己不满意,反复琢磨「是不是还不够好」' },
|
|
11839
|
+
兄弟: { field: '手足、同辈与合作', ask: '和同辈人怎么相处', drift: '同辈之间的支持与较劲', huaJi: '同辈之间容易有拉扯,合作前先把账算清楚' },
|
|
11840
|
+
夫妻: { field: '亲密关系与伴侣', ask: '感情里怎么相处', drift: '关系的温度与相处方式', huaJi: '感情里容易反复计较,越在意越觉得累' },
|
|
11841
|
+
子女: { field: '子女、晚辈与作品', ask: '和晚辈、和自己的创作怎么相处', drift: '照顾与创造', huaJi: '对子女或作品容易操心过头,投入多而见效慢' },
|
|
11842
|
+
财帛: { field: '赚钱方式与现金流', ask: '钱从哪来、留不留得住', drift: '进项与花销', huaJi: '钱上容易反复,进得来也容易散,先管现金再谈收益' },
|
|
11843
|
+
疾厄: { field: '身体底子与情绪出口', ask: '身体哪里要多留意', drift: '作息与身体的信号', huaJi: '情绪容易往身体上走,压力最先反映在睡眠与肠胃' },
|
|
11844
|
+
迁移: { field: '出门、环境与人缘', ask: '在外发展顺不顺', drift: '外部环境与人际机会', huaJi: '在外容易遇到消耗,换环境前先把代价想清楚' },
|
|
11845
|
+
交友: { field: '朋友、同事与部属', ask: '怎么识人、怎么带人', drift: '身边的人际圈', huaJi: '容易替别人操心、被人情拖住,帮人之前先给自己留余地' },
|
|
11846
|
+
官禄: { field: '事业方向与做事方式', ask: '做什么工作、怎么做事', drift: '工作与身份感', huaJi: '工作上容易反复调整方向,先把一件事做完再谈换' },
|
|
11847
|
+
田宅: { field: '家庭、住所与积累', ask: '安家、置产与家底', drift: '居住环境与家庭气氛', huaJi: '家里的事容易牵扯精力,置产与搬迁宜缓不宜急' },
|
|
11848
|
+
福德: { field: '精神享受与内在节奏', ask: '怎么让自己舒服、怎么放松', drift: '心境、兴趣与休息', huaJi: '想得多、放不下,休息也休息不踏实' },
|
|
11849
|
+
父母: { field: '长辈、上司与文书', ask: '和长辈上级的关系、文书合约', drift: '长辈缘与合同文书', huaJi: '与长辈上级容易有隔阂,文书合约要逐条看清' },
|
|
11850
|
+
};
|
|
11851
|
+
|
|
11852
|
+
const STAR_EXTRA = {
|
|
11853
|
+
紫微: { alias: '帝星', key: '尊', bright: '心里像有根定海针,遇事敢拍板,也压得住场面', dim: '容易端着架子,想法很多却不肯先低头', gift: '定方向、分主次、把人组织起来', watch: '面子与身段' },
|
|
11854
|
+
天机: { alias: '智星', key: '动', bright: '脑子快、点子多,变化里反而找得到路', dim: '想法多过行动,容易在犹豫里把时间耗掉', gift: '策划、推演、把复杂的事拆成步骤', watch: '想太多、坐不住' },
|
|
11855
|
+
太阳: { alias: '日主', key: '公', bright: '外放热心,愿意担事,也容易被看见', dim: '付出多、回报少,容易觉得不被认可', gift: '对外沟通、带头做事、把光照到别人身上', watch: '用力过度、忘了照顾自己' },
|
|
11856
|
+
武曲: { alias: '财星', key: '实', bright: '务实果决,认结果、扛得住硬活', dim: '容易只认数字,人情上显得生硬', gift: '算账、执行、把事做扎实', watch: '太硬、不给缓冲' },
|
|
11857
|
+
天同: { alias: '福星', key: '柔', bright: '脾气温和,能把紧张的气氛化开', dim: '容易贪舒服、事情拖着不动', gift: '协调、服务、让人放松下来', watch: '安逸与拖延' },
|
|
11858
|
+
廉贞: { alias: '囚星', key: '细', bright: '细腻又讲原则,做事有分寸', dim: '容易较真到钻牛角尖,情绪起伏也大', gift: '抓细节、守规矩、做需要精度的活', watch: '情绪郁结、过度执着' },
|
|
11859
|
+
天府: { alias: '库星', key: '稳', bright: '稳得住、会存会调度,是团队的压舱石', dim: '偏保守,机会来了也不敢动', gift: '守成、管资源、把局面稳住', watch: '求稳到错过时机' },
|
|
11860
|
+
太阴: { alias: '月主', key: '藏', bright: '心思细、耐得住,静下来能做深事', dim: '敏感多虑,情绪都藏在心里', gift: '研究、文案、需要长期专注的活', watch: '内耗与睡眠' },
|
|
11861
|
+
贪狼: { alias: '桃花', key: '贪', bright: '好奇、活络、人缘好,学什么都快', dim: '什么都想要,结果哪样都没做透', gift: '开拓、交际、把资源变成机会', watch: '边界与节制' },
|
|
11862
|
+
巨门: { alias: '暗星', key: '辩', bright: '口才与逻辑都好,靠说理就能服人', dim: '容易多疑,一句话能听出三层意思', gift: '谈判、教学、法务、需要辨析的活', watch: '言语是非与疑心' },
|
|
11863
|
+
天相: { alias: '印星', key: '辅', bright: '讲规矩、会协调,是让人放心的副手', dim: '容易迁就别人,委屈自己也不说', gift: '协调、执行、把流程跑顺', watch: '太在意别人怎么看' },
|
|
11864
|
+
天梁: { alias: '荫星', key: '荫', bright: '有长者气,能扛事、也愿意护着人', dim: '操心过度,替别人背了不该背的', gift: '顾问、教育、医护、替人排忧', watch: '管太多、放不下' },
|
|
11865
|
+
七杀: { alias: '将星', key: '决', bright: '果断敢冲,压力越大越顶得住', dim: '容易硬碰硬,把关系撞出裂痕', gift: '开拓、攻坚、从零打出一块地', watch: '急与硬' },
|
|
11866
|
+
破军: { alias: '耗星', key: '破', bright: '敢破敢立,旧局推得动、新局立得起', dim: '推翻了却重建不了,反复折腾', gift: '变革、重组、做从零到一的事', watch: '冲动与耗损' },
|
|
11867
|
+
};
|
|
11868
|
+
|
|
11869
|
+
const STAR_PAIR = {
|
|
11870
|
+
紫微天府: { gist: '尊贵加稳重:既想有位置,也守得住家底,适合在体系里往上走', watch: '别把稳做成不动' },
|
|
11871
|
+
紫微贪狼: { gist: '帝星带桃花:有格局也有玩心,门路多、欲望也多', watch: '兴趣铺太开,主次容易乱' },
|
|
11872
|
+
紫微天相: { gist: '帝星配印:权力与规矩并存,做事讲体面,也讲章法', watch: '太要好看,容易被形式拖住' },
|
|
11873
|
+
紫微七杀: { gist: '帝星加将星:气魄大、手腕硬,开得了局面', watch: '压得住人也容易压伤人' },
|
|
11874
|
+
紫微破军: { gist: '帝星带耗:敢于推倒重来,一生常有大的转身', watch: '代价是先破后立,破之前先备好退路' },
|
|
11875
|
+
天机太阴: { gist: '机月同宫:心思细、筹划深,适合幕后与会动脑子的活', watch: '算得太细,反而迟迟不动手' },
|
|
11876
|
+
天机巨门: { gist: '机巨同宫:头脑快、嘴也利,论辩是强项', watch: '话多容易生是非' },
|
|
11877
|
+
天机天梁: { gist: '机梁同宫:善谋又讲原则,常是出主意又担责任的人', watch: '替人想太多,累的是自己' },
|
|
11878
|
+
太阳太阴: { gist: '日月同宫:外放与内敛同时在身上,两种节奏互相拉扯', watch: '别自己跟自己打架' },
|
|
11879
|
+
太阳巨门: { gist: '日巨同宫:靠一张嘴把事说成,适合以表达与说服为业', watch: '说话直,容易得罪人' },
|
|
11880
|
+
太阳天梁: { gist: '阳梁同宫:热心又有长者气,助人型,容易被人依赖', watch: '别把别人的事全揽过来' },
|
|
11881
|
+
武曲天府: { gist: '武府同宫:会算也会守,财务与执行双强,稳中有实', watch: '只算眼前账,容易错过长线' },
|
|
11882
|
+
武曲贪狼: { gist: '武贪同宫:务实与欲望并存,传统说三十岁以后越走越开', watch: '先把本事磨厚,别急着要结果' },
|
|
11883
|
+
武曲天相: { gist: '武相同宫:讲效率也讲规矩,适合在大机构里做执行', watch: '规矩压得太死,手脚会绑住' },
|
|
11884
|
+
武曲七杀: { gist: '武杀同宫:硬碰硬的组合,冲劲足、压力也大', watch: '成事快,耗得也快' },
|
|
11885
|
+
武曲破军: { gist: '武破同宫:能打也能拆,适合攻坚与改革', watch: '聚散都快,留不住的要认' },
|
|
11886
|
+
天同太阴: { gist: '同阴同宫:温和细腻,重感受,适合安静一点的环境', watch: '太舒服就不想动' },
|
|
11887
|
+
天同巨门: { gist: '同巨同宫:想得软、说得直,容易在亲近的人面前失控', watch: '把话说软一点' },
|
|
11888
|
+
天同天梁: { gist: '同梁同宫:有福气也有长者缘,遇事常有人替你说句话', watch: '依赖久了会长不大' },
|
|
11889
|
+
廉贞天府: { gist: '廉府同宫:精细配稳重,守得住规矩也管得住资源', watch: '过分谨慎会错过窗口' },
|
|
11890
|
+
廉贞贪狼: { gist: '廉贪同宫:欲望与原则拉扯,才艺多、诱惑也多', watch: '重心要自己定,别被带着走' },
|
|
11891
|
+
廉贞天相: { gist: '廉相同宫:讲分寸、重体面,做事有章法', watch: '被规矩绑住手脚' },
|
|
11892
|
+
廉贞七杀: { gist: '廉杀同宫:刚烈果决,抗压强,敢碰难事', watch: '硬碰硬伤的是关系' },
|
|
11893
|
+
廉贞破军: { gist: '廉破同宫:敢于破局,变动多,适合在动荡里做事', watch: '变动要有节奏,别一直重来' },
|
|
11894
|
+
};
|
|
11895
|
+
|
|
11896
|
+
const SHA_STAR = {
|
|
11897
|
+
擎羊: { nature: '锐、直接、带冲撞', inPalace: '让这一宫的事来得急,容易有竞争与对抗', remind: '慢半拍再回应,别用人身去硬碰' },
|
|
11898
|
+
陀罗: { nature: '拖、磨、反复', inPalace: '让这一宫的事拖得久,越急越推不动', remind: '把大目标切成小段,靠节奏推进而不是靠爆发' },
|
|
11899
|
+
火星: { nature: '急、爆、来得快去得快', inPalace: '让这一宫的事突然发生,情绪也容易点着', remind: '起的当下先别做决定,隔一天再看' },
|
|
11900
|
+
铃星: { nature: '闷、记、往里烧', inPalace: '让这一宫的事闷着发酵,不说并不代表没有', remind: '把不满讲出来,比憋着省事' },
|
|
11901
|
+
地空: { nature: '抽离、落空', inPalace: '让这一宫的努力容易「看着有、抓不住」', remind: '重要的事留书面凭证,别只靠口头约定' },
|
|
11902
|
+
地劫: { nature: '耗、变动', inPalace: '让这一宫的资源容易在变动里流失', remind: '先设止损线,再谈投入' },
|
|
11903
|
+
天刑: { nature: '约束、规矩', inPalace: '这一宫容易受规则或外力约束', remind: '照流程走,别找捷径' },
|
|
11904
|
+
天姚: { nature: '吸引、暧昧', inPalace: '这一宫容易有人情与暧昧的牵扯', remind: '边界说清楚,别用含糊换方便' },
|
|
11905
|
+
咸池: { nature: '情欲、外缘', inPalace: '这一宫容易被外在的吸引牵动', remind: '分清一时心动与长期相处' },
|
|
11906
|
+
孤辰: { nature: '孤、独', inPalace: '这一宫的事常要自己扛', remind: '主动开口求援,不丢人' },
|
|
11907
|
+
寡宿: { nature: '淡、疏', inPalace: '这一宫的关系容易偏淡', remind: '关系要靠主动经营' },
|
|
11908
|
+
破碎: { nature: '碎、不整', inPalace: '这一宫的成果容易零散、难成整块', remind: '把事收尾收完整' },
|
|
11909
|
+
天哭: { nature: '忧、敏感', inPalace: '这一宫容易让人心里发紧', remind: '情绪来了先照顾好身体' },
|
|
11910
|
+
天虚: { nature: '虚、不实', inPalace: '这一宫容易雷声大雨点小', remind: '看落地证据,不看承诺' },
|
|
11911
|
+
};
|
|
11912
|
+
|
|
11913
|
+
const MAIN_SHA = ['擎羊', '陀罗', '火星', '铃星', '地空', '地劫'];
|
|
11914
|
+
|
|
11915
|
+
const FU_STAR = {
|
|
11916
|
+
左辅: { nature: '助力、帮手', gift: '这一宫容易有人搭把手', note: '多把事交出去,别一个人扛' },
|
|
11917
|
+
右弼: { nature: '援手、缓和', gift: '这一宫容易在关键处被接住', note: '接受帮助,也记得回礼' },
|
|
11918
|
+
文昌: { nature: '文书、条理', gift: '这一宫的书面与规划能力强', note: '把想法落成文档' },
|
|
11919
|
+
文曲: { nature: '才艺、口才', gift: '这一宫的表达与感受力好', note: '用表达换机会' },
|
|
11920
|
+
天魁: { nature: '明文贵人', gift: '这一宫容易遇到明面上的提携', note: '该争取的位置直接开口' },
|
|
11921
|
+
天钺: { nature: '暗助贵人', gift: '这一宫常有人在背后帮忙', note: '人情记着,早晚用得上' },
|
|
11922
|
+
禄存: { nature: '守财、积存', gift: '这一宫的东西守得住', note: '先存后花' },
|
|
11923
|
+
天马: { nature: '动、驿马', gift: '这一宫的事常与移动、外地有关', note: '动起来比原地等更有利' },
|
|
11924
|
+
台辅: { nature: '台面、名分', gift: '这一宫容易被摆到台面上', note: '露脸的机会别推' },
|
|
11925
|
+
封诰: { nature: '封赏、认证', gift: '这一宫的资质与头衔有用', note: '该考的证早点考' },
|
|
11926
|
+
红鸾: { nature: '喜事', gift: '这一宫容易有喜庆与好消息', note: '好消息要说出来' },
|
|
11927
|
+
天喜: { nature: '喜庆、人缘', gift: '这一宫的人缘与气氛好', note: '多参加场合' },
|
|
11928
|
+
龙池: { nature: '雅、工整', gift: '这一宫有审美与工整的一面', note: '把细节做好' },
|
|
11929
|
+
凤阁: { nature: '华、体面', gift: '这一宫讲究排场与观感', note: '该有的体面别省' },
|
|
11930
|
+
三台: { nature: '地位、层级', gift: '这一宫容易有位置感', note: '按层级办事' },
|
|
11931
|
+
八座: { nature: '席位、稳定', gift: '这一宫坐得稳', note: '守住已有的位置' },
|
|
11932
|
+
恩光: { nature: '恩、被赏识', gift: '这一宫容易被赏识', note: '把成果让人看见' },
|
|
11933
|
+
天贵: { nature: '贵气、身份', gift: '这一宫带一点贵气', note: '抬头挺胸,别自轻' },
|
|
11934
|
+
};
|
|
11935
|
+
|
|
11936
|
+
const HUA_READ = {
|
|
11937
|
+
禄: { key: '得', gist: '顺手、有人帮,做起来不费劲' },
|
|
11938
|
+
权: { key: '掌', gist: '要自己拿主意,也容易用力过猛' },
|
|
11939
|
+
科: { key: '名', gist: '带一层体面与名声,遇事多能收得漂亮' },
|
|
11940
|
+
忌: { key: '执', gist: '容易在意、反复,是心里放不下的那一块' },
|
|
11941
|
+
};
|
|
11942
|
+
|
|
11943
|
+
const BRIGHT_READ = {
|
|
11944
|
+
庙: { word: '得地', tone: 'good', plain: '长处放得开,几乎是本色出演' },
|
|
11945
|
+
旺: { word: '有力', tone: 'good', plain: '特点容易显出来,做事有底气' },
|
|
11946
|
+
得: { word: '尚可', tone: 'neutral', plain: '能用,需要一点外力配合' },
|
|
11947
|
+
利: { word: '中平', tone: 'neutral', plain: '长处与短板都在,看怎么用' },
|
|
11948
|
+
平: { word: '偏弱', tone: 'neutral', plain: '不太争得到位置,宜借势' },
|
|
11949
|
+
不: { word: '不得地', tone: 'bad', plain: '长处不容易使上,得多绕一步' },
|
|
11950
|
+
陷: { word: '失地', tone: 'bad', plain: '容易往负面走,更需要自觉' },
|
|
11951
|
+
};
|
|
11952
|
+
|
|
11953
|
+
const PATTERN_READ = {
|
|
11954
|
+
紫府同宫: { gist: '帝星与库星同坐命宫:格局稳、底气足,天生适合做统筹', advice: '别把稳做成保守,该出手时出手' },
|
|
11955
|
+
紫府朝垣: { gist: '紫微天府会照命宫:有贵气也有实力,环境一般不会太差', advice: '靠结构做事,别只靠个人硬撑' },
|
|
11956
|
+
君臣庆会: { gist: '紫微或天府坐命,又得左辅右弼魁钺会照:有人帮、有位置', advice: '把团队搭起来,别一个人扛' },
|
|
11957
|
+
极向离明: { gist: '紫微在午守命:处在最亮的位置,格局与声势都强', advice: '光环大,注意别把人压住' },
|
|
11958
|
+
七杀朝斗: { gist: '七杀在子午守命:杀伐果断,能在压力下成事', advice: '硬气用在事上,不用在关系上' },
|
|
11959
|
+
英星入庙: { gist: '破军在子午守命:敢破敢立,常能从零打出一片', advice: '破之后要有立,别只破不立' },
|
|
11960
|
+
石中隐玉: { gist: '巨门在子午守命:本事藏在里面,要靠机会慢慢磨出来', advice: '别因为一时不被看见就放弃' },
|
|
11961
|
+
巨日同宫: { gist: '巨门太阳同宫:靠表达与说服开路,越抛头露面越有利', advice: '话多的时候注意分寸' },
|
|
11962
|
+
日月夹命: { gist: '太阳太阴分居命宫两侧:内外两种力量都来帮你', advice: '一快一慢,别自己跟自己打架' },
|
|
11963
|
+
日月对照: { gist: '太阳太阴分守命迁:外放与内敛互为表里', advice: '换环境对你是加分项' },
|
|
11964
|
+
左右夹命: { gist: '左辅右弼夹命:关键处总有人搭手', advice: '主动求助,贵人才好使力' },
|
|
11965
|
+
昌曲夹命: { gist: '文昌文曲夹命:文书、考试、表达上占便宜', advice: '把才华落到作品与证书上' },
|
|
11966
|
+
魁钺夹命: { gist: '天魁天钺夹命:明暗两路都有人提携', advice: '机会来了别客气' },
|
|
11967
|
+
三奇嘉会: { gist: '化禄化权化科会于命宫三方:三样都到位,是标准的顺局', advice: '别把顺境当常态,留一手' },
|
|
11968
|
+
双禄朝垣: { gist: '禄存与化禄同会命宫三方:进项与积累两头都有', advice: '存下来的才算数' },
|
|
11969
|
+
府相朝垣: { gist: '天府天相会于命宫三方:稳当、讲规矩,适合体系内发展', advice: '按流程走,别嫌慢' },
|
|
11970
|
+
禄马交驰: { gist: '禄存与天马同宫或对照:动中得财,越跑越有', advice: '别在原地等机会' },
|
|
11971
|
+
月朗天门: { gist: '太阴在亥守命:心思澄明,适合做需要静气的事', advice: '把敏感用在专业上,别用在揣测上' },
|
|
11972
|
+
日出扶桑: { gist: '太阳在卯守命:正当升起的位置,势头好、人也敞亮', advice: '趁势做事,别等' },
|
|
11973
|
+
机月同梁: { gist: '天机太阴天梁会命:动脑、静气、长者缘齐备,适合稳定的专业路线', advice: '少折腾,深耕一门' },
|
|
11974
|
+
武贪同行: { gist: '武曲贪狼同宫:务实与欲望并存,传统说三十岁后越走越开', advice: '先把本事磨厚,别急着要结果' },
|
|
11975
|
+
命无正曜: { gist: '命宫无主星:性格由环境与对宫塑造,适应力是你的长处', advice: '选对环境比选对方法更要紧' },
|
|
11976
|
+
杀破狼: { gist: '七杀破军贪狼会命:一生变动多、节奏快,适合在动荡里做事', advice: '把变动变成主动选择,而不是被动应付' },
|
|
11977
|
+
双禄交流: { gist: '禄存与化禄相对:财路两头通', advice: '现金流要管好,小心两头都花' },
|
|
11978
|
+
火贪铃贪: { gist: '贪狼遇火星或铃星:爆发型的组合,机会来得猛', advice: '机会来时别犹豫,走时别恋战' },
|
|
11979
|
+
火铃夹命: { gist: '火星铃星分居命宫两侧:情绪容易被点着,也容易被消耗', advice: '先把火气压一压,事就顺一半' },
|
|
11980
|
+
羊陀夹命: { gist: '禄存守命、擎羊陀罗前后夹之:位置稳,但四周都是压力', advice: '守得住就别急着动' },
|
|
11981
|
+
羊陀夹忌: { gist: '化忌与禄存同宫、羊陀夹之:传统里最需要留意的一类结构', advice: '那件事慢一点,让别人先动' },
|
|
11982
|
+
铃昌陀武: { gist: '铃星文昌陀罗武曲会于命宫三方:想法多、爱走弯路,容易自己把自己绊住', advice: '做决定前先写下来,隔一夜再定' },
|
|
11983
|
+
命里逢空: { gist: '地空地劫会命:计划常有意外的抽离,落袋才算数', advice: '留凭证、留退路' },
|
|
11984
|
+
马头带箭: { gist: '擎羊在午守命:锋芒极盛,成事快、伤人也不慢', advice: '冲劲用在攻坚,不用在争输赢' },
|
|
11985
|
+
天罗地网: { gist: '命宫在辰戌:天罗地网,走的是有限制的路', advice: '在框里做出成绩,别硬撞框' },
|
|
11986
|
+
刑囚夹印: { gist: '廉贞天相同守命宫于子午又遇擎羊:规则与冲撞同时压过来', advice: '循规蹈矩是保命符' },
|
|
11987
|
+
泛水桃花: { gist: '贪狼在子守命:才情与情缘都旺,重心容易散', advice: '给自己立一条不越的线' },
|
|
11988
|
+
};
|
|
11989
|
+
|
|
11990
|
+
const PALACE_ALIAS = { 奴仆: '交友', 奴仆宫: '交友', 事业: '官禄', 事业宫: '官禄' };
|
|
11991
|
+
function palaceFieldOf(name) {
|
|
11992
|
+
const key = PALACE_ALIAS[String(name || '')] || String(name || '');
|
|
11993
|
+
return PALACE_FIELD[key] || null;
|
|
11994
|
+
}
|
|
11995
|
+
|
|
11996
|
+
function brightRead(level) {
|
|
11997
|
+
return BRIGHT_READ[String(level || '')] || null;
|
|
11998
|
+
}
|
|
11999
|
+
|
|
12000
|
+
function starExtraOf(name) {
|
|
12001
|
+
return STAR_EXTRA[String(name || '')] || null;
|
|
12002
|
+
}
|
|
12003
|
+
|
|
12004
|
+
function starPairOf(mainStars) {
|
|
12005
|
+
const list = (Array.isArray(mainStars) ? mainStars : []).filter(Boolean);
|
|
12006
|
+
if (list.length !== 2) return null;
|
|
12007
|
+
return STAR_PAIR[list.join('')] || STAR_PAIR[list.slice().reverse().join('')] || null;
|
|
12008
|
+
}
|
|
12009
|
+
|
|
12010
|
+
function huaInLine(type, palace) {
|
|
12011
|
+
const f = palaceFieldOf(palace);
|
|
12012
|
+
const h = HUA_READ[type];
|
|
12013
|
+
if (!f || !h) return '';
|
|
12014
|
+
if (type === '忌') return `化忌入${palace}:${f.huaJi}`;
|
|
12015
|
+
const tail = {
|
|
12016
|
+
禄: `${f.field}上来路顺、有人递梯子`,
|
|
12017
|
+
权: `${f.field}上你会想自己拿主意,也容易用力过猛`,
|
|
12018
|
+
科: `${f.field}上体面与名声会帮到你`,
|
|
12019
|
+
}[type];
|
|
12020
|
+
return tail ? `化${type}入${palace}:${tail}` : '';
|
|
12021
|
+
}
|
|
12022
|
+
|
|
12023
|
+
function shaLineOf(names) {
|
|
12024
|
+
const list = (Array.isArray(names) ? names : []).filter((n) => SHA_STAR[n]);
|
|
12025
|
+
if (!list.length) return '';
|
|
12026
|
+
const parts = list.slice(0, 3).map((n) => `${n}(${SHA_STAR[n].nature})${SHA_STAR[n].inPalace}`);
|
|
12027
|
+
const remind = list.length === 1 ? SHA_STAR[list[0]].remind : '先处理最急的那一件,其余的会跟着松动';
|
|
12028
|
+
return `${parts.join(';')}。做法上:${remind}。`;
|
|
12029
|
+
}
|
|
12030
|
+
|
|
12031
|
+
function shaNatureOf(names) {
|
|
12032
|
+
return (Array.isArray(names) ? names : [])
|
|
12033
|
+
.map((n) => SHA_STAR[n] && SHA_STAR[n].nature)
|
|
12034
|
+
.filter(Boolean)
|
|
12035
|
+
.join('、');
|
|
12036
|
+
}
|
|
12037
|
+
|
|
12038
|
+
function fuLineOf(names) {
|
|
12039
|
+
const list = (Array.isArray(names) ? names : []).filter((n) => FU_STAR[n]);
|
|
12040
|
+
if (!list.length) return '';
|
|
12041
|
+
return list.slice(0, 3).map((n) => `${n}${FU_STAR[n].gift.replace(/^这一宫/, '')}`).join(',');
|
|
12042
|
+
}
|
|
12043
|
+
|
|
12044
|
+
function patternReadOf(name, tone) {
|
|
12045
|
+
const hit = PATTERN_READ[String(name || '')];
|
|
12046
|
+
if (hit) return hit;
|
|
12047
|
+
if (tone === 'good') return { gist: '结构偏向有利,具体落在哪件事,要看它牵动的是哪一宫', advice: '顺势把事情做完整' };
|
|
12048
|
+
if (tone === 'bad') return { gist: '结构偏向消耗,提示这一块值得多一分留意', advice: '先把节奏放缓,再谈取舍' };
|
|
12049
|
+
return { gist: '结构中性,成事与否更多看后天怎么用', advice: '当成提醒,不当成结论' };
|
|
12050
|
+
}
|
|
12051
|
+
|
|
12052
|
+
return { PALACE_FIELD, STAR_EXTRA, STAR_PAIR, SHA_STAR, MAIN_SHA, FU_STAR, HUA_READ, BRIGHT_READ, PATTERN_READ, palaceFieldOf, brightRead, starExtraOf, starPairOf, huaInLine, shaLineOf, shaNatureOf, fuLineOf, patternReadOf };
|
|
12053
|
+
})();
|
|
12054
|
+
|
|
12055
|
+
__mods['bazi-words'] = (function () {
|
|
12056
|
+
|
|
12057
|
+
const STEM_PORTRAIT = {
|
|
12058
|
+
甲: {
|
|
12059
|
+
image: '参天之木',
|
|
12060
|
+
look: '身形多半偏修长,肩背挺,站着有股站相',
|
|
12061
|
+
temper: '直、有担当,认定的事不太会转弯',
|
|
12062
|
+
gift: '扛得起事,适合把一摊子组织起来',
|
|
12063
|
+
trap: '不会转弯,撞上南墙也硬顶',
|
|
12064
|
+
},
|
|
12065
|
+
乙: {
|
|
12066
|
+
image: '藤萝之木',
|
|
12067
|
+
look: '身形柔韧,气质亲和,不太有攻击性',
|
|
12068
|
+
temper: '柔中带韧,擅长借力,能屈能伸',
|
|
12069
|
+
gift: '协调、渗透,在缝隙里也能生长',
|
|
12070
|
+
trap: '太依赖环境,环境一换就慌',
|
|
12071
|
+
},
|
|
12072
|
+
丙: {
|
|
12073
|
+
image: '太阳之火',
|
|
12074
|
+
look: '面色偏红润,精神足,进门容易被注意到',
|
|
12075
|
+
temper: '外放热情,心里想什么脸上就写着什么',
|
|
12076
|
+
gift: '感染人、带动气氛,适合站到台前',
|
|
12077
|
+
trap: '三分钟热度,来得快去得也快',
|
|
12078
|
+
},
|
|
12079
|
+
丁: {
|
|
12080
|
+
image: '灯烛之火',
|
|
12081
|
+
look: '偏清瘦,眼神亮,动静之间有点静气',
|
|
12082
|
+
temper: '内敛细腻,认准一件事能守很久',
|
|
12083
|
+
gift: '专注、耐得住,适合做需要磨的活',
|
|
12084
|
+
trap: '敏感,容易在心里反复内耗',
|
|
12085
|
+
},
|
|
12086
|
+
戊: {
|
|
12087
|
+
image: '城墙之土',
|
|
12088
|
+
look: '骨架偏厚,给人稳当、压得住场的感觉',
|
|
12089
|
+
temper: '沉稳慢热,不轻易表态,表态了就算数',
|
|
12090
|
+
gift: '承载与守成,能把局面稳稳托住',
|
|
12091
|
+
trap: '太钝,机会过了才反应过来',
|
|
12092
|
+
},
|
|
12093
|
+
己: {
|
|
12094
|
+
image: '田园之土',
|
|
12095
|
+
look: '面目温和,身形圆润,没什么棱角',
|
|
12096
|
+
temper: '包容细致,想得多,习惯先照顾别人',
|
|
12097
|
+
gift: '经营与服务,把琐碎的事理顺',
|
|
12098
|
+
trap: '纠结,反复权衡反而错过时机',
|
|
12099
|
+
},
|
|
12100
|
+
庚: {
|
|
12101
|
+
image: '刀剑之金',
|
|
12102
|
+
look: '骨架硬朗,气场直接,说话不绕弯',
|
|
12103
|
+
temper: '果决、讲义气,眼里容不下拖泥带水',
|
|
12104
|
+
gift: '执行与开疆,难啃的骨头敢接',
|
|
12105
|
+
trap: '太刚,锋利的一面容易伤到亲近的人',
|
|
12106
|
+
},
|
|
12107
|
+
辛: {
|
|
12108
|
+
image: '珠玉之金',
|
|
12109
|
+
look: '清秀讲究,衣着细节看得出用心',
|
|
12110
|
+
temper: '精致敏锐,对分寸与体面很在意',
|
|
12111
|
+
gift: '审美与精细活,做得比说的好',
|
|
12112
|
+
trap: '挑剔,也容易被一句评价刺到',
|
|
12113
|
+
},
|
|
12114
|
+
壬: {
|
|
12115
|
+
image: '江河之水',
|
|
12116
|
+
look: '身形偏厚实,眉眼开阔,气度大',
|
|
12117
|
+
temper: '大开大合,爱自由,不喜欢被框住',
|
|
12118
|
+
gift: '统筹与流动,能把资源盘活',
|
|
12119
|
+
trap: '散漫,摊子铺开却收不回来',
|
|
12120
|
+
},
|
|
12121
|
+
癸: {
|
|
12122
|
+
image: '雨露之水',
|
|
12123
|
+
look: '清秀安静,存在感不抢,但耐看',
|
|
12124
|
+
temper: '细腻、直觉强,心事多半自己消化',
|
|
12125
|
+
gift: '感知与研究,能注意到别人漏掉的细节',
|
|
12126
|
+
trap: '多愁,遇事先退,容易错过表态的时机',
|
|
12127
|
+
},
|
|
12128
|
+
};
|
|
12129
|
+
|
|
12130
|
+
const TENGOD_PORTRAIT = {
|
|
12131
|
+
正官: { role: '规则与名分', gift: '守序可靠,答应的事会做到', trap: '太在意评价,放不开手脚', love: '重承诺,但不擅长把在意说出口', work: '适合在成体系的组织里按层级上升' },
|
|
12132
|
+
七杀: { role: '压力与冲劲', gift: '抗压强、敢担事,越难越来劲', trap: '急躁,习惯用硬碰解决问题', love: '容易被有主见的人吸引,也容易互相较劲', work: '适合高挑战、要快速决断的岗位' },
|
|
12133
|
+
正财: { role: '稳定收入与责任', gift: '务实会积累,账目清楚', trap: '算得太细,不敢为机会冒一点险', love: '重实际,用行动多于言语', work: '适合按劳取酬、积累型的路径' },
|
|
12134
|
+
偏财: { role: '机会与流动资源', gift: '善抓机会、人脉活络', trap: '铺得太开,钱和精力都容易留不住', love: '大方、桃花多,边界要自己划', work: '适合业务、投资、资源整合' },
|
|
12135
|
+
食神: { role: '表达与享受', gift: '会生活,也能把喜欢的事做成产出', trap: '太舒服就懒下来,节奏一松就拖', love: '温柔会照顾人,也怕麻烦', work: '适合技术、创作、餐饮、教育' },
|
|
12136
|
+
伤官: { role: '才华与不服', gift: '点子多、敢改,能做出别人做不出的东西', trap: '嘴上不饶人,赢了道理输了关系', love: '要求高,容易挑对方的刺', work: '适合改革、创意、专业型岗位' },
|
|
12137
|
+
正印: { role: '支持与学习', gift: '有耐心、学得进,靠得住', trap: '依赖心重,想得多做得少', love: '需要被理解与照顾', work: '适合研究、文教、需要资质的岗位' },
|
|
12138
|
+
偏印: { role: '偏门与钻研', gift: '冷门的门类也能钻透', trap: '孤,想法多但不爱解释', love: '需要空间,不喜欢被管', work: '适合专精技术、冷门专业' },
|
|
12139
|
+
比肩: { role: '同伴与自我', gift: '独立、扛得住,不轻易麻烦别人', trap: '固执,什么都想亲力亲为', love: '相处像朋友多过像恋人', work: '适合并肩作战或独立负责一块' },
|
|
12140
|
+
劫财: { role: '竞争与行动', gift: '行动快、敢抢,机会面前不犹豫', trap: '冲动,容易在钱和人情上破口', love: '来去都快,需要给彼此空间', work: '适合业务冲刺、竞争型岗位' },
|
|
12141
|
+
|
|
12142
|
+
比劫: { role: '自我与同辈', gift: '独立、扛得住,不太依赖别人', trap: '固执,什么都想自己来', love: '相处像并肩的伙伴', work: '适合独立负责一块,或与同频的人并肩' },
|
|
12143
|
+
食伤: { role: '表达与产出', gift: '有想法,也做得出东西', trap: '话多或要求高,容易得罪人', love: '重视交流,也容易挑刺', work: '适合创作、技术、教学这类要表达的岗位' },
|
|
12144
|
+
财: { role: '资源与现实', gift: '务实、会算账、抓得住机会', trap: '把安全感全押在数字上', love: '重实际,用行动多于言语', work: '适合业务、财务、资源整合' },
|
|
12145
|
+
官杀: { role: '规则与压力', gift: '守序、抗压、担得起责任', trap: '绷得太紧,习惯用硬碰解决', love: '重承诺,也容易管得太宽', work: '适合体系内按层级上升,或高压高挑战的岗位' },
|
|
12146
|
+
印: { role: '支持与学习', gift: '有耐心、学得进、靠得住', trap: '想得多做得少,依赖现成的东西', love: '需要被理解与照顾', work: '适合研究、文教、需要资质的岗位' },
|
|
12147
|
+
};
|
|
12148
|
+
|
|
12149
|
+
const FRAME_TONE = {
|
|
12150
|
+
强: {
|
|
12151
|
+
泄: '这盘的问题是「力气有余、出口不够」:不缺劲头,缺的是把劲往哪使。先把方向定下来,比再多加一把力更管用。',
|
|
12152
|
+
制: '这盘气足又带压力:能扛事,但也容易一直绷着。学会把压力分出去,比硬顶更能长久。',
|
|
12153
|
+
耗: '这盘底子厚,适合在资源与实务上做文章:把力气换成看得见的成果,别停在想法里。',
|
|
12154
|
+
},
|
|
12155
|
+
弱: {
|
|
12156
|
+
生: '这盘底子偏薄,靠「有人托一把」最有效:找对平台、师友与环境,比自己硬撑省力得多。',
|
|
12157
|
+
比: '这盘单打独斗会累,找到同频的人并肩做,反而能把短板补上。',
|
|
12158
|
+
泄: '这盘不宜再往外耗,先收一收摊子,把根基补稳,再谈扩张。',
|
|
12159
|
+
},
|
|
12160
|
+
中: {
|
|
12161
|
+
default: '这盘五行相对均衡,没有哪一处特别极端:走哪条路都能走,靠的是选择与坚持,不是运气。',
|
|
12162
|
+
},
|
|
12163
|
+
};
|
|
12164
|
+
|
|
12165
|
+
function frameToneOf(level, favorRoles) {
|
|
12166
|
+
const strong = /强/.test(String(level || ''));
|
|
12167
|
+
const weak = /弱/.test(String(level || ''));
|
|
12168
|
+
const roles = Array.isArray(favorRoles) ? favorRoles : [String(favorRoles || '')];
|
|
12169
|
+
if (!strong && !weak) return FRAME_TONE.中.default;
|
|
12170
|
+
const table = strong ? FRAME_TONE.强 : FRAME_TONE.弱;
|
|
12171
|
+
for (const r of roles) {
|
|
12172
|
+
const key = /官杀/.test(r) ? '制'
|
|
12173
|
+
: /财/.test(r) ? '耗'
|
|
12174
|
+
: /食伤/.test(r) ? '泄'
|
|
12175
|
+
: /印/.test(r) ? '生'
|
|
12176
|
+
: /比劫/.test(r) ? '比' : '';
|
|
12177
|
+
if (key && table[key]) return table[key];
|
|
12178
|
+
}
|
|
12179
|
+
return strong ? table.泄 : table.生;
|
|
12180
|
+
}
|
|
12181
|
+
|
|
12182
|
+
const RELATION_RULES = [
|
|
12183
|
+
[/自刑/, '自刑:自己跟自己较劲,多半是内耗而不是外来的事'],
|
|
12184
|
+
[/三会|三合/, '三合三会:几股力并成一股,做同类的事更容易成势'],
|
|
12185
|
+
[/六合|合/, '合:人事上容易谈拢,也容易被关系绑住、脱不开身'],
|
|
12186
|
+
[/相冲|冲/, '冲:桩子会晃,变动与拉扯偏多,宜先稳住再动'],
|
|
12187
|
+
[/相刑|刑/, '刑:规矩与情绪上的摩擦,事情不大但磨人'],
|
|
12188
|
+
[/相害|害/, '害:暗处的损耗,多是说不清的不顺'],
|
|
12189
|
+
[/相破|破/, '破:本来成形的事容易散,收尾要多花一分力'],
|
|
12190
|
+
];
|
|
12191
|
+
|
|
12192
|
+
function relationNotes(list) {
|
|
12193
|
+
const out = [];
|
|
12194
|
+
for (const raw of (Array.isArray(list) ? list : [])) {
|
|
12195
|
+
for (const [re, note] of RELATION_RULES) {
|
|
12196
|
+
if (re.test(raw) && !out.includes(note)) { out.push(note); break; }
|
|
12197
|
+
}
|
|
12198
|
+
}
|
|
12199
|
+
return out;
|
|
12200
|
+
}
|
|
12201
|
+
|
|
12202
|
+
function godPortraitOf(name) {
|
|
12203
|
+
return TENGOD_PORTRAIT[String(name || '')] || null;
|
|
12204
|
+
}
|
|
12205
|
+
|
|
12206
|
+
function stemPortraitOf(stem) {
|
|
12207
|
+
return STEM_PORTRAIT[String(stem || '')] || null;
|
|
12208
|
+
}
|
|
12209
|
+
|
|
12210
|
+
return { STEM_PORTRAIT, TENGOD_PORTRAIT, FRAME_TONE, frameToneOf, relationNotes, godPortraitOf, stemPortraitOf };
|
|
12211
|
+
})();
|
|
12212
|
+
|
|
10517
12213
|
__mods.interpret = (function () {
|
|
10518
12214
|
|
|
10519
12215
|
const { HEX64, HEX_BY_CORE, TRIGRAM, YAO_POSITION, MOVING_NATURE, ZIWEI_STARS, WUXING_INDUSTRY, WUXING_ORGAN, TENGOD_STYLE, LIUREN_JIANG, TAROT_ELEMENT_FOCUS, DISCLAIMER } = __mods['interpret-data'];
|
|
10520
12216
|
const { MUTAGEN } = __mods.ziwei;
|
|
12217
|
+
const { palaceFieldOf, starExtraOf, starPairOf, brightRead, huaInLine, shaLineOf, shaNatureOf, fuLineOf, patternReadOf, MAIN_SHA } = __mods['ziwei-words'];
|
|
12218
|
+
const { stemPortraitOf, godPortraitOf, frameToneOf, relationNotes } = __mods['bazi-words'];
|
|
10521
12219
|
const { bodyLabels, yongshenOf } = __mods.liuyao;
|
|
10522
12220
|
|
|
10523
12221
|
const DIMENSIONS = [
|
|
@@ -10560,7 +12258,7 @@ function askOf(opts) {
|
|
|
10560
12258
|
question,
|
|
10561
12259
|
direction: d.key,
|
|
10562
12260
|
directionLabel: d.label,
|
|
10563
|
-
echo: `问题:${question
|
|
12261
|
+
echo: question ? `问题:${question} | 询问方向:${d.label}` : `询问方向:${d.label}`,
|
|
10564
12262
|
};
|
|
10565
12263
|
}
|
|
10566
12264
|
|
|
@@ -10787,8 +12485,66 @@ function baziInterpret(r) {
|
|
|
10787
12485
|
},
|
|
10788
12486
|
];
|
|
10789
12487
|
|
|
12488
|
+
const stemP = stemPortraitOf(dm.stem);
|
|
12489
|
+
const topP = godPortraitOf(topName);
|
|
12490
|
+
const secondP = godPortraitOf(secondName);
|
|
12491
|
+
const season = st.parts && st.parts.season ? st.parts.season : null;
|
|
12492
|
+
const dayZhi = pick(r.pillars?.day, 'branch', '');
|
|
12493
|
+
const byGodSorted = Object.entries(isObj(frame.godStats?.byGod) ? frame.godStats.byGod : {})
|
|
12494
|
+
.filter(([, v]) => Number(v) > 0)
|
|
12495
|
+
.sort((a, b) => b[1] - a[1]);
|
|
12496
|
+
const topGodName = byGodSorted[0] ? byGodSorted[0][0] : '';
|
|
12497
|
+
const topGodP = godPortraitOf(topGodName);
|
|
12498
|
+
const favorRolesByWeight = (Array.isArray(ys.favorRoles) ? ys.favorRoles : [])
|
|
12499
|
+
.slice()
|
|
12500
|
+
.sort((a, b) => (Number(groups[b]) || 0) - (Number(groups[a]) || 0));
|
|
12501
|
+
|
|
12502
|
+
const frameworkText = [
|
|
12503
|
+
`**日主**:${dm.stem}${dm.element}(${dm.yinYang}${dm.element})${season ? `生于${season.branch}月,日主在月令「${season.word}」` : ''},命局${level}(${pick(st, 'score', '—')} 分)${stemP ? `——${stemP.image}之象` : ''}。`,
|
|
12504
|
+
`**用神**:喜${join(favor) || '—'}(${join(ys.favorRoles || []) || '—'}),忌${join(avoid) || '—'}(${join(ys.avoidRoles || []) || '—'})。${frameToneOf(level, favorRolesByWeight)}`,
|
|
12505
|
+
`**格局**:${primary}(${pick(frame.primary, 'evidence', '')})${(Array.isArray(frame.geju) ? frame.geju : []).filter((g) => g.name && g.name !== primary).length
|
|
12506
|
+
? `,另有${frame.geju.map((g) => g.name).filter((n) => n && n !== primary).join('、')}`
|
|
12507
|
+
: ''}。`,
|
|
12508
|
+
].join('\n');
|
|
12509
|
+
|
|
12510
|
+
const portraitText = [
|
|
12511
|
+
`**外在取象**:${stemP ? `${stemP.image}的日主,传统取象上${stemP.look}` : '这一柱的取象词库未覆盖'}${stemP ? `;气质上${stemP.temper}` : ''}。这一层只是取象,不作定论。`,
|
|
12512
|
+
`**性格底色**:十神里${topName || '—'}最重${top[0] ? `(${top[0][1]})` : ''}${secondName ? `,${secondName}次之` : ''}。${topP ? `${topP.gift};${topP.trap}。` : ''}`
|
|
12513
|
+
+ (topGodP && topGodName && topGodName !== topName ? `具体到单颗,${topGodName}最显,落在「${topGodP.role}」上。` : '')
|
|
12514
|
+
+ (stemP ? `放在${dm.stem}日主身上,长处是「${stemP.gift}」,容易踩的坑是「${stemP.trap}」。` : ''),
|
|
12515
|
+
`**事业与家庭**:${topP ? `做事上${topP.work}` : '做事方式看喜用与时运'}${topP ? `;感情里${topP.love}。` : '。'}日支${dayZhi}${pick(r.pillars?.day, 'zizuo', '') ? `坐${pick(r.pillars?.day, 'zizuo', '')}` : ''},${Number(groups[spouseKey] || 0) >= 2 ? '配偶星不弱,关系里你有条件被好好对待,也要留意别把这些当成理所当然' : '配偶星偏轻,感情更需要主动经营'}。${secondP ? `另一面是${secondName}的${secondP.role}:${secondP.gift}。` : ''}`,
|
|
12516
|
+
].join('\n');
|
|
12517
|
+
|
|
12518
|
+
const yearLines = (r.liunian || []).slice(0, 3).map((l) => {
|
|
12519
|
+
const lk = isObj(l.luck) ? l.luck : {};
|
|
12520
|
+
const notes = relationNotes(l.relations);
|
|
12521
|
+
const why = (lk.reasons || []).slice(0, 2).join(',');
|
|
12522
|
+
return `**${l.year} ${l.ganzhi}**(${l.age}岁·${l.stemTenGod || '—'})${lk.tier || '平'}:${why || '没有特别信号,按大运的基调走'}${notes.length ? `;与命局的关系——${notes.join(';')}` : ''}。`;
|
|
12523
|
+
}).join('\n');
|
|
12524
|
+
const yearsText = yearLines
|
|
12525
|
+
? `先看眼前三年(大字是当年干支与十神,后面是该年的档位与理由):\n${yearLines}\n读法:档位说的是「这一年顺不顺手」,不是「会发生什么」;年份不顺时把重要动作挪到顺的年份,比硬扛更省事。`
|
|
12526
|
+
: '流年数据未取到,暂不展开。';
|
|
12527
|
+
|
|
12528
|
+
const adviceItems = [];
|
|
12529
|
+
if (favor.length) {
|
|
12530
|
+
adviceItems.push(`把生活与工作往${join(favor)}的方向挪一点:${favor.slice(0, 2).map((e) => WUXING_INDUSTRY[e] || '').filter(Boolean).join(';') || '按喜用五行对应的行业挑'}。不必推倒重来,先从环境、圈子和日常习惯改起。`);
|
|
12531
|
+
}
|
|
12532
|
+
if (avoid.length) {
|
|
12533
|
+
adviceItems.push(`对${join(avoid)}保持一点自觉:不是不能碰,而是别在关键决定上给它加码——${avoid.includes('火') ? '少在情绪最热的时候拍板' : avoid.includes('木') ? '少在想法最多的时候开工' : '先把手上的事收尾再谈新的'}。`);
|
|
12534
|
+
}
|
|
12535
|
+
const relNotes = relationNotes(r.relations && r.relations.branches);
|
|
12536
|
+
if (relNotes.length) {
|
|
12537
|
+
adviceItems.push(`命局里的地支关系是「${(r.relations.branches || []).join('、')}」:${relNotes.join(';')}。对应到具体人事,先处理情绪,再处理事情。`);
|
|
12538
|
+
}
|
|
12539
|
+
if (cli && cli.need) {
|
|
12540
|
+
adviceItems.push(`调候要${cli.need.stem}${cli.need.element}:${cli.need.why}。落到日常,就是往这一类的环境、作息与节奏上靠。`);
|
|
12541
|
+
}
|
|
12542
|
+
const adviceText = adviceItems.slice(0, 4).map((t, i) => `${'①②③④'[i]} ${t}`).join('\n');
|
|
12543
|
+
|
|
10790
12544
|
const sections = [
|
|
10791
12545
|
...(cross.length ? [{ key: 'cross', label: '交叉判断', text: cross.join(' ') }] : []),
|
|
12546
|
+
{ key: 'framework', label: '命局框架', text: frameworkText },
|
|
12547
|
+
{ key: 'portrait', label: '画像', text: portraitText },
|
|
10792
12548
|
{
|
|
10793
12549
|
key: 'reasoning', label: '看盘顺序',
|
|
10794
12550
|
text: [
|
|
@@ -10802,6 +12558,19 @@ function baziInterpret(r) {
|
|
|
10802
12558
|
`⑤ 落到维度:工作看喜用五行与十神权重;感情看配偶星与日支;健康看最旺与最弱的五行。五维度都只是这套推导的应用,不是另一套算法。`,
|
|
10803
12559
|
].join('\n'),
|
|
10804
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
|
+
})()] : []),
|
|
10805
12574
|
{
|
|
10806
12575
|
key: 'timeline', label: '时间窗',
|
|
10807
12576
|
text: (() => {
|
|
@@ -10818,8 +12587,12 @@ function baziInterpret(r) {
|
|
|
10818
12587
|
return `${jiaoLine}当前大运:${pick(cur, 'ganzhi', '—')}(${curSpan})。后续两步:${nextTwo}。\n近五年流年:${years || '—'}。\n读法:大运管"这十年的大环境",流年管"今年的具体天气";两者打架时,以能否动到用神为准。`;
|
|
10819
12588
|
})(),
|
|
10820
12589
|
},
|
|
12590
|
+
{ key: 'years', label: '流年时间轴', text: yearsText },
|
|
12591
|
+
{ key: 'advice', label: '专业建议', text: adviceText },
|
|
10821
12592
|
(() => {
|
|
10822
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}` : '';
|
|
10823
12596
|
return {
|
|
10824
12597
|
key: 'suiyun', label: '岁运提示',
|
|
10825
12598
|
text: hits.length
|
|
@@ -10827,7 +12600,7 @@ function baziInterpret(r) {
|
|
|
10827
12600
|
const stem = (l.suiyun.dayun || []).map((d) => `第${d.step}步${d.ganzhi}`).join('、');
|
|
10828
12601
|
return `${l.year} ${l.ganzhi}(${stem || '未到起运'}):${l.suiyun.signals.map((s) => s.detail).join(';')}`;
|
|
10829
12602
|
}).join('\n') +
|
|
10830
|
-
'\n读法:岁运并临、运年反吟与流年伏吟/反吟只说明干支层面重复或对冲,传统上当作「变动感较强」的信号;本插件不据此判吉凶,要落到具体年份,仍看该年是否动到用神。'
|
|
12603
|
+
'\n读法:岁运并临、运年反吟与流年伏吟/反吟只说明干支层面重复或对冲,传统上当作「变动感较强」的信号;本插件不据此判吉凶,要落到具体年份,仍看该年是否动到用神。' + src
|
|
10831
12604
|
: '近十年没有岁运并临、运年反吟或流年伏吟/反吟。「岁运并临主大凶」这类说法流传很广,本插件只把它当变动提示,没有命中就不作额外解读。',
|
|
10832
12605
|
};
|
|
10833
12606
|
})(),
|
|
@@ -10994,12 +12767,21 @@ function ziweiInterpret(r) {
|
|
|
10994
12767
|
? `你的命宫无正曜,按紫微的规则借对宫(迁移)来看,主星是${soulStar}`
|
|
10995
12768
|
: `你的命宫与对宫都没有正曜,这里按命主星${soulStar}来看`;
|
|
10996
12769
|
const S = ZIWEI_STARS[soulStar] || ZIWEI_STARS.紫微;
|
|
12770
|
+
const zwMainSha = (p) => zwSha(p).filter((n) => MAIN_SHA.includes(n));
|
|
10997
12771
|
|
|
10998
12772
|
const careerStar = zwMainStar(career);
|
|
10999
12773
|
const wealthStar = zwMainStar(wealth);
|
|
11000
12774
|
const spouseStar = zwMainStar(spouse);
|
|
11001
12775
|
const healthStar = zwMainStar(health);
|
|
11002
12776
|
|
|
12777
|
+
const mainsOf = (p) => (p?.stars || []).filter((x) => x.type === '主星');
|
|
12778
|
+
const brightOf = (p, name) => (p?.stars || []).find((x) => x.name === name)?.brightness || '';
|
|
12779
|
+
const pairOf = (p) => starPairOf(mainsOf(p).map((x) => x.name));
|
|
12780
|
+
const SX = starExtraOf(soulStar) || {};
|
|
12781
|
+
const soulBright = brightRead(brightOf(soul, soulStar));
|
|
12782
|
+
const soulPair = pairOf(soul);
|
|
12783
|
+
const lightLine = (b, extra) => (extra ? `${b && b.tone === 'bad' ? extra.dim : extra.bright}。` : '');
|
|
12784
|
+
|
|
11003
12785
|
const age = Number(pick(r.liunian?.[0], 'age', NaN));
|
|
11004
12786
|
let daxianPalace = null;
|
|
11005
12787
|
for (const p of r.palaces || []) {
|
|
@@ -11017,14 +12799,21 @@ function ziweiInterpret(r) {
|
|
|
11017
12799
|
const dimensions = [
|
|
11018
12800
|
{
|
|
11019
12801
|
key: 'overall', label: '整体运势',
|
|
11020
|
-
text: `${soulFrom},性格底色上${S.trait}
|
|
12802
|
+
text: `${soulFrom}${soulBright ? `(${soulBright.word}——${soulBright.plain})` : ''},性格底色上${S.trait}。` +
|
|
12803
|
+
(soulPair ? `${soulPair.gist};${soulPair.watch}。` : '') +
|
|
12804
|
+
`本盘${patText}。` +
|
|
11021
12805
|
`当前大限走在${daxianPalace ? `${daxianPalace.palace}(${daxianPalace.daxian.start}–${daxianPalace.daxian.end}岁)` : '当前阶段'},` +
|
|
11022
12806
|
`${lnMutagen ? `流年四化为${lnMutagen},本年的变化感主要落在这几颗星上` : '流年四化信号不明显'}。` +
|
|
11023
12807
|
(r.flow ? `再往下一层,当前流月命宫是${r.flow.month.ganzhi},落在原局${r.flow.month.palace || '未上盘'},本月的变化更容易在这一宫代表的事情上显出来。` : '') +
|
|
11024
12808
|
(natalSihuaText
|
|
11025
12809
|
? `另外你本命的生年四化落在:${natalSihuaText}——这是你这辈子比较稳定的底色,不随某一年改变。`
|
|
11026
12810
|
: ''),
|
|
11027
|
-
advice:
|
|
12811
|
+
advice: (() => {
|
|
12812
|
+
const dxName = daxianPalace ? daxianPalace.palace : '命宫';
|
|
12813
|
+
const dxField = palaceFieldOf(dxName);
|
|
12814
|
+
return `这一阶段的主题更接近「${dxName}」——${dxField ? dxField.field : '这一宫代表的事'}。把它当作这几年的主线,其余安排围着它让路;`
|
|
12815
|
+
+ `${SX.gift ? `你最顺手的做法是${SX.gift}` : `你的优势在${S.trait}`},但要留意${SX.watch || '用它用过了头'}。`;
|
|
12816
|
+
})(),
|
|
11028
12817
|
evidence: [
|
|
11029
12818
|
`命宫 ${soulStar}${soulOwn ? '' : '(借对宫)'}`,
|
|
11030
12819
|
daxianPalace ? `大限 ${daxianPalace.palace} ${daxianPalace.daxian.start}–${daxianPalace.daxian.end}岁` : '',
|
|
@@ -11034,16 +12823,38 @@ function ziweiInterpret(r) {
|
|
|
11034
12823
|
},
|
|
11035
12824
|
{
|
|
11036
12825
|
key: 'work', label: '工作与职业选择',
|
|
11037
|
-
text:
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
12826
|
+
text: (() => {
|
|
12827
|
+
const careerBright = brightRead(brightOf(career, careerStar));
|
|
12828
|
+
const careerPair = pairOf(career);
|
|
12829
|
+
const careerSha = zwMainSha(career);
|
|
12830
|
+
return `命宫${soulStar}给你的是底层偏好:${S.work}。`
|
|
12831
|
+
+ `官禄宫${careerStar
|
|
12832
|
+
? `主星为${careerStar}${careerBright ? `(${careerBright.word})` : ''},${ZIWEI_STARS[careerStar]?.work || '有其自身的做事方式'}`
|
|
12833
|
+
: '无正曜,工作方式更多受环境与他人影响,适合配合型岗位'}。`
|
|
12834
|
+
+ (careerPair ? `${careerPair.gist};要留意${careerPair.watch}。` : '')
|
|
12835
|
+
+ (careerSha.length ? `官禄宫又见${join(careerSha)}:${shaLineOf(careerSha)}` : '')
|
|
12836
|
+
+ `两者合起来看,你更适合${careerStar && careerStar !== soulStar ? `用${soulStar}的方式去做${careerStar}擅长的事` : '在稳定的框架里发挥自己的特点'}。`;
|
|
12837
|
+
})(),
|
|
12838
|
+
advice: `挑工作时可以先看岗位内容是否匹配上面这条;如果暂时不能换,试着在现有岗位里争取靠近这部分的事务——${SX.gift ? `把「${SX.gift}」这类活往自己身上揽,比硬熬更容易做出成绩` : '先做出一件拿得出手的事,比硬熬更容易被看见'}。`,
|
|
12839
|
+
evidence: [
|
|
12840
|
+
`命宫 ${soulStar}${soulBright ? `·${soulBright.word}` : ''}`,
|
|
12841
|
+
`官禄 ${careerStar || '无正曜'}`,
|
|
12842
|
+
`财帛 ${wealthStar || '无正曜'}`,
|
|
12843
|
+
...(zwMainSha(career).length ? [`官禄煞星 ${join(zwMainSha(career))}`] : []),
|
|
12844
|
+
],
|
|
11041
12845
|
},
|
|
11042
12846
|
{
|
|
11043
12847
|
key: 'career', label: '事业发展',
|
|
11044
|
-
text:
|
|
11045
|
-
|
|
11046
|
-
|
|
12848
|
+
text: (() => {
|
|
12849
|
+
const wealthBright = brightRead(brightOf(wealth, wealthStar));
|
|
12850
|
+
const wealthPair = pairOf(wealth);
|
|
12851
|
+
return `财帛宫${wealthStar
|
|
12852
|
+
? `见${wealthStar}${wealthBright ? `(${wealthBright.word})` : ''},${ZIWEI_STARS[wealthStar]?.trait || ''}`
|
|
12853
|
+
: '无正曜'},官禄宫${careerStar || '无正曜'},`
|
|
12854
|
+
+ `${wealthStar && careerStar ? '财与事业两宫都有主星坐守,说明这两块是可以主动经营的部分' : '有一宫无主星,说明该块更容易受外部条件牵动,宜借势而非强求'}。`
|
|
12855
|
+
+ (wealthPair ? `${wealthPair.gist}。` : '')
|
|
12856
|
+
+ `大限推进上,${daxianPalace ? `目前落在${daxianPalace.palace},这一宫管${palaceFieldOf(daxianPalace.palace)?.field || '这一段的事'}` : '当前阶段'},下一步会转入相邻的宫位,重心也会跟着挪。`;
|
|
12857
|
+
})(),
|
|
11047
12858
|
advice: `事业上建议做两件事:一是把可积累的东西(技能、资质、作品)做厚;二是${careerStar ? `发挥${careerStar}的优势——${ZIWEI_STARS[careerStar]?.trait || ''}` : '找一个能带你的前辈或平台'}。遇到四化化忌的年份,先守成再谈扩张。`,
|
|
11048
12859
|
evidence: [
|
|
11049
12860
|
`财帛 ${wealthStar || '无正曜'}`,
|
|
@@ -11053,8 +12864,17 @@ function ziweiInterpret(r) {
|
|
|
11053
12864
|
},
|
|
11054
12865
|
{
|
|
11055
12866
|
key: 'love', label: '爱情与感情',
|
|
11056
|
-
text:
|
|
11057
|
-
|
|
12867
|
+
text: (() => {
|
|
12868
|
+
const spouseBright = brightRead(brightOf(spouse, spouseStar));
|
|
12869
|
+
const spousePair = pairOf(spouse);
|
|
12870
|
+
const spouseSha = zwMainSha(spouse);
|
|
12871
|
+
return `夫妻宫${spouseStar
|
|
12872
|
+
? `主星为${spouseStar}${spouseBright ? `(${spouseBright.word})` : ''},感情上的倾向是${ZIWEI_STARS[spouseStar]?.love || '有自己相处的节奏'}`
|
|
12873
|
+
: '无正曜,关系状态更多由对方与互动方式决定'}。`
|
|
12874
|
+
+ (spousePair ? `${spousePair.gist}。` : '')
|
|
12875
|
+
+ `${spouseSha.length ? `夫妻宫同时见${join(spouseSha)}:${shaLineOf(spouseSha)}煞星不等于定局,更多是提醒你留意沟通方式。` : '夫妻宫未见明显煞星,关系的基调相对平顺。'}`
|
|
12876
|
+
+ (SX.watch ? `另外,你自带的${SX.watch}这一面,在亲密关系里最容易被放大。` : '');
|
|
12877
|
+
})(),
|
|
11058
12878
|
advice: `感情里${spouseStar ? `参考${spouseStar}的特点:${ZIWEI_STARS[spouseStar]?.love || ''}` : '可以更主动地表达自己的需求'}。有分歧时先说清事实与感受,别急着下结论;关系的好坏取决于两个人怎么做,不取决于这张盘。`,
|
|
11059
12879
|
evidence: [
|
|
11060
12880
|
`夫妻宫 ${spouseStar || '无正曜'}`,
|
|
@@ -11064,8 +12884,17 @@ function ziweiInterpret(r) {
|
|
|
11064
12884
|
},
|
|
11065
12885
|
{
|
|
11066
12886
|
key: 'health', label: '健康状况',
|
|
11067
|
-
text:
|
|
11068
|
-
|
|
12887
|
+
text: (() => {
|
|
12888
|
+
const healthBright = brightRead(brightOf(health, healthStar));
|
|
12889
|
+
const healthSha = zwMainSha(health);
|
|
12890
|
+
return `疾厄宫${healthStar
|
|
12891
|
+
? `见${healthStar}${healthBright ? `(${healthBright.word})` : ''},传统取象上${ZIWEI_STARS[healthStar]?.health || '需要留意自身的薄弱环节'}`
|
|
12892
|
+
: '无正曜,身体状态更多受生活作息直接影响'}。`
|
|
12893
|
+
+ (healthSha.length
|
|
12894
|
+
? `同时见${join(healthSha)},按星情只是「${shaNatureOf(healthSha)}」这一层,提示这一块值得比其他部位多一分留意。`
|
|
12895
|
+
: '')
|
|
12896
|
+
+ '这些都是象征性的提示,不构成任何医学判断。';
|
|
12897
|
+
})(),
|
|
11069
12898
|
advice: `把${healthStar ? ZIWEI_STARS[healthStar]?.health?.replace('留意', '').replace('需要留意', '') || '常规' : '常规'}当作体检时重点关注的参考;真正管用的还是规律作息、适度运动与定期检查。身体不舒服请直接就医。`,
|
|
11070
12899
|
evidence: [
|
|
11071
12900
|
`疾厄宫 ${healthStar || '无正曜'}`,
|
|
@@ -11074,9 +12903,101 @@ function ziweiInterpret(r) {
|
|
|
11074
12903
|
},
|
|
11075
12904
|
];
|
|
11076
12905
|
|
|
12906
|
+
const soulField = palaceFieldOf('命宫');
|
|
12907
|
+
const bodyLands = pick(r.body, 'lands', '');
|
|
12908
|
+
const bodyField = palaceFieldOf(bodyLands);
|
|
12909
|
+
const identityText = [
|
|
12910
|
+
`命宫落在${soul.branch}(${soul && soul.ganzhi ? soul.ganzhi : '—'}),主星${soulStar}${soulBright ? `·${soulBright.word}` : ''}——这一宫管${soulField ? soulField.field : '你自己'},${SX.gift ? `你身上最能用出去的是${SX.gift}` : S.trait}。`
|
|
12911
|
+
+ (SX.gift ? lightLine(soulBright, SX) : ''),
|
|
12912
|
+
soulPair ? `${soulPair.gist};要留意的是${soulPair.watch}。` : '',
|
|
12913
|
+
bodyLands ? `身宫寄在${bodyLands}——${bodyField ? `${bodyField.field}是后天更容易使上劲的地方` : '这是后天着力点'},中年以后会越来越明显。` : '',
|
|
12914
|
+
`五行局为${pick(r.bureau, 'name', '—')},${pick(r.daxian, 'startAge', '—')}岁起运:局定的是节奏(几步起、十年一换),不是好坏。`,
|
|
12915
|
+
`命主${pick(r, 'lifeMaster', '—')}、身主${pick(r, 'bodyMaster', '—')}:传统把这两颗当作整张盘的定调星,命主看底色,身主看后半程的着力点。`,
|
|
12916
|
+
].filter(Boolean).join('\n');
|
|
12917
|
+
|
|
12918
|
+
const trimDot = (s) => String(s || '').replace(/。$/, '');
|
|
12919
|
+
const palaceLines = (r.palaces || []).map((p) => {
|
|
12920
|
+
const mains = mainsOf(p);
|
|
12921
|
+
const shas = zwSha(p);
|
|
12922
|
+
const fus = (p.stars || []).filter((x) => x.type === '辅星' || x.type === '吉星').map((x) => x.name);
|
|
12923
|
+
const huas = (p.stars || []).filter((x) => x.mutagen).map((x) => `${x.name}化${x.mutagen}`);
|
|
12924
|
+
const selfs = (p.selfHua || []).map((x) => `自化${x.type}`);
|
|
12925
|
+
const head = `【${p.palace}·${p.branch}】`
|
|
12926
|
+
+ `${mains.length ? mains.map((x) => `${x.name}${x.brightness || ''}`).join('·') : '无正曜'}`
|
|
12927
|
+
+ (fus.length ? `|吉 ${fus.slice(0, 3).join('、')}` : '')
|
|
12928
|
+
+ (shas.length ? `|煞 ${shas.join('、')}` : '')
|
|
12929
|
+
+ ((huas.length || selfs.length) ? `|${[...huas, ...selfs].join('、')}` : '');
|
|
12930
|
+
|
|
12931
|
+
const read = [];
|
|
12932
|
+
if (mains.length) {
|
|
12933
|
+
const pair = starPairOf(mains.map((x) => x.name));
|
|
12934
|
+
const ex = starExtraOf(mains[0].name);
|
|
12935
|
+
if (pair) read.push(pair.gist);
|
|
12936
|
+
else if (ex) read.push(ex.gift);
|
|
12937
|
+
} else {
|
|
12938
|
+
const opposite = zwMainStar(zwPalace(r, (p.sanfang || [])[3]));
|
|
12939
|
+
read.push(opposite ? `无正曜,借对宫${opposite}来看` : '无正曜,这一宫随环境走');
|
|
12940
|
+
}
|
|
12941
|
+
if (fus.length) read.push(fuLineOf(fus));
|
|
12942
|
+
if (shas.length) read.push(shaLineOf(shas));
|
|
12943
|
+
for (const x of (p.stars || []).filter((y) => y.mutagen).slice(0, 2)) read.push(huaInLine(x.mutagen, p.palace));
|
|
12944
|
+
const tail = read.filter(Boolean).map(trimDot).join(';');
|
|
12945
|
+
return `${head}\n ${tail}。`;
|
|
12946
|
+
}).join('\n');
|
|
12947
|
+
const palacesText = `十二宫从命宫逆排,每宫管一件事。看一宫不能只看本宫,还要并上它的三方四正(本宫+对宫+两个三合宫)——下面先逐宫摊开,再回到整体。\n${palaceLines}`;
|
|
12948
|
+
|
|
12949
|
+
const PATTERN_TIERS = [
|
|
12950
|
+
{ tone: 'good', label: '有利格局' },
|
|
12951
|
+
{ tone: 'neutral', label: '结构提示' },
|
|
12952
|
+
{ tone: 'bad', label: '忌格提醒' },
|
|
12953
|
+
];
|
|
12954
|
+
const patternSections = PATTERN_TIERS.map((t) => {
|
|
12955
|
+
const list = patterns.filter((p) => (p.tone || 'neutral') === t.tone);
|
|
12956
|
+
if (!list.length) return null;
|
|
12957
|
+
return {
|
|
12958
|
+
key: `pattern-${t.tone}`,
|
|
12959
|
+
label: t.label,
|
|
12960
|
+
tone: t.tone === 'neutral' ? 'watch' : t.tone,
|
|
12961
|
+
text: list.map((p) => {
|
|
12962
|
+
const rd = patternReadOf(p.name, p.tone);
|
|
12963
|
+
return `**${p.name}** ${rd.gist}\n 依据:${p.evidence}\n 做法:${rd.advice}`;
|
|
12964
|
+
}).join('\n'),
|
|
12965
|
+
};
|
|
12966
|
+
}).filter(Boolean);
|
|
12967
|
+
if (!patternSections.length) {
|
|
12968
|
+
patternSections.push({ key: 'pattern-none', label: '格局', text: '本盘未触发内置的常见格局条目。这不代表盘面平淡——格局只是把若干星位组合起个名字,没命中时按宫位与四化逐条看即可。' });
|
|
12969
|
+
}
|
|
12970
|
+
|
|
12971
|
+
const adviceItems = [];
|
|
12972
|
+
if (SX.gift) {
|
|
12973
|
+
adviceItems.push(`把「${SX.gift}」做成招牌:${soulBright && soulBright.tone === 'bad'
|
|
12974
|
+
? `${soulStar}在这宫不得地,长处不会自己显出来,越要挑能发挥它的场子`
|
|
12975
|
+
: `${soulStar}${soulBright ? `·${soulBright.word}` : '在命宫'},顺着这条走最省力`}。`);
|
|
12976
|
+
}
|
|
12977
|
+
if (daxianPalace && daxianPalace.daxian) {
|
|
12978
|
+
const dxf = palaceFieldOf(daxianPalace.palace);
|
|
12979
|
+
adviceItems.push(`这几年主线在${daxianPalace.palace}(${daxianPalace.daxian.start}–${daxianPalace.daxian.end}岁):${dxf ? dxf.field : '这一宫的事'}排前面,力气别摊平。`);
|
|
12980
|
+
}
|
|
12981
|
+
const jiHua = natalSihua.find((m) => m.type === '忌');
|
|
12982
|
+
if (jiHua && jiHua.palace) {
|
|
12983
|
+
const jf = palaceFieldOf(jiHua.palace);
|
|
12984
|
+
adviceItems.push(`生年化忌落在${jiHua.palace}:${jf ? jf.huaJi : '这一块容易反复'}——别硬顶,把预期调低一点反而顺。`);
|
|
12985
|
+
}
|
|
12986
|
+
const soulSha = zwMainSha(soul);
|
|
12987
|
+
if (soulSha.length) adviceItems.push(`命宫见${join(soulSha)}:${shaLineOf(soulSha)}`);
|
|
12988
|
+
const spouseSha2 = zwMainSha(spouse);
|
|
12989
|
+
if (spouseSha2.length && !soulSha.length) {
|
|
12990
|
+
adviceItems.push(`夫妻宫见${join(spouseSha2)}:${shaLineOf(spouseSha2)}`);
|
|
12991
|
+
}
|
|
12992
|
+
const adviceText = adviceItems.slice(0, 4)
|
|
12993
|
+
.map((t, i) => `${'①②③④'[i]} ${trimDot(t)}`)
|
|
12994
|
+
.join('\n') || '这张盘的结构比较平,没有单点特别突出——按现有节奏走,把一件事做完整比开新头更划算。';
|
|
12995
|
+
|
|
11077
12996
|
const sections = [
|
|
11078
|
-
{ key: '
|
|
11079
|
-
{ key: '
|
|
12997
|
+
{ key: 'identity', label: '命身底色', text: identityText },
|
|
12998
|
+
{ key: 'palaces', label: '逐宫分析', text: palacesText },
|
|
12999
|
+
...patternSections,
|
|
13000
|
+
{ key: 'advice', label: '行动建议', text: adviceText },
|
|
11080
13001
|
{
|
|
11081
13002
|
key: 'reasoning', label: '看盘顺序',
|
|
11082
13003
|
text: [
|
|
@@ -11371,6 +13292,11 @@ function liuyaoInterpret(r, ask) {
|
|
|
11371
13292
|
} else if (ug.fushen.length) {
|
|
11372
13293
|
useText.push(`用神不上卦:本卦六爻里没有${ug.liuqin},按「用神不上卦则于本宫首卦内寻之」,到${String(pick(ben, 'palace', '')).replace(/宫$/, '')}宫首卦取伏神——${ug.fushen.map((f) => `${f.position}爻${f.ganzhi}${f.element},伏于飞神${f.fei ? `${f.fei.liuqin}${f.fei.ganzhi}${f.fei.element}` : '—'}之下`).join(';')}。`);
|
|
11373
13294
|
if (ug.relationSay.length) useText.push(`飞伏生克:${ug.relationSay.join(';')}。伏神要得出才算有力,藏在忌神之下且被克,则虽有如无。`);
|
|
13295
|
+
const chufu = r.fushenAccess;
|
|
13296
|
+
if (chufu && Array.isArray(chufu.items) && chufu.items.length) {
|
|
13297
|
+
useText.push(`伏神出伏的条件:${chufu.items.map((f) => f.say).join(';')}。`);
|
|
13298
|
+
useText.push('「助」与「压」只把飞伏生克、月建日辰与月破并列摆出,再归成四档(可出 / 有助有压 / 受压难出 / 未得助);不排各家优先级,旬空只标出、不并入档位,也不给应期日期。');
|
|
13299
|
+
}
|
|
11374
13300
|
} else {
|
|
11375
13301
|
useText.push(`用神不上卦,且本宫首卦里也没找到${ug.liuqin},这一问在卦面上没有直接对应物,只能借日月或改日再占。`);
|
|
11376
13302
|
}
|
|
@@ -11406,10 +13332,31 @@ function liuyaoInterpret(r, ask) {
|
|
|
11406
13332
|
useText.push(`时令对用神:${head},日辰 ${strength.day ? `${strength.day.branch}(${strength.day.element})` : '—'}。${body.join(';')}。`);
|
|
11407
13333
|
useText.push('月建看这一段时令站在哪一边,日辰看当天那股力量是扶还是克;两处同时看,只报状态,不折成分数。');
|
|
11408
13334
|
}
|
|
11409
|
-
useText.push('
|
|
13335
|
+
useText.push('这一层只把用神、卦体与时令对起来,不折成分数、不断成败;应期另在「应期线索」一节只给触发支与快慢。');
|
|
11410
13336
|
sections.push({ key: 'yongshen', label: '用神落位与卦体', text: useText.join('\n') });
|
|
11411
13337
|
}
|
|
11412
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
|
+
|
|
11413
13360
|
{
|
|
11414
13361
|
const hs = r.hexStrength;
|
|
11415
13362
|
if (hs && Array.isArray(hs.lines) && hs.lines.length) {
|
|
@@ -11438,7 +13385,7 @@ function liuyaoInterpret(r, ask) {
|
|
|
11438
13385
|
|
|
11439
13386
|
sections.push({
|
|
11440
13387
|
key: 'limits', label: '未纳入',
|
|
11441
|
-
text: '
|
|
13388
|
+
text: '本卦没有计算:用神两现时该取哪一爻的权重、应期的具体日期(只给逢值/逢冲/逢合的触发支与快慢方向)、忌神受制的时点、动变连环。化进/化退的力重只按月建五态给「得令/失令」这类档位,不折成加权分数;这些都会改变"旺不旺"的判断,所以这里只给取象与方向。',
|
|
11442
13389
|
});
|
|
11443
13390
|
|
|
11444
13391
|
const dimensions = [
|
|
@@ -11841,23 +13788,34 @@ const BUILDERS = {
|
|
|
11841
13788
|
const { interpretQimen } = __mods['qimen-interpret'];
|
|
11842
13789
|
const { buildAnswer, buildPlain, buildGlossary, buildFollowups, dimensionPlain } = __mods['interpret-plain'];
|
|
11843
13790
|
const { knowledgeFor, caveatsFor, STATUS_LABEL } = __mods['interpret-knowledge'];
|
|
11844
|
-
const { CLASSIC_BOOKS } = __mods.classics;
|
|
13791
|
+
const { CLASSIC_BOOKS, suiyunClassicOf } = __mods.classics;
|
|
11845
13792
|
|
|
11846
13793
|
function enrichPlain(result, r, ask) {
|
|
11847
13794
|
if (!result) return result;
|
|
13795
|
+
const DIM_RANK = ['overall', 'work', 'career', 'love', 'health'];
|
|
13796
|
+
const rankOf = (key) => { const i = DIM_RANK.indexOf(key); return i < 0 ? DIM_RANK.length : i; };
|
|
13797
|
+
const seen = new Set();
|
|
11848
13798
|
const dims = (result.dimensions || []).map((d) => {
|
|
11849
13799
|
const p = dimensionPlain(d.key, r, {});
|
|
11850
|
-
|
|
11851
|
-
id: k.id,
|
|
11852
|
-
gist: k.gist,
|
|
11853
|
-
detail: k.detail,
|
|
11854
|
-
source: k.source,
|
|
11855
|
-
status: k.status,
|
|
11856
|
-
statusLabel: STATUS_LABEL[k.status] || k.status,
|
|
11857
|
-
note: k.note || '',
|
|
11858
|
-
}));
|
|
11859
|
-
return { ...d, ...(p ? { plain: p } : {}), ...(know.length ? { knowledge: know } : {}) };
|
|
13800
|
+
return { ...d, ...(p ? { plain: p } : {}) };
|
|
11860
13801
|
});
|
|
13802
|
+
const KNOW_PER_DIM = 3;
|
|
13803
|
+
for (const d of dims.slice().sort((a, b) => rankOf(a.key) - rankOf(b.key))) {
|
|
13804
|
+
const know = knowledgeFor(r.system, d.key)
|
|
13805
|
+
.filter((k) => !seen.has(k.id))
|
|
13806
|
+
.slice(0, KNOW_PER_DIM)
|
|
13807
|
+
.map((k) => ({
|
|
13808
|
+
id: k.id,
|
|
13809
|
+
gist: k.gist,
|
|
13810
|
+
detail: k.detail,
|
|
13811
|
+
source: k.source,
|
|
13812
|
+
status: k.status,
|
|
13813
|
+
statusLabel: STATUS_LABEL[k.status] || k.status,
|
|
13814
|
+
note: k.note || '',
|
|
13815
|
+
}));
|
|
13816
|
+
for (const k of know) seen.add(k.id);
|
|
13817
|
+
if (know.length) d.knowledge = know;
|
|
13818
|
+
}
|
|
11861
13819
|
const texts = [
|
|
11862
13820
|
result.lead,
|
|
11863
13821
|
...dims.map((d) => [d.label, d.text, d.advice, d.plain, ...(d.knowledge || []).map((k) => k.detail)].filter(Boolean).join('')),
|
|
@@ -11865,15 +13823,19 @@ function enrichPlain(result, r, ask) {
|
|
|
11865
13823
|
].filter(Boolean);
|
|
11866
13824
|
|
|
11867
13825
|
const caveats = caveatsFor(r.system);
|
|
11868
|
-
const
|
|
11869
|
-
|
|
13826
|
+
const disputed = caveats.filter((k) => k.status !== 'todo');
|
|
13827
|
+
const caveatLine = disputed.length
|
|
13828
|
+
? disputed.map((k) => {
|
|
13829
|
+
const tag = STATUS_LABEL[k.status] || k.status;
|
|
13830
|
+
return `· ${k.gist}(${tag})${seen.has(k.id) || !k.note ? '' : `——${k.note}`}`;
|
|
13831
|
+
}).join('\n')
|
|
11870
13832
|
: '';
|
|
11871
13833
|
const secs = [...(result.sections || [])];
|
|
11872
13834
|
if (caveatLine) {
|
|
11873
13835
|
secs.push({
|
|
11874
13836
|
key: 'caveats',
|
|
11875
13837
|
label: '这套规则有多稳',
|
|
11876
|
-
text:
|
|
13838
|
+
text: `下列几条各家说法不一,本插件取其中一派并把分歧标出来,供你判断可信度(已在上面展开的只列条目,未展开的附原注):\n${caveatLine}`,
|
|
11877
13839
|
});
|
|
11878
13840
|
}
|
|
11879
13841
|
const todos = caveats.filter((k) => k.status === 'todo');
|
|
@@ -12153,24 +14115,45 @@ const SYSTEM_LABEL = {
|
|
|
12153
14115
|
function askPrompt(r, opts = {}) {
|
|
12154
14116
|
const label = SYSTEM_LABEL[r && r.system] || (r && r.system) || '未知体系';
|
|
12155
14117
|
const asked = String((opts && opts.question) || '').trim();
|
|
12156
|
-
const question = asked || '
|
|
14118
|
+
const question = asked || '请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。';
|
|
12157
14119
|
const limit = Number.isFinite(opts && opts.maxChars) && opts.maxChars >= 400 ? opts.maxChars : 3000;
|
|
12158
14120
|
const raw = String((r && r.summary) || '').trim();
|
|
12159
14121
|
const truncated = raw.length > limit;
|
|
12160
14122
|
const summary = truncated ? `${raw.slice(0, limit)}…(摘要已截断)` : raw;
|
|
12161
14123
|
|
|
14124
|
+
const it = (opts && typeof opts.interpret === 'object' && opts.interpret)
|
|
14125
|
+
|| (r && typeof r.interpret === 'object' && r.interpret) || null;
|
|
14126
|
+
const answer = String((it && it.answer) || '').trim();
|
|
14127
|
+
const plain = String((it && it.plain) || '').trim();
|
|
14128
|
+
const draft = [];
|
|
14129
|
+
if (answer) draft.push(`直答:${answer}`);
|
|
14130
|
+
if (plain) draft.push(`说人话:${plain}`);
|
|
14131
|
+
|
|
12162
14132
|
const lines = [
|
|
12163
14133
|
'【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。',
|
|
12164
14134
|
`体系:${label}`,
|
|
12165
14135
|
`所问:${question}`,
|
|
12166
14136
|
'',
|
|
14137
|
+
...(draft.length ? [
|
|
14138
|
+
'——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——',
|
|
14139
|
+
...draft,
|
|
14140
|
+
'',
|
|
14141
|
+
] : []),
|
|
12167
14142
|
'——盘面摘要——',
|
|
12168
14143
|
summary || '(这张盘没有摘要字段,请先让我重新排一次。)',
|
|
12169
14144
|
'',
|
|
12170
14145
|
'——回答要求——',
|
|
12171
|
-
'
|
|
12172
|
-
|
|
12173
|
-
|
|
14146
|
+
'读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:',
|
|
14147
|
+
draft.length
|
|
14148
|
+
? '1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;'
|
|
14149
|
+
: '1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;',
|
|
14150
|
+
'2) 判断最多两条,按重要性排序,每条分四行写:',
|
|
14151
|
+
' 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;',
|
|
14152
|
+
' 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;',
|
|
14153
|
+
' 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;',
|
|
14154
|
+
' 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;',
|
|
14155
|
+
'3) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;',
|
|
14156
|
+
'4) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。',
|
|
12174
14157
|
];
|
|
12175
14158
|
const text = lines.join('\n');
|
|
12176
14159
|
return { text, question, system: (r && r.system) || '', label, chars: text.length, truncated };
|
|
@@ -12274,16 +14257,32 @@ function crossCheck(bazi, zw) {
|
|
|
12274
14257
|
const bad = ['忌', '大忌'];
|
|
12275
14258
|
const baziGood = good.includes(t);
|
|
12276
14259
|
const baziBad = bad.includes(t);
|
|
14260
|
+
const baziKnown = t !== '—';
|
|
12277
14261
|
const ziweiHeavy = sha >= 2;
|
|
14262
|
+
const ziweiKnown = !!d;
|
|
12278
14263
|
let stance = '有张力';
|
|
12279
|
-
let note = '
|
|
12280
|
-
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 {
|
|
12281
14280
|
stance = '同向';
|
|
12282
14281
|
note = '两边对当前阶段的松紧判断接近';
|
|
12283
14282
|
}
|
|
12284
14283
|
push('rhythm', '当前节奏',
|
|
12285
14284
|
`大运档位 ${t}`,
|
|
12286
|
-
|
|
14285
|
+
d ? `大限在${d.palace}${sha ? `;煞星 ${sha} 颗` : ';无煞星'}` : '大限未取到',
|
|
12287
14286
|
stance, note);
|
|
12288
14287
|
}
|
|
12289
14288
|
|
|
@@ -12297,7 +14296,12 @@ function crossText(cross) {
|
|
|
12297
14296
|
.join('\n');
|
|
12298
14297
|
}
|
|
12299
14298
|
|
|
12300
|
-
|
|
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 };
|
|
12301
14305
|
})();
|
|
12302
14306
|
|
|
12303
14307
|
__mods.verify = (function () {
|
|
@@ -12466,8 +14470,8 @@ return { matchEvent, rectifyBirth, RECTIFY_KINDS };
|
|
|
12466
14470
|
|
|
12467
14471
|
__mods.index = (function () {
|
|
12468
14472
|
const { buildBazi } = __mods.bazi;
|
|
12469
|
-
const { buildLiuyao, tossLines, bodyLabels, yongshenOf, yongshenStrength, hexagramStrength, jinTuiPower } = __mods.liuyao;
|
|
12470
|
-
const { buildZiwei, BRIGHTNESS, flowOf, asOfParts } = __mods.ziwei;
|
|
14473
|
+
const { buildLiuyao, tossLines, bodyLabels, yongshenOf, yongshenStrength, fushenAccess, hexagramStrength, jinTuiPower, yingqiWindow } = __mods.liuyao;
|
|
14474
|
+
const { buildZiwei, BRIGHTNESS, flowOf, asOfParts, ZIWEI_SCHOOL_DEFAULTS } = __mods.ziwei;
|
|
12471
14475
|
const { drawTarot } = __mods.tarot;
|
|
12472
14476
|
const { buildMeihua } = __mods.meihua;
|
|
12473
14477
|
const { buildDaliuren } = __mods.daliuren;
|
|
@@ -12479,7 +14483,7 @@ const { toJDN, ganzhiName, dayGanzhiIndex } = __mods.calendar;
|
|
|
12479
14483
|
const { randomOf, isSeed } = __mods.random;
|
|
12480
14484
|
const { interpret, DIRECTIONS, DIRECTION_DEFAULT } = __mods.interpret;
|
|
12481
14485
|
const { followup, askPrompt } = __mods.followup;
|
|
12482
|
-
const { crossCheck, crossText } = __mods.crosscheck;
|
|
14486
|
+
const { crossCheck, crossText, crossSection } = __mods.crosscheck;
|
|
12483
14487
|
const { pastSignals, verifyFit } = __mods.verify;
|
|
12484
14488
|
const { rectifyBirth } = __mods.rectify;
|
|
12485
14489
|
const { buildAlmanac } = __mods.almanac;
|
|
@@ -12490,7 +14494,7 @@ const { buildStar } = __mods.star;
|
|
|
12490
14494
|
const { buildNumerology } = __mods.numerology;
|
|
12491
14495
|
const { buildMbti, mbtiPaper } = __mods.mbti;
|
|
12492
14496
|
const { buildConvert } = __mods.convert;
|
|
12493
|
-
const { classicsFor, classicsText } = __mods.classics;
|
|
14497
|
+
const { classicsFor, classicsText, suiyunClassicOf, CLASSIC_BOOKS } = __mods.classics;
|
|
12494
14498
|
const { buildTrend } = __mods.trend;
|
|
12495
14499
|
const { buildFengshui } = __mods.fengshui;
|
|
12496
14500
|
const { buildName } = __mods.name;
|
|
@@ -12515,6 +14519,20 @@ function requireGender(value, who = '') {
|
|
|
12515
14519
|
throw fail('E_INPUT', `${who ? who + '的' : ''}gender 必须是 male 或 female${got};性别决定大运/大限顺逆,不能靠默认值`);
|
|
12516
14520
|
}
|
|
12517
14521
|
|
|
14522
|
+
const ZIWEI_SCHOOL_KEYS = [
|
|
14523
|
+
'brightnessSchool', 'gengYearSihua', 'tianmaSchool', 'tiankongSchool', 'jiekongSchool',
|
|
14524
|
+
'kuiyueSchool', 'tianshiTianshang', 'changshengSchool', 'lateZishi',
|
|
14525
|
+
];
|
|
14526
|
+
|
|
14527
|
+
function ziweiSchoolArgs(args) {
|
|
14528
|
+
const out = {};
|
|
14529
|
+
for (const key of ZIWEI_SCHOOL_KEYS) {
|
|
14530
|
+
if (args[key] !== undefined) out[key] = args[key];
|
|
14531
|
+
}
|
|
14532
|
+
if (args.schools && typeof args.schools === 'object') out.schools = args.schools;
|
|
14533
|
+
return out;
|
|
14534
|
+
}
|
|
14535
|
+
|
|
12518
14536
|
function parseDateTime(text) {
|
|
12519
14537
|
if (typeof text !== 'string' || !text.trim()) {
|
|
12520
14538
|
throw fail('E_INPUT', '缺少 datetime(公历日期时间),例如 1990-05-12T14:30');
|
|
@@ -12566,6 +14584,10 @@ function baziText(r) {
|
|
|
12566
14584
|
? `神煞(${r.shensha.count} 见):` + r.shensha.groups.map((g) =>
|
|
12567
14585
|
`${g.cat}|` + g.items.map((i) => `${i.name}(${i.pillars.map((k) => SHORT[k]).join('')})`).join('、')).join(';')
|
|
12568
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
|
+
: '';
|
|
12569
14591
|
const gejuLine = r.frame ? [
|
|
12570
14592
|
`格局:${r.frame.primary ? `${r.frame.primary.name}(${r.frame.primary.evidence})` : '—'}`,
|
|
12571
14593
|
` ${r.frame.geju.map((g) => `${g.name}[${g.kind}]`).join(' ')}`,
|
|
@@ -12588,6 +14610,7 @@ function baziText(r) {
|
|
|
12588
14610
|
shenshaLine,
|
|
12589
14611
|
`真太阳时:${r.solarTime.trueSolarText}(${r.input.geo ? r.input.geo.note + ';' : ''}${r.solarTime.note}) 晚子时:${r.input.lateZi ? '23:00 后算次日' : '23:00 后仍算当日'}`,
|
|
12590
14612
|
`节气:上一节 ${r.jieqi.previous.name} ${r.jieqi.previous.time} 下一节 ${r.jieqi.next.name} ${r.jieqi.next.time}`,
|
|
14613
|
+
...(renyuanLine ? [renyuanLine] : []),
|
|
12591
14614
|
`大运:${r.dayun.rule}(${r.dayun.direction}),${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月起运${jiao}`,
|
|
12592
14615
|
` ${dayun}`,
|
|
12593
14616
|
`流年:${r.liunian.slice(0, 10).map((l) => `${l.year}${l.ganzhi}(${l.stemTenGod})${l.luck ? `·${l.luck.tier}` : ''}`).join(' ')}`,
|
|
@@ -12595,15 +14618,31 @@ function baziText(r) {
|
|
|
12595
14618
|
const hits = r.liunian.filter((l) => l.suiyun && l.suiyun.signals && l.suiyun.signals.length);
|
|
12596
14619
|
if (!hits.length) return '岁运提示:近十年无岁运并临、运年反吟或流年伏吟/反吟(只标干支,不判吉凶)';
|
|
12597
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}》` : '';
|
|
12598
14623
|
return '岁运提示(只标干支变动,不判吉凶):' + hits
|
|
12599
|
-
.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;
|
|
12600
14625
|
})(),
|
|
12601
14626
|
'(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)',
|
|
12602
14627
|
].join('\n') + near;
|
|
12603
14628
|
}
|
|
12604
14629
|
|
|
12605
14630
|
function ziweiText(r) {
|
|
12606
|
-
const
|
|
14631
|
+
const rawMonth = r.lunar.monthRaw || r.lunar.month;
|
|
14632
|
+
const lunarText = `${r.lunar.year}年${r.lunar.isLeap ? `闰${rawMonth}` : r.lunar.month}月${r.lunar.day}日`
|
|
14633
|
+
+ (r.lunar.isLeap && r.lunar.month !== rawMonth ? `(按${r.lunar.month}月起盘)` : '');
|
|
14634
|
+
const schoolLine = (() => {
|
|
14635
|
+
if (!r.schools) return '';
|
|
14636
|
+
const labels = {
|
|
14637
|
+
brightnessSchool: '亮度', gengYearSihua: '庚干四化', tianmaSchool: '天马', tiankongSchool: '天空',
|
|
14638
|
+
jiekongSchool: '截空', kuiyueSchool: '魁钺', tianshiTianshang: '天伤天使',
|
|
14639
|
+
changshengSchool: '长生', lateZishi: '晚子时',
|
|
14640
|
+
};
|
|
14641
|
+
const diff = Object.entries(labels)
|
|
14642
|
+
.filter(([key]) => r.schools[key] && r.schools[key] !== ZIWEI_SCHOOL_DEFAULTS[key])
|
|
14643
|
+
.map(([key, label]) => `${label} ${r.schools[key]}`);
|
|
14644
|
+
return diff.length ? `【流派】${diff.join(' ')}` : '';
|
|
14645
|
+
})();
|
|
12607
14646
|
const starText = (stars) => (stars.length
|
|
12608
14647
|
? stars.map((s) => `${s.name}${s.mutagen ? `化${s.mutagen}` : ''}`).join(' ')
|
|
12609
14648
|
: '—');
|
|
@@ -12652,6 +14691,7 @@ function ziweiText(r) {
|
|
|
12652
14691
|
`【命宫】${r.soul.branch}(${r.soul.ganzhi}·${r.soul.nayin}) 【身宫】${r.body.branch}(落${r.body.lands}) 【五行局】${r.bureau.name}`,
|
|
12653
14692
|
`【紫微】${r.ziwei} 【天府】${r.tianfu} 【命主】${r.lifeMaster} 【身主】${r.bodyMaster}`,
|
|
12654
14693
|
`【大限】${r.daxian.rule},${r.daxian.startAge}岁起 【小限】${r.xiaoxianRule.direction}`,
|
|
14694
|
+
schoolLine,
|
|
12655
14695
|
`【昌曲】文昌${r.changqu.wenchang.branch}(${r.changqu.wenchang.palace}${r.changqu.wenchang.mutagen ? '·化' + r.changqu.wenchang.mutagen : ''}) 文曲${r.changqu.wenqu.branch}(${r.changqu.wenqu.palace}${r.changqu.wenqu.mutagen ? '·化' + r.changqu.wenqu.mutagen : ''})`,
|
|
12656
14696
|
` ${r.changqu.relation} 入命三方:${r.changqu.inSoulSanfang ? '是' : '否'} 吸收面:${r.changqu.absorb.label}(${r.changqu.absorb.reason})`,
|
|
12657
14697
|
flyLine,
|
|
@@ -12805,6 +14845,10 @@ function liuyaoText(r) {
|
|
|
12805
14845
|
const m = strength.month && strength.month.branch ? `月建 ${strength.month.branch}(${strength.month.element}) ` : '';
|
|
12806
14846
|
out.push(`用神旺衰:${m}${strength.labels.join(' · ')}`);
|
|
12807
14847
|
}
|
|
14848
|
+
const chufu = r.fushenAccess;
|
|
14849
|
+
if (chufu && Array.isArray(chufu.labels) && chufu.labels.length) {
|
|
14850
|
+
out.push(`伏神出伏:${chufu.labels.join(' · ')}`);
|
|
14851
|
+
}
|
|
12808
14852
|
} else {
|
|
12809
14853
|
out.push('用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)');
|
|
12810
14854
|
}
|
|
@@ -12819,6 +14863,10 @@ function liuyaoText(r) {
|
|
|
12819
14863
|
if (jt && Array.isArray(jt.lines) && jt.lines.length) {
|
|
12820
14864
|
out.push(`进退力重:${jt.lines.map((l) => `${l.position}爻${l.from}→${l.to}${l.type}·${l.verdict}`).join(' · ')}`);
|
|
12821
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
|
+
}
|
|
12822
14870
|
return out.filter(Boolean).join('\n');
|
|
12823
14871
|
}
|
|
12824
14872
|
|
|
@@ -12832,6 +14880,8 @@ function compute(args = {}) {
|
|
|
12832
14880
|
r.classics = classicsFor(r);
|
|
12833
14881
|
const ct = classicsText(r.classics);
|
|
12834
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 };
|
|
12835
14885
|
}
|
|
12836
14886
|
if (r && r.precision && r.precision.level === 'approx' && r.summary) {
|
|
12837
14887
|
r.summary = `⚠ ${r.precision.note}\n${r.summary}`;
|
|
@@ -12858,11 +14908,11 @@ function compute(args = {}) {
|
|
|
12858
14908
|
};
|
|
12859
14909
|
const asOf = checkAsOf(args.asOf);
|
|
12860
14910
|
const other = r.system === 'bazi'
|
|
12861
|
-
? buildZiwei({ ...common, leapAsNext: args.leapAsNext === true, asOf })
|
|
14911
|
+
? buildZiwei({ ...common, leapMonth: args.leapMonth, leapAsNext: args.leapAsNext === true, ...ziweiSchoolArgs(args), asOf })
|
|
12862
14912
|
: buildBazi({ ...common, lateZi: args.lateZi !== false, nowYear: asOf ? asOf.year : undefined });
|
|
12863
14913
|
r.cross = crossCheck(r.system === 'bazi' ? r : other, r.system === 'ziwei' ? r : other);
|
|
12864
14914
|
if (r.interpret) {
|
|
12865
|
-
r.interpret.sections.push(
|
|
14915
|
+
r.interpret.sections.push(crossSection(r.cross));
|
|
12866
14916
|
}
|
|
12867
14917
|
}
|
|
12868
14918
|
if (Number.isInteger(args.verifyPast) && args.verifyPast > 0 && r.system === 'bazi') {
|
|
@@ -12907,7 +14957,7 @@ function compute(args = {}) {
|
|
|
12907
14957
|
function interpretText(i) {
|
|
12908
14958
|
if (!i) return '';
|
|
12909
14959
|
const out = [`【${i.title || '解析与详解'}】${i.ask && i.ask.echo ? i.ask.echo : ''}`];
|
|
12910
|
-
if (i.answer) out.push(`▶
|
|
14960
|
+
if (i.answer) out.push(`▶ ${i.ask && i.ask.question ? '先答所问' : '先看结论'}:${i.answer}`);
|
|
12911
14961
|
if (i.plain) out.push(`▶ 说人话:${i.plain}`);
|
|
12912
14962
|
if (i.lead) out.push(i.lead);
|
|
12913
14963
|
if (Array.isArray(i.outline) && i.outline.length) {
|
|
@@ -12977,7 +15027,9 @@ function computeRaw(args = {}) {
|
|
|
12977
15027
|
const result = buildZiwei({
|
|
12978
15028
|
...dt,
|
|
12979
15029
|
gender: requireGender(args.gender),
|
|
15030
|
+
leapMonth: args.leapMonth,
|
|
12980
15031
|
leapAsNext: args.leapAsNext === true,
|
|
15032
|
+
...ziweiSchoolArgs(args),
|
|
12981
15033
|
longitude: typeof args.longitude === 'number' ? args.longitude : undefined,
|
|
12982
15034
|
address: typeof args.address === 'string' ? args.address : undefined,
|
|
12983
15035
|
geo: args.geo && typeof args.geo === 'object' ? args.geo : undefined,
|
|
@@ -13116,6 +15168,10 @@ function computeRaw(args = {}) {
|
|
|
13116
15168
|
if (ug.liuqin) {
|
|
13117
15169
|
const strength = yongshenStrength(result, ug, { monthBranch, dayBranch: result.dayGanZhi.branch });
|
|
13118
15170
|
if (strength) result.useGodStrength = strength;
|
|
15171
|
+
const chufu = fushenAccess(result, ug, { monthBranch, dayBranch: result.dayGanZhi.branch });
|
|
15172
|
+
if (chufu) result.fushenAccess = chufu;
|
|
15173
|
+
const yq = yingqiWindow(result, ug, { monthBranch });
|
|
15174
|
+
if (yq) result.yingqi = yq;
|
|
13119
15175
|
}
|
|
13120
15176
|
if (args.seed !== undefined && args.seed !== null && args.seed !== '') result.seed = Number(args.seed);
|
|
13121
15177
|
return { ...result, ...(asOf ? { asOf } : {}), summary: liuyaoText(result) };
|
|
@@ -13214,7 +15270,17 @@ function computeRaw(args = {}) {
|
|
|
13214
15270
|
return { ...result, precision: dt.precision, summary: trendText(result) };
|
|
13215
15271
|
}
|
|
13216
15272
|
if (system === 'fengshui') {
|
|
13217
|
-
const action = args.action === 'advise' ? 'advise' : 'natal';
|
|
15273
|
+
const action = args.action === 'advise' ? 'advise' : args.action === 'xuankong' ? 'xuankong' : 'natal';
|
|
15274
|
+
if (action === 'xuankong') {
|
|
15275
|
+
const result = buildFengshui({
|
|
15276
|
+
action,
|
|
15277
|
+
sitting: args.sitting,
|
|
15278
|
+
facing: args.facing,
|
|
15279
|
+
...(args.period !== undefined ? { period: args.period } : {}),
|
|
15280
|
+
...(Number.isInteger(args.fortuneYear) ? { fortuneYear: args.fortuneYear } : {}),
|
|
15281
|
+
});
|
|
15282
|
+
return { ...result, summary: fengshuiText(result) };
|
|
15283
|
+
}
|
|
13218
15284
|
if (action === 'advise') {
|
|
13219
15285
|
const result = buildFengshui({
|
|
13220
15286
|
action,
|
|
@@ -13253,6 +15319,8 @@ function computeRaw(args = {}) {
|
|
|
13253
15319
|
givenName: args.givenName,
|
|
13254
15320
|
limit: args.limit,
|
|
13255
15321
|
charElements: args.charElements && typeof args.charElements === 'object' ? args.charElements : undefined,
|
|
15322
|
+
strokeOverrides: args.strokeOverrides && typeof args.strokeOverrides === 'object' ? args.strokeOverrides : undefined,
|
|
15323
|
+
surnameStrokes: args.surnameStrokes && typeof args.surnameStrokes === 'object' ? args.surnameStrokes : undefined,
|
|
13256
15324
|
...birth,
|
|
13257
15325
|
...(args.gender === 'male' || args.gender === 'female' ? { gender: args.gender } : {}),
|
|
13258
15326
|
...(args.datetime ? {
|
|
@@ -13420,6 +15488,25 @@ function trendText(r) {
|
|
|
13420
15488
|
}
|
|
13421
15489
|
|
|
13422
15490
|
function fengshuiText(r) {
|
|
15491
|
+
if (r.meta.action === 'xuankong') {
|
|
15492
|
+
const p = r.meta.period;
|
|
15493
|
+
const cell = (palace) => {
|
|
15494
|
+
const x = r.palaces.find((y) => y.palace === palace);
|
|
15495
|
+
return `${palace}${x.yun}/${x.shan}/${x.xiang}`;
|
|
15496
|
+
};
|
|
15497
|
+
const row = (names) => names.map(cell).join(' ');
|
|
15498
|
+
const w = r.wangShanWangXiang;
|
|
15499
|
+
return [
|
|
15500
|
+
`【玄空】${r.meta.periodLabel} 坐 ${r.meta.sitting} 向 ${r.meta.facing}`,
|
|
15501
|
+
`【入中】山盘 ${r.meta.shanCenter.star}${r.meta.shanCenter.name}(${r.meta.shanCenter.fly},${r.meta.shanCenter.basis});向盘 ${r.meta.xiangCenter.star}${r.meta.xiangCenter.name}(${r.meta.xiangCenter.fly},${r.meta.xiangCenter.basis})`,
|
|
15502
|
+
`【九宫】${row(['巽', '离', '坤'])}|${row(['震', '中', '兑'])}|${row(['艮', '坎', '乾'])}`,
|
|
15503
|
+
`【当运】山星${p}到${r.dangYun.shan.text};向星${p}到${r.dangYun.xiang.text}`,
|
|
15504
|
+
`【表法】${w.table.length ? w.table.join('、') : '无'};${w.note}`,
|
|
15505
|
+
`【合十】山星合十 ${r.heshi.shan.join('、') || '无'};向星合十 ${r.heshi.xiang.join('、') || '无'}`,
|
|
15506
|
+
...(r.meta.note ? [`※ ${r.meta.note}`] : []),
|
|
15507
|
+
`※ ${r.disclaimer}`,
|
|
15508
|
+
].join('\n');
|
|
15509
|
+
}
|
|
13423
15510
|
if (r.meta.action === 'advise') {
|
|
13424
15511
|
const match = r.mingMatch
|
|
13425
15512
|
? [`【命宅配】${r.mingMatch.text}`]
|
|
@@ -13451,7 +15538,11 @@ function nameText(r) {
|
|
|
13451
15538
|
if (r.action === 'generate') {
|
|
13452
15539
|
return [
|
|
13453
15540
|
`【候选名】姓 ${r.surname}(${r.gender},喜用 ${r.bazi.favorable.join('、')})${r.bazi.basis}`,
|
|
13454
|
-
...r.candidates.map((c) =>
|
|
15541
|
+
...r.candidates.map((c) => {
|
|
15542
|
+
const wu = c.wuge && c.wuge.available ? ` 五格 ${c.wuge.summary}` : '';
|
|
15543
|
+
const ph = c.phonetics && c.phonetics.available ? ` 音韵 ${c.phonetics.level}(${c.phonetics.tonePattern})` : '';
|
|
15544
|
+
return `${c.rank}. ${c.name} ${c.chars.map((x) => `${x.char}(${x.element})${x.meaning}`).join(' ')}${wu}${ph}`;
|
|
15545
|
+
}),
|
|
13455
15546
|
...r.notes.map((n) => `※ ${n}`),
|
|
13456
15547
|
].join('\n');
|
|
13457
15548
|
}
|
|
@@ -13464,10 +15555,20 @@ function nameText(r) {
|
|
|
13464
15555
|
: '';
|
|
13465
15556
|
return `· ${c.char}:${el}|${fit}|${c.meaning}${sug}`;
|
|
13466
15557
|
};
|
|
15558
|
+
const wu = r.wuge;
|
|
15559
|
+
const wugeLine = wu && wu.available
|
|
15560
|
+
? `【五格】${wu.strokes.map((x) => `${x.char}${x.strokes}画`).join('+')}|${wu.summary}|三才 ${wu.sancai.text}`
|
|
15561
|
+
: `【五格】${wu ? wu.reason : '未算'}`;
|
|
15562
|
+
const ph = r.phonetics;
|
|
15563
|
+
const phLine = ph && ph.available
|
|
15564
|
+
? `【音韵】${ph.chars.map((x) => `${x.char}${x.py}${x.tone}`).join(' ')}|声调 ${ph.tonePattern}|${ph.level}${ph.issues.length ? `:${ph.issues.map((i) => i.text).join(';')}` : ''}`
|
|
15565
|
+
: `【音韵】${ph ? ph.reason : '未算'}`;
|
|
13467
15566
|
return [
|
|
13468
15567
|
`【名字评估】${r.fullName}`,
|
|
13469
15568
|
...r.chars.map(charLine),
|
|
13470
15569
|
r.bazi ? `【八字】日主 ${r.bazi.dayMaster && r.bazi.dayMaster.stem ? `${r.bazi.dayMaster.stem}(${r.bazi.dayMaster.element})` : r.bazi.dayMaster},旺衰 ${r.bazi.strength.level}(${r.bazi.strength.score}),${r.bazi.basis}` : '',
|
|
15570
|
+
wugeLine,
|
|
15571
|
+
phLine,
|
|
13471
15572
|
`【结论】${r.verdict}`,
|
|
13472
15573
|
...r.notes.map((n) => `※ ${n}`),
|
|
13473
15574
|
].filter(Boolean).join('\n');
|
|
@@ -13499,12 +15600,13 @@ function renderText(result) {
|
|
|
13499
15600
|
return parts.filter(Boolean).join('\n\n');
|
|
13500
15601
|
}
|
|
13501
15602
|
|
|
13502
|
-
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 };
|
|
13503
15604
|
})();
|
|
13504
15605
|
|
|
13505
15606
|
const Engine = __mods.index;
|
|
13506
15607
|
window.Engine = Engine;
|
|
13507
|
-
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":"按八字选字"}]}];
|
|
13508
15610
|
(function () {
|
|
13509
15611
|
const NEED_ASK = { liuyao: true, meihua: true, daliuren: true, tarot: true };
|
|
13510
15612
|
const needAsk = (kind) => !!NEED_ASK[kind];
|
|
@@ -13631,11 +15733,12 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
13631
15733
|
.pp-str b{color:var(--red);font-size:15px;margin:0 4px}
|
|
13632
15734
|
.pp-drel{font-style:normal;color:var(--red);font-size:12px}
|
|
13633
15735
|
.pp-dim{color:var(--muted)}
|
|
15736
|
+
.pp-sy-src{margin-top:6px;font-size:11.5px;line-height:1.55}
|
|
13634
15737
|
.pp-r{display:none}
|
|
13635
15738
|
.pp-modes{display:flex;align-items:center;border-bottom:1px solid var(--line);font-family:system-ui,sans-serif}
|
|
13636
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}
|
|
13637
15740
|
.pp-modes label:hover{background:var(--hover2)}
|
|
13638
|
-
.pp-soon{margin-left:auto;padding-right:10px;font-size:12px;color:var(--
|
|
15741
|
+
.pp-soon{margin-left:auto;padding-right:10px;font-size:12px;color:var(--muted)}
|
|
13639
15742
|
.pp-body{display:none}
|
|
13640
15743
|
#ppm-ben:checked~.pp-body.ben,#ppm-da:checked~.pp-body.da,#ppm-ln:checked~.pp-body.ln{display:block}
|
|
13641
15744
|
#ppm-ben:checked~.pp-modes label[for="ppm-ben"],#ppm-da:checked~.pp-modes label[for="ppm-da"],#ppm-ln:checked~.pp-modes label[for="ppm-ln"]{background:var(--red);color:var(--on-accent)}
|
|
@@ -13911,7 +16014,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
13911
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}
|
|
13912
16015
|
.mp-tt-ta:focus{border-color:var(--red)}
|
|
13913
16016
|
|
|
13914
|
-
.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;
|
|
13915
16018
|
font-family:"Songti SC","SimSun","Microsoft YaHei",serif;font-size:13px;line-height:1.75}
|
|
13916
16019
|
.mp-it *{box-sizing:border-box}
|
|
13917
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}
|
|
@@ -13927,7 +16030,6 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
13927
16030
|
.mp-it-ask .ask-q{font-weight:600;color:var(--ink)}
|
|
13928
16031
|
.mp-it-ask .ask-sep{color:var(--dimline);margin:0 7px}
|
|
13929
16032
|
.mp-it-ask .ask-d{color:var(--lu)}
|
|
13930
|
-
.mp-it-ask .ask-none{color:var(--muted);font-weight:400}
|
|
13931
16033
|
.mp-it-focus{margin-left:6px;font-size:12px;color:var(--lu);border:1px solid rgba(var(--lu-rgb),.35);border-radius:999px;padding:1px 9px;font-family:system-ui,sans-serif}
|
|
13932
16034
|
.mp-it-dim.focus{background:linear-gradient(90deg,rgba(var(--lu-rgb),.06),transparent 60%);border-left:2px solid var(--lu);padding-left:10px}
|
|
13933
16035
|
.mp-it-lead{padding:11px 16px;font-size:13px;color:var(--ink2);border-bottom:1px dashed var(--line)}
|
|
@@ -13968,6 +16070,16 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
13968
16070
|
.mp-it-sec{margin-bottom:11px}
|
|
13969
16071
|
.mp-it-sh{font-size:13px;font-weight:700;color:var(--lu);letter-spacing:.06em;margin-bottom:4px}
|
|
13970
16072
|
.mp-it-stext{font-size:13px;line-height:1.9;color:var(--ink2);text-align:justify}
|
|
16073
|
+
.mp-it-sec.tone-good,.mp-it-sec.tone-watch,.mp-it-sec.tone-bad{padding-left:8px}
|
|
16074
|
+
.mp-it-sec.tone-good{border-left:2px solid var(--lu)}
|
|
16075
|
+
.mp-it-sec.tone-watch{border-left:2px solid var(--quan)}
|
|
16076
|
+
.mp-it-sec.tone-bad{border-left:2px solid var(--red)}
|
|
16077
|
+
.mp-it-sec.tone-good .mp-it-sh{color:var(--lu)}
|
|
16078
|
+
.mp-it-sec.tone-watch .mp-it-sh{color:var(--quan)}
|
|
16079
|
+
.mp-it-sec.tone-bad .mp-it-sh{color:var(--red)}
|
|
16080
|
+
.mp-it-p{margin:0 0 5px}
|
|
16081
|
+
.mp-it-p:last-child{margin-bottom:0}
|
|
16082
|
+
.mp-it-p b{color:var(--ink);font-weight:700;letter-spacing:.02em}
|
|
13971
16083
|
.mp-outline{margin:12px 16px 0;border:1px solid var(--line);border-left:3px solid var(--lu);border-radius:8px;background:var(--card);padding:10px 12px}
|
|
13972
16084
|
.mp-outline-h{font-size:12px;font-weight:700;letter-spacing:.12em;color:var(--lu);margin-bottom:6px;font-family:system-ui,sans-serif}
|
|
13973
16085
|
.mp-outline-row{display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;padding:3px 0;font-size:13px;line-height:1.7;color:var(--ink2)}
|
|
@@ -13988,13 +16100,25 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
13988
16100
|
.mp-it-conf.c-强{color:var(--lu);border-color:rgba(var(--lu-rgb),.4)}
|
|
13989
16101
|
.mp-it-conf.c-中{color:var(--label);border-color:var(--line)}
|
|
13990
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)}
|
|
13991
16115
|
.mp-tables{border-top:1px solid var(--line);padding:12px 16px 4px;background:var(--card)}
|
|
13992
16116
|
.mp-table-wrap{margin-bottom:12px}
|
|
13993
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}
|
|
13994
16118
|
.mp-table-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:8px}
|
|
13995
16119
|
.mp-table{width:100%;border-collapse:collapse;font-size:12px;line-height:1.6;color:var(--ink2);font-family:system-ui,sans-serif}
|
|
13996
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}
|
|
13997
|
-
.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}
|
|
13998
16122
|
.mp-table tbody tr:last-child td{border-bottom:none}
|
|
13999
16123
|
.mp-table tbody tr:nth-child(even) td{background:rgba(0,0,0,.02)}
|
|
14000
16124
|
@media print{
|
|
@@ -14005,6 +16129,52 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
14005
16129
|
.mp-table-wrap,.mp-it-sec,.mp-it-dim{break-inside:avoid}
|
|
14006
16130
|
.mp-table-wrap{page-break-inside:avoid}
|
|
14007
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
|
+
}
|
|
14008
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)}
|
|
14009
16179
|
.mp-fu.miss{border-left-color:var(--red)}
|
|
14010
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}
|
|
@@ -14095,8 +16265,57 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
14095
16265
|
.mp-nm-c:last-child{border-bottom:0}
|
|
14096
16266
|
.mp-nm-c b{font-family:var(--fx);font-size:16.5px;font-weight:600;white-space:nowrap;letter-spacing:.5px}
|
|
14097
16267
|
.mp-nm-c em{font-style:normal;font-size:11.5px;line-height:1.7;color:var(--muted);font-family:var(--sans)}
|
|
16268
|
+
.mp-nm-wu{margin-top:10px;border-top:1px solid var(--hair);padding-top:9px}
|
|
16269
|
+
.mp-nm-wu-h{display:flex;align-items:baseline;gap:9px;font-size:12.5px;color:var(--ink2)}
|
|
16270
|
+
.mp-nm-wu-h b{font-weight:700;letter-spacing:.18em}
|
|
16271
|
+
.mp-nm-wu-h i{font-style:normal;font-size:11px;color:var(--faint)}
|
|
16272
|
+
.mp-nm-wu-rows{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:7px 0 6px}
|
|
16273
|
+
.mp-nm-wu-c{border:1px solid var(--line);border-radius:6px;padding:5px 6px;text-align:center;background:var(--band)}
|
|
16274
|
+
.mp-nm-wu-c em{display:block;font-style:normal;font-size:10.5px;color:var(--muted);letter-spacing:.06em}
|
|
16275
|
+
.mp-nm-wu-c b{display:block;font-size:16px;line-height:1.35;color:var(--ink);font-family:var(--sans)}
|
|
16276
|
+
.mp-nm-wu-c i{display:block;font-style:normal;font-size:10px;line-height:1.5;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
16277
|
+
.mp-nm-wu-c.is-ok{border-color:var(--lu)}
|
|
16278
|
+
.mp-nm-wu-c.is-ok b{color:var(--lu)}
|
|
16279
|
+
.mp-nm-wu-c.is-half{border-color:var(--quan)}
|
|
16280
|
+
.mp-nm-wu-c.is-half b{color:var(--quan)}
|
|
16281
|
+
.mp-nm-wu-c.is-bad b{color:var(--ji)}
|
|
16282
|
+
.mp-nm-ph{margin-top:9px;font-size:12.5px;line-height:1.8;color:var(--ink2)}
|
|
16283
|
+
.mp-nm-ph b{font-weight:700;letter-spacing:.18em;margin-right:6px}
|
|
16284
|
+
.mp-nm-ph em{font-style:normal;color:var(--muted);margin-left:6px;font-family:var(--sans);font-size:11.5px}
|
|
16285
|
+
.mp-nm-ph-lv{font-size:11px;border-radius:999px;padding:0 7px;line-height:1.7;border:1px solid var(--line);color:var(--muted)}
|
|
16286
|
+
.mp-nm-ph-lv.ok{color:var(--lu);border-color:var(--lu)}
|
|
16287
|
+
.mp-nm-ph-lv.warn{color:var(--quan);border-color:var(--quan)}
|
|
16288
|
+
.mp-nm-ph-lv.bad{color:var(--ji);border-color:var(--ji)}
|
|
16289
|
+
.mp-nm-ph-i{display:inline-block;margin:2px 6px 0 0;font-size:11.5px;color:var(--muted)}
|
|
16290
|
+
.mp-nm-ph-i:before{content:'·';margin-right:3px;color:var(--faint)}
|
|
14098
16291
|
@media print{.mp-nm{break-inside:avoid}}
|
|
14099
16292
|
.mp-quick-pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:1.9;color:var(--ink2)}
|
|
16293
|
+
.mp-fs .mp-quick-h{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
|
|
16294
|
+
.mp-fs-sub{font-size:11.5px;color:var(--muted);font-family:var(--sans)}
|
|
16295
|
+
.mp-fs-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
|
|
16296
|
+
.mp-fs-chip{font-size:11.5px;line-height:1.8;border:1px solid var(--line);border-radius:999px;padding:0 9px;color:var(--muted);background:var(--band);font-family:var(--sans)}
|
|
16297
|
+
.mp-fs-chip.ok{color:var(--lu);border-color:color-mix(in srgb,var(--lu) 40%,var(--line))}
|
|
16298
|
+
.mp-fs-key{margin:0 0 6px;font-size:11px;color:var(--faint);font-family:var(--sans)}
|
|
16299
|
+
.mp-fs-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:6px;overflow:hidden;margin-bottom:10px}
|
|
16300
|
+
.mp-fs-cell{background:var(--card);padding:7px 9px;display:flex;flex-direction:column;gap:6px;min-height:56px}
|
|
16301
|
+
.mp-fs-cell.center{background:var(--band)}
|
|
16302
|
+
.mp-fs-top{display:flex;align-items:baseline;gap:6px;min-width:0}
|
|
16303
|
+
.mp-fs-gua{font-family:var(--fx);font-size:15px;font-weight:700;line-height:1;color:var(--ink)}
|
|
16304
|
+
.mp-fs-dir{font-size:10.5px;color:var(--muted);font-family:var(--sans);white-space:nowrap}
|
|
16305
|
+
.mp-fs-star{margin-left:auto;font-size:12px;color:var(--ink2);font-family:var(--sans);white-space:nowrap}
|
|
16306
|
+
.mp-fs-star em{font-style:normal;font-size:10px;margin-left:4px;padding:0 5px;border:1px solid currentColor;border-radius:999px;line-height:1.6;vertical-align:1px}
|
|
16307
|
+
.mp-fs-star em.ok{color:var(--lu)}
|
|
16308
|
+
.mp-fs-star em.bad{color:var(--ji)}
|
|
16309
|
+
.mp-fs-nums{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;font-family:var(--sans);font-variant-numeric:tabular-nums}
|
|
16310
|
+
.mp-fs-nums span{text-align:center;font-size:13px;line-height:1.7;border:1px solid var(--hair);border-radius:4px;color:var(--ink2)}
|
|
16311
|
+
.mp-fs-nums span.on{background:var(--tri);border-color:var(--quan);color:var(--quan);font-weight:700}
|
|
16312
|
+
.mp-fs-facts{margin:0;display:flex;flex-direction:column;gap:4px}
|
|
16313
|
+
.mp-fs-row{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px;font-size:12px;line-height:1.75}
|
|
16314
|
+
.mp-fs-row dt{margin:0;color:var(--muted);font-family:var(--sans)}
|
|
16315
|
+
.mp-fs-row dd{margin:0;color:var(--ink2);word-break:break-word}
|
|
16316
|
+
.mp-fs-note{margin-top:9px;padding-top:8px;border-top:1px dashed var(--line);font-size:11px;line-height:1.7;color:var(--muted)}
|
|
16317
|
+
@media print{.mp-fs{break-inside:avoid}}
|
|
16318
|
+
@media (max-width:420px){.mp-fs-cell{padding:6px}.mp-fs-gua{font-size:14px}.mp-fs-nums span{font-size:12px}}
|
|
14100
16319
|
.mp-mb{margin:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--card);box-shadow:var(--shadow);overflow:hidden;font-family:var(--sans)}
|
|
14101
16320
|
.mp-mb-h{display:flex;flex-direction:row;align-items:center;gap:14px;flex-wrap:wrap;padding:15px 18px 14px;
|
|
14102
16321
|
background:linear-gradient(135deg,var(--sel),var(--band) 64%,var(--card));border-bottom:1px solid var(--hair)}
|
|
@@ -14493,7 +16712,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
14493
16712
|
return `<div class="pp-center">
|
|
14494
16713
|
${mode}
|
|
14495
16714
|
<div class="ct-t2">公历 ${r.input.year}-${String(r.input.month).padStart(2, '0')}-${String(r.input.day).padStart(2, '0')} ${String(r.input.hour).padStart(2, '0')}:${String(r.input.minute).padStart(2, '0')}</div>
|
|
14496
|
-
<div class="ct-t2">农历 ${r.lunar.year}年${r.lunar.isLeap ?
|
|
16715
|
+
<div class="ct-t2">农历 ${r.lunar.year}年${r.lunar.isLeap ? `闰${r.lunar.monthRaw || r.lunar.month}` : r.lunar.month}月${r.lunar.day}日${r.hourBranch}时${r.lunar.isLeap && r.lunar.monthRaw && r.lunar.month !== r.lunar.monthRaw ? `(按${r.lunar.month}月起盘)` : ''}</div>
|
|
14497
16716
|
${sizhuOf(r) ? `<div class="ct-t3">${sizhuOf(r)}</div>` : ''}
|
|
14498
16717
|
<div class="ct-t4">命主 ${r.lifeMaster} 身主 ${r.bodyMaster}</div>
|
|
14499
16718
|
<div class="ct-t4">命宫 ${r.soul.branch} 身宫 ${r.body.branch} 五行局 ${r.bureau.name}</div>
|
|
@@ -14752,6 +16971,20 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
14752
16971
|
return `<span class="pp-chip ${cls}">${esc(l)}</span>`;
|
|
14753
16972
|
}).join('')}</div>`
|
|
14754
16973
|
: '';
|
|
16974
|
+
const fu = r.fushenAccess && Array.isArray(r.fushenAccess.labels) ? r.fushenAccess : null;
|
|
16975
|
+
const fushenRow = fu && fu.labels.length
|
|
16976
|
+
? `<div class="pp-chips">${fu.labels.map((l) => {
|
|
16977
|
+
const cls = /可出/.test(l) ? 'ok' : /受压难出|有助有压/.test(l) ? 'warn' : '';
|
|
16978
|
+
return `<span class="pp-chip ${cls}">伏神${esc(l)}</span>`;
|
|
16979
|
+
}).join('')}</div>`
|
|
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
|
+
: '';
|
|
14755
16988
|
const jp = r.jinTuiPower && Array.isArray(r.jinTuiPower.labels) ? r.jinTuiPower : null;
|
|
14756
16989
|
const jinRow = jp && jp.labels.length
|
|
14757
16990
|
? `<div class="pp-chips">${jp.labels.map((l) => {
|
|
@@ -14773,6 +17006,8 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
14773
17006
|
${bodyRow}
|
|
14774
17007
|
${useRow}
|
|
14775
17008
|
${strengthRow}
|
|
17009
|
+
${fushenRow}
|
|
17010
|
+
${yingqiRow}
|
|
14776
17011
|
${jinRow}
|
|
14777
17012
|
${hexRow}
|
|
14778
17013
|
</div>`;
|
|
@@ -15342,7 +17577,20 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15342
17577
|
const head = (title, sub) => `<div class="mp-nm-h"><b>${esc(title)}</b>${sub ? `<i>${esc(sub)}</i>` : ''}</div>`;
|
|
15343
17578
|
if (r.action === 'generate') {
|
|
15344
17579
|
const fav = r.bazi && r.bazi.favorable ? r.bazi.favorable.join('、') : '';
|
|
15345
|
-
const cands = (r.candidates || []).map((c) =>
|
|
17580
|
+
const cands = (r.candidates || []).map((c) => {
|
|
17581
|
+
const wu = c.wuge && c.wuge.available
|
|
17582
|
+
? (() => {
|
|
17583
|
+
const good = c.wuge.rows.filter((x) => x.level === '吉').length;
|
|
17584
|
+
const bad = c.wuge.rows.filter((x) => x.level === '凶').length;
|
|
17585
|
+
const cls = bad === 0 && good >= 4 ? ' ok' : bad >= 2 ? ' no' : '';
|
|
17586
|
+
return `<span class="mp-nm-fit${cls}" title="${esc(c.wuge.summary)}">五格 ${good}/5 吉</span>`;
|
|
17587
|
+
})()
|
|
17588
|
+
: '';
|
|
17589
|
+
const ph = c.phonetics && c.phonetics.available
|
|
17590
|
+
? `<span class="mp-nm-fit${c.phonetics.level === '拗口' ? ' no' : c.phonetics.level === '顺口' ? ' ok' : ''}" title="${esc((c.phonetics.issues || []).map((x) => x.text).join(';'))}">${esc(c.phonetics.level)}</span>`
|
|
17591
|
+
: '';
|
|
17592
|
+
return `<div class="mp-nm-c"><b>${esc(c.name)}</b><span class="mp-nm-els">${c.chars.map((x) => elChip(x.element)).join('')}${wu}${ph}</span><em>${esc(c.chars.map((x) => x.char + '·' + x.meaning).join(' '))}</em></div>`;
|
|
17593
|
+
}).join('');
|
|
15346
17594
|
return `<section class="mp-nm" aria-label="候选名">
|
|
15347
17595
|
${head('候选名', `姓 ${r.surname}(${r.gender})${fav ? ` 喜用 ${fav}` : ''}`)}
|
|
15348
17596
|
<div class="mp-nm-cand">${cands}</div>
|
|
@@ -15365,10 +17613,24 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15365
17613
|
? `<div class="mp-nm-m">八字:${esc(r.bazi.dayMaster && r.bazi.dayMaster.stem ? `${r.bazi.dayMaster.stem}(${r.bazi.dayMaster.element})` : String(r.bazi.dayMaster || ''))} ${esc(r.bazi.strength ? `${r.bazi.strength.level}(${r.bazi.strength.score})` : '')} 喜用 ${esc((r.bazi.favorable || []).join('、'))}</div>
|
|
15366
17614
|
<div class="mp-nm-m">${esc(r.bazi.basis || '')}</div>`
|
|
15367
17615
|
: '';
|
|
17616
|
+
const LV = (x) => (x === '吉' ? 'is-ok' : x === '半吉' ? 'is-half' : 'is-bad');
|
|
17617
|
+
const wu = r.wuge && r.wuge.available
|
|
17618
|
+
? `<div class="mp-nm-wu">
|
|
17619
|
+
<div class="mp-nm-wu-h"><b>五格</b><i>康熙笔画 · 通行本 81 数理</i></div>
|
|
17620
|
+
<div class="mp-nm-wu-rows">${r.wuge.rows.map((x) => `<div class="mp-nm-wu-c ${LV(x.level)}"><em>${esc(x.key)}</em><b>${x.strokes}</b><i>${esc(`${x.level} · ${x.name}`)}</i></div>`).join('')}</div>
|
|
17621
|
+
<div class="mp-nm-m">笔画:${r.wuge.strokes.map((x) => `${esc(x.char)}${x.strokes}${x.source === 'user' ? '(指定)' : ''}`).join(' + ')}</div>
|
|
17622
|
+
<div class="mp-nm-m">三才:${esc(r.wuge.sancai.text)}</div>
|
|
17623
|
+
</div>`
|
|
17624
|
+
: `<div class="mp-nm-wu"><div class="mp-nm-wu-h"><b>五格</b><i>这一版算不了</i></div><div class="mp-nm-m">${esc(r.wuge ? r.wuge.reason : '未算')}</div></div>`;
|
|
17625
|
+
const ph = r.phonetics && r.phonetics.available
|
|
17626
|
+
? `<div class="mp-nm-ph"><b>音韵</b><span class="mp-nm-ph-lv${r.phonetics.level === '顺口' ? ' ok' : r.phonetics.level === '拗口' ? ' bad' : ' warn'}">${esc(r.phonetics.level)}</span><em>${esc(r.phonetics.chars.map((x) => `${x.py}${x.tone}`).join(' '))} 声调 ${esc(r.phonetics.tonePattern)}</em>${(r.phonetics.issues || []).map((x) => `<span class="mp-nm-ph-i">${esc(x.text)}</span>`).join('')}</div>`
|
|
17627
|
+
: `<div class="mp-nm-ph"><b>音韵</b><em>${esc(r.phonetics ? r.phonetics.reason : '未算')}</em></div>`;
|
|
15368
17628
|
return `<section class="mp-nm" aria-label="名字评估">
|
|
15369
17629
|
${head(r.fullName || '', `字库 ${r.stats && r.stats.libSize ? r.stats.libSize : ''} 字${r.stats && r.stats.unknown ? ` 未收录 ${r.stats.unknown}` : ''}`)}
|
|
15370
17630
|
${rows}
|
|
15371
17631
|
${bz}
|
|
17632
|
+
${wu}
|
|
17633
|
+
${ph}
|
|
15372
17634
|
<div class="mp-nm-verd">${esc(r.verdict || '')}</div>
|
|
15373
17635
|
<div class="mp-nm-note">${(r.notes || []).map((n) => '※ ' + esc(n)).join('<br>')}</div>
|
|
15374
17636
|
</section>`;
|
|
@@ -15468,8 +17730,10 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15468
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>`;
|
|
15469
17731
|
}).join('')}</div>` : '';
|
|
15470
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>` : '';
|
|
15471
17735
|
const syRow = sy.length ? `<div class="pp-tl pp-dim">岁运提示(只标干支变动,不判吉凶)</div><div class="pp-chips">${sy.map((l) =>
|
|
15472
|
-
`<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}` : '';
|
|
15473
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>` : '';
|
|
15474
17738
|
const ssGroups = (r.shensha && r.shensha.groups) || [];
|
|
15475
17739
|
const ssx = ssGroups.length ? `
|
|
@@ -15509,6 +17773,19 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15509
17773
|
|
|
15510
17774
|
const MT_LABEL = { natal: '命盘解析', divination: '卦象解析', card: '牌阵解析' };
|
|
15511
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
|
+
|
|
15512
17789
|
pp.interpretHTML = function (it, opt) {
|
|
15513
17790
|
if (!it) return '';
|
|
15514
17791
|
const hasBody = (it.dimensions && it.dimensions.length) || (it.sections && it.sections.length);
|
|
@@ -15532,23 +17809,28 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15532
17809
|
? `<div class="mp-tables">${it.tables.filter((t) => Array.isArray(t.rows) && t.rows.length).map((t) => `<div class="mp-table-wrap">
|
|
15533
17810
|
<div class="mp-table-h">${esc(t.title)}</div>
|
|
15534
17811
|
<div class="mp-table-scroll"><table class="mp-table">
|
|
15535
|
-
<thead><tr>${t.columns.map((c) => `<th>${esc(c)}</th>`).join('')}</tr></thead>
|
|
15536
|
-
<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>
|
|
15537
17814
|
</table></div>
|
|
15538
17815
|
</div>`).join('')}</div>`
|
|
15539
17816
|
: '';
|
|
17817
|
+
const richText = (text) => String(text || '')
|
|
17818
|
+
.split('\n')
|
|
17819
|
+
.map((line) => `<div class="mp-it-p">${esc(line).replace(/\*\*([^*]+)\*\*/g, '<b>$1</b>')}</div>`)
|
|
17820
|
+
.join('');
|
|
15540
17821
|
const secs = (it.sections && it.sections.length)
|
|
15541
|
-
? `<div class="mp-it-secs">${it.sections.map((s) => `<div class="mp-it-sec" id="mp-sec-${esc(s.key)}">
|
|
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)}">
|
|
15542
17823
|
<div class="mp-it-sh">${esc(s.label)}</div>
|
|
15543
|
-
<div class="mp-it-stext">${
|
|
17824
|
+
<div class="mp-it-stext">${(Array.isArray(s.items) && s.items.length) ? crossHTML(s.items) : richText(s.text)}</div>
|
|
15544
17825
|
</div>`).join('')}</div>`
|
|
15545
17826
|
: '';
|
|
15546
17827
|
const tags = [it.systemLabel, MT_LABEL[it.moduleType] || it.moduleType].filter(Boolean);
|
|
15547
17828
|
const ask = it.ask;
|
|
15548
|
-
const
|
|
15549
|
-
|
|
17829
|
+
const askQ = ask && ask.question ? esc(ask.question) : '';
|
|
17830
|
+
const askLine = ask && (askQ || (ask.direction && ask.direction !== 'general'))
|
|
17831
|
+
? `<div class="mp-it-ask">${askQ ? `<span class="ask-q">问题:${askQ}</span><span class="ask-sep">|</span>` : ''}<span class="ask-d">询问方向:${esc(ask.directionLabel || '综合')}</span></div>`
|
|
15550
17832
|
: '';
|
|
15551
|
-
const answer = it.answer ? `<div class="mp-it-ans"><b
|
|
17833
|
+
const answer = it.answer ? `<div class="mp-it-ans"><b>${askQ ? '先答所问' : '先看结论'}</b>${esc(it.answer)}</div>` : '';
|
|
15552
17834
|
const plain = it.plain ? `<div class="mp-it-plain"><b>说人话</b>${esc(it.plain)}</div>` : '';
|
|
15553
17835
|
const fu = (it.followups && it.followups.length)
|
|
15554
17836
|
? `<div class="mp-it-fu"><b>还可以这样追问</b><ul>${it.followups.map((q) => `<li>${esc(q)}</li>`).join('')}</ul></div>`
|
|
@@ -15678,6 +17960,93 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, geocodeAd
|
|
|
15678
17960
|
</section>`;
|
|
15679
17961
|
};
|
|
15680
17962
|
|
|
17963
|
+
const FS_GRID = [['巽', '离', '坤'], ['震', '中', '兑'], ['艮', '坎', '乾']];
|
|
17964
|
+
const FS_DIR = { 坎: '正北', 艮: '东北', 震: '正东', 巽: '东南', 离: '正南', 坤: '西南', 兑: '正西', 乾: '西北', 中: '中宫' };
|
|
17965
|
+
const FS_LUCKY = ['生气', '延年', '天医', '伏位'];
|
|
17966
|
+
const fsChip = (text, cls) => `<span class="mp-fs-chip${cls ? ' ' + cls : ''}">${esc(text)}</span>`;
|
|
17967
|
+
const fsCell = (gua, head, body) => `<div class="mp-fs-cell${gua === '中' ? ' center' : ''}">`
|
|
17968
|
+
+ `<div class="mp-fs-top"><span class="mp-fs-gua">${esc(gua)}</span><span class="mp-fs-dir">${esc(FS_DIR[gua] || '')}</span>${head || ''}</div>`
|
|
17969
|
+
+ (body || '') + '</div>';
|
|
17970
|
+
const fsFacts = (rows) => (rows.length
|
|
17971
|
+
? `<dl class="mp-fs-facts">${rows.map(([k, v]) => `<div class="mp-fs-row"><dt>${esc(k)}</dt><dd>${esc(v)}</dd></div>`).join('')}</dl>`
|
|
17972
|
+
: '');
|
|
17973
|
+
const fsSection = (title, sub, chips, grid, facts, notes) => `<section class="mp-quick mp-fs" aria-label="风水结果">`
|
|
17974
|
+
+ `<div class="mp-quick-h"><b>${esc(title)}</b>${sub ? `<span class="mp-fs-sub">${esc(sub)}</span>` : ''}</div>`
|
|
17975
|
+
+ (chips.length ? `<div class="mp-fs-chips">${chips.join('')}</div>` : '')
|
|
17976
|
+
+ grid + facts
|
|
17977
|
+
+ (notes.filter(Boolean).map((x) => `<div class="mp-fs-note">${esc(x)}</div>`).join(''))
|
|
17978
|
+
+ '</section>';
|
|
17979
|
+
const fsBaguaGrid = (list, aria) => `<div class="mp-fs-grid" role="group" aria-label="${esc(aria)}">`
|
|
17980
|
+
+ FS_GRID.map((row) => row.map((g) => {
|
|
17981
|
+
const x = list.find((y) => y && y.palace === g);
|
|
17982
|
+
if (!x) return fsCell(g, '', '');
|
|
17983
|
+
const good = FS_LUCKY.includes(x.star);
|
|
17984
|
+
const head = `<span class="mp-fs-star"${x.role ? ` title="${esc(x.role)}"` : ''}>${esc(x.star)}`
|
|
17985
|
+
+ `<em class="${good ? 'ok' : 'bad'}">${good ? '吉' : '凶'}</em></span>`;
|
|
17986
|
+
return fsCell(g, head, '');
|
|
17987
|
+
}).join('')).join('') + '</div>';
|
|
17988
|
+
|
|
17989
|
+
function fsXuankong(r, m) {
|
|
17990
|
+
const period = m.period;
|
|
17991
|
+
const by = {};
|
|
17992
|
+
for (const p of r.palaces || []) by[p.palace] = p;
|
|
17993
|
+
const grid = `<div class="mp-fs-key">每宫依次为 <b>运</b>/<b>山</b>/<b>向</b> 三星;底色高亮=当运(${esc(period)}运)</div>`
|
|
17994
|
+
+ '<div class="mp-fs-grid" role="group" aria-label="玄空九宫(运/山/向)">'
|
|
17995
|
+
+ FS_GRID.map((row) => row.map((g) => {
|
|
17996
|
+
const p = by[g];
|
|
17997
|
+
if (!p) return fsCell(g, '', '');
|
|
17998
|
+
const nums = [['运', p.yun], ['山', p.shan], ['向', p.xiang]]
|
|
17999
|
+
.map(([k, v]) => `<span class="${v === period ? 'on' : ''}" title="${esc(k)}星 ${esc(v)}">${esc(v)}</span>`).join('');
|
|
18000
|
+
return fsCell(g, '', `<div class="mp-fs-nums">${nums}</div>`);
|
|
18001
|
+
}).join('')).join('') + '</div>';
|
|
18002
|
+
const w = r.wangShanWangXiang || {};
|
|
18003
|
+
const chips = [
|
|
18004
|
+
fsChip(`山盘 ${m.shanCenter.star}${m.shanCenter.name} · ${m.shanCenter.fly}`),
|
|
18005
|
+
fsChip(`向盘 ${m.xiangCenter.star}${m.xiangCenter.name} · ${m.xiangCenter.fly}`),
|
|
18006
|
+
fsChip(w.byChart ? '盘面:到山到向' : '盘面:未到山到向', w.byChart ? 'ok' : ''),
|
|
18007
|
+
fsChip(w.byTable ? '表法:在列' : '表法:未列', w.byTable ? 'ok' : ''),
|
|
18008
|
+
];
|
|
18009
|
+
const facts = fsFacts([
|
|
18010
|
+
['入中', `山盘 ${m.shanCenter.star}${m.shanCenter.name}(${m.shanCenter.fly},${m.shanCenter.basis});`
|
|
18011
|
+
+ `向盘 ${m.xiangCenter.star}${m.xiangCenter.name}(${m.xiangCenter.fly},${m.xiangCenter.basis})`],
|
|
18012
|
+
['当运', `山星${period}落 ${r.dangYun.shan.text};向星${period}落 ${r.dangYun.xiang.text}`],
|
|
18013
|
+
['合十', `山星:${(r.heshi.shan || []).join('、') || '无'};向星:${(r.heshi.xiang || []).join('、') || '无'}`],
|
|
18014
|
+
['表法', `${w.note || ''}${(w.table || []).length ? ` 本运所列:${w.table.join('、')}。` : ' 本运表法无局。'}`],
|
|
18015
|
+
]);
|
|
18016
|
+
return fsSection('玄空下卦', `${m.periodLabel} · 坐${m.sitting} · 向${m.facing}`, chips, grid, facts, [m.note, r.disclaimer]);
|
|
18017
|
+
}
|
|
18018
|
+
|
|
18019
|
+
function fsNatal(r, m) {
|
|
18020
|
+
const mg = r.mingGua || {};
|
|
18021
|
+
const grid = fsBaguaGrid([...(r.luckyDirections || []), ...(r.unluckyDirections || [])], '八宅八向(吉凶)');
|
|
18022
|
+
const chips = [fsChip(mg.compatible || '—'), fsChip(`${m.gender}命 · ${m.guaYear} 年立春界`)];
|
|
18023
|
+
const rows = [];
|
|
18024
|
+
if (r.yearlyFlying) {
|
|
18025
|
+
const fy = r.yearlyFlying;
|
|
18026
|
+
rows.push(['年紫白', `${fy.centerName}入中;${fy.palaces.filter((p) => p.palace !== '中')
|
|
18027
|
+
.map((p) => `${p.palace}${p.name}`).join('、')}`]);
|
|
18028
|
+
}
|
|
18029
|
+
return fsSection('八宅命卦', `${mg.num}${mg.gua}(${mg.group})· ${mg.direction}`, chips, grid, fsFacts(rows), [m.note, r.disclaimer]);
|
|
18030
|
+
}
|
|
18031
|
+
|
|
18032
|
+
function fsAdvise(r, m) {
|
|
18033
|
+
const lay = r.layout || {};
|
|
18034
|
+
const grid = fsBaguaGrid(r.houseStars || [], '宅卦八向(吉凶)');
|
|
18035
|
+
const chips = [fsChip(`${m.houseGua}宅 · ${m.houseGroup}`), fsChip(`坐${m.sitting}`), fsChip(`向${m.facing}`)];
|
|
18036
|
+
const rows = [['门', lay.door], ['灶', lay.stove], ['床', lay.bed], ['厕', lay.toilet]];
|
|
18037
|
+
if (r.mingMatch) rows.push(['命宅配', r.mingMatch.text]);
|
|
18038
|
+
return fsSection('门主灶', `${m.houseGua}宅 · 坐${m.sitting} · 向${m.facing}`, chips, grid, fsFacts(rows),
|
|
18039
|
+
[m.birthNote, r.disclaimer]);
|
|
18040
|
+
}
|
|
18041
|
+
|
|
18042
|
+
pp.fengshuiHTML = function (r) {
|
|
18043
|
+
if (!r || r.system !== 'fengshui') return pp.quickHTML(r);
|
|
18044
|
+
const m = r.meta || {};
|
|
18045
|
+
if (m.action === 'xuankong') return fsXuankong(r, m);
|
|
18046
|
+
if (m.action === 'advise') return fsAdvise(r, m);
|
|
18047
|
+
return fsNatal(r, m);
|
|
18048
|
+
};
|
|
18049
|
+
|
|
15681
18050
|
pp.quickHTML = function (r) {
|
|
15682
18051
|
if (!r) return '';
|
|
15683
18052
|
const LABEL = {
|
|
@@ -15829,7 +18198,7 @@ function HISTORY_LABEL(kind, r) {
|
|
|
15829
18198
|
}
|
|
15830
18199
|
const PP = window.__PP;
|
|
15831
18200
|
const CSS = `
|
|
15832
|
-
.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}
|
|
15833
18202
|
.mp-wrap>*{max-width:940px;margin-left:auto;margin-right:auto}
|
|
15834
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;
|
|
15835
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)}
|
|
@@ -15839,10 +18208,53 @@ const CSS = `
|
|
|
15839
18208
|
.mp-checks label{display:inline-flex;align-items:center;gap:6px;cursor:pointer}
|
|
15840
18209
|
.mp-askblock{margin-top:14px;display:flex;flex-direction:column;gap:5px}
|
|
15841
18210
|
.mp-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
|
|
15842
|
-
.mp-
|
|
15843
|
-
.mp-
|
|
15844
|
-
.mp-
|
|
15845
|
-
.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)}
|
|
15846
18258
|
.mp-field{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--dsw-alias-label-secondary);min-width:0}
|
|
15847
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;
|
|
15848
18260
|
transition:border-color .14s,box-shadow .14s,background .14s}
|
|
@@ -15944,8 +18356,10 @@ const CSS = `
|
|
|
15944
18356
|
}
|
|
15945
18357
|
@media (max-width:720px){
|
|
15946
18358
|
.mp-wrap{padding:14px 14px 36px}
|
|
15947
|
-
.mp-tabs{display:
|
|
15948
|
-
.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}
|
|
15949
18363
|
.mp-input,.mp-textarea{padding:10px 12px;font-size:16px;min-height:44px;height:auto}
|
|
15950
18364
|
.mp-textarea{min-height:76px}
|
|
15951
18365
|
.mp-quiz-q{padding:9px 10px}
|
|
@@ -15964,7 +18378,8 @@ const CSS = `
|
|
|
15964
18378
|
}
|
|
15965
18379
|
@media (max-width:420px){
|
|
15966
18380
|
.mp-wrap{padding:12px 10px 32px}
|
|
15967
|
-
.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}
|
|
15968
18383
|
}
|
|
15969
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}
|
|
15970
18385
|
@media (prefers-reduced-motion:reduce){
|
|
@@ -16073,12 +18488,36 @@ const TABS = [
|
|
|
16073
18488
|
{ k: 'numerology', label: '生命数字', timeLabel: '', hint: '生命数字按公历生日归约出生命路径数、生日数与态度数。' },
|
|
16074
18489
|
{ k: 'mbti', label: '人格', timeLabel: '', hint: '十六型人格是 24 道自我报告题的 MBTI 风格测算:4 题一页,按 1–5 打分,答满 12 题即可看结果;只作自我参照,不是官方量表。' },
|
|
16075
18490
|
{ k: 'trend', label: '人生K线', timeLabel: '出生时刻', hint: '人生 K 线按大运与流年十神给逐年运势分,画成走势图。' },
|
|
16076
|
-
{ k: 'fengshui', label: '风水', timeLabel: '', hint: '
|
|
18491
|
+
{ k: 'fengshui', label: '风水', timeLabel: '', hint: '风水看八宅命卦、大游年四吉四凶与流年九宫飞星;也可按坐向看门主灶倾向,或按运与坐向排玄空下卦盘。' },
|
|
16077
18492
|
{ k: 'name', label: '起名', timeLabel: '', hint: '起名按八字喜用匹配字库五行,可评估现有名字或生成候选名。' },
|
|
16078
18493
|
];
|
|
16079
18494
|
|
|
16080
18495
|
function pad(n) { return String(n).padStart(2, '0'); }
|
|
16081
18496
|
|
|
18497
|
+
const QUICK_TABS = ['almanac', 'convert', 'zeri', 'chenggu', 'xiaoliuren', 'star', 'numerology', 'trend', 'fengshui', 'name'];
|
|
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
|
+
|
|
16082
18521
|
function nowParts() {
|
|
16083
18522
|
const d = new Date();
|
|
16084
18523
|
return { date: `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`, time: `${pad(d.getHours())}:${pad(d.getMinutes())}` };
|
|
@@ -16100,7 +18539,7 @@ const Core = window.__MPCore || {};
|
|
|
16100
18539
|
const needAsk = Core.needAsk || ((t) => false);
|
|
16101
18540
|
|
|
16102
18541
|
const COMPOSER = { ref: null, seats: [], keys: '', injectType: '', spec: '', errs: [], regs: 0, mounted: 0 };
|
|
16103
|
-
const LAST = { r: null, q: '' };
|
|
18542
|
+
const LAST = { r: null, q: '', it: null };
|
|
16104
18543
|
|
|
16105
18544
|
function bridgeDiagText() {
|
|
16106
18545
|
const bits = [];
|
|
@@ -16145,7 +18584,7 @@ function askTextForLast() {
|
|
|
16145
18584
|
const r = LAST.r;
|
|
16146
18585
|
if (!r) return '';
|
|
16147
18586
|
try {
|
|
16148
|
-
const p = Engine.askPrompt ? Engine.askPrompt(r, { question: LAST.q }) : null;
|
|
18587
|
+
const p = Engine.askPrompt ? Engine.askPrompt(r, { question: LAST.q, interpret: LAST.it }) : null;
|
|
16149
18588
|
return (p && p.text) || String(r.summary || '');
|
|
16150
18589
|
} catch (e) { return String(r.summary || ''); }
|
|
16151
18590
|
}
|
|
@@ -16213,6 +18652,7 @@ function App() {
|
|
|
16213
18652
|
const [mbPage, setMbPage] = useState(0);
|
|
16214
18653
|
const [toAge, setToAge] = useState('60');
|
|
16215
18654
|
const [fsMode, setFsMode] = useState('natal');
|
|
18655
|
+
const [fsPeriod, setFsPeriod] = useState('9');
|
|
16216
18656
|
const [sitting, setSitting] = useState('子');
|
|
16217
18657
|
const [facing, setFacing] = useState('午');
|
|
16218
18658
|
const [nnMode, setNnMode] = useState('assess');
|
|
@@ -16223,9 +18663,15 @@ function App() {
|
|
|
16223
18663
|
const [lines, setLines] = useState('');
|
|
16224
18664
|
const [result, setResult] = useState(null);
|
|
16225
18665
|
useEffect(() => {
|
|
16226
|
-
if (result && result.r) { LAST.r = result.r; LAST.q = askText.trim(); }
|
|
18666
|
+
if (result && result.r) { LAST.r = result.r; LAST.q = askText.trim(); LAST.it = result.it || null; }
|
|
16227
18667
|
}, [result, askText]);
|
|
16228
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({});
|
|
16229
18675
|
const [replayArgs, setReplayArgs] = useState(null);
|
|
16230
18676
|
const [error, setError] = useState('');
|
|
16231
18677
|
const [notice, setNotice] = useState('');
|
|
@@ -16310,8 +18756,13 @@ function App() {
|
|
|
16310
18756
|
if (k === 'trend') { args.gender = genderV; args.toAge = Number(toAge) || 60; args.trueSolar = trueSolar; args.lateZi = lateZi; }
|
|
16311
18757
|
if (k === 'fengshui') {
|
|
16312
18758
|
args.action = fsMode;
|
|
16313
|
-
if (fsMode === '
|
|
16314
|
-
else {
|
|
18759
|
+
if (fsMode === 'natal') { args.gender = genderV; }
|
|
18760
|
+
else {
|
|
18761
|
+
args.sitting = sitting;
|
|
18762
|
+
args.facing = facing;
|
|
18763
|
+
delete args.datetime;
|
|
18764
|
+
if (fsMode === 'xuankong') args.period = Number(fsPeriod) || 9;
|
|
18765
|
+
}
|
|
16315
18766
|
}
|
|
16316
18767
|
if (k === 'name') {
|
|
16317
18768
|
args.action = nnMode;
|
|
@@ -16321,7 +18772,7 @@ function App() {
|
|
|
16321
18772
|
args.trueSolar = trueSolar; args.lateZi = lateZi;
|
|
16322
18773
|
} else {
|
|
16323
18774
|
args.givenName = givenName.trim();
|
|
16324
|
-
delete args.datetime;
|
|
18775
|
+
if (!dt.date || !dt.time) delete args.datetime;
|
|
16325
18776
|
}
|
|
16326
18777
|
}
|
|
16327
18778
|
if (k === 'convert') {
|
|
@@ -16398,8 +18849,8 @@ function App() {
|
|
|
16398
18849
|
? { question: needAsk(k) ? question.trim() : '', direction }
|
|
16399
18850
|
: undefined;
|
|
16400
18851
|
const it = Engine.interpret ? Engine.interpret(r, ask) : null;
|
|
16401
|
-
if (it && r.cross && Engine.
|
|
16402
|
-
it.sections = [...(it.sections || []),
|
|
18852
|
+
if (it && r.cross && Engine.crossSection) {
|
|
18853
|
+
it.sections = [...(it.sections || []), Engine.crossSection(r.cross)];
|
|
16403
18854
|
}
|
|
16404
18855
|
const timed = kindOf(k) === 'cast' && (k !== 'meihua' || mh === 'time');
|
|
16405
18856
|
setResult({ kind: k, r, it, at: dt, timed, trend });
|
|
@@ -16444,6 +18895,25 @@ function App() {
|
|
|
16444
18895
|
run(next, v);
|
|
16445
18896
|
};
|
|
16446
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
|
+
|
|
16447
18917
|
const editDate = (value) => {
|
|
16448
18918
|
setDate(value);
|
|
16449
18919
|
if (timeKind !== 'none') setManual((m) => Object.assign({}, m, { [timeKind]: { date: value, time } }));
|
|
@@ -16546,7 +19016,7 @@ function App() {
|
|
|
16546
19016
|
const askInChat = () => {
|
|
16547
19017
|
if (!result || !result.r) return;
|
|
16548
19018
|
try {
|
|
16549
|
-
const p = Engine.askPrompt ? Engine.askPrompt(result.r, { question: askText.trim() }) : null;
|
|
19019
|
+
const p = Engine.askPrompt ? Engine.askPrompt(result.r, { question: askText.trim(), interpret: result.it }) : null;
|
|
16550
19020
|
const text = p && p.text ? p.text : String(result.r.summary || '');
|
|
16551
19021
|
if (sendToComposer(text)) { setChatNote('已发到对话窗,往下看回复。'); return; }
|
|
16552
19022
|
const diag = '(' + bridgeDiagText() + ')';
|
|
@@ -16648,15 +19118,55 @@ function App() {
|
|
|
16648
19118
|
run(k);
|
|
16649
19119
|
}, [replayArgs]);
|
|
16650
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
|
+
|
|
16651
19128
|
const children = [
|
|
16652
|
-
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) =>
|
|
16653
19163
|
h('button', {
|
|
16654
19164
|
key: t.k,
|
|
16655
19165
|
role: 'tab',
|
|
16656
19166
|
'aria-selected': tab === t.k ? 'true' : 'false',
|
|
16657
19167
|
tabIndex: tab === t.k ? 0 : -1,
|
|
16658
19168
|
className: 'mp-tab' + (tab === t.k ? ' on' : ''),
|
|
16659
|
-
onClick: () =>
|
|
19169
|
+
onClick: () => activate(t.k),
|
|
16660
19170
|
}, t.label))),
|
|
16661
19171
|
|
|
16662
19172
|
h('div', { key: 'head', className: 'mp-panel' },
|
|
@@ -16808,15 +19318,20 @@ function App() {
|
|
|
16808
19318
|
})) : null,
|
|
16809
19319
|
tab === 'fengshui' ? field('看什么', h('div', { className: 'mp-seg' },
|
|
16810
19320
|
h('button', { className: fsMode === 'natal' ? 'on' : '', onClick: () => setFsMode('natal') }, '命卦'),
|
|
16811
|
-
h('button', { className: fsMode === 'advise' ? 'on' : '', onClick: () => setFsMode('advise') }, '门主灶')
|
|
16812
|
-
|
|
19321
|
+
h('button', { className: fsMode === 'advise' ? 'on' : '', onClick: () => setFsMode('advise') }, '门主灶'),
|
|
19322
|
+
h('button', { className: fsMode === 'xuankong' ? 'on' : '', onClick: () => setFsMode('xuankong') }, '玄空'))) : null,
|
|
19323
|
+
(tab === 'fengshui' && fsMode !== 'natal') ? field('坐山(24 山)', h('input', {
|
|
16813
19324
|
className: 'mp-input', value: sitting, placeholder: '如 子 / 乾',
|
|
16814
19325
|
onChange: (e) => setSitting(e.target.value),
|
|
16815
19326
|
})) : null,
|
|
16816
|
-
(tab === 'fengshui' && fsMode
|
|
19327
|
+
(tab === 'fengshui' && fsMode !== 'natal') ? field('朝向(24 山)', h('input', {
|
|
16817
19328
|
className: 'mp-input', value: facing, placeholder: '如 午 / 巽',
|
|
16818
19329
|
onChange: (e) => setFacing(e.target.value),
|
|
16819
19330
|
})) : null,
|
|
19331
|
+
(tab === 'fengshui' && fsMode === 'xuankong') ? field('运(1–9)', h('input', {
|
|
19332
|
+
className: 'mp-input', type: 'number', min: 1, max: 9, value: fsPeriod,
|
|
19333
|
+
onChange: (e) => setFsPeriod(e.target.value),
|
|
19334
|
+
})) : null,
|
|
16820
19335
|
tab === 'name' ? field('看什么', h('div', { className: 'mp-seg' },
|
|
16821
19336
|
h('button', { className: nnMode === 'assess' ? 'on' : '', onClick: () => setNnMode('assess') }, '评名字'),
|
|
16822
19337
|
h('button', { className: nnMode === 'generate' ? 'on' : '', onClick: () => setNnMode('generate') }, '生成候选'))) : null,
|
|
@@ -16856,7 +19371,11 @@ function App() {
|
|
|
16856
19371
|
onClick: openSample, title: '用固定示例盘看完整报告(不改动你已填的数据)',
|
|
16857
19372
|
}, '看示例'),
|
|
16858
19373
|
h('button', { className: 'mp-btn', onClick: go, title: '时间仍为自动时,点它会取当下再起卦' },
|
|
16859
|
-
tab === 'tarot' ? '抽牌'
|
|
19374
|
+
tab === 'tarot' ? '抽牌'
|
|
19375
|
+
: tab === 'bazi' || tab === 'ziwei' ? '排盘'
|
|
19376
|
+
: tab === 'hepan' ? '合盘'
|
|
19377
|
+
: tab === 'qimen' ? '起局'
|
|
19378
|
+
: QUICK_TABS.indexOf(tab) >= 0 ? '看结果' : '起卦'))),
|
|
16860
19379
|
|
|
16861
19380
|
h('div', { key: 'hint', className: 'mp-hint' }, meta.hint),
|
|
16862
19381
|
|
|
@@ -16885,10 +19404,12 @@ function App() {
|
|
|
16885
19404
|
h('b', null, tab === 'ziwei' || tab === 'bazi' ? '填好出生信息,点「排盘」'
|
|
16886
19405
|
: tab === 'tarot' ? '写下想问的事,点「抽牌」'
|
|
16887
19406
|
: tab === 'mbti' ? '按 1–5 给题目打分,答满 12 题就能看结果'
|
|
16888
|
-
: '
|
|
19407
|
+
: QUICK_TABS.indexOf(tab) >= 0 ? '填好参数,点「看结果」'
|
|
19408
|
+
: '写下所问之事,点「起卦」'),
|
|
16889
19409
|
tab === 'ziwei' || tab === 'bazi' ? '出生日期、时刻与性别即可;出生地只影响真太阳时。'
|
|
16890
19410
|
: tab === 'mbti' ? '4 题一页,答案只在本地参与计算,不会上传。'
|
|
16891
|
-
:
|
|
19411
|
+
: QUICK_TABS.indexOf(tab) >= 0 ? '按上面的选项填好参数即可;全部在本机计算,不上传。'
|
|
19412
|
+
: '起卦时刻已自动取当下,也可以手动改。') : null,
|
|
16892
19413
|
|
|
16893
19414
|
result ? h('div', {
|
|
16894
19415
|
key: 'card',
|
|
@@ -16912,6 +19433,7 @@ function App() {
|
|
|
16912
19433
|
: result.kind === 'trend' ? PP.trendHTML(result.r)
|
|
16913
19434
|
: result.kind === 'name' ? PP.nameHTML(result.r)
|
|
16914
19435
|
: result.kind === 'mbti' ? PP.mbtiHTML(result.r)
|
|
19436
|
+
: result.kind === 'fengshui' ? PP.fengshuiHTML(result.r)
|
|
16915
19437
|
: PP.quickHTML(result.r),
|
|
16916
19438
|
result.it,
|
|
16917
19439
|
{ folded: defaultFolded() },
|