日期选择样式优化
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
<view
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user