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

@@ -1,6 +1,6 @@
export default {
baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
// baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
// baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
// baseUrl: 'http://192.168.3.29:8081',
// baseUrl: 'http://10.213.6.207:19010/api',
// 语音转文字

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;

View File

@@ -110,7 +110,7 @@
</tabcontrolVue>
<SelectJobs ref="selectJobsModel"></SelectJobs>
<!-- 后门 -->
<!-- <view class="backdoor" @click="loginbackdoor">
<!-- <view class="backdoor" @click="loginbackdoor">
<uni-icons type="gift-filled" size="30"></uni-icons>
</view> -->
</AppLayout>

View File

@@ -82,7 +82,8 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h
})
}
let header = {
...headers
...headers,
'X-Target-URI': url
};
const userStore = useUserStore();
const token = userStore.token;
@@ -117,7 +118,8 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h
// ------------------------------------------------------------------
return new Promise((resolve, reject) => {
uni.request({
url: config.baseUrl + url,
url: config.baseUrl + '/app/proxy',
// url: config.baseUrl + url,
method: method,
data: requestData,
header,