This commit is contained in:
史典卓
2025-03-28 15:19:42 +08:00
parent ad4eb162a5
commit 0216f6053a
396 changed files with 18278 additions and 9899 deletions

View File

@@ -1,64 +1,243 @@
<template>
<scroll-view :scroll-y="true" class="nearby-scroll">
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom">
<view class="two-head">
<view class="head-item active">市北区</view>
<view class="head-item" v-for="(item, index) in 10" :key="index">中山路商圈</view>
<!-- <view class="head-item active">市北区</view> -->
<view
class="head-item"
:class="{ active: state.comId === item.commercialAreaId }"
v-for="(item, index) in state.comlist"
:key="item.commercialAreaId"
@click="clickCommercialArea(item)"
>
{{ item.commercialAreaName }}
</view>
</view>
<view class="nearby-list">
<view class="list-head" @touchmove.stop.prevent>
<view class="tab-options">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll" @touchmove.stop>
<view class="tab-op-left">
<view class="tab-list" v-for="(item, index) in 4" :key="index">中国万岁</view>
<uni-icons type="plusempty" style="margin-right: 10rpx" size="20"></uni-icons>
<view
class="tab-list"
:class="{ tabchecked: state.tabIndex === 'all' }"
@click="choosePosition('all')"
>
全部
</view>
<view
class="tab-list"
:class="{ tabchecked: state.tabIndex === index }"
@click="choosePosition(index)"
v-for="(item, index) in userInfo.jobTitle"
:key="index"
>
{{ item }}
</view>
</view>
</scroll-view>
<view class="tab-op-right">
<view class="tab-recommend">推荐</view>
<view class="tab-filter">
<view class="tab-number">1000+</view>
<uni-icons type="plusempty" style="margin-right: 10rpx" size="20"></uni-icons>
<view class="tab-recommend">
<latestHotestStatus @confirm="handelHostestSearch"></latestHotestStatus>
</view>
<view class="tab-filter" @click="emit('onFilter', 3)">
<view class="tab-number" v-show="pageState.total">{{ formatTotal(pageState.total) }}</view>
<image class="image" src="/static/icon/filter.png"></image>
</view>
</view>
</view>
</view>
<view class="one-cards">
<view class="card-box" v-for="(item, index) in 20" :key="index">
<view class="card-box" v-for="(item, index) in list" :key="item.jobId" @click="navToPost(item.jobId)">
<view class="box-row mar_top0">
<view class="row-left">销售工程师-高级销售经理</view>
<view class="row-right">1-2</view>
<view class="row-left">{{ item.jobTitle }}</view>
<view class="row-right">
<Salary-Expectation
:max-salary="item.maxSalary"
:min-salary="item.minSalary"
></Salary-Expectation>
</view>
</view>
<view class="box-row">
<view class="row-left">
<view class="row-tag">本科</view>
<view class="row-tag">1-5</view>
<view class="row-tag" v-if="item.education">
<dict-Label dictType="education" :value="item.education"></dict-Label>
</view>
<view class="row-tag" v-if="item.experience">
<dict-Label dictType="experience" :value="item.experience"></dict-Label>
</view>
</view>
</view>
<view class="box-row mar_top0">
<view class="row-item mineText">2024.1.8</view>
<view class="row-item mineText">8</view>
<view class="row-item mineText textblue">匹配度93%</view>
<view class="row-item mineText">{{ item.postingDate || '发布日期' }}</view>
<view class="row-item mineText">{{ vacanciesTo(item.vacancies) }}</view>
<view class="row-item mineText textblue"><matchingDegree :job="item"></matchingDegree></view>
<view class="row-item">
<uni-icons type="star" size="28"></uni-icons>
<!-- <uni-icons type="star-filled" color="#FFCB47" size="30"></uni-icons> -->
</view>
</view>
<view class="box-row">
<view class="row-left mineText">湖南沃森电气科技有限公司</view>
<view class="row-right mineText">青岛 青岛经济技术开发区 550m</view>
<view class="row-left mineText">{{ item.companyName }}</view>
<view class="row-right mineText">
青岛
<dict-Label dictType="area" :value="item.jobLocationAreaCode"></dict-Label>
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitude()"
:blong="longitude()"
></convert-distance>
</view>
</view>
</view>
</view>
</view>
<loadmore ref="loadmoreRef"></loadmore>
</scroll-view>
</template>
<script setup>
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
const state = reactive({});
import { onLoad, onShow } from '@dcloudio/uni-app';
import useDictStore from '@/stores/useDictStore';
import useUserStore from '@/stores/useUserStore';
const { getDictSelectOption, oneDictData } = useDictStore();
const { $api, navTo, vacanciesTo, formatTotal } = inject('globalFunction');
import useLocationStore from '@/stores/useLocationStore';
const { getLocation, longitude, latitude } = useLocationStore();
const emit = defineEmits(['onFilter']);
const state = reactive({
tabIndex: 'all',
comlist: [],
comId: 0,
});
const fromValue = reactive({
area: 0,
areaInfo: {},
});
const loadmoreRef = ref(null);
const userInfo = ref({});
const isLoaded = ref(false);
const pageState = reactive({
page: 0,
total: 0,
maxPage: 2,
pageSize: 10,
search: {
order: 0,
},
});
const list = ref([]);
onShow(() => {
userInfo.value = useUserStore().userInfo;
});
onLoad(() => {
getBusinessDistrict();
});
function navToPost(jobId) {
navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`);
}
async function loadData() {
try {
if (isLoaded.value) return;
getJobList('refresh');
isLoaded.value = true;
} catch (err) {
isLoaded.value = false; // 重置状态允许重试
throw err;
}
}
function scrollBottom() {
getJobList();
loadmoreRef.value.change('loading');
}
function choosePosition(index) {
state.tabIndex = index;
if (index === 'all') {
pageState.search.jobTitle = '';
} else {
pageState.search.jobTitle = useUserStore().userInfo.jobTitle[index];
}
getJobList('refresh');
}
function clickCommercialArea(area) {
state.areaInfo = area;
state.comId = area.commercialAreaId;
getJobList('refresh');
}
function getBusinessDistrict() {
$api.createRequest(`/app/common/commercialArea`).then((resData) => {
if (resData.data.length) {
state.comlist = resData.data;
state.areaInfo = resData.data[0];
state.comId = resData.data[0].commercialAreaId;
}
});
}
function getJobList(type = 'add') {
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 2;
}
let params = {
longitude: state.areaInfo.longitude,
latitude: state.areaInfo.latitude,
current: pageState.page,
pageSize: pageState.pageSize,
radius: 2,
...pageState.search,
};
$api.createRequest('/app/job/commercialArea', params, 'POST').then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = list.value.length;
const reslist = rows;
list.value.splice(str, end, ...reslist);
} else {
list.value = rows;
}
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
if (rows.length < pageState.pageSize) {
loadmoreRef.value.change('noMore');
} else {
loadmoreRef.value.change('more');
}
});
}
function handelHostestSearch(val) {
pageState.search.order = val.value;
getJobList('refresh');
}
function handleFilterConfirm(val) {
pageState.search = {
order: pageState.search.order,
};
for (const [key, value] of Object.entries(val)) {
pageState.search[key] = value.join(',');
}
getJobList('refresh');
}
defineExpose({ loadData, handleFilterConfirm });
</script>
<style lang="stylus" scoped>
.tabchecked
color: #4778EC !important
.nearby-scroll
overflow: hidden;
.two-head
@@ -85,7 +264,7 @@ const state = reactive({});
color: #FFFFFF;
.nearby-list
margin-top: 40rpx;
background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
// background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
.list-head
height: 77rpx;
background-color: #FFFFFF;
@@ -123,7 +302,8 @@ const state = reactive({});
align-items: center;
.tab-recommend
white-space: nowrap;
width: 92rpx;
width: fit-content;
padding: 0 10rpx;
height: 42rpx;
background: #4778EC;
border-radius: 17rpx 17rpx 0rpx 17rpx;
@@ -165,6 +345,9 @@ const state = reactive({});
color: #606060;
.textblue
color: #4778EC;
.row-right
min-width: 120rpx
text-align: right
.row-left
display: flex;
justify-content: space-between;

View File

@@ -1,13 +1,15 @@
<template>
<scroll-view :scroll-y="true" class="nearby-scroll">
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom">
<view class="nearby-map" @touchmove.stop.prevent>
<zhuo-tianditu-MultiPoint-Mapper
ref="tMap"
:showLabel="false"
:showCirle="true"
api-key="e122b0518f43b32dcc256edbae20a5d1"
@onLoad="LoadComplite"
></zhuo-tianditu-MultiPoint-Mapper>
<map
style="width: 100%; height: 300px"
:latitude="latitude()"
:longitude="longitude()"
:markers="mapCovers"
:circles="mapCircles"
:controls="mapControls"
@controltap="handleControl"
></map>
</view>
<view class="nearby-list">
<view class="list-head" @touchmove.stop.prevent>
@@ -32,81 +34,236 @@
></bingProgressComponent>
</view>
<view class="tab-op-right">
<view class="tab-recommend">推荐</view>
<view class="tab-filter">
<view class="tab-number">1000+</view>
<view class="tab-recommend">
<latestHotestStatus @confirm="handelHostestSearch"></latestHotestStatus>
</view>
<view class="tab-filter" @click="emit('onFilter', 0)">
<view class="tab-number" v-show="pageState.total">{{ formatTotal(pageState.total) }}</view>
<image class="image" src="/static/icon/filter.png"></image>
</view>
</view>
</view>
</view>
<view class="one-cards">
<view class="card-box" v-for="(item, index) in 20" :key="index">
<view class="card-box" v-for="(item, index) in list" :key="item.jobId" @click="navToPost(item.jobId)">
<view class="box-row mar_top0">
<view class="row-left">销售工程师-高级销售经理</view>
<view class="row-right">1-2</view>
<view class="row-left">{{ item.jobTitle }}</view>
<view class="row-right">
<Salary-Expectation
:max-salary="item.maxSalary"
:min-salary="item.minSalary"
></Salary-Expectation>
</view>
</view>
<view class="box-row">
<view class="row-left">
<view class="row-tag">本科</view>
<view class="row-tag">1-5</view>
<view class="row-tag" v-if="item.education">
<dict-Label dictType="education" :value="item.education"></dict-Label>
</view>
<view class="row-tag" v-if="item.experience">
<dict-Label dictType="experience" :value="item.experience"></dict-Label>
</view>
</view>
</view>
<view class="box-row mar_top0">
<view class="row-item mineText">2024.1.8</view>
<view class="row-item mineText">8</view>
<view class="row-item mineText textblue">匹配度93%</view>
<view class="row-item mineText">{{ item.postingDate || '发布日期' }}</view>
<view class="row-item mineText">{{ vacanciesTo(item.vacancies) }}</view>
<view class="row-item mineText textblue"><matchingDegree :job="item"></matchingDegree></view>
<view class="row-item">
<uni-icons type="star" size="28"></uni-icons>
<!-- <uni-icons type="star-filled" color="#FFCB47" size="30"></uni-icons> -->
</view>
</view>
<view class="box-row">
<view class="row-left mineText">湖南沃森电气科技有限公司</view>
<view class="row-right mineText">青岛 青岛经济技术开发区 550m</view>
<view class="row-left mineText">{{ item.companyName }}</view>
<view class="row-right mineText">
青岛
<dict-Label dictType="area" :value="item.jobLocationAreaCode"></dict-Label>
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitude()"
:blong="longitude()"
></convert-distance>
</view>
</view>
</view>
</view>
</view>
<loadmore ref="loadmoreRef"></loadmore>
</scroll-view>
</template>
<script setup>
import point2 from '@/static/icon/point2.png';
import LocationPng from '@/static/icon/Location.png';
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import useLocationStore from '@/stores/useLocationStore';
import bingProgressComponent from '/components/bing-progress/bing-progress.vue';
import screeningJobRequirementsVue from '@/components/screening-job-requirements/screening-job-requirements.vue';
import { reactive, inject, watch, ref, onMounted, onBeforeUnmount } from 'vue';
const { getLocation, longitude, latitude } = useLocationStore();
import { onLoad, onShow } from '@dcloudio/uni-app';
import { msg } from '../../../common/globalFunction';
const { $api, navTo, debounce, vacanciesTo, customSystem, formatTotal } = inject('globalFunction');
const emit = defineEmits(['onFilter']);
const tMap = ref();
const progress = ref();
const state = reactive({
progressWidth: '150px',
const mapCovers = ref([]);
const mapCircles = ref([]);
const mapControls = ref([
{
id: 1,
position: {
// 控件位置
left: customSystem.systemInfo.screenWidth - 50,
top: 180,
width: 30,
height: 30,
},
iconPath: LocationPng, // 控件图标
},
]);
const loadmoreRef = ref(null);
const pageState = reactive({
page: 0,
total: 100,
maxPage: 2,
pageSize: 10,
search: {
radius: 1,
order: 0,
},
});
const isLoaded = ref(false);
const list = ref([]);
const state = reactive({
progressWidth: '200px',
});
onLoad(() => {});
function navToPost(jobId) {
navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`);
}
async function loadData() {
try {
if (isLoaded.value) return;
isLoaded.value = true;
} catch (err) {
isLoaded.value = false; // 重置状态允许重试
throw err;
}
}
function scrollBottom() {
getJobList();
loadmoreRef.value.change('loading');
}
function handleControl(e) {
switch (e.detail.controlId) {
case 1:
getInit();
break;
}
}
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
query
.select('.tab-scroll')
.boundingClientRect((data) => {
state.progressWidth = data.width - 50 + 'px';
})
.exec();
tMap.value.open(104.397894, 31.126855);
$api.msg('使用模拟定位');
getInit();
});
// 初始化
function LoadComplite() {
console.log('天地图加载完成');
const list = [
function getInit() {
getLocation().then((res) => {
mapCovers.value = [
{
latitude: res.latitude,
longitude: res.longitude,
iconPath: point2,
},
];
mapCircles.value = [
{
latitude: res.latitude,
longitude: res.longitude,
radius: 1000,
fillColor: '#00b8002e',
},
];
getJobList('refresh');
});
}
function progressChange(e) {
const range = 1 + e.value;
pageState.search.radius = range;
mapCircles.value = [
{
id: 0,
label: '',
lat: 31.126855,
lon: 104.397894,
latitude: latitude(),
longitude: longitude(),
radius: range * 1000,
fillColor: '#00b8002e',
},
];
tMap.value.addFeature(list);
debounceAjax('refresh');
}
function progressChange(e) {
tMap.value.changeRange(e.value);
let debounceAjax = debounce(getJobList, 500);
function getJobList(type = 'add') {
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 2;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
longitude: longitude(),
latitude: latitude(),
...pageState.search,
};
$api.createRequest('/app/job/nearJob', params, 'POST').then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = list.value.length;
const reslist = rows;
list.value.splice(str, end, ...reslist);
} else {
list.value = rows;
}
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
if (rows.length < pageState.pageSize) {
loadmoreRef.value.change('noMore');
} else {
loadmoreRef.value.change('more');
}
});
}
function handelHostestSearch(val) {
pageState.search.order = val.value;
getJobList('refresh');
}
function handleFilterConfirm(val) {
pageState.search = {
radius: pageState.search.radius,
order: pageState.search.order,
};
for (const [key, value] of Object.entries(val)) {
pageState.search[key] = value.join(',');
}
getJobList('refresh');
}
defineExpose({ loadData, handleFilterConfirm });
</script>
<style lang="stylus" scoped>
@@ -115,8 +272,9 @@ function progressChange(e) {
.nearby-map
height: 467rpx;
background: #e8e8e8;
overflow: hidden
.nearby-list
background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
// background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
.list-head
height: 77rpx;
background-color: #FFFFFF;
@@ -163,7 +321,8 @@ function progressChange(e) {
align-items: center;
.tab-recommend
white-space: nowrap;
width: 92rpx;
width: fit-content;
padding: 0 10rpx;
height: 42rpx;
background: #4778EC;
border-radius: 17rpx 17rpx 0rpx 17rpx;
@@ -186,7 +345,7 @@ function progressChange(e) {
.one-cards
display: flex;
flex-direction: column;
padding: 0 20rpx;
padding: 0 20rpx 20rpx 20rpx;
.card-box
width: calc(100% - 36rpx - 36rpx);
border-radius: 0rpx 0rpx 0rpx 0rpx;
@@ -205,6 +364,9 @@ function progressChange(e) {
color: #606060;
.textblue
color: #4778EC;
.row-right
min-width: 120rpx
text-align: right
.row-left
display: flex;
justify-content: space-between;

View File

@@ -1,20 +1,44 @@
<template>
<scroll-view :scroll-y="true" class="nearby-scroll">
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom">
<view class="three-head" @touchmove.stop.prevent>
<scroll-view class="scroll-head" :scroll-x="true" :show-scrollbar="false">
<view class="metro">
<view class="metro-one">1号线</view>
<view class="metro-two">王家港-东郭庄</view>
<view class="metro-one">
<picker
class="one-picker"
@change="bindPickerChange"
@cancel="state.downup = true"
@click="state.downup = false"
:value="state.value"
range-key="text"
:range="range"
>
<view class="one-picker">
<view class="uni-input">{{ inputText(state.subwayId) }}</view>
<uni-icons v-if="state.downup" type="down" size="16"></uni-icons>
<uni-icons v-else type="up" size="16"></uni-icons>
</view>
</picker>
</view>
<view class="metro-two">{{ state.subwayStart.stationName }}-{{ state.subwayEnd.stationName }}</view>
<view class="metro-three">
<view class="three-background">
<view class="three-items">
<view class="three-item">
<view class="item-dont dontstart"></view>
<view class="item-text">王家港</view>
</view>
<view class="three-item" v-for="(item, index) in 20" :key="index">
<view class="item-dont"></view>
<view class="item-text">王家港</view>
<view
class="three-item"
v-for="(item, index) in subwayCurrent.subwayStationList"
@click="selectSubwayStation(item, index)"
:key="index"
>
<view
class="item-dont"
:class="{
dontstart: index === 0,
dontend: index === subwayCurrent.subwayStationList.length - 1,
donted: index === state.dont,
}"
></view>
<view class="item-text">{{ item.stationName }}</view>
</view>
</view>
</view>
@@ -25,58 +49,271 @@
<view class="nearby-list">
<view class="list-head" @touchmove.stop.prevent>
<view class="tab-options">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll" @touchmove.stop>
<view class="tab-op-left">
<view class="tab-list" v-for="(item, index) in 4" :key="index">中国万岁</view>
<uni-icons type="plusempty" style="margin-right: 10rpx" size="20"></uni-icons>
<view
class="tab-list"
:class="{ tabchecked: state.tabIndex === 'all' }"
@click="choosePosition('all')"
>
全部
</view>
<view
class="tab-list"
:class="{ tabchecked: state.tabIndex === index }"
v-for="(item, index) in userInfo.jobTitle"
:key="index"
@click="choosePosition(index)"
>
{{ item }}
</view>
</view>
</scroll-view>
<view class="tab-op-right">
<view class="tab-recommend">推荐</view>
<view class="tab-filter">
<view class="tab-number">1000+</view>
<uni-icons type="plusempty" style="margin-right: 10rpx" size="20"></uni-icons>
<view class="tab-recommend">
<latestHotestStatus @confirm="handelHostestSearch"></latestHotestStatus>
</view>
<view class="tab-filter" @click="emit('onFilter', 2)">
<view class="tab-number" v-show="pageState.total">{{ formatTotal(pageState.total) }}</view>
<image class="image" src="/static/icon/filter.png"></image>
</view>
</view>
</view>
</view>
<view class="one-cards">
<view class="card-box" v-for="(item, index) in 20" :key="index">
<view class="card-box" v-for="(item, index) in list" :key="item.jobId" @click="navToPost(item.jobId)">
<view class="box-row mar_top0">
<view class="row-left">销售工程师-高级销售经理</view>
<view class="row-right">1-2</view>
<view class="row-left">{{ item.jobTitle }}</view>
<view class="row-right">
<Salary-Expectation
:max-salary="item.maxSalary"
:min-salary="item.minSalary"
></Salary-Expectation>
</view>
</view>
<view class="box-row">
<view class="row-left">
<view class="row-tag">本科</view>
<view class="row-tag">1-5</view>
<view class="row-tag" v-if="item.education">
<dict-Label dictType="education" :value="item.education"></dict-Label>
</view>
<view class="row-tag" v-if="item.experience">
<dict-Label dictType="experience" :value="item.experience"></dict-Label>
</view>
</view>
</view>
<view class="box-row mar_top0">
<view class="row-item mineText">2024.1.8</view>
<view class="row-item mineText">8</view>
<view class="row-item mineText textblue">匹配度93%</view>
<view class="row-item mineText">{{ item.postingDate || '发布日期' }}</view>
<view class="row-item mineText">{{ vacanciesTo(item.vacancies) }}</view>
<view class="row-item mineText textblue"><matchingDegree :job="item"></matchingDegree></view>
<view class="row-item">
<uni-icons type="star" size="28"></uni-icons>
<!-- <uni-icons type="star-filled" color="#FFCB47" size="30"></uni-icons> -->
</view>
</view>
<view class="box-row">
<view class="row-left mineText">湖南沃森电气科技有限公司</view>
<view class="row-right mineText">青岛 青岛经济技术开发区 550m</view>
<view class="row-left mineText">{{ item.companyName }}</view>
<view class="row-right mineText">
青岛
<dict-Label dictType="area" :value="item.jobLocationAreaCode"></dict-Label>
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitude()"
:blong="longitude()"
></convert-distance>
</view>
</view>
</view>
</view>
</view>
<loadmore ref="loadmoreRef"></loadmore>
</scroll-view>
</template>
<script setup>
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
const state = reactive({});
import { onLoad, onShow } from '@dcloudio/uni-app';
import useUserStore from '@/stores/useUserStore';
const { $api, navTo, vacanciesTo, formatTotal } = inject('globalFunction');
import useLocationStore from '@/stores/useLocationStore';
const { getLocation, longitude, latitude } = useLocationStore();
const emit = defineEmits(['onFilter']);
// status
const subwayCurrent = ref([]);
const isLoaded = ref(false);
const range = ref([]);
const userInfo = ref({});
const state = reactive({
subwayList: [],
subwayStart: {},
subwayEnd: {},
value: 0,
subwayId: 0,
downup: true,
dont: 0,
dontObj: {},
tabIndex: 'all',
});
const pageState = reactive({
page: 0,
total: 0,
maxPage: 2,
pageSize: 10,
search: {
order: 0,
},
});
const list = ref([]);
const loadmoreRef = ref(null);
onLoad(() => {
getSubway();
});
onShow(() => {
userInfo.value = useUserStore().userInfo;
});
function navToPost(jobId) {
navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`);
}
async function loadData() {
try {
if (isLoaded.value) return;
getJobList('refresh');
isLoaded.value = true;
} catch (err) {
isLoaded.value = false; // 重置状态允许重试
throw err;
}
}
function scrollBottom() {
getJobList();
loadmoreRef.value.change('loading');
}
function choosePosition(index) {
state.tabIndex = index;
if (index === 'all') {
pageState.search.jobTitle = '';
} else {
pageState.search.jobTitle = useUserStore().userInfo.jobTitle[index];
}
getJobList('refresh');
}
function selectSubwayStation(point, index) {
console.log(point, index);
state.dont = index;
state.dontObj = point;
getJobList('refresh');
}
function inputText(id) {
if (id) {
const text = range.value.filter((item) => item.value === id)[0].text;
return text;
} else {
return '';
}
}
function bindPickerChange(e) {
const lineId = range.value[e.detail.value];
const value = state.subwayList.filter((iv) => iv.lineId === lineId.value)[0];
subwayCurrent.value = value;
state.value = e.detail.value;
state.subwayId = value.lineId;
const points = value.subwayStationList;
state.downup = true;
if (points.length) {
state.dont = 0;
state.dontObj = points[0];
state.subwayStart = points[0];
state.subwayEnd = points[points.length - 1];
}
}
function getSubway() {
$api.createRequest(`/app/common/subway`).then((resData) => {
state.subwayList = resData.data;
subwayCurrent.value = resData.data[0];
state.subwayId = resData.data[0].lineId;
state.value = 0;
state.dont = 0;
range.value = resData.data.map((iv) => ({ text: iv.lineName, value: iv.lineId }));
const points = resData.data[0].subwayStationList;
if (points.length) {
state.dont = 0;
state.dontObj = points[0];
state.subwayStart = points[0];
state.subwayEnd = points[points.length - 1];
}
});
}
function getJobList(type = 'add') {
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 2;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
subwayIds: [state.dontObj.stationId],
latitude: state.dontObj.latitude,
longitude: state.dontObj.longitude,
radius: 2,
...pageState.search,
};
$api.createRequest('/app/job/subway', params, 'POST').then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = list.value.length;
const reslist = rows;
list.value.splice(str, end, ...reslist);
} else {
list.value = rows;
}
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
if (rows.length < pageState.pageSize) {
loadmoreRef.value.change('noMore');
} else {
loadmoreRef.value.change('more');
}
});
}
function handelHostestSearch(val) {
pageState.search.order = val.value;
getJobList('refresh');
}
function handleFilterConfirm(val) {
pageState.search = {
order: pageState.search.order,
};
for (const [key, value] of Object.entries(val)) {
pageState.search[key] = value.join(',');
}
getJobList('refresh');
}
defineExpose({ loadData, handleFilterConfirm });
</script>
<style lang="stylus" scoped>
.tabchecked
color: #4778EC !important;
.nearby-scroll
overflow: hidden;
.three-head
@@ -93,6 +330,14 @@ const state = reactive({});
font-size: 28rpx;
color: #000000;
line-height: 33rpx;
width: fit-content;
min-width: 100rpx;
.one-picker
width: 100%
height: 100%
display: flex;
flex-wrap: nowrap;
align-items: center;
.metro-two
font-size: 21rpx;
color: #606060;
@@ -118,6 +363,19 @@ const state = reactive({});
border-radius: 50%;
position: relative;
margin-bottom: 10rpx;
.donted::after
position: absolute;
content: '';
color: #FFFFFF;
font-size: 20rpx;
text-align: center;
left: 0;
top: -5rpx;
width: 27rpx;
height: 27rpx;
line-height: 28rpx;
background: blue !important;
border-radius: 50%;
.dontstart::after
position: absolute;
content: '始';
@@ -129,7 +387,20 @@ const state = reactive({});
width: 27rpx;
height: 27rpx;
line-height: 28rpx;
background: blue;
background: #666666;
border-radius: 50%;
.dontend::after
position: absolute;
content: '终点';
color: #FFFFFF;
font-size: 20rpx;
text-align: center;
left: 0;
top: -5rpx;
width: 27rpx;
height: 27rpx;
line-height: 28rpx;
background: #666666;
border-radius: 50%;
.item-text
width: 23rpx;
@@ -151,14 +422,14 @@ const state = reactive({});
z-index: 1;
.nearby-list
margin-top: 40rpx;
background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
// background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
.list-head
height: 77rpx;
background-color: #FFFFFF;
border-radius: 17rpx 17rpx 0rpx 0rpx;
position: relative;
top: -17rpx;
z-index: 9999;
z-index: 2;
.tab-options
display: flex;
align-items: center;
@@ -189,7 +460,8 @@ const state = reactive({});
align-items: center;
.tab-recommend
white-space: nowrap;
width: 92rpx;
width: fit-content;
padding: 0 10rpx;
height: 42rpx;
background: #4778EC;
border-radius: 17rpx 17rpx 0rpx 17rpx;
@@ -231,6 +503,9 @@ const state = reactive({});
color: #606060;
.textblue
color: #4778EC;
.row-right
min-width: 120rpx
text-align: right
.row-left
display: flex;
justify-content: space-between;

View File

@@ -1,72 +1,237 @@
<template>
<scroll-view :scroll-y="true" class="nearby-scroll">
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom">
<view class="two-head">
<view class="head-item active">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view class="head-item">市北区</view>
<view
class="head-item"
:class="{ active: item.value === fromValue.area }"
v-for="(item, index) in oneDictData('area')"
:key="item.value"
@click="changeArea(item.value, item)"
>
{{ item.label }}
</view>
<view
class="head-item"
:class="{ active: state.tabBxText === fromValue.area }"
@click="changeArea(state.tabBxText, item)"
>
不限区域
</view>
</view>
<view class="nearby-list">
<view class="list-head" @touchmove.stop.prevent>
<view class="tab-options">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll" @touchmove.stop>
<view class="tab-op-left">
<view class="tab-list" v-for="(item, index) in 4" :key="index">中国万岁</view>
<uni-icons type="plusempty" style="margin-right: 10rpx" size="20"></uni-icons>
<view
class="tab-list"
:class="{ tabchecked: state.tabIndex === 'all' }"
@click="choosePosition('all')"
>
全部
</view>
<view
class="tab-list"
:class="{ tabchecked: state.tabIndex === index }"
@click="choosePosition(index)"
v-for="(item, index) in userInfo.jobTitle"
:key="index"
>
{{ item }}
</view>
</view>
</scroll-view>
<view class="tab-op-right">
<view class="tab-recommend">推荐</view>
<view class="tab-filter">
<view class="tab-number">1000+</view>
<uni-icons type="plusempty" style="margin-right: 10rpx" size="20"></uni-icons>
<view class="tab-recommend">
<latestHotestStatus @confirm="handelHostestSearch"></latestHotestStatus>
</view>
<view class="tab-filter" @click="emit('onFilter', 1)">
<view class="tab-number" v-show="pageState.total">{{ formatTotal(pageState.total) }}</view>
<image class="image" src="/static/icon/filter.png"></image>
</view>
</view>
</view>
</view>
<view class="one-cards">
<view class="card-box" v-for="(item, index) in 20" :key="index">
<view class="card-box" v-for="(item, index) in list" :key="item.jobId" @click="navToPost(item.jobId)">
<view class="box-row mar_top0">
<view class="row-left">销售工程师-高级销售经理</view>
<view class="row-right">1-2</view>
<view class="row-left">{{ item.jobTitle }}</view>
<view class="row-right">
<Salary-Expectation
:max-salary="item.maxSalary"
:min-salary="item.minSalary"
></Salary-Expectation>
</view>
</view>
<view class="box-row">
<view class="row-left">
<view class="row-tag">本科</view>
<view class="row-tag">1-5</view>
<view class="row-tag" v-if="item.education">
<dict-Label dictType="education" :value="item.education"></dict-Label>
</view>
<view class="row-tag" v-if="item.experience">
<dict-Label dictType="experience" :value="item.experience"></dict-Label>
</view>
</view>
</view>
<view class="box-row mar_top0">
<view class="row-item mineText">2024.1.8</view>
<view class="row-item mineText">8</view>
<view class="row-item mineText textblue">匹配度93%</view>
<view class="row-item mineText">{{ item.postingDate || '发布日期' }}</view>
<view class="row-item mineText">{{ vacanciesTo(item.vacancies) }}</view>
<view class="row-item mineText textblue"><matchingDegree :job="item"></matchingDegree></view>
<view class="row-item">
<uni-icons type="star" size="28"></uni-icons>
<!-- <uni-icons type="star-filled" color="#FFCB47" size="30"></uni-icons> -->
</view>
</view>
<view class="box-row">
<view class="row-left mineText">湖南沃森电气科技有限公司</view>
<view class="row-right mineText">青岛 青岛经济技术开发区 550m</view>
<view class="row-left mineText">{{ item.companyName }}</view>
<view class="row-right mineText">
青岛
<dict-Label dictType="area" :value="item.jobLocationAreaCode"></dict-Label>
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitude()"
:blong="longitude()"
></convert-distance>
</view>
</view>
</view>
</view>
</view>
<loadmore ref="loadmoreRef"></loadmore>
</scroll-view>
</template>
<script setup>
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
const state = reactive({});
import { onLoad, onShow } from '@dcloudio/uni-app';
import useDictStore from '@/stores/useDictStore';
import useUserStore from '@/stores/useUserStore';
import useLocationStore from '@/stores/useLocationStore';
const { getLocation, longitude, latitude } = useLocationStore();
const { getDictSelectOption, oneDictData } = useDictStore();
const { $api, navTo, vacanciesTo, formatTotal } = inject('globalFunction');
const emit = defineEmits(['onFilter']);
const state = reactive({
tabIndex: 'all',
tabBxText: 'buxianquyu',
});
const isLoaded = ref(false);
const fromValue = reactive({
area: 0,
});
const loadmoreRef = ref(null);
const userInfo = ref({});
const pageState = reactive({
page: 0,
total: 0,
maxPage: 2,
pageSize: 10,
search: {
order: 0,
},
});
const list = ref([]);
onShow(() => {
userInfo.value = useUserStore().userInfo;
});
function navToPost(jobId) {
navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`);
}
async function loadData() {
try {
if (isLoaded.value) return;
const area = oneDictData('area')[0];
fromValue.area = area.value;
getJobList('refresh');
isLoaded.value = true;
} catch (err) {
isLoaded.value = false; // 重置状态允许重试
throw err;
}
}
function scrollBottom() {
getJobList();
loadmoreRef.value.change('loading');
}
function choosePosition(index) {
state.tabIndex = index;
if (index === 'all') {
pageState.search.jobTitle = '';
} else {
pageState.search.jobTitle = useUserStore().userInfo.jobTitle[index];
}
getJobList('refresh');
}
function changeArea(area, item) {
fromValue.area = area;
getJobList('refresh');
}
function getJobList(type = 'add') {
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 2;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
countyIds: [fromValue.area],
...pageState.search,
};
if (fromValue.area === state.tabBxText) {
params.countyIds = [];
}
$api.createRequest('/app/job/countyJob', params, 'POST').then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = list.value.length;
const reslist = rows;
list.value.splice(str, end, ...reslist);
} else {
list.value = rows;
}
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
if (rows.length < pageState.pageSize) {
loadmoreRef.value.change('noMore');
} else {
loadmoreRef.value.change('more');
}
});
}
function handelHostestSearch(val) {
pageState.search.order = val.value;
getJobList('refresh');
}
function handleFilterConfirm(val) {
pageState.search = {
order: pageState.search.order,
};
for (const [key, value] of Object.entries(val)) {
pageState.search[key] = value.join(',');
}
getJobList('refresh');
}
defineExpose({ loadData, handleFilterConfirm });
</script>
<style lang="stylus" scoped>
.tabchecked
color: #4778EC !important
.nearby-scroll
overflow: hidden;
.two-head
@@ -93,7 +258,7 @@ const state = reactive({});
color: #FFFFFF;
.nearby-list
margin-top: 40rpx;
background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
// background: linear-gradient( 180deg, #4778EC 0%, #002979 100%);
.list-head
height: 77rpx;
background-color: #FFFFFF;
@@ -131,7 +296,8 @@ const state = reactive({});
align-items: center;
.tab-recommend
white-space: nowrap;
width: 92rpx;
width: fit-content;
padding: 0 10rpx;
height: 42rpx;
background: #4778EC;
border-radius: 17rpx 17rpx 0rpx 17rpx;
@@ -173,6 +339,9 @@ const state = reactive({});
color: #606060;
.textblue
color: #4778EC;
.row-right
min-width: 120rpx
text-align: right
.row-left
display: flex;
justify-content: space-between;

