2025-03-28 15:19:42 +08:00
|
|
|
<template>
|
|
|
|
<view class="collection-content">
|
2025-05-13 11:10:38 +08:00
|
|
|
<renderJobs
|
|
|
|
seeDate="applyTime"
|
|
|
|
v-if="pageState.list.length"
|
|
|
|
:list="pageState.list"
|
|
|
|
:longitude="longitudeVal"
|
|
|
|
:latitude="latitudeVal"
|
|
|
|
></renderJobs>
|
|
|
|
<empty v-else pdTop="200"></empty>
|
2025-03-28 15:19:42 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import dictLabel from '@/components/dict-Label/dict-Label.vue';
|
|
|
|
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
|
|
|
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
|
|
|
import useUserStore from '@/stores/useUserStore';
|
|
|
|
const { $api, navTo, vacanciesTo } = inject('globalFunction');
|
2025-05-13 11:10:38 +08:00
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
import useLocationStore from '@/stores/useLocationStore';
|
|
|
|
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
2025-03-28 15:19:42 +08:00
|
|
|
const userStore = useUserStore();
|
|
|
|
const state = reactive({});
|
|
|
|
const pageState = reactive({
|
|
|
|
page: 0,
|
|
|
|
list: [],
|
|
|
|
total: 0,
|
|
|
|
maxPage: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
});
|
|
|
|
onLoad(() => {
|
|
|
|
console.log('onLoad');
|
|
|
|
// $api.sleep(2000).then(() => {
|
|
|
|
// navTo('/pages/login/login');
|
|
|
|
// });
|
|
|
|
getJobList();
|
|
|
|
});
|
|
|
|
|
|
|
|
onReachBottom(() => {
|
|
|
|
getJobList();
|
|
|
|
});
|
|
|
|
|
|
|
|
function navToPost(jobId) {
|
|
|
|
navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
function getJobList(type = 'add') {
|
|
|
|
if (type === 'refresh') {
|
2025-05-15 14:17:51 +08:00
|
|
|
pageState.page = 1;
|
2025-03-28 15:19:42 +08:00
|
|
|
pageState.maxPage = 1;
|
|
|
|
}
|
|
|
|
if (type === 'add' && pageState.page < pageState.maxPage) {
|
|
|
|
pageState.page += 1;
|
|
|
|
}
|
|
|
|
let params = {
|
|
|
|
current: pageState.page,
|
|
|
|
pageSize: pageState.pageSize,
|
|
|
|
};
|
|
|
|
$api.createRequest('/app/user/apply/job', params).then((resData) => {
|
|
|
|
const { rows, total } = resData;
|
|
|
|
if (type === 'add') {
|
|
|
|
const str = pageState.pageSize * (pageState.page - 1);
|
|
|
|
const end = pageState.list.length;
|
|
|
|
const reslist = rows;
|
|
|
|
pageState.list.splice(str, end, ...reslist);
|
|
|
|
} else {
|
|
|
|
pageState.list = rows;
|
|
|
|
}
|
|
|
|
// pageState.list = resData.rows;
|
|
|
|
pageState.total = resData.total;
|
|
|
|
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
2025-05-13 11:10:38 +08:00
|
|
|
console.log(pageState.list);
|
2025-03-28 15:19:42 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2025-05-13 11:10:38 +08:00
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.collection-content{
|
|
|
|
padding: 1rpx 28rpx 20rpx 28rpx;
|
|
|
|
background: #F4F4F4;
|
|
|
|
height: 100%
|
|
|
|
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
|
|
|
|
}
|
2025-03-28 15:19:42 +08:00
|
|
|
</style>
|