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 { export default {
baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网 // baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
// baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试 baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
// baseUrl: 'http://192.168.3.29:8081', // baseUrl: 'http://192.168.3.29:8081',
// baseUrl: 'http://10.213.6.207:19010/api', // baseUrl: 'http://10.213.6.207:19010/api',
// 语音转文字 // 语音转文字

View File

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

View File

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

View File

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