View File

@@ -8,44 +8,112 @@
</view>
<view class="nearby-content">
<swiper class="swiper" :current="state.current" @change="changeSwiperType">
<swiper-item class="swiper-item" disable-touch>
<oneComponent></oneComponent>
</swiper-item>
<swiper-item class="swiper-item">
<twoComponent></twoComponent>
</swiper-item>
<swiper-item class="swiper-item">
<threeComponent></threeComponent>
</swiper-item>
<swiper-item class="swiper-item">
<fourComponent></fourComponent>
<!-- 动态绑定ref -->
<swiper-item class="swiper-item" v-for="(_, index) in 4" :key="index">
<component
:is="components[index]"
@onFilter="addfileter"
:ref="(el) => handelComponentsRef(el, index)"
/>
</swiper-item>
</swiper>
</view>
<!-- 弹窗 -->
<screeningJobRequirementsVue
:area="false"
v-model:show="showFilter"
@confirm="handleFilterConfirm"
></screeningJobRequirementsVue>
<screeningJobRequirementsVue
:area="false"
v-model:show="showFilter1"
@confirm="handleFilterConfirm"
></screeningJobRequirementsVue>
<screeningJobRequirementsVue
:area="false"
v-model:show="showFilter2"
@confirm="handleFilterConfirm"
></screeningJobRequirementsVue>
<screeningJobRequirementsVue
:area="false"
v-model:show="showFilter3"
@confirm="handleFilterConfirm"
></screeningJobRequirementsVue>
</view>
</template>
<script setup>
import screeningJobRequirementsVue from '@/components/screening-job-requirements/screening-job-requirements.vue';
import oneComponent from './components/one.vue';
import twoComponent from './components/two.vue';
import threeComponent from './components/three.vue';
import fourComponent from './components/four.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, debounce, throttle } = inject('globalFunction');
const loadedMap = reactive([false, false, false, false]);
const swiperRefs = [ref(null), ref(null), ref(null), ref(null)];
const components = [oneComponent, twoComponent, threeComponent, fourComponent];
const filterId = ref(0);
const showFilter = ref(false);
const showFilter1 = ref(false);
const showFilter2 = ref(false);
const showFilter3 = ref(false);
const state = reactive({
current: 2,
current: 0,
all: [{}],
});
onLoad(() => {});
// filter education aera scale 。。。。
function handleFilterConfirm(e) {
swiperRefs[filterId.value].value?.handleFilterConfirm(e);
}
function addfileter(val) {
filterId.value = val;
switch (val) {
case 0:
showFilter.value = true;
break;
case 1:
showFilter1.value = true;
break;
case 2:
showFilter2.value = true;
break;
case 3:
showFilter3.value = true;
break;
}
}
onMounted(() => {
handleTabChange(state.current);
});
const handelComponentsRef = (el, index) => {
if (el) {
swiperRefs[index].value = el;
}
};
// 查看消息类型
function changeSwiperType(e) {
const currented = e.detail.current;
state.current = currented;
const index = e.detail.current;
state.current = index;
handleTabChange(index);
}
function changeType(index) {
state.current = index;
handleTabChange(index);
}
function handleTabChange(index) {
if (!loadedMap[index]) {
swiperRefs[index].value?.loadData();
loadedMap[index] = true;
}
}
</script>
@@ -68,7 +136,7 @@ function changeType(index) {
width: calc(100% / 4);
z-index: 9
.actived
width: 169rpx;
// width: 169rpx;
height: 63rpx;
background: #13C57C;
box-shadow: 0rpx 7rpx 7rpx 0rpx rgba(0,0,0,0.25);