feat : 足迹日期选择新增有记录的日期项; request改为proxy + header url

This commit is contained in:
2025-12-11 14:04:17 +08:00
parent 2b1a87b65e
commit cb1052346e
4 changed files with 32 additions and 8 deletions

View File

@@ -26,7 +26,7 @@
<view
class="item button-click"
:class="{
optional: item.isThisMonth && hasZphInData(item),
optional: (item.isThisMonth && hasZphInData(item)) || hasViewRecordInData(item),
noOptional: !item.isThisMonth,
active: current.date === item.date && item.isThisMonth,
}"
@@ -62,6 +62,7 @@ const pages = reactive({
year: 0,
month: 0,
});
const hasViewRecordDateArray = ref([]);
const hasZphDateArray = ref([]);
onLoad((options) => {
@@ -76,6 +77,7 @@ onLoad((options) => {
new Array(recordNum.value + 1).fill(null).map(() => {
addMonth();
});
updateViewRecordDateArray()
} else {
initPagesDate();
new Array(recordNum.value).fill(null).map(() => {
@@ -83,7 +85,7 @@ onLoad((options) => {
});
}
if (options.entrance === 'careerfair') {
updateDateArray();
updateCareerFairDateArray();
}
});
@@ -92,6 +94,17 @@ function hasZphInData(item) {
return false;
}
const dateArray = Array.isArray(hasViewRecordDateArray.value) ? hasViewRecordDateArray.value : [];
return dateArray.some((date) => {
return typeof date === 'string' && date === item.date;
});
}
function hasViewRecordInData(item) {
if (!item || typeof item.date !== 'string') {
return false;
}
const dateArray = Array.isArray(hasZphDateArray.value) ? hasZphDateArray.value : [];
return dateArray.some((date) => {
@@ -99,7 +112,7 @@ function hasZphInData(item) {
});
}
async function updateDateArray() {
async function updateCareerFairDateArray() {
const LoadCache = (resData) => {
if (resData.code === 200) {
hasZphDateArray.value = resData.data;
@@ -107,6 +120,14 @@ async function updateDateArray() {
};
$api.createRequestWithCache('/app/internal/getDateList', {}, 'GET', false, {}, LoadCache).then(LoadCache);
}
async function updateViewRecordDateArray() {
const LoadCache = (resData) => {
if (resData.code === 200) {
hasViewRecordDateArray.value = resData.data;
}
};
$api.createRequestWithCache('/app/user/getJobReviewDate', {}, 'GET', false, {}, LoadCache).then(LoadCache);
}
function backParams() {
if (isValidDateString(current.value.date)) {
@@ -307,6 +328,7 @@ function getMonthCalendarData({ year, month, selectableDates = [] }) {
justify-content: center
border-radius: 20rpx 20rpx 20rpx 20rpx;
padding: 16rpx 0
margin: 0 2rpx;
margin-bottom: 20rpx
.item-top{
font-weight: 600;