日期选择样式优化

This commit is contained in:
2025-11-28 18:17:44 +08:00
parent 9a5bffae85
commit 7ce14fa7e2

View File

@@ -24,9 +24,9 @@
<view class="list-title">{{ vItem.title }}</view>
<view class="list-item">
<view
class="item button-click "
class="item button-click"
:class="{
optional:machHasZph(item),
optional:hasZphInData(item),
noOptional: !item.isThisMonth,
active: current.date === item.date && item.isThisMonth,
}"
@@ -60,7 +60,10 @@ const pages = reactive({
month: 0,
});
const hasZphDateArray = ref([])
onLoad((options) => {
updateDateArray()
if (options.date) {
current.value = {
date: options?.date || null,
@@ -80,8 +83,18 @@ onLoad((options) => {
}
});
function machHasZph(item) {
return true
function hasZphInData(item) {
return hasZphDateArray.value.some(date=>date == item.date)
}
async function updateDateArray() {
if(localStorage.getItem('hasZphDateArray')) hasZphDateArray.value = localStorage.getItem('hasZphDateArray')
let res = await $api.createRequest('/app/internal/getDateList', {}, 'get')
if(res.data){
hasZphDateArray.value = res.data
localStorage.setItem('hasZphDateArray',res.data)
}
}
function backParams() {