优化工作日
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m50s

This commit is contained in:
youzi 2025-01-01 09:53:13 +08:00
parent b34147a30b
commit c22510574e
2 changed files with 6 additions and 8 deletions

View File

@ -2,6 +2,6 @@
ENV = 'development' ENV = 'development'
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
VITE_APP_BASE_URL = 'http://127.0.0.1:7777' # VITE_APP_BASE_URL = 'http://127.0.0.1:7777'
# VITE_APP_BASE_URL = 'https://www.hxyouzi.com' VITE_APP_BASE_URL = 'https://www.hxyouzi.com'

View File

@ -17,7 +17,7 @@
</div> </div>
</div> </div>
<div class="right h-[150px]"> <div class="right h-[150px]">
<img height="150" :src="isw ? onwork : offwork" alt=""> <img height="150" :src="!jq.data.type ? onwork : offwork" alt="">
</div> </div>
</div> </div>
@ -90,7 +90,6 @@ import offwork from '@/assets/offwork.webp';
import onwork from '@/assets/onwork.webp'; import onwork from '@/assets/onwork.webp';
import hot from "@/icon/hot.svg"; import hot from "@/icon/hot.svg";
import { formatTime } from '@/util/index.js'; import { formatTime } from '@/util/index.js';
import ww from 'chinese-workday';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
@ -98,18 +97,17 @@ import { onMounted, ref } from 'vue';
const jqs = ['立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种', '夏至', '小暑', '大暑', '立秋', '处暑', '白露', '秋分', '寒露', '霜降', '立冬', '小雪', '大雪', '冬至', '小寒', '大寒'] const jqs = ['立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种', '夏至', '小暑', '大暑', '立秋', '处暑', '白露', '秋分', '寒露', '霜降', '立冬', '小雪', '大雪', '冬至', '小寒', '大寒']
const time = ref(formatTime(new Date(), 'hh:mm:ss')) const time = ref(formatTime(new Date(), 'hh:mm:ss'))
const date = ref(formatTime(new Date(), 'YYYY 年 MM 月 DD 日')) const date = ref(formatTime(new Date(), 'YYYY 年 MM 月 DD 日'))
const date1 = ref(formatTime(new Date(), 'YYYY-MM-DD'))
const isw = ref(true)
isw.value = ww.isWorkday(date1)
const holi = await $http.wea.getTodayHoliday() const holi = await $http.wea.getTodayHoliday()
console.log("*************", holi);
const jqImg = ref('#') const jqImg = ref('#')
const jq = await $http.wea.getJq() const jq = await $http.wea.getJq()
console.log("*************",jq);
const j = jq.data.solarTerms.slice(0, 2) const j = jq.data.solarTerms.slice(0, 2)
const jNum = jqs.indexOf(j) + 1 const jNum = jqs.indexOf(j) + 1
jqImg.value = 'https://www.hxyouzi.com/img/jieqi/' + jNum + '.jpg' jqImg.value = 'https://www.hxyouzi.com/img/jieqi/' + jNum + '.jpg'