flat:AI+
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user