hookehuyr

新增农历日历显示

......@@ -13,6 +13,7 @@
},
"dependencies": {
"@code-ts/cin": "^0.0.2",
"@tenado/lunarjs": "^1.0.9",
"@vant/area-data": "^1.3.1",
"@vant/touch-emulator": "^1.4.0",
"@vant/use": "^1.6.0",
......@@ -28,6 +29,7 @@
"js-cookie": "^3.0.1",
"js-sha1": "^0.6.0",
"lodash": "^4.17.21",
"lunar-lite": "^0.1.1",
"moment": "^2.29.3",
"mui-player": "^1.7.0",
"sha1": "^1.1.1",
......@@ -40,7 +42,8 @@
"vue": "^3.2.36",
"weixin-js-sdk": "^1.6.0",
"xctc-check": "^0.0.2",
"xijs": "^1.2.6"
"xijs": "^1.2.6",
"xst-solar2lunar": "^2.1.0"
},
"devDependencies": {
"@types/jquery": "^3.5.14",
......
<!--
* @Date: 2024-01-15 13:35:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-24 13:05:17
* @LastEditTime: 2024-01-24 18:45:17
* @FilePath: /xysBooking/src/views/booking.vue
* @Description: 预约页面
-->
......@@ -25,6 +25,7 @@
]"
>
<div v-if="findDatesInfo(date).date">
<p class="day-lunar">{{ findDatesInfo(date).lunar_date.IDayCn }}</p>
<p class="day-text">{{ findDatesInfo(date).text }}</p>
<p v-if="findDatesInfo(date).reserve_full === ReserveStatus.AVAILABLE" class="day-price">¥{{ findDatesInfo(date).price }}</p>
<p v-else-if="findDatesInfo(date).reserve_full === ReserveStatus.INFINITY || findDatesInfo(date).reserve_full === ReserveStatus.OVERDUE" class="day-price"></p>
......@@ -105,7 +106,7 @@ import { useGo } from '@/hooks/useGo'
import icon_select1 from '@/assets/images/单选01@2x.png'
import icon_select2 from '@/assets/images/单选02@2x.png'
import { canReserveDateListAPI, canReserveTimeListAPI } from '@/api/index'
import calendar from 'xst-solar2lunar'
const $route = useRoute();
const $router = useRouter();
......@@ -140,11 +141,13 @@ onMounted(async () => {
const findDatesInfo = (date) => {
const result = dates_list.value.find((item) => item.month_date === date);
const currentDate = new Date(date);
const lunarDate = calendar.solar2lunar(dayjs(date).format('YYYY-MM-DD'));
return {
text: currentDate.getDate().toString().padStart(2, '0'),
date: result?.month_date,
price: result?.price,
reserve_full: result?.reserve_full,
lunar_date: lunarDate
};
};
......@@ -335,6 +338,11 @@ const nextBtn = () => {
text-align: center;
margin: 0 0.3rem;
padding: 0.5rem 0;
.day-lunar {
color: #1E1E1E;
font-size: 0.85rem;
margin-bottom: 5px;
}
.day-text {
color: #1E1E1E;
font-weight: bold;
......@@ -350,6 +358,10 @@ const nextBtn = () => {
background-color: #FFFBF3;
}
&.disabled {
.day-lunar {
color: #C7C7C7;
margin-bottom: 5px;
}
.day-text {
color: #C7C7C7;
}
......
......@@ -375,6 +375,11 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"
"@tenado/lunarjs@^1.0.9":
version "1.0.9"
resolved "https://mirrors.cloud.tencent.com/npm/@tenado/lunarjs/-/lunarjs-1.0.9.tgz#fda97379b0d8778347bca28d3311392f3d551aec"
integrity sha512-39V25O4qL5E++m36YXPNVS0bP8ifej8ym0jAawDWrD8tWs39AJMQaPBjbL0aTSoeBn5BafJyKnhy62rEp+b+8w==
"@types/estree@^1.0.0":
version "1.0.1"
resolved "https://mirrors.cloud.tencent.com/npm/@types/estree/-/estree-1.0.1.tgz"
......@@ -1263,6 +1268,11 @@ dayjs@^1.10.4, dayjs@^1.11.3:
resolved "https://mirrors.cloud.tencent.com/npm/dayjs/-/dayjs-1.11.8.tgz"
integrity sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==
dayjs@^1.9.3:
version "1.11.10"
resolved "https://mirrors.cloud.tencent.com/npm/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0"
integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4:
version "4.3.4"
resolved "https://mirrors.cloud.tencent.com/npm/debug/-/debug-4.3.4.tgz"
......@@ -2343,6 +2353,18 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
lunar-lite@^0.1.1:
version "0.1.1"
resolved "https://mirrors.cloud.tencent.com/npm/lunar-lite/-/lunar-lite-0.1.1.tgz#c2c114b95eae24b84ebc0702f616ed573772c244"
integrity sha512-ttdkDY4uZg6LtE8r4m/Vt+z48ReT8StYXPY2eXqJ6tOG3C4I11g/f/gAJXplJIRTZd+F1xOFa52tUiP2UIkqzQ==
dependencies:
lunar-typescript "^1.6.13"
lunar-typescript@^1.6.13:
version "1.7.0"
resolved "https://mirrors.cloud.tencent.com/npm/lunar-typescript/-/lunar-typescript-1.7.0.tgz#1385963c2bd0dac76fdee127f3af8c6be8173ab1"
integrity sha512-qBGcagYd0171ANwGSMdGfdFk+5wkL8OJWprjuGB/xFG4Cm+WXs/sSbIF4tw2I7Rgpf/5UrlIHGX0+eoe2HIo4Q==
magic-string@^0.25.7:
version "0.25.9"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz"
......@@ -3761,6 +3783,13 @@ xml-name-validator@^4.0.0:
resolved "https://mirrors.cloud.tencent.com/npm/xml-name-validator/-/xml-name-validator-4.0.0.tgz"
integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==
xst-solar2lunar@^2.1.0:
version "2.1.0"
resolved "https://mirrors.cloud.tencent.com/npm/xst-solar2lunar/-/xst-solar2lunar-2.1.0.tgz#f9d913f0a46f6debaeedae1cb85ab05cb1091a67"
integrity sha512-1X2Enk2LK1l6ZQWjSFQsLspmm6h32p8a+UGYi+HkJLEQmKiy5KSlTs2xEiyyAAG+7jTo6EOxPWS2lk3yLk/ivg==
dependencies:
dayjs "^1.9.3"
y18n@^5.0.5:
version "5.0.8"
resolved "https://mirrors.cloud.tencent.com/npm/y18n/-/y18n-5.0.8.tgz"
......