feat(home): 日视图swiper轮播+老黄历方框合并+引入lunar-javascript真实宜忌
Publish Mini Program Dev Version / publish (push) Has been cancelled
Publish Mini Program Dev Version / publish (push) Has been cancelled
1. 日视图改为swiper轮播,左右滑动切换日期,箭头固定在最左最右 2. 大日期方框扩大到包含农历和干支 3. 生肖(马年)移到导航栏右侧 4. 星期移到工作日提示左侧 5. 引入lunar-javascript(6tail库),用真实宜忌(最多20+项)替换手写4-5项 6. 值神/黄道详情样式调整:label大、value小、加间隔 7. 去掉点击放大提示
This commit is contained in:
@@ -50,6 +50,7 @@ const {
|
||||
HOUR_WEIGHTS,
|
||||
BONE_INTERPRETATIONS
|
||||
} = require('./data.js');
|
||||
const { Solar } = require('../lunar.js');
|
||||
|
||||
/** 判断是否为闰年 */
|
||||
function isLeapYear(year) {
|
||||
@@ -648,13 +649,18 @@ function getAlmanacInfo(year, month, day) {
|
||||
const minorRen = getMinorRen(dayInfo.lunarMonth, dayInfo.lunarDay, 12);
|
||||
const phase = dayInfo.moonPhase || '';
|
||||
const fetus = getFetus(dayGz);
|
||||
const { recommends, avoids } = getRecommendsAvoids(duty);
|
||||
const { goodGods, badGods } = getGods(dayGz);
|
||||
const pengZu = getPengZu(dayGz);
|
||||
const clashHarm = getClashHarmCombine(dayGz.branch);
|
||||
const nayin = getNayin(dayGz.ganzhi);
|
||||
const hourDetails = getHourlyAlmanac(dayGz);
|
||||
|
||||
// 用 lunar-javascript 获取真实的宜忌/吉神/凶煞(老黄历数据,最多 20+ 项)
|
||||
const lunar = Solar.fromYmd(year, month, day).getLunar();
|
||||
const recommends = lunar.getDayYi();
|
||||
const avoids = lunar.getDayJi();
|
||||
const goodGods = lunar.getDayJiShen();
|
||||
const badGods = lunar.getDayXiongSha();
|
||||
|
||||
const luckyDuties = ['除', '执', '危', '成', '开'];
|
||||
const unluckyDuties = ['建', '满', '平', '破', '收', '闭'];
|
||||
let dutyLuck = 'neutral';
|
||||
|
||||
Reference in New Issue
Block a user