Compare commits
2 Commits
550173c82d
...
e5afbcedb1
| Author | SHA1 | Date | |
|---|---|---|---|
| e5afbcedb1 | |||
| 78661c12af |
@@ -26,6 +26,7 @@
|
||||
<view
|
||||
class="item button-click"
|
||||
:class="{
|
||||
optional:hasZphInData(item),
|
||||
noOptional: !item.isThisMonth,
|
||||
active: current.date === item.date && item.isThisMonth,
|
||||
}"
|
||||
@@ -59,7 +60,10 @@ const pages = reactive({
|
||||
month: 0,
|
||||
});
|
||||
|
||||
const hasZphDateArray = ref([])
|
||||
|
||||
onLoad((options) => {
|
||||
updateDateArray()
|
||||
if (options.date) {
|
||||
current.value = {
|
||||
date: options?.date || null,
|
||||
@@ -79,6 +83,20 @@ onLoad((options) => {
|
||||
}
|
||||
});
|
||||
|
||||
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() {
|
||||
if (isValidDateString(current.value.date)) {
|
||||
navBack({
|
||||
|
||||
Reference in New Issue
Block a user