778899
This commit is contained in:
parent
9dfcd7990f
commit
be1d539bd4
|
@ -0,0 +1,209 @@
|
|||
<template>
|
||||
<view class="calendar">
|
||||
<view class="header">
|
||||
<view class="header-title">
|
||||
<view class="year-month">{{ year }}年{{ month + 1 }}月</view>
|
||||
<view class="botton-father">
|
||||
<view class="click-button" @click="prevMonth">上个月</view>
|
||||
<view class="click-button" @click="nextMonth">下个月</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weekdays">
|
||||
<view v-for="(day, idx) in weekdays" :key="idx" class="weekday">{{ day }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="days">
|
||||
<view v-for="cell in cells" :key="cell.key" class="day-cell" :class="{
|
||||
'prev-month': cell.prev,
|
||||
'next-month': cell.next,
|
||||
selected: isSelected(cell.key)
|
||||
}" @click="selectDate(cell)">
|
||||
<view class="gregorian">{{ cell.dateText }}</view>
|
||||
<view class="lunar" v-if="cell.lunarText">{{ cell.lunarText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
computed
|
||||
} from 'vue';
|
||||
import solarlunar from 'solarlunar'; // npm install solarlunar
|
||||
|
||||
const now = new Date();
|
||||
const year = ref(now.getFullYear());
|
||||
const month = ref(now.getMonth());
|
||||
|
||||
// 单选选中 key
|
||||
const selectedKey = ref(null);
|
||||
|
||||
// 星期一到星期日
|
||||
const weekdays = ['一', '二', '三', '四', '五', '六', '日'];
|
||||
|
||||
const firstWeekdayOfMonth = (y, m) => {
|
||||
const d = new Date(y, m, 1).getDay();
|
||||
return (d + 6) % 7;
|
||||
};
|
||||
|
||||
const cells = computed(() => {
|
||||
const list = [];
|
||||
const prevMonthDate = new Date(year.value, month.value, 0);
|
||||
const prevYear = prevMonthDate.getFullYear();
|
||||
const prevMonth = prevMonthDate.getMonth();
|
||||
const prevTotal = prevMonthDate.getDate();
|
||||
const startOffset = firstWeekdayOfMonth(year.value, month.value);
|
||||
for (let i = 0; i < startOffset; i++) {
|
||||
const day = prevTotal - startOffset + i + 1;
|
||||
const lunar = solarlunar.solar2lunar(prevYear, prevMonth + 1, day);
|
||||
list.push({
|
||||
key: `prev-${prevYear}-${prevMonth + 1}-${day}`,
|
||||
dateText: day,
|
||||
lunarText: lunar.dayCn,
|
||||
prev: true,
|
||||
next: false,
|
||||
});
|
||||
}
|
||||
|
||||
const totalDays = new Date(year.value, month.value + 1, 0).getDate();
|
||||
for (let d = 1; d <= totalDays; d++) {
|
||||
const lunar = solarlunar.solar2lunar(year.value, month.value + 1, d);
|
||||
list.push({
|
||||
key: `${year.value}-${month.value + 1}-${d}`,
|
||||
dateText: d,
|
||||
lunarText: lunar.dayCn,
|
||||
prev: false,
|
||||
next: false,
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
});
|
||||
|
||||
function isSelected(key) {
|
||||
return selectedKey.value === key;
|
||||
}
|
||||
|
||||
function selectDate(cell) {
|
||||
if (cell.prev) {
|
||||
return
|
||||
}
|
||||
selectedKey.value = cell.key;
|
||||
// 触发导出事件或回调
|
||||
console.log('Selected date:', cell.key);
|
||||
}
|
||||
|
||||
function prevMonth() {
|
||||
if (month.value === 0) {
|
||||
year.value--;
|
||||
month.value = 11;
|
||||
} else {
|
||||
month.value--;
|
||||
}
|
||||
}
|
||||
|
||||
function nextMonth() {
|
||||
if (month.value === 11) {
|
||||
year.value++;
|
||||
month.value = 0;
|
||||
} else {
|
||||
month.value++;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.calendar {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.year-month {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.botton-father {
|
||||
display: flex;
|
||||
margin-top: -20rpx;
|
||||
}
|
||||
|
||||
.click-button {
|
||||
padding: 10rpx;
|
||||
width: 120rpx;
|
||||
font-size: 25rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 10rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
background-color: #888;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.weekdays {
|
||||
display: flex;
|
||||
background-color: #E9E7FC;
|
||||
border-radius: 30rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.weekday {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.days {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.day-cell {
|
||||
width: 73.5rpx;
|
||||
height: 80.5rpx;
|
||||
text-align: center;
|
||||
padding-top: 8rpx;
|
||||
padding-bottom: 8rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.day-cell.prev-month .gregorian,
|
||||
.day-cell.next-month .gregorian {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
/* 选中样式 */
|
||||
.day-cell.selected {
|
||||
background-color: #0B98DC;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.day-cell.selected .gregorian,
|
||||
.day-cell.selected .lunar {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.gregorian {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.lunar {
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
|
@ -1998,7 +1998,7 @@
|
|||
}
|
||||
|
||||
.boom {
|
||||
height: 839rpx;
|
||||
height: 850rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* // justify-content: center; */
|
||||
|
@ -2018,12 +2018,13 @@
|
|||
z-index: 10;
|
||||
font-weight: 700;
|
||||
border-top: 1rpx solid transparent;
|
||||
border-bottom: 1rpx solid transparent;
|
||||
border-image: repeating-linear-gradient(90deg, #0184db 0px, #0184db 6rpx, transparent 6rpx, transparent 12rpx) 1;
|
||||
}
|
||||
|
||||
.boom-son-target {
|
||||
height: 209rpx;
|
||||
width: 120rpx;
|
||||
width: 60rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -2031,6 +2032,7 @@
|
|||
text-align: center;
|
||||
z-index: 10;
|
||||
font-weight: 700;
|
||||
border-top: 1rpx solid transparent;
|
||||
border-bottom: 1rpx solid transparent;
|
||||
border-image: repeating-linear-gradient(90deg, #0184db 0px, #0184db 6rpx, transparent 6rpx, transparent 12rpx) 1;
|
||||
/* 确保文字在容器内居中 */
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
:key="index1">
|
||||
<view
|
||||
:class=" targetRuler.index0 === index0 && targetRuler.index1 === index1 ? targetRuler.index1 ?`title-time-border-big`:`title-time-border-big-top` : `super-card-time-card` "
|
||||
:style="!targetRuler.bordershow && saveRulerTime.index0 === index0 && saveRulerTime.index1 === index1 ? {zIndex:999} : {borderTop: '1rpx solid transparent'}"
|
||||
:style="!targetRuler.bordershow && saveRulerTime.index0 === index0 && saveRulerTime.index1 === index1 ? {zIndex:999} : {borderBottom: '1rpx solid transparent'}"
|
||||
:id="`a${index0}_${index1}`" style="position: relative;"
|
||||
@click="rulerTouchClick(item1,index0,index1,$event)"
|
||||
@touchstart="rulerTouchStart(item1,index0,index1,$event)"
|
||||
|
@ -777,7 +777,7 @@
|
|||
thirdmenuIndex.value = 0;
|
||||
}
|
||||
const changecard = () => {
|
||||
|
||||
isDelete.value = false;
|
||||
if (isMove.value) {
|
||||
getNew()
|
||||
} else {
|
||||
|
@ -843,6 +843,19 @@
|
|||
// selectType.value是选择周和月的状态
|
||||
const movecard = (where : number) => {
|
||||
isDelete.value = false;
|
||||
// console.log("?????",leftIn.value,saveleft.value*117)
|
||||
if (((saveleft.value * 117 - leftIn.value) > 5) || ((leftIn.value - saveleft.value * 117) > 0)) {
|
||||
cardLeft.value = 1;
|
||||
nextTick(() => {
|
||||
cardLeft.value = saveleft.value * 117;
|
||||
})
|
||||
}
|
||||
if (((savetop.value * 104.5 - topIn.value) > 5) || ((topIn.value - savetop.value * 104.5) > 0)) {
|
||||
scrollTop.value = 1;
|
||||
nextTick(() => {
|
||||
scrollTop.value = savetop.value * 104.5;
|
||||
})
|
||||
}
|
||||
switch (where) {
|
||||
case 0:
|
||||
if (saveEditIndex.value.index1) {
|
||||
|
@ -893,6 +906,18 @@
|
|||
// isHave()
|
||||
break
|
||||
}
|
||||
|
||||
// if(((savetop.value*117 - topIn.value) > 5) || ((topIn.value - savetop.value*104.5)>0) ){
|
||||
// scrollTop.value = savetop.value * 104.5;
|
||||
// }
|
||||
// if(saveleft.value*117 > leftIn.value || leftIn.value > saveright.value*117 || topIn.value<savetop.value* 104.5 || topIn.value>savebottom.value* 104.5){
|
||||
// // cardLeft.value = 0;
|
||||
// // scrollTop.value = 0;
|
||||
// // cardLeft.value = saveleft.value * 117;
|
||||
// // scrollTop.value = savetop.value * 104.5;
|
||||
// console.log("?????",leftIn.value,topIn.value)
|
||||
// }
|
||||
|
||||
}
|
||||
const weekValue = ref("");
|
||||
const weekIndex = ref(-1);
|
||||
|
@ -927,7 +952,7 @@
|
|||
deleteRuler(saveEditIndex.value.index0, saveEditIndex.value.index1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const haveName = ref(false);
|
||||
const isHave = () => {
|
||||
|
@ -968,13 +993,17 @@
|
|||
// };
|
||||
//监听拖拽
|
||||
const dragOffset = ref(0);
|
||||
const topIn = ref(0)
|
||||
const moveDownNumber = ref(0)
|
||||
function handleScrolltime(e) {
|
||||
let num = e.detail.scrollTop
|
||||
topIn.value = e.detail.scrollTop
|
||||
let formattedNum = parseFloat(num.toFixed(2));
|
||||
moveDownNumber.value = formattedNum
|
||||
}
|
||||
const leftIn = ref(0)
|
||||
function handleTop(e) {
|
||||
leftIn.value = e.detail.scrollLeft
|
||||
// console.log(e.detail.scrollLeft)
|
||||
// if(e.detail.scrollLeft>7000){
|
||||
// cardLeft.value = 0;
|
||||
|
@ -1213,8 +1242,8 @@
|
|||
.boundingClientRect((data : any) => {
|
||||
data.forEach(async (res : any) => {
|
||||
// 根据你的条件筛选元素
|
||||
if (res.left > 200 && res.left < 1067 && res.top < 570 && res.top > 140 && res.dataset.index0 == index0 && res.dataset.index1 == index1) {
|
||||
if (res.left > 200 && res.left < 500) {
|
||||
if (res.left > 100 && res.left < 1067 && res.top < 570 && res.top > 140 && res.dataset.index0 == index0 && res.dataset.index1 == index1) {
|
||||
if (res.left > 100 && res.left < 500) {
|
||||
// 表格太靠左侧,修改到右面
|
||||
openX.value = Math.floor(res.left) + 520;
|
||||
} else {
|
||||
|
@ -1474,11 +1503,11 @@
|
|||
let allobject = bigArray.value[upmenuIndex.value].children[downmenuIndex.value].children[thirdmenuIndex.value]
|
||||
if (allobject.cycleType === "即时护理") {
|
||||
scrollLeft.value = 1;
|
||||
bottomItems.value.forEach((element : any, index : number) => {
|
||||
if (element.id === allobject.id) {
|
||||
stopIt = true
|
||||
}
|
||||
})
|
||||
bottomItems.value.forEach((element : any, index : number) => {
|
||||
if (element.id === allobject.id) {
|
||||
stopIt = true
|
||||
}
|
||||
})
|
||||
nextTick(() => {
|
||||
if (!stopIt) {
|
||||
scrollLeft.value = 0;
|
||||
|
@ -1486,14 +1515,14 @@
|
|||
bottomItems.value[0].target = "#fff"
|
||||
clearTimeout(cleansettimeout.value);
|
||||
}
|
||||
|
||||
|
||||
bottomItems.value.unshift({
|
||||
name: allobject.title,
|
||||
url: "/static/index/ou.png",
|
||||
target: `#00a8ff`,
|
||||
id: allobject.id
|
||||
})
|
||||
console.log("!!!!",bottomItems.value)
|
||||
console.log("!!!!", bottomItems.value)
|
||||
// 实现即时指令动画
|
||||
cleansettimeout.value = setTimeout(() => {
|
||||
bottomItems.value[0].target = `#fff`;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"name" : "养老App",
|
||||
"appid" : "__UNI__FB2D473",
|
||||
"description" : "养老App",
|
||||
"versionName" : "1.1.4",
|
||||
"versionCode" : 114,
|
||||
"versionName" : "1.1.5",
|
||||
"versionCode" : 115,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "hldy_app",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/solarlunar": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmmirror.com/solarlunar/-/solarlunar-2.0.7.tgz",
|
||||
"integrity": "sha512-2SfuCCgAAxFU5MTMYuKGbRgRLcPTJQf3azMEw/GmBpHXA7N2eAQJStSqktZJjnq4qRCboBPnqEB866+PCregag==",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": ["babel-plugin-add-module-exports"]
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"semi": 2
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
language: node_js
|
||||
|
||||
sudo: false
|
||||
|
||||
node_js:
|
||||
- "6"
|
||||
- "7"
|
||||
- "8"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- xvfb
|
||||
|
||||
install:
|
||||
- export DISPLAY=':99.0'
|
||||
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
||||
- npm install
|
|
@ -0,0 +1,23 @@
|
|||
# 2.0.4 / 2018-12-01
|
||||
|
||||
* fix #6
|
||||
# 2.0.3 / 2018-07-18
|
||||
|
||||
* fix #5
|
||||
|
||||
# 2.0.2 / 2018-03-07
|
||||
|
||||
* fix #3
|
||||
|
||||
# 2.0.1 / 2017-10-06
|
||||
|
||||
* fix main #2
|
||||
|
||||
# 2.0.0 / 2017-09-29
|
||||
|
||||
* Add yearCn, thank you @ThaddeusJiang
|
||||
* ES6
|
||||
|
||||
# 1.0.0 / 2015-10-11
|
||||
|
||||
* First Version
|
|
@ -0,0 +1,187 @@
|
|||
## solarLunar
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![build status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
[![Dependency Status][dep-image]][dep-url]
|
||||
[![devDependency Status][devdep-image]][devdep-url]
|
||||
[![NPM downloads][downloads-image]][npm-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/solarlunar.svg?style=flat-square
|
||||
[npm-url]: https://www.npmjs.com/package/solarlunar
|
||||
[travis-image]: https://img.shields.io/travis/yize/solarlunar.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/yize/solarlunar
|
||||
[coveralls-image]: https://img.shields.io/coveralls/yize/solarlunar.svg?style=flat-square
|
||||
[coveralls-url]: https://coveralls.io/r/yize/solarlunar?branch=master
|
||||
[dep-image]: http://img.shields.io/david/yize/solarlunar.svg?style=flat-square
|
||||
[dep-url]: https://david-dm.org/yize/solarlunar
|
||||
[devdep-image]: http://img.shields.io/david/dev/yize/solarlunar.svg?style=flat-square
|
||||
[devdep-url]: https://david-dm.org/yize/solarlunar#info=devDependencies
|
||||
[downloads-image]: https://img.shields.io/npm/dm/solarlunar.svg
|
||||
|
||||
1900 年至 2100 年公历、农历互转
|
||||
|
||||
* Solar : 公历 阳历
|
||||
* Lunar : 农历 阴历
|
||||
|
||||
支持年份:`1900-2100`
|
||||
|
||||
## 用法:
|
||||
|
||||
```js
|
||||
import solarLunar from 'solarLunar';
|
||||
|
||||
const solar2lunarData = solarLunar.solar2lunar(2015, 10, 8); // 输入的日子为公历
|
||||
const lunar2solarData = solarLunar.lunar2solar(2015, 8, 26); // 输入的日子为农历
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
```js
|
||||
{
|
||||
lYear: 2015,
|
||||
lMonth: 8,
|
||||
lDay: 26,
|
||||
animal: '羊',
|
||||
monthCn: '八月',
|
||||
dayCn: '廿六',
|
||||
cYear: 2015,
|
||||
cMonth: 10,
|
||||
cDay: 8,
|
||||
gzYear: '乙未',
|
||||
gzMonth: '丙戌',
|
||||
gzDay: '丁巳',
|
||||
isToday: false,
|
||||
isLeap: false,
|
||||
nWeek: 4,
|
||||
ncWeek: '星期四',
|
||||
isTerm: true,
|
||||
term: '寒露'
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
* (Object)`solarLunar.solar2lunar` : 输入的日子为公历年月日
|
||||
|
||||
* 参数 : (Number)年,(Number)月,(Number)日
|
||||
|
||||
|
||||
```js
|
||||
solarLunar.solar2lunar(2015, 10, 8);
|
||||
solarLunar.solar2lunar(2015, 10, 08); // 等价于上者
|
||||
```
|
||||
|
||||
* (Object)`solarLunar.lunar2solar` : 输入的日子为农历年月日
|
||||
|
||||
* 参数 : (Number)年,(Number)月,(Number)日
|
||||
|
||||
|
||||
```js
|
||||
solarLunar.lunar2solar(2015, 8, 26);
|
||||
solarLunar.lunar2solar(2015, 08, 26); // 等价于上者
|
||||
```
|
||||
|
||||
* (Array)`solarLunar.lunarInfo` : 农历 1900-2100 的润大小信息表
|
||||
|
||||
* (Array)`solarLunar.solarMonth` : 公历每个月份的天数普通表
|
||||
|
||||
* (Array)`solarLunar.gan` : 天干地支之天干速查表 - 干 `["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]`
|
||||
|
||||
* (Array)`solarLunar.zhi` : 天干地支之地支速查表 - 支 `["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]`
|
||||
|
||||
* (Array)`solarLunar.animals` : 生肖表 `["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]`
|
||||
|
||||
* (Array)`solarLunar.lunarTerm` : 24 节气速查表 `["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]`
|
||||
|
||||
* (Array)`solarLunar.lTermInfo` : 1900-2100 各年的 24 节气日期速查表
|
||||
|
||||
* (Array)`nStr1` : 数字转中文速查表 `['日','一','二','三','四','五','六','七','八','九','十']`
|
||||
|
||||
* (Array)`nStr2` : 日期转农历称呼速查表 `['初','十','廿','卅']`
|
||||
|
||||
* (Array)`nStr3` : 月份转农历称呼速查表 `['正','一','二','三','四','五','六','七','八','九','十','冬','腊']`
|
||||
|
||||
* (Number)`lYearDays` : 返回农历 y 年一整年的总天数
|
||||
|
||||
```js
|
||||
const count = solarLunar.lYearDays(1987); //count=387
|
||||
```
|
||||
|
||||
* (Number(0-12))`leapMonth` : 返回农历 y 年闰月是哪个月;若 y 年没有闰月 则返回 0
|
||||
|
||||
```js
|
||||
const leapMonth = solarLunar.leapMonth(1987); //leapMonth=6
|
||||
```
|
||||
|
||||
* (Number(0|29|30))`leapDays` : 返回农历 y 年闰月的天数 若该年没有闰月则返回 0
|
||||
|
||||
```js
|
||||
const leapMonthDay = solarLunar.leapDays(1987); //leapMonthDay=29
|
||||
```
|
||||
|
||||
* (Number(-1|29|30))`monthDays` : 返回农历 y 年 m 月(非闰月)的总天数,计算 m 为闰月时的天数请使用 leapDays 方法
|
||||
|
||||
```js
|
||||
const MonthDay = solarLunar.monthDays(1987, 9); //MonthDay=29
|
||||
```
|
||||
|
||||
* (Number (-1、28、29、30、31))`solarDays` : 返回公历(!)y 年 m 月的天数
|
||||
|
||||
```js
|
||||
const solarMonthDay = solarLunar.leapDays(1987); //solarMonthDay=30
|
||||
```
|
||||
|
||||
* (Number)`toGanZhi` : 传入 offset 偏移量返回干支
|
||||
|
||||
* (Number)`toGanZhi` : 传入公历(!)y 年获得该年第 n 个节气的公历日期
|
||||
|
||||
* 第一个参数为公历年(1900-2100);
|
||||
* 第二个参数为二十四节气中的第几个节气(1~24);从 n=1(小寒)算起
|
||||
|
||||
```js
|
||||
const _24 = solarLunar.getTerm(1987, 3); //_24=4;意即1987年2月4日立春
|
||||
```
|
||||
|
||||
* (String)`toChinaMonth` : 传入农历数字月份返回汉语通俗表示法
|
||||
|
||||
```js
|
||||
const cnMonth = solarLunar.toChinaMonth(12); //cnMonth='腊月'
|
||||
```
|
||||
|
||||
* (String)`toChinaDay` : 传入农历日期数字返回汉字表示法
|
||||
|
||||
```js
|
||||
const cnDay = solarLunar.toChinaDay(21); //cnMonth='廿一'
|
||||
```
|
||||
|
||||
* (String)`getAnimal` : 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
||||
|
||||
```js
|
||||
const animal = solarLunar.getAnimal(1987); //animal='兔'
|
||||
```
|
||||
|
||||
## 返回值
|
||||
|
||||
* (Number)`lYear` : 农历年
|
||||
* (Number)`lMonth` : 农历月
|
||||
* (Number)`lDay` : 农历日
|
||||
* (String)`monthCn` : 农历月中文名称,如果为闰月,则会在月份前增加 `闰` 字
|
||||
* (String)`dayCn` : 农历日中文名称
|
||||
* (String)`animal` : 生肖
|
||||
* (String)`gzYear` : 年的农历叫法(干支)
|
||||
* (String)`gzMonth` : 月的农历叫法(干支)
|
||||
* (String)`gzDay` : 日的农历叫法(干支)
|
||||
* (Number)`cYear` : 公历年
|
||||
* (Number)`cMonth` : 公历月
|
||||
* (Number)`cDay` : 公历日
|
||||
* (Number)`nWeek` : 周几
|
||||
* (String)`ncWeek` : 中文周几
|
||||
* (Boolean)`isLeap` : 是否是闰月
|
||||
* (Boolean)`isToday` : 是否是今天
|
||||
* (Boolean)`isTerm` : 是否有节气
|
||||
* (String)`term` : 节气,如果没有则返回空字符串
|
||||
|
||||
## Links
|
||||
|
||||
* [http://blog.jjonline.cn/userInterFace/173.html](http://blog.jjonline.cn/userInterFace/173.html)
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* 天干地支之地支速查表<=>生肖
|
||||
* @Array Of Property
|
||||
* @trans['鼠','牛','虎','兔','龙','蛇','马','羊','猴','鸡','狗','猪']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u9f20',
|
||||
'\u725b',
|
||||
'\u864e',
|
||||
'\u5154',
|
||||
'\u9f99',
|
||||
'\u86c7',
|
||||
'\u9a6c',
|
||||
'\u7f8a',
|
||||
'\u7334',
|
||||
'\u9e21',
|
||||
'\u72d7',
|
||||
'\u732a'
|
||||
];
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* 天干地支之天干速查表
|
||||
* @Array Of Property trans['甲','乙','丙','丁','戊','己','庚','辛','壬','癸']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u7532',
|
||||
'\u4e59',
|
||||
'\u4e19',
|
||||
'\u4e01',
|
||||
'\u620a',
|
||||
'\u5df1',
|
||||
'\u5e9a',
|
||||
'\u8f9b',
|
||||
'\u58ec',
|
||||
'\u7678'
|
||||
];
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* 1900-2100各年的24节气日期速查表
|
||||
* @Array Of Property
|
||||
* @return 0x string For splice
|
||||
*/
|
||||
export default [
|
||||
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
|
||||
'97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
|
||||
'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
|
||||
'97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
|
||||
'97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
|
||||
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
|
||||
'97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
|
||||
'97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
|
||||
'97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
|
||||
'97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
|
||||
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
|
||||
'7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
||||
'9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
|
||||
'97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
|
||||
'9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
||||
'9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
|
||||
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
|
||||
'977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
||||
'977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
||||
'977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
|
||||
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
|
||||
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
|
||||
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
|
||||
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
|
||||
'7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
||||
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
|
||||
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
|
||||
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
|
||||
'665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
|
||||
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'
|
||||
];
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* 农历 1900-2100 的润大小信息表
|
||||
* @return Array
|
||||
*/
|
||||
export default [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2,//1900-1909
|
||||
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,//1910-1919
|
||||
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,//1920-1929
|
||||
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950,//1930-1939
|
||||
0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557,//1940-1949
|
||||
0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0,//1950-1959
|
||||
0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0,//1960-1969
|
||||
0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6,//1970-1979
|
||||
0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570,//1980-1989
|
||||
0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0,//1990-1999
|
||||
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5,//2000-2009
|
||||
0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930,//2010-2019
|
||||
0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530,//2020-2029
|
||||
0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45,//2030-2039
|
||||
0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0,//2040-2049
|
||||
/**Add By JJonline@JJonline.Cn**/
|
||||
0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0,//2050-2059
|
||||
0x092e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4,//2060-2069
|
||||
0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0,//2070-2079
|
||||
0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160,//2080-2089
|
||||
0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a4d0, 0x0d150, 0x0f252,//2090-2099
|
||||
0x0d520];//2100;
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* 24节气速查表
|
||||
* @Array Of Property
|
||||
* @trans['小寒','大寒','立春','雨水','惊蛰','春分','清明','谷雨','立夏','小满','芒种','夏至','小暑','大暑','立秋','处暑','白露','秋分','寒露','霜降','立冬','小雪','大雪','冬至']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u5c0f\u5bd2', '\u5927\u5bd2', '\u7acb\u6625', '\u96e8\u6c34', '\u60ca\u86f0', '\u6625\u5206', '\u6e05\u660e', '\u8c37\u96e8', '\u7acb\u590f', '\u5c0f\u6ee1', '\u8292\u79cd', '\u590f\u81f3', '\u5c0f\u6691', '\u5927\u6691', '\u7acb\u79cb', '\u5904\u6691', '\u767d\u9732', '\u79cb\u5206', '\u5bd2\u9732', '\u971c\u964d', '\u7acb\u51ac', '\u5c0f\u96ea', '\u5927\u96ea', '\u51ac\u81f3'
|
||||
];
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* 数字转中文速查表
|
||||
* @Array Of Property
|
||||
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u65e5',
|
||||
'\u4e00',
|
||||
'\u4e8c',
|
||||
'\u4e09',
|
||||
'\u56db',
|
||||
'\u4e94',
|
||||
'\u516d',
|
||||
'\u4e03',
|
||||
'\u516b',
|
||||
'\u4e5d',
|
||||
'\u5341'
|
||||
];
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* 日期转农历称呼速查表
|
||||
* @Array Of Property
|
||||
* @trans ['初','十','廿','卅']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default ['\u521d', '\u5341', '\u5eff', '\u5345'];
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* 月份转农历称呼速查表
|
||||
* @Array Of Property
|
||||
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u6b63',
|
||||
'\u4e8c',
|
||||
'\u4e09',
|
||||
'\u56db',
|
||||
'\u4e94',
|
||||
'\u516d',
|
||||
'\u4e03',
|
||||
'\u516b',
|
||||
'\u4e5d',
|
||||
'\u5341',
|
||||
'\u51ac',
|
||||
'\u814a'
|
||||
];
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* 年份数字转中文速查表
|
||||
* @Array Of Property
|
||||
* @trans ['零','一','二','三','四','五','六','七','八','九','十']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u96f6',
|
||||
'\u4e00',
|
||||
'\u4e8c',
|
||||
'\u4e09',
|
||||
'\u56db',
|
||||
'\u4e94',
|
||||
'\u516d',
|
||||
'\u4e03',
|
||||
'\u516b',
|
||||
'\u4e5d',
|
||||
'\u5341'
|
||||
];
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* 公历每个月份的天数普通表
|
||||
* @Array Of Property
|
||||
* @return Number
|
||||
*/
|
||||
export default [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* 天干地支之地支速查表
|
||||
* @Array Of Property
|
||||
* @trans['子','丑','寅','卯','辰','巳','午','未','申','酉','戌','亥']
|
||||
* @return Cn string
|
||||
*/
|
||||
export default [
|
||||
'\u5b50',
|
||||
'\u4e11',
|
||||
'\u5bc5',
|
||||
'\u536f',
|
||||
'\u8fb0',
|
||||
'\u5df3',
|
||||
'\u5348',
|
||||
'\u672a',
|
||||
'\u7533',
|
||||
'\u9149',
|
||||
'\u620c',
|
||||
'\u4ea5'
|
||||
];
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>测试</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="./lib/solarlunar.min.js"></script>
|
||||
<script>
|
||||
console.log(solarlunar.solar2lunar(2015, 10, 2))
|
||||
console.log(solarlunar.solar2lunar(2015, 10, 8))
|
||||
console.log(solarlunar.lunar2solar(2015, 10, 2))
|
||||
console.log(solarlunar.lunar2solar(2015, 8, 26))
|
||||
console.log(solarlunar.solar2lunar(2033, 12, 23))
|
||||
console.log(solarlunar.solar2lunar(2017, 12, 14)) // 10.27
|
||||
console.log(solarlunar.solar2lunar(1949, 8, 14)) // 7.20
|
||||
console.log(solarlunar.solar2lunar(1949, 9, 14)) // 闰月 7.20
|
||||
console.log(solarlunar.solar2lunar(1949, 10, 14)) // 8.23
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,62 @@
|
|||
'use strict';
|
||||
|
||||
var webpackCfg = require('./webpack.config.js');
|
||||
var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
|
||||
module.exports = function (config) {
|
||||
var indexSpec = path.join(process.cwd(), './test/solarLunar.spec.js');
|
||||
var files = [
|
||||
indexSpec,
|
||||
];
|
||||
var preprocessors = {};
|
||||
preprocessors[indexSpec] = ['webpack'];
|
||||
|
||||
var reporters = ['mocha'];
|
||||
|
||||
if (process.env.TRAVIS_JOB_ID) {
|
||||
reporters = ['coverage', 'coveralls'];
|
||||
}
|
||||
|
||||
var coverageReporter = {
|
||||
reporters: [
|
||||
{
|
||||
type: 'lcov',
|
||||
subdir: '.',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
webpackCfg.module.rules.push({
|
||||
test: /\.jsx?$/,
|
||||
loader: 'istanbul-instrumenter-loader',
|
||||
include: [path.join(process.cwd(), './src')],
|
||||
enforce: 'post'
|
||||
});
|
||||
|
||||
var conf = {
|
||||
reporters: reporters,
|
||||
singleRun: true,
|
||||
browsers: ['Electron'],
|
||||
electronOpts: {},
|
||||
client: {
|
||||
mocha: {
|
||||
reporter: 'html', // change Karma's debug.html to the mocha web reporter
|
||||
ui: 'bdd',
|
||||
},
|
||||
},
|
||||
frameworks: ['mocha'],
|
||||
files: files,
|
||||
preprocessors: preprocessors,
|
||||
coverageReporter: coverageReporter,
|
||||
webpack: webpackCfg,
|
||||
webpackServer: {
|
||||
noInfo: true, //please don't spam the console when running in karma!
|
||||
},
|
||||
};
|
||||
|
||||
config.set(conf);
|
||||
};
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
"name": "solarlunar",
|
||||
"version": "2.0.7",
|
||||
"description": "阳历阴历(公历农历)互转",
|
||||
"main": "lib/solarlunar.min.js",
|
||||
"scripts": {
|
||||
"build": "webpack --env build",
|
||||
"dev": "webpack --progress --colors --watch --env dev",
|
||||
"test": "karma start karma.conf.js",
|
||||
"test:watch": "mocha --compilers js:babel-core/register --colors -w ./test/*.spec.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/yize/solarlunar.git"
|
||||
},
|
||||
"keywords": [
|
||||
"calendar",
|
||||
"公历",
|
||||
"农历",
|
||||
"阳历",
|
||||
"阴历",
|
||||
"solar",
|
||||
"lunar"
|
||||
],
|
||||
"author": "yize",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/yize/solarlunar/issues"
|
||||
},
|
||||
"homepage": "https://github.com/yize/solarlunar#readme",
|
||||
"devDependencies": {
|
||||
"babel-cli": "6.24.1",
|
||||
"babel-core": "^6.3.26",
|
||||
"babel-eslint": "7.2.3",
|
||||
"babel-loader": "7.0.0",
|
||||
"babel-plugin-add-module-exports": "0.2.1",
|
||||
"babel-preset-es2015": "6.24.1",
|
||||
"chai": "3.5.0",
|
||||
"electron": "^1.7.8",
|
||||
"electron-prebuilt": "^1.4.13",
|
||||
"eslint": "3.19.0",
|
||||
"eslint-loader": "1.7.1",
|
||||
"gulp": "^3.9.0",
|
||||
"istanbul-instrumenter-loader": "^0.2.0",
|
||||
"karma": "^1.7.1",
|
||||
"karma-coverage": "^1.1.1",
|
||||
"karma-coveralls": "^1.1.2",
|
||||
"karma-electron-launcher": "^0.1.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-mocha-reporter": "^2.2.4",
|
||||
"karma-webpack": "^2.0.4",
|
||||
"mocha": "3.3.0",
|
||||
"should": "~7.1.0",
|
||||
"webpack": "3.1.0",
|
||||
"yargs": "7.1.0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import solarLunar from './solarLunar';
|
||||
|
||||
export default solarLunar;
|
|
@ -0,0 +1,444 @@
|
|||
/**
|
||||
* @1900-2100区间内的公历、农历互转
|
||||
* @charset UTF-8
|
||||
* @author Ajing(JJonline@JJonline.Cn)
|
||||
* @Time 2014-7-21
|
||||
* @Version $ID$
|
||||
* @公历转农历:solarLunar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
|
||||
* @农历转公历:solarLunar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
|
||||
* @link http://blog.jjonline.cn/userInterFace/173.html
|
||||
*/
|
||||
|
||||
import lunarInfo from '../const/lunarInfo';
|
||||
import solarMonth from '../const/solarMonth';
|
||||
import gan from '../const/gan';
|
||||
import zhi from '../const/zhi';
|
||||
import animals from '../const/animals';
|
||||
import lunarTerm from '../const/lunarTerm';
|
||||
import lTermInfo from '../const/lTermInfo';
|
||||
import nStr1 from '../const/nStr1';
|
||||
import nStr2 from '../const/nStr2';
|
||||
import nStr3 from '../const/nStr3';
|
||||
import nStr4 from '../const/nStr4';
|
||||
|
||||
const solarLunar = {
|
||||
lunarInfo,
|
||||
solarMonth,
|
||||
gan,
|
||||
zhi,
|
||||
animals,
|
||||
lunarTerm,
|
||||
lTermInfo,
|
||||
nStr1,
|
||||
nStr2,
|
||||
nStr3,
|
||||
nStr4,
|
||||
/**
|
||||
* 返回农历y年一整年的总天数
|
||||
* @param lunar Year
|
||||
* @return Number
|
||||
* @eg:var count = solarLunar.lYearDays(1987) ;//count=387
|
||||
*/
|
||||
lYearDays: function (y) {
|
||||
var i, sum = 348;
|
||||
for (i = 0x8000; i > 0x8; i >>= 1) {
|
||||
sum += (solarLunar.lunarInfo[y - 1900] & i) ? 1 : 0;
|
||||
}
|
||||
return (sum + solarLunar.leapDays(y));
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
||||
* @param lunar Year
|
||||
* @return Number (0-12)
|
||||
* @eg:var leapMonth = solarLunar.leapMonth(1987) ;//leapMonth=6
|
||||
*/
|
||||
leapMonth: function (y) { //闰字编码 \u95f0
|
||||
return (solarLunar.lunarInfo[y - 1900] & 0xf);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
||||
* @param lunar Year
|
||||
* @return Number (0、29、30)
|
||||
* @eg:var leapMonthDay = solarLunar.leapDays(1987) ;//leapMonthDay=29
|
||||
*/
|
||||
leapDays: function (y) {
|
||||
if (solarLunar.leapMonth(y)) {
|
||||
return ((solarLunar.lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
|
||||
}
|
||||
return (0);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 返回农历 y 年 m 月(非闰月)的总天数,计算 m 为闰月时的天数请使用 leapDays 方法
|
||||
* @param lunar Year
|
||||
* @return Number (-1、29、30)
|
||||
* @eg:var MonthDay = solarLunar.monthDays(1987,9) ;//MonthDay=29
|
||||
*/
|
||||
monthDays: function (y, m) {
|
||||
if (m > 12 || m < 1) {
|
||||
return -1;
|
||||
}//月份参数从1至12,参数错误返回-1
|
||||
return ((solarLunar.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 返回公历(!)y年m月的天数
|
||||
* @param solar Year
|
||||
* @return Number (-1、28、29、30、31)
|
||||
* @eg:var solarMonthDay = solarLunar.leapDays(1987) ;//solarMonthDay=30
|
||||
*/
|
||||
solarDays: function (y, m) {
|
||||
if (m > 12 || m < 1) {
|
||||
return -1;
|
||||
} //若参数错误 返回-1
|
||||
var ms = m - 1;
|
||||
if (ms == 1) { //2月份的闰平规律测算后确认返回28或29
|
||||
return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28);
|
||||
} else {
|
||||
return (solarLunar.solarMonth[ms]);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 传入offset偏移量返回干支
|
||||
* @param offset 相对甲子的偏移量
|
||||
* @return Cn string
|
||||
*/
|
||||
toGanZhi: function (offset) {
|
||||
return (solarLunar.gan[offset % 10] + solarLunar.zhi[offset % 12]);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 传入公历(!) y 年获得该年第 n 个节气的公历日期
|
||||
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
||||
* @return number Number
|
||||
* @eg:var _24 = solarLunar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
||||
*/
|
||||
getTerm: function (y, n) {
|
||||
if (y < 1900 || y > 2100) {
|
||||
return -1;
|
||||
}
|
||||
if (n < 1 || n > 24) {
|
||||
return -1;
|
||||
}
|
||||
var _table = solarLunar.lTermInfo[y - 1900];
|
||||
var _info = [
|
||||
parseInt('0x' + _table.substr(0, 5)).toString(),
|
||||
parseInt('0x' + _table.substr(5, 5)).toString(),
|
||||
parseInt('0x' + _table.substr(10, 5)).toString(),
|
||||
parseInt('0x' + _table.substr(15, 5)).toString(),
|
||||
parseInt('0x' + _table.substr(20, 5)).toString(),
|
||||
parseInt('0x' + _table.substr(25, 5)).toString()
|
||||
];
|
||||
var _calDay = [
|
||||
_info[0].substr(0, 1),
|
||||
_info[0].substr(1, 2),
|
||||
_info[0].substr(3, 1),
|
||||
_info[0].substr(4, 2),
|
||||
|
||||
_info[1].substr(0, 1),
|
||||
_info[1].substr(1, 2),
|
||||
_info[1].substr(3, 1),
|
||||
_info[1].substr(4, 2),
|
||||
|
||||
_info[2].substr(0, 1),
|
||||
_info[2].substr(1, 2),
|
||||
_info[2].substr(3, 1),
|
||||
_info[2].substr(4, 2),
|
||||
|
||||
_info[3].substr(0, 1),
|
||||
_info[3].substr(1, 2),
|
||||
_info[3].substr(3, 1),
|
||||
_info[3].substr(4, 2),
|
||||
|
||||
_info[4].substr(0, 1),
|
||||
_info[4].substr(1, 2),
|
||||
_info[4].substr(3, 1),
|
||||
_info[4].substr(4, 2),
|
||||
|
||||
_info[5].substr(0, 1),
|
||||
_info[5].substr(1, 2),
|
||||
_info[5].substr(3, 1),
|
||||
_info[5].substr(4, 2)
|
||||
];
|
||||
return parseInt(_calDay[n - 1]);
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入农历年份数字返回汉语通俗表示法
|
||||
* @param lunar year
|
||||
* @return string
|
||||
* @eg:
|
||||
*/
|
||||
toChinaYear: function (y) { //年 => \u5E74
|
||||
var oxxx = parseInt(y / 1000);
|
||||
var xoxx = parseInt(y % 1000 / 100);
|
||||
var xxox = parseInt(y % 100 / 10);
|
||||
var xxxo = y % 10;
|
||||
|
||||
return solarLunar.nStr4[oxxx] + solarLunar.nStr4[xoxx] + solarLunar.nStr4[xxox] + solarLunar.nStr4[xxxo] + "\u5E74";
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入农历数字月份返回汉语通俗表示法
|
||||
* @param lunar month
|
||||
* @return number string
|
||||
* @eg:var cnMonth = solarLunar.toChinaMonth(12) ;//cnMonth='腊月'
|
||||
*/
|
||||
toChinaMonth: function (m) { // 月 => \u6708
|
||||
if (m > 12 || m < 1) {
|
||||
return -1;
|
||||
} //若参数错误 返回-1
|
||||
var s = solarLunar.nStr3[m - 1];
|
||||
s += "\u6708";//加上月字
|
||||
return s;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 传入农历日期数字返回汉字表示法
|
||||
* @param lunar day
|
||||
* @return Cn string
|
||||
* @eg:var cnDay = solarLunar.toChinaDay(21) ;//cnMonth='廿一'
|
||||
*/
|
||||
toChinaDay: function (d) { //日 => \u65e5
|
||||
var s;
|
||||
switch (d) {
|
||||
case 10:
|
||||
s = '\u521d\u5341';
|
||||
break;
|
||||
case 20:
|
||||
s = '\u4e8c\u5341';
|
||||
break;
|
||||
break;
|
||||
case 30:
|
||||
s = '\u4e09\u5341';
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
s = solarLunar.nStr2[Math.floor(d / 10)];
|
||||
s += solarLunar.nStr1[d % 10];
|
||||
}
|
||||
return (s);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
||||
* @param y year
|
||||
* @return Cn string
|
||||
* @eg:var animal = solarLunar.getAnimal(1987) ;//animal='兔'
|
||||
* todo 生肖需要精确转换
|
||||
*/
|
||||
getAnimal: function (y) {
|
||||
return solarLunar.animals[(y - 4) % 12];
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 传入公历年月日获得详细的公历、农历object信息 <=>JSON
|
||||
* @param y solar year
|
||||
* @param m solar month
|
||||
* @param d solar day
|
||||
* @return JSON object
|
||||
* @eg:console.log(solarLunar.solar2lunar(1987,11,01));
|
||||
*/
|
||||
solar2lunar: function (y, m, d) { //参数区间1900.1.31~2100.12.31
|
||||
if (y < 1900 || y > 2100) {
|
||||
return -1;
|
||||
}//年份限定、上限
|
||||
if (y == 1900 && m == 1 && d < 31) {
|
||||
return -1;
|
||||
}//下限
|
||||
if (!y) { //未传参 获得当天
|
||||
var objDate = new Date();
|
||||
} else {
|
||||
var objDate = new Date(y, parseInt(m) - 1, d);
|
||||
}
|
||||
var i, leap = 0, temp = 0;
|
||||
//修正ymd参数
|
||||
var y = objDate.getFullYear(), m = objDate.getMonth() + 1, d = objDate.getDate();
|
||||
var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000;
|
||||
for (i = 1900; i < 2101 && offset > 0; i++) {
|
||||
temp = solarLunar.lYearDays(i);
|
||||
offset -= temp;
|
||||
}
|
||||
if (offset < 0) {
|
||||
offset += temp;
|
||||
i--;
|
||||
}
|
||||
|
||||
//是否今天
|
||||
var isTodayObj = new Date(), isToday = false;
|
||||
if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
|
||||
isToday = true;
|
||||
}
|
||||
//星期几
|
||||
var nWeek = objDate.getDay(), cWeek = solarLunar.nStr1[nWeek];
|
||||
if (nWeek == 0) {
|
||||
nWeek = 7;
|
||||
}//数字表示周几顺应天朝周一开始的惯例
|
||||
//农历年
|
||||
var year = i;
|
||||
|
||||
var leap = solarLunar.leapMonth(i); //闰哪个月
|
||||
|
||||
var isLeap = false;
|
||||
|
||||
//效验闰月
|
||||
for (i = 1; i < 13 && offset > 0; i++) {
|
||||
//闰月
|
||||
if (leap > 0 && i == (leap + 1) && isLeap == false) {
|
||||
--i;
|
||||
isLeap = true;
|
||||
temp = solarLunar.leapDays(year); //计算农历闰月天数
|
||||
}
|
||||
else {
|
||||
temp = solarLunar.monthDays(year, i);//计算农历普通月天数
|
||||
}
|
||||
//解除闰月
|
||||
if (isLeap == true && i == (leap + 1)) {
|
||||
isLeap = false;
|
||||
}
|
||||
offset -= temp;
|
||||
}
|
||||
|
||||
if (offset == 0 && leap > 0 && i == leap + 1)
|
||||
if (isLeap) {
|
||||
isLeap = false;
|
||||
} else {
|
||||
isLeap = true;
|
||||
--i;
|
||||
}
|
||||
if (offset < 0) {
|
||||
offset += temp;
|
||||
--i;
|
||||
}
|
||||
//农历月
|
||||
var month = i;
|
||||
//农历日
|
||||
var day = offset + 1;
|
||||
|
||||
//天干地支处理
|
||||
var sm = m - 1;
|
||||
var term3 = solarLunar.getTerm(y, 3); //该公历年立春日期
|
||||
var gzY = solarLunar.toGanZhi(y - 4);//普通按年份计算,下方尚需按立春节气来修正
|
||||
var termTimestamp = new Date(y, 1, term3).getTime();
|
||||
var dayTimestamp = new Date(y, sm, d).getTime();
|
||||
//依据立春日进行修正gzY
|
||||
if (dayTimestamp < termTimestamp) {
|
||||
gzY = solarLunar.toGanZhi(y - 5);
|
||||
}
|
||||
|
||||
//月柱 1900年1月小寒以前为 丙子月(60进制12)
|
||||
var firstNode = solarLunar.getTerm(y, (m * 2 - 1));//返回当月「节」为几日开始
|
||||
var secondNode = solarLunar.getTerm(y, (m * 2));//返回当月「节」为几日开始
|
||||
|
||||
//依据12节气修正干支月
|
||||
var gzM = solarLunar.toGanZhi((y - 1900) * 12 + m + 11);
|
||||
if (d >= firstNode) {
|
||||
gzM = solarLunar.toGanZhi((y - 1900) * 12 + m + 12);
|
||||
}
|
||||
|
||||
//传入的日期的节气与否
|
||||
var isTerm = false;
|
||||
var term = "";
|
||||
if (firstNode == d) {
|
||||
isTerm = true;
|
||||
term = solarLunar.lunarTerm[m * 2 - 2];
|
||||
}
|
||||
if (secondNode == d) {
|
||||
isTerm = true;
|
||||
term = solarLunar.lunarTerm[m * 2 - 1];
|
||||
}
|
||||
//日柱 当月一日与 1900/1/1 相差天数
|
||||
var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10;
|
||||
var gzD = solarLunar.toGanZhi(dayCyclical + d - 1);
|
||||
return {
|
||||
'lYear': year,
|
||||
'lMonth': month,
|
||||
'lDay': day,
|
||||
'animal': solarLunar.getAnimal(year),
|
||||
'yearCn': solarLunar.toChinaYear(year),
|
||||
'monthCn': (isLeap && leap === month ? "\u95f0" : '') + solarLunar.toChinaMonth(month),
|
||||
'dayCn': solarLunar.toChinaDay(day),
|
||||
'cYear': y,
|
||||
'cMonth': m,
|
||||
'cDay': d,
|
||||
'gzYear': gzY,
|
||||
'gzMonth': gzM,
|
||||
'gzDay': gzD,
|
||||
'isToday': isToday,
|
||||
'isLeap': isLeap,
|
||||
'nWeek': nWeek,
|
||||
'ncWeek': "\u661f\u671f" + cWeek,
|
||||
'isTerm': isTerm,
|
||||
'term': term
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 传入公历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
|
||||
* @param y lunar year
|
||||
* @param m lunar month
|
||||
* @param d lunar day
|
||||
* @param isLeapMonth lunar month is leap or not.
|
||||
* @return JSON object
|
||||
* @eg:console.log(solarLunar.lunar2solar(1987,9,10));
|
||||
*/
|
||||
lunar2solar: function (y, m, d, isLeapMonth) { //参数区间1900.1.31~2100.12.1
|
||||
var leapOffset = 0;
|
||||
var leapMonth = solarLunar.leapMonth(y);
|
||||
var leapDay = solarLunar.leapDays(y);
|
||||
if (isLeapMonth && (leapMonth != m)) {
|
||||
return -1;
|
||||
}//传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
|
||||
if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) {
|
||||
return -1;
|
||||
}//超出了最大极限值
|
||||
var day = solarLunar.monthDays(y, m);
|
||||
if (y < 1900 || y > 2100 || d > day) {
|
||||
return -1;
|
||||
}//参数合法性效验
|
||||
|
||||
//计算农历的时间差
|
||||
var offset = 0;
|
||||
for (var i = 1900; i < y; i++) {
|
||||
offset += solarLunar.lYearDays(i);
|
||||
}
|
||||
var leap = 0, isAdd = false;
|
||||
for (var i = 1; i < m; i++) {
|
||||
leap = solarLunar.leapMonth(y);
|
||||
if (!isAdd) {//处理闰月
|
||||
if (leap <= i && leap > 0) {
|
||||
offset += solarLunar.leapDays(y);
|
||||
isAdd = true;
|
||||
}
|
||||
}
|
||||
offset += solarLunar.monthDays(y, i);
|
||||
}
|
||||
//转换闰月农历 需补充该年闰月的前一个月的时差
|
||||
if (isLeapMonth) {
|
||||
offset += day;
|
||||
}
|
||||
//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
|
||||
var stmap = Date.UTC(1900, 1, 30, 0, 0, 0);
|
||||
var calObj = new Date((offset + d - 31) * 86400000 + stmap);
|
||||
var cY = calObj.getUTCFullYear();
|
||||
var cM = calObj.getUTCMonth() + 1;
|
||||
var cD = calObj.getUTCDate();
|
||||
|
||||
return solarLunar.solar2lunar(cY, cM, cD);
|
||||
}
|
||||
};
|
||||
|
||||
export default solarLunar;
|
|
@ -0,0 +1,199 @@
|
|||
import solarLunar, { solar2lunar, lunar2solar } from '../src/';
|
||||
import should from 'should';
|
||||
|
||||
const solar2lunarData = solar2lunar(2015, 10, 2); // 转换为阴历
|
||||
const solar2lunarData2 = solar2lunar(2015, 10, 8); // 转换为阴历
|
||||
const lunar2solarData = lunar2solar(2015, 10, 2); // 转换为公历
|
||||
const lunar2solarData2 = lunar2solar(2015, 8, 26); // 转换为公历
|
||||
const solar2lunarData3 = solar2lunar(2033, 12, 23); // 转换为阴历
|
||||
const solar2lunarData4 = solar2lunar(2017, 12, 14); // 转换为阴历
|
||||
|
||||
const solar2lunarData5 = solar2lunar(1949, 8, 14); // 转换为阴历 7.20
|
||||
const solar2lunarData6 = solar2lunar(1949, 9, 14); // 转换为阴历 闰月 7.20
|
||||
const solar2lunarData7 = solar2lunar(1949, 10, 14); // 转换为阴历 8.23
|
||||
const solar2lunarData8 = solar2lunar(2019, 1, 31); // 转换为阴历 2019.1.27 干支
|
||||
const solar2lunarData9 = solar2lunar(2019, 2, 4); // 转换为阴历 2019.1.27 干支
|
||||
const solar2lunarData10 = solar2lunar(2018, 2, 2); // 转换为阴历 2019.1.27 干支
|
||||
|
||||
describe('should work', function () {
|
||||
describe('solar2lunar', function () {
|
||||
it('should have property solar2lunar', function () {
|
||||
solarLunar.should.have.property('solar2lunar');
|
||||
});
|
||||
it('lYear should equal 2015', function () {
|
||||
solar2lunarData.lYear.should.be.equal(2015);
|
||||
});
|
||||
it('lMonth should equal 8', function () {
|
||||
solar2lunarData.lMonth.should.be.equal(8);
|
||||
});
|
||||
it('lDay should equal 20', function () {
|
||||
solar2lunarData.lDay.should.be.equal(20);
|
||||
});
|
||||
it('animal should equal 羊', function () {
|
||||
solar2lunarData.animal.should.be.equal('羊');
|
||||
});
|
||||
it('yearCn should equal 二零一五年', function () {
|
||||
solar2lunarData.yearCn.should.be.equal('二零一五年');
|
||||
});
|
||||
it('monthCn should equal 八月', function () {
|
||||
solar2lunarData.monthCn.should.be.equal('八月');
|
||||
});
|
||||
it('dayCn should equal 二十', function () {
|
||||
solar2lunarData.dayCn.should.be.equal('二十');
|
||||
});
|
||||
it('gzYear should equal 乙未', function () {
|
||||
solar2lunarData.gzYear.should.be.equal('乙未');
|
||||
});
|
||||
it('gzMonth should equal 乙酉', function () {
|
||||
solar2lunarData.gzMonth.should.be.equal('乙酉');
|
||||
});
|
||||
it('gzDay should equal 辛亥', function () {
|
||||
solar2lunarData.gzDay.should.be.equal('辛亥');
|
||||
});
|
||||
it('isToday should equal false', function () {
|
||||
solar2lunarData.isToday.should.be.false();
|
||||
});
|
||||
it('isLeap should equal false', function () {
|
||||
solar2lunarData.isLeap.should.be.false();
|
||||
});
|
||||
it('nWeek should equal 5', function () {
|
||||
solar2lunarData.nWeek.should.be.equal(5);
|
||||
});
|
||||
it('ncWeek should equal 星期五', function () {
|
||||
solar2lunarData.ncWeek.should.be.equal('星期五');
|
||||
});
|
||||
it('isTerm should equal false', function () {
|
||||
solar2lunarData.isTerm.should.be.false();
|
||||
});
|
||||
it('term should equal empty string', function () {
|
||||
should(solar2lunarData.term).be.exactly('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('solar2lunar that has term', function () {
|
||||
it('isTerm should be true', function () {
|
||||
should(solar2lunarData2.isTerm).be.true();
|
||||
});
|
||||
it('term should not be null', function () {
|
||||
should(solar2lunarData2.term).not.be.null();
|
||||
});
|
||||
it('term should equal 寒露', function () {
|
||||
should(solar2lunarData2.term).be.equal('寒露');
|
||||
});
|
||||
});
|
||||
|
||||
describe('lunar2solar', function () {
|
||||
it('should have property lunar2solar', function () {
|
||||
solarLunar.should.have.property('lunar2solar');
|
||||
});
|
||||
it('lYear should equal 2015', function () {
|
||||
lunar2solarData.lYear.should.be.equal(2015);
|
||||
});
|
||||
it('lMonth should equal 10', function () {
|
||||
lunar2solarData.lMonth.should.be.equal(10);
|
||||
});
|
||||
it('lDay should equal 2', function () {
|
||||
lunar2solarData.lDay.should.be.equal(2);
|
||||
});
|
||||
it('animal should equal 羊', function () {
|
||||
lunar2solarData.animal.should.be.equal('羊');
|
||||
});
|
||||
it('yearCn should equal 二零一五年', function () {
|
||||
solar2lunarData.yearCn.should.be.equal('二零一五年');
|
||||
});
|
||||
it('monthCn should equal 十月', function () {
|
||||
lunar2solarData.monthCn.should.be.equal('十月');
|
||||
});
|
||||
it('dayCn should equal 初二', function () {
|
||||
lunar2solarData.dayCn.should.be.equal('初二');
|
||||
});
|
||||
it('gzYear should equal 乙未', function () {
|
||||
lunar2solarData.gzYear.should.be.equal('乙未');
|
||||
});
|
||||
it('gzMonth should equal 丁亥', function () {
|
||||
lunar2solarData.gzMonth.should.be.equal('丁亥');
|
||||
});
|
||||
it('gzDay should equal 癸巳', function () {
|
||||
lunar2solarData.gzDay.should.be.equal('癸巳');
|
||||
});
|
||||
it('isToday should equal false', function () {
|
||||
lunar2solarData.isToday.should.be.false();
|
||||
});
|
||||
it('isLeap should equal false', function () {
|
||||
lunar2solarData.isLeap.should.be.false();
|
||||
});
|
||||
it('nWeek should equal 5', function () {
|
||||
lunar2solarData.nWeek.should.be.equal(5);
|
||||
});
|
||||
it('ncWeek should equal 星期五', function () {
|
||||
lunar2solarData.ncWeek.should.be.equal('星期五');
|
||||
});
|
||||
it('isTerm should equal false', function () {
|
||||
lunar2solarData.isTerm.should.be.false();
|
||||
});
|
||||
it('term should equal empty string', function () {
|
||||
should(lunar2solarData.term).be.exactly('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('lunar2solar that has term', function () {
|
||||
it('isTerm should be true', function () {
|
||||
should(lunar2solarData2.isTerm).be.true();
|
||||
});
|
||||
it('term should not be null', function () {
|
||||
should(lunar2solarData2.term).not.be.null();
|
||||
});
|
||||
it('term should equal 寒露', function () {
|
||||
should(lunar2solarData2.term).be.equal('寒露');
|
||||
});
|
||||
});
|
||||
describe('2033/12/23', function () {
|
||||
it('should be leap', function () {
|
||||
should(solar2lunarData3.isLeap).be.true();
|
||||
});
|
||||
});
|
||||
describe('2017/12/14', function () {
|
||||
it('should not be leap', function () {
|
||||
should(solar2lunarData4.monthCn).be.equal('十月');
|
||||
});
|
||||
});
|
||||
describe('1949/8/14', function () {
|
||||
it('monthCn should equal 七月', function () {
|
||||
should(solar2lunarData5.monthCn).be.equal('七月');
|
||||
});
|
||||
it('isLeap should equal false', function () {
|
||||
solar2lunarData5.isLeap.should.be.false();
|
||||
});
|
||||
});
|
||||
describe('1949/9/14', function () {
|
||||
it('monthCn should equal 闰七月', function () {
|
||||
should(solar2lunarData6.monthCn).be.equal('闰七月');
|
||||
});
|
||||
it('isLeap should equal true', function () {
|
||||
solar2lunarData6.isLeap.should.be.true();
|
||||
});
|
||||
});
|
||||
describe('1949/10/14', function () {
|
||||
it('monthCn should equal 八月', function () {
|
||||
should(solar2lunarData7.monthCn).be.equal('八月');
|
||||
});
|
||||
it('isLeap should equal false', function () {
|
||||
solar2lunarData7.isLeap.should.be.false();
|
||||
});
|
||||
});
|
||||
describe('2019/2/1', function () {
|
||||
it('gzYear should be 戊戌', function () {
|
||||
should(solar2lunarData8.gzYear).be.equal('戊戌');
|
||||
});
|
||||
});
|
||||
describe('2019/2/5', function () {
|
||||
it('gzYear should be 己亥', function () {
|
||||
should(solar2lunarData9.gzYear).be.equal('己亥');
|
||||
});
|
||||
});
|
||||
describe('2018/2/2', function () {
|
||||
it('gzYear should be 丁酉', function () {
|
||||
should(solar2lunarData10.gzYear).be.equal('丁酉');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -0,0 +1,51 @@
|
|||
/* global __dirname, require, module*/
|
||||
|
||||
const webpack = require('webpack');
|
||||
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
||||
const path = require('path');
|
||||
const env = require('yargs').argv.env; // use --env with webpack 2
|
||||
|
||||
let libraryName = 'solarlunar';
|
||||
|
||||
let plugins = [],
|
||||
outputFile;
|
||||
|
||||
if (env === 'build') {
|
||||
plugins.push(new UglifyJsPlugin({ minimize: true }));
|
||||
outputFile = libraryName + '.min.js';
|
||||
} else {
|
||||
outputFile = libraryName + '.js';
|
||||
}
|
||||
|
||||
const config = {
|
||||
entry: __dirname + '/src/index.js',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
path: __dirname + '/lib',
|
||||
filename: outputFile,
|
||||
library: libraryName,
|
||||
libraryTarget: 'umd',
|
||||
umdNamedDefine: true
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /(\.jsx|\.js)$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /(node_modules|bower_components)/
|
||||
},
|
||||
{
|
||||
test: /(\.jsx|\.js)$/,
|
||||
loader: 'eslint-loader',
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
modules: [path.resolve('./node_modules'), path.resolve('./src')],
|
||||
extensions: ['.json', '.js']
|
||||
},
|
||||
plugins: plugins
|
||||
};
|
||||
|
||||
module.exports = config;
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "hldy_app",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"solarlunar": "^2.0.7"
|
||||
}
|
||||
},
|
||||
"node_modules/solarlunar": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmmirror.com/solarlunar/-/solarlunar-2.0.7.tgz",
|
||||
"integrity": "sha512-2SfuCCgAAxFU5MTMYuKGbRgRLcPTJQf3azMEw/GmBpHXA7N2eAQJStSqktZJjnq4qRCboBPnqEB866+PCregag==",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"solarlunar": "^2.0.7"
|
||||
}
|
||||
}
|
|
@ -24,6 +24,14 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
},
|
||||
// 服务考核
|
||||
{
|
||||
"path": "pages/assess/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
},
|
||||
// 登录
|
||||
{
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
<template>
|
||||
<view class="backgroundContainer">
|
||||
<view class="assess-title">
|
||||
<view class="left-icons">
|
||||
<image class="left-icons-img" :src="`/static/index/undericons/doublekuai.png`" />
|
||||
<view class="right-icons-font">服务考核-</view>
|
||||
<view class="right-icons-text">批量考核</view>
|
||||
</view>
|
||||
<view class="right-icons">
|
||||
<image class="right-icons-img" :src="`/static/index/undericons/man.png`" />
|
||||
<view :class="darkFans?`right-icons-font-dark`: `right-icons-font` ">王金福</view>
|
||||
<image class="right-icons-img-icon"
|
||||
:src="darkFans?`/static/index/undericons/face.png`:`/static/index/undericons/facelight.png`" />
|
||||
<image class="right-icons-img-icon"
|
||||
:src="darkFans?`/static/index/undericons/hand.png`:`/static/index/undericons/handlight.png`" />
|
||||
<image class="right-icons-img-icon" @click="jumpTo"
|
||||
:src="darkFans?`/static/index/undericons/out.png`:`/static/index/undericons/outlight.png`" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="assess-another">
|
||||
<view class="left-contain">
|
||||
<view class="calendar">
|
||||
<calendar />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <calendar /> -->
|
||||
<!-- <view v-for="(item,index) in menuArray" :key="index">
|
||||
<view class="menuCard" @click="jumpTo(item.url)">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="small-button">
|
||||
服务考核
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 自动更新组件 -->
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onBeforeUnmount, computed, nextTick, } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import calendar from '@/component/public/calendar.vue'
|
||||
// 暗黑模式
|
||||
const darkFans = ref(false);
|
||||
const zyupgrade = ref(null)
|
||||
type darkFanstype = {
|
||||
darkFans : boolean
|
||||
}
|
||||
|
||||
const jumpTo = (url : string) => {
|
||||
uni.navigateBack()
|
||||
// uni.navigateTo({
|
||||
// url: url
|
||||
// });
|
||||
}
|
||||
// 生命周期钩子
|
||||
onLoad((options : darkFanstype) => {
|
||||
// 为uni.navigateBack()啥这么写,因为options给我返回的是字符串这个`false`,只能这么写,前端中`false`是true
|
||||
// uni.navigateBack()
|
||||
});
|
||||
|
||||
// 生命周期钩子
|
||||
onShow(() => {
|
||||
zyupgrade.value?.check_update()
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.backgroundContainer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-image: url('/static/index/lightbgcnew.png');
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.assess-title {
|
||||
margin-top: 60rpx;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.right-icons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
float: right;
|
||||
height: 70rpx;
|
||||
margin-right: 40rpx;
|
||||
|
||||
.right-icons-font {
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
font-size: 35rpx;
|
||||
margin-top: -15rpx;
|
||||
}
|
||||
|
||||
.right-icons-font-dark {
|
||||
color: #fff;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
font-size: 35rpx;
|
||||
margin-top: -15rpx;
|
||||
}
|
||||
|
||||
.right-icons-img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
margin-top: -20rpx;
|
||||
}
|
||||
|
||||
.right-icons-img-icon {
|
||||
width: 60rpx;
|
||||
height: 80rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
.left-icons{
|
||||
display: flex;
|
||||
margin-left: 40rpx;
|
||||
.left-icons-img {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
|
||||
.right-icons-font {
|
||||
font-weight: 700;
|
||||
font-size: 35rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.right-icons-text{
|
||||
font-size: 35rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.assess-another{
|
||||
width: 100%;
|
||||
height: calc(100vh - 120rpx);
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
margin-left: 50rpx;
|
||||
.left-contain{
|
||||
height: 100%;
|
||||
width: 600rpx;
|
||||
.calendar{
|
||||
width: 100%;
|
||||
height: 650rpx;
|
||||
background: linear-gradient(to top,#F4F3FF,#FFFFFF,#ECEFFF);
|
||||
border-radius: 25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -5,6 +5,9 @@
|
|||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="small-button" @click="jumpTo(`/pages/assess/index`)">
|
||||
服务考核
|
||||
</view>
|
||||
</view>
|
||||
<!-- 自动更新组件 -->
|
||||
<zy-update ref="zyupgrade" :noticeflag="true" theme="blue" :h5preview="false" oldversion="1.0.0"
|
||||
|
@ -74,7 +77,19 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.small-button{
|
||||
position: absolute;
|
||||
width: 300rpx;
|
||||
top: 200rpx;
|
||||
left: 600rpx;
|
||||
height: 200rpx;
|
||||
background: linear-gradient(to bottom, #04BCED, #0160CE);
|
||||
border-radius: 30rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
// //暗黑模式
|
||||
// .darkbackgroundContainer {
|
||||
// display: flex;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__FB2D473","name":"养老App","version":{"name":"1.1.4","code":114},"description":"养老App","developer":{"name":"","email":"","url":""},"permissions":{"Share":{},"Camera":{},"VideoPlayer":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"},"prerendered":"false"}},"google":{"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"uni.UNIFB2D473","aliasname":"__uni__fb2d473","password":"Z4Urhm9jqwqMGoeQNpGzJA==","storepwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keypwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"dSYMs":false,"devices":"universal"},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"share":{"weixin":{"UniversalLinks":"","appid":"wxda748470da82886e"}}},"orientation":"portrait-primary"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"control":"uni-v3","vueVersion":"3","compilerVersion":"4.57","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal","webView":{"minUserAgentVersion":"49.0"}},"adid":"122926210510"},"app-harmony":{"useragent":{"value":"uni-app","concatenate":true},"uniStatistics":{"enable":false}},"screenOrientation":["landscape-primary","landscape-secondary"],"launch_path":"__uniappview.html"}
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__FB2D473","name":"养老App","version":{"name":"1.1.5","code":115},"description":"养老App","developer":{"name":"","email":"","url":""},"permissions":{"Share":{},"Camera":{},"VideoPlayer":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"},"prerendered":"false"}},"google":{"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"uni.UNIFB2D473","aliasname":"__uni__fb2d473","password":"Z4Urhm9jqwqMGoeQNpGzJA==","storepwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keypwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"dSYMs":false,"devices":"universal"},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"share":{"weixin":{"UniversalLinks":"","appid":"wxda748470da82886e"}}},"orientation":"portrait-primary"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"control":"uni-v3","vueVersion":"3","compilerVersion":"4.57","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal","webView":{"minUserAgentVersion":"49.0"}},"adid":"122926210510"},"app-harmony":{"useragent":{"value":"uni-app","concatenate":true},"uniStatistics":{"enable":false}},"screenOrientation":["landscape-primary","landscape-secondary"],"launch_path":"__uniappview.html"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,8 +7,8 @@
|
|||
"id": "__UNI__FB2D473",
|
||||
"name": "养老App",
|
||||
"version": {
|
||||
"name": "1.1.4",
|
||||
"code": 114
|
||||
"name": "1.1.5",
|
||||
"code": 115
|
||||
},
|
||||
"description": "养老App",
|
||||
"developer": {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
|||
;(function(){
|
||||
let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
|
||||
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","bounce":"none","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app x","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"养老App","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"4.57","entryPagePath":"pages/index/index","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"locales":{},"darkmode":false,"themeConfig":{}};
|
||||
const __uniRoutes = [{"path":"pages/index/index","meta":{"isQuit":true,"isEntry":true,"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Nursing/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Warehousing/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/login/login","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/timeMatrix/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/timeMatrix/indexnew","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
|
||||
const __uniRoutes = [{"path":"pages/index/index","meta":{"isQuit":true,"isEntry":true,"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Nursing/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Warehousing/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/assess/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/login/login","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/timeMatrix/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/timeMatrix/indexnew","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
|
||||
__uniConfig.styles=[];//styles
|
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,8 +7,8 @@
|
|||
"id": "__UNI__FB2D473",
|
||||
"name": "养老App",
|
||||
"version": {
|
||||
"name": "1.1.4",
|
||||
"code": 114
|
||||
"name": "1.1.5",
|
||||
"code": 115
|
||||
},
|
||||
"description": "养老App",
|
||||
"developer": {
|
||||
|
|
|
@ -7023,7 +7023,7 @@
|
|||
background-repeat: no-repeat;
|
||||
}
|
||||
.boom[data-v-72bcf905] {
|
||||
height: 26.21875rem;
|
||||
height: 26.5625rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* // justify-content: center; */
|
||||
|
@ -7042,11 +7042,12 @@
|
|||
z-index: 10;
|
||||
font-weight: 700;
|
||||
border-top: 0.03125rem solid transparent;
|
||||
border-bottom: 0.03125rem solid transparent;
|
||||
border-image: repeating-linear-gradient(90deg, #0184db 0px, #0184db 0.1875rem, transparent 0.1875rem, transparent 0.375rem) 1;
|
||||
}
|
||||
.boom .boom-son-target[data-v-72bcf905] {
|
||||
height: 6.53125rem;
|
||||
width: 3.75rem;
|
||||
width: 1.875rem;
|
||||
font-size: 0.9375rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -7054,6 +7055,7 @@
|
|||
text-align: center;
|
||||
z-index: 10;
|
||||
font-weight: 700;
|
||||
border-top: 0.03125rem solid transparent;
|
||||
border-bottom: 0.03125rem solid transparent;
|
||||
border-image: repeating-linear-gradient(90deg, #0184db 0px, #0184db 0.1875rem, transparent 0.1875rem, transparent 0.375rem) 1;
|
||||
/* 确保文字在容器内居中 */
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
.calendar[data-v-41c06644] {
|
||||
padding: 16px;
|
||||
}
|
||||
.header[data-v-41c06644] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.header-title[data-v-41c06644] {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.year-month[data-v-41c06644] {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.botton-father[data-v-41c06644] {
|
||||
display: flex;
|
||||
margin-top: -0.625rem;
|
||||
}
|
||||
.click-button[data-v-41c06644] {
|
||||
padding: 0.3125rem;
|
||||
width: 3.75rem;
|
||||
font-size: 0.78125rem;
|
||||
height: 1.25rem;
|
||||
margin-right: 0.3125rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
background-color: #888;
|
||||
border-radius: 0.3125rem;
|
||||
}
|
||||
.weekdays[data-v-41c06644] {
|
||||
display: flex;
|
||||
background-color: #E9E7FC;
|
||||
border-radius: 0.9375rem;
|
||||
padding: 0.3125rem;
|
||||
}
|
||||
.weekday[data-v-41c06644] {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.days[data-v-41c06644] {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0.3125rem;
|
||||
}
|
||||
.day-cell[data-v-41c06644] {
|
||||
width: 2.29688rem;
|
||||
height: 2.51563rem;
|
||||
text-align: center;
|
||||
padding-top: 0.25rem;
|
||||
padding-bottom: 0.25rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.day-cell.prev-month .gregorian[data-v-41c06644],
|
||||
.day-cell.next-month .gregorian[data-v-41c06644] {
|
||||
color: #ccc;
|
||||
}
|
||||
/* 选中样式 */
|
||||
.day-cell.selected[data-v-41c06644] {
|
||||
background-color: #0B98DC;
|
||||
border-radius: 0.3125rem;
|
||||
}
|
||||
.day-cell.selected .gregorian[data-v-41c06644],
|
||||
.day-cell.selected .lunar[data-v-41c06644] {
|
||||
color: #fff;
|
||||
}
|
||||
.gregorian[data-v-41c06644] {
|
||||
font-size: 14px;
|
||||
}
|
||||
.lunar[data-v-41c06644] {
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.backgroundContainer[data-v-90aab738] {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-image: url('../../static/index/lightbgcnew.png');
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.assess-title[data-v-90aab738] {
|
||||
margin-top: 1.875rem;
|
||||
width: 100%;
|
||||
height: 1.875rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.assess-title .right-icons[data-v-90aab738] {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
float: right;
|
||||
height: 2.1875rem;
|
||||
margin-right: 1.25rem;
|
||||
}
|
||||
.assess-title .right-icons .right-icons-font[data-v-90aab738] {
|
||||
margin-left: 0.3125rem;
|
||||
margin-right: 0.3125rem;
|
||||
font-size: 1.09375rem;
|
||||
margin-top: -0.46875rem;
|
||||
}
|
||||
.assess-title .right-icons .right-icons-font-dark[data-v-90aab738] {
|
||||
color: #fff;
|
||||
margin-left: 0.3125rem;
|
||||
margin-right: 0.3125rem;
|
||||
font-size: 1.09375rem;
|
||||
margin-top: -0.46875rem;
|
||||
}
|
||||
.assess-title .right-icons .right-icons-img[data-v-90aab738] {
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
margin-left: 0.3125rem;
|
||||
margin-right: 0.3125rem;
|
||||
margin-top: -0.625rem;
|
||||
}
|
||||
.assess-title .right-icons .right-icons-img-icon[data-v-90aab738] {
|
||||
width: 1.875rem;
|
||||
height: 2.5rem;
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
.assess-title .left-icons[data-v-90aab738] {
|
||||
display: flex;
|
||||
margin-left: 1.25rem;
|
||||
}
|
||||
.assess-title .left-icons .left-icons-img[data-v-90aab738] {
|
||||
width: 2.1875rem;
|
||||
height: 2.1875rem;
|
||||
}
|
||||
.assess-title .left-icons .right-icons-font[data-v-90aab738] {
|
||||
font-weight: 700;
|
||||
font-size: 1.09375rem;
|
||||
margin-left: 0.3125rem;
|
||||
margin-top: 0.3125rem;
|
||||
}
|
||||
.assess-title .left-icons .right-icons-text[data-v-90aab738] {
|
||||
font-size: 1.09375rem;
|
||||
margin-top: 0.3125rem;
|
||||
}
|
||||
.assess-another[data-v-90aab738] {
|
||||
width: 100%;
|
||||
height: calc(100vh - 3.75rem);
|
||||
margin-top: 0.3125rem;
|
||||
display: flex;
|
||||
margin-left: 1.5625rem;
|
||||
}
|
||||
.assess-another .left-contain[data-v-90aab738] {
|
||||
height: 100%;
|
||||
width: 18.75rem;
|
||||
}
|
||||
.assess-another .left-contain .calendar[data-v-90aab738] {
|
||||
width: 100%;
|
||||
height: 20.3125rem;
|
||||
background: linear-gradient(to top, #F4F3FF, #FFFFFF, #ECEFFF);
|
||||
border-radius: 0.78125rem;
|
||||
}
|
|
@ -1478,3 +1478,16 @@ uni-button.cuIcon.lg[data-v-bf1d6c35] {
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.small-button[data-v-1cf27b2a] {
|
||||
position: absolute;
|
||||
width: 9.375rem;
|
||||
top: 6.25rem;
|
||||
left: 18.75rem;
|
||||
height: 6.25rem;
|
||||
background: linear-gradient(to bottom, #04BCED, #0160CE);
|
||||
border-radius: 0.9375rem;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
Loading…
Reference in New Issue