205 lines
5.9 KiB
Vue
205 lines
5.9 KiB
Vue
<template>
|
|
<transition-group name="blur-fade-stagger" tag="view">
|
|
<view v-for="(job, index) in dataSource" :key="job.id" :style="{ '--i': 2 }">
|
|
<view class="cards" @click="nextDetail(job)">
|
|
<view class="card-company">
|
|
<text class="company line_1">{{ job.gsmc }}</text>
|
|
</view>
|
|
<view class="card-bottom">
|
|
<view class="fl_box fs_14">
|
|
<!-- <dict-tree-Label class="mar_ri10" dictType="industry" :value="job.industry"></dict-tree-Label>
|
|
<dict-Label dictType="scale" :value="job.scale"></dict-Label> -->
|
|
<view>{{ job.gsxy }}</view>
|
|
</view>
|
|
<view class="ris">
|
|
<text class="fs_14">
|
|
在招职位·
|
|
<text class="color_256BFA">{{ job.zzgwsl || '-' }}</text>
|
|
个
|
|
</text>
|
|
</view>
|
|
</view>
|
|
<view class="card-tags">
|
|
<view class="tag" v-if="job.nature">
|
|
<dict-Label dictType="nature" :value="job.nature"></dict-Label>
|
|
<dict-Label dictType="nature" :value="job.nature"></dict-Label>
|
|
</view>
|
|
<view class="tag">
|
|
{{ vacanciesTo(job.vacancies) }}
|
|
</view>
|
|
<view class="tag" v-if="job.qyxz">
|
|
{{ job.qyxz }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</transition-group>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { inject, computed, toRaw, watch, ref, nextTick } from 'vue';
|
|
const { insertSortData, navTo, vacanciesTo } = inject('globalFunction');
|
|
import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js';
|
|
const recommedIndexDb = useRecommedIndexedDBStore();
|
|
|
|
const dataSource = ref([]);
|
|
const props = defineProps({
|
|
list: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
longitude: {
|
|
type: Number,
|
|
default: 120.382665,
|
|
},
|
|
latitude: {
|
|
type: Number,
|
|
default: 36.066938,
|
|
},
|
|
seeDate: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
zphId: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
});
|
|
const processedIds = new Set();
|
|
watch(
|
|
() => props.list,
|
|
(newList) => {
|
|
if (!Array.isArray(newList)) return;
|
|
|
|
let shouldReset = false;
|
|
|
|
if (dataSource.value.length > newList.length) {
|
|
shouldReset = true;
|
|
} else if (dataSource.value.length > 0 && newList.length > 0) {
|
|
// 注意:这里沿用你代码中使用的 item.id 作为唯一标识
|
|
const oldId = dataSource.value[0].id;
|
|
const newId = newList[0].id;
|
|
if (oldId !== newId) {
|
|
shouldReset = true;
|
|
}
|
|
}
|
|
|
|
if (shouldReset) {
|
|
dataSource.value = [];
|
|
processedIds.clear();
|
|
}
|
|
|
|
const newItems = newList.filter((item) => !processedIds.has(item.id));
|
|
|
|
if (newItems.length === 0) return;
|
|
|
|
newItems.forEach((item) => processedIds.add(item.id));
|
|
const delay = 50;
|
|
newItems.forEach((item, index) => {
|
|
setTimeout(() => {
|
|
dataSource.value.push(item);
|
|
}, index * delay);
|
|
});
|
|
},
|
|
{ immediate: true, deep: true }
|
|
);
|
|
|
|
function nextDetail(company) {
|
|
navTo(
|
|
`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.gsID}&companyName=${company.gsmc}&zphId=${props.zphId}&dataType=2`
|
|
);
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus" scoped>
|
|
.date-jobTitle{
|
|
font-weight: 400;
|
|
font-size: 28rpx;
|
|
color: #495265;
|
|
padding: 28rpx 0 0 20rpx
|
|
}
|
|
.cards{
|
|
padding: 32rpx;
|
|
background: #FFFFFF;
|
|
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
|
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
|
margin-top: 22rpx;
|
|
.card-company{
|
|
display: flex
|
|
justify-content: space-between
|
|
align-items: flex-start
|
|
.company{
|
|
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
|
font-weight: 500;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
}
|
|
.salary{
|
|
font-weight: 500;
|
|
font-size: 28rpx;
|
|
color: #4C6EFB;
|
|
white-space: nowrap
|
|
line-height: 48rpx
|
|
}
|
|
}
|
|
.card-companyName{
|
|
font-weight: 400;
|
|
font-size: 28rpx;
|
|
color: #6C7282;
|
|
}
|
|
.card-tags{
|
|
display: flex
|
|
flex-wrap: wrap
|
|
.tag{
|
|
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
|
width: fit-content;
|
|
height: 30rpx;
|
|
background: #F4F4F4;
|
|
border-radius: 4rpx;
|
|
padding: 6rpx 20rpx;
|
|
line-height: 30rpx;
|
|
font-weight: 400;
|
|
font-size: 24rpx;
|
|
color: #6C7282;
|
|
text-align: center;
|
|
margin-top: 14rpx;
|
|
white-space: nowrap
|
|
margin-right: 20rpx
|
|
}
|
|
}
|
|
.card-bottom{
|
|
margin-top: 15rpx
|
|
margin-bottom: 10rpx
|
|
display: flex
|
|
justify-content: space-between
|
|
font-size: 28rpx;
|
|
color: #6C7282;
|
|
}
|
|
}
|
|
.ris{
|
|
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
|
}
|
|
</style>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@media(min-width: 800px){
|
|
.cards{
|
|
.card-company{
|
|
.company{
|
|
font-size: 38rpx;
|
|
}
|
|
}
|
|
.card-bottom{
|
|
font-size: 34rpx;
|
|
}
|
|
.card-tags{
|
|
.tag{
|
|
padding: 10rpx 30rpx;
|
|
font-size: 30rpx;
|
|
border-radius: 6rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style> |