页面适配
This commit is contained in:
@@ -1,39 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
<transition-group name="blur-fade-stagger" tag="view">
|
<transition-group name="blur-fade-stagger" tag="view">
|
||||||
<view v-for="(job, index) in dataSource" :key="job.id" :style="{ '--i': 2 }">
|
<!-- #endif -->
|
||||||
<view class="cards" @click="nextDetail(job)">
|
<view v-for="(job, index) in dataSource" :key="job.id" :style="{ '--i': 2 }">
|
||||||
<view class="card-company">
|
<view class="cards" @click="nextDetail(job)">
|
||||||
<text class="company line_1">{{ job.gsmc }}</text>
|
<view class="card-company">
|
||||||
</view>
|
<text class="company line_1">{{ job.gsmc }}</text>
|
||||||
<view class="card-bottom">
|
</view>
|
||||||
<view class="fl_box fs_14">
|
<view class="card-bottom">
|
||||||
<!-- <dict-tree-Label class="mar_ri10" dictType="industry" :value="job.industry"></dict-tree-Label>
|
<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> -->
|
<dict-Label dictType="scale" :value="job.scale"></dict-Label> -->
|
||||||
<view>{{ job.gsxy }}</view>
|
<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>
|
||||||
|
<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>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
</transition-group>
|
</transition-group>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -44,70 +51,70 @@ const recommedIndexDb = useRecommedIndexedDBStore();
|
|||||||
|
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
longitude: {
|
longitude: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 120.382665,
|
default: 120.382665,
|
||||||
},
|
},
|
||||||
latitude: {
|
latitude: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 36.066938,
|
default: 36.066938,
|
||||||
},
|
},
|
||||||
seeDate: {
|
seeDate: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
zphId: {
|
zphId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const processedIds = new Set();
|
const processedIds = new Set();
|
||||||
watch(
|
watch(
|
||||||
() => props.list,
|
() => props.list,
|
||||||
(newList) => {
|
(newList) => {
|
||||||
if (!Array.isArray(newList)) return;
|
if (!Array.isArray(newList)) return;
|
||||||
|
|
||||||
let shouldReset = false;
|
let shouldReset = false;
|
||||||
|
|
||||||
if (dataSource.value.length > newList.length) {
|
if (dataSource.value.length > newList.length) {
|
||||||
shouldReset = true;
|
shouldReset = true;
|
||||||
} else if (dataSource.value.length > 0 && newList.length > 0) {
|
} else if (dataSource.value.length > 0 && newList.length > 0) {
|
||||||
// 注意:这里沿用你代码中使用的 item.id 作为唯一标识
|
// 注意:这里沿用你代码中使用的 item.id 作为唯一标识
|
||||||
const oldId = dataSource.value[0].id;
|
const oldId = dataSource.value[0].id;
|
||||||
const newId = newList[0].id;
|
const newId = newList[0].id;
|
||||||
if (oldId !== newId) {
|
if (oldId !== newId) {
|
||||||
shouldReset = true;
|
shouldReset = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldReset) {
|
if (shouldReset) {
|
||||||
dataSource.value = [];
|
dataSource.value = [];
|
||||||
processedIds.clear();
|
processedIds.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
const newItems = newList.filter((item) => !processedIds.has(item.id));
|
const newItems = newList.filter((item) => !processedIds.has(item.id));
|
||||||
|
|
||||||
if (newItems.length === 0) return;
|
if (newItems.length === 0) return;
|
||||||
|
|
||||||
newItems.forEach((item) => processedIds.add(item.id));
|
newItems.forEach((item) => processedIds.add(item.id));
|
||||||
const delay = 50;
|
const delay = 50;
|
||||||
newItems.forEach((item, index) => {
|
newItems.forEach((item, index) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dataSource.value.push(item);
|
dataSource.value.push(item);
|
||||||
}, index * delay);
|
}, index * delay);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{ immediate: true, deep: true }
|
{ immediate: true, deep: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
function nextDetail(company) {
|
function nextDetail(company) {
|
||||||
navTo(
|
navTo(
|
||||||
`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.gsID}&companyName=${company.gsmc}&zphId=${props.zphId}&dataType=2`
|
`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.gsID}&companyName=${company.gsmc}&zphId=${props.zphId}&dataType=2`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ function nextDetail(job) {
|
|||||||
if (job.isPublish) {
|
if (job.isPublish) {
|
||||||
return $api.msg('已过期');
|
return $api.msg('已过期');
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}&dataType=${job.dataType}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&dataType=${job.dataType}`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ function nextDetail(job) {
|
|||||||
return $api.msg('已过期');
|
return $api.msg('已过期');
|
||||||
}
|
}
|
||||||
// 根据数据类型跳转到不同的详情页
|
// 根据数据类型跳转到不同的详情页
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}&dataType=${job.dataType}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&dataType=${job.dataType}`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ function nextDetail(job) {
|
|||||||
if (job.isPublish) {
|
if (job.isPublish) {
|
||||||
return $api.msg('已过期');
|
return $api.msg('已过期');
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}&dataType=${job.dataType}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&dataType=${job.dataType}`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
<transition-group name="blur-fade-stagger" tag="view">
|
<transition-group name="blur-fade-stagger" tag="view">
|
||||||
<view v-for="job in dataSource" :key="job.id || job.jobId" :style="{ '--i': 2 }">
|
<!-- #endif -->
|
||||||
<view v-if="!job.isTitle" class="cards" @click="nextDetail(job)">
|
<view v-for="job in dataSource" :key="job.id || job.jobId" :style="{ '--i': 2 }">
|
||||||
<view class="card-company">
|
<view v-if="!job.isTitle" class="cards" @click="nextDetail(job)">
|
||||||
<text class="company">{{ job.jobTitle }}</text>
|
<view class="card-company">
|
||||||
<view class="salary">
|
<text class="company">{{ job.jobTitle }}</text>
|
||||||
<Salary-Expectation
|
<view class="salary">
|
||||||
:max-salary="job.maxSalary"
|
<Salary-Expectation
|
||||||
:min-salary="job.minSalary"
|
:max-salary="job.maxSalary"
|
||||||
></Salary-Expectation>
|
:min-salary="job.minSalary"
|
||||||
</view>
|
></Salary-Expectation>
|
||||||
</view>
|
|
||||||
<view class="card-companyName">{{ job.gwmc }}</view>
|
|
||||||
<view class="card-tags">
|
|
||||||
<view class="tag">
|
|
||||||
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
|
||||||
</view>
|
|
||||||
<view class="tag">
|
|
||||||
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
|
||||||
</view>
|
|
||||||
<view class="tag">
|
|
||||||
{{ vacanciesTo(job.vacancies) }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="card-bottom">
|
|
||||||
<view>{{ job.postingDate }}</view>
|
|
||||||
<view>
|
|
||||||
<convert-distance
|
|
||||||
:alat="job.latitude"
|
|
||||||
:along="job.longitude"
|
|
||||||
:blat="latitude"
|
|
||||||
:blong="longitude"
|
|
||||||
></convert-distance>
|
|
||||||
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="date-jobTitle" v-else>
|
</view>
|
||||||
{{ job.title }}
|
<view class="card-companyName">{{ job.gwmc }}</view>
|
||||||
|
<view class="card-tags">
|
||||||
|
<view class="tag">
|
||||||
|
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="tag">
|
||||||
|
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
||||||
|
</view>
|
||||||
|
<view class="tag">
|
||||||
|
{{ vacanciesTo(job.vacancies) }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="card-bottom">
|
||||||
|
<view>{{ job.postingDate }}</view>
|
||||||
|
<view>
|
||||||
|
<convert-distance
|
||||||
|
:alat="job.latitude"
|
||||||
|
:along="job.longitude"
|
||||||
|
:blat="latitude"
|
||||||
|
:blong="longitude"
|
||||||
|
></convert-distance>
|
||||||
|
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="date-jobTitle" v-else>
|
||||||
|
{{ job.title }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
</transition-group>
|
</transition-group>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -50,85 +56,85 @@ import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js
|
|||||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: '标题',
|
default: '标题',
|
||||||
},
|
},
|
||||||
longitude: {
|
longitude: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 120.382665,
|
default: 120.382665,
|
||||||
},
|
},
|
||||||
latitude: {
|
latitude: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 36.066938,
|
default: 36.066938,
|
||||||
},
|
},
|
||||||
seeDate: {
|
seeDate: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const listData = computed(() => {
|
const listData = computed(() => {
|
||||||
if (props.seeDate && props.list.length) {
|
if (props.seeDate && props.list.length) {
|
||||||
const ulist = toRaw(props.list);
|
const ulist = toRaw(props.list);
|
||||||
const [reslist, lastDate] = insertSortData(ulist, props.seeDate);
|
const [reslist, lastDate] = insertSortData(ulist, props.seeDate);
|
||||||
return reslist;
|
return reslist;
|
||||||
}
|
}
|
||||||
return props.list;
|
return props.list;
|
||||||
});
|
});
|
||||||
|
|
||||||
const processedIds = new Set();
|
const processedIds = new Set();
|
||||||
watch(
|
watch(
|
||||||
() => props.list,
|
() => props.list,
|
||||||
(newList) => {
|
(newList) => {
|
||||||
if (!Array.isArray(newList)) return;
|
if (!Array.isArray(newList)) return;
|
||||||
|
|
||||||
// --- 新增逻辑开始 ---
|
// --- 新增逻辑开始 ---
|
||||||
// 判断是否需要重置数据 (例如:点击了搜索、切换了Tab、或下拉刷新)
|
// 判断是否需要重置数据 (例如:点击了搜索、切换了Tab、或下拉刷新)
|
||||||
let shouldReset = false;
|
let shouldReset = false;
|
||||||
|
|
||||||
// 场景1: 新列表长度比当前渲染的列表短,说明发生了重置(如从20条变成了10条)
|
// 场景1: 新列表长度比当前渲染的列表短,说明发生了重置(如从20条变成了10条)
|
||||||
if (dataSource.value.length > newList.length) {
|
if (dataSource.value.length > newList.length) {
|
||||||
shouldReset = true;
|
shouldReset = true;
|
||||||
}
|
}
|
||||||
// 场景2: 列表不为空,且第一条数据的ID发生了变化,说明是全新的搜索结果
|
// 场景2: 列表不为空,且第一条数据的ID发生了变化,说明是全新的搜索结果
|
||||||
else if (dataSource.value.length > 0 && newList.length > 0) {
|
else if (dataSource.value.length > 0 && newList.length > 0) {
|
||||||
const oldId = dataSource.value[0].id || dataSource.value[0].jobId;
|
const oldId = dataSource.value[0].id || dataSource.value[0].jobId;
|
||||||
const newId = newList[0].id || newList[0].jobId;
|
const newId = newList[0].id || newList[0].jobId;
|
||||||
if (oldId !== newId) {
|
if (oldId !== newId) {
|
||||||
shouldReset = true;
|
shouldReset = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果判定为重置,则清空现有数据和ID记录
|
// 如果判定为重置,则清空现有数据和ID记录
|
||||||
if (shouldReset) {
|
if (shouldReset) {
|
||||||
dataSource.value = [];
|
dataSource.value = [];
|
||||||
processedIds.clear();
|
processedIds.clear();
|
||||||
}
|
}
|
||||||
// --- 新增逻辑结束 ---
|
// --- 新增逻辑结束 ---
|
||||||
|
|
||||||
const newItems = newList.filter((item) => !processedIds.has(item.id || item.jobId));
|
const newItems = newList.filter((item) => !processedIds.has(item.id || item.jobId));
|
||||||
|
|
||||||
if (newItems.length === 0) return;
|
if (newItems.length === 0) return;
|
||||||
|
|
||||||
newItems.forEach((item) => processedIds.add(item.id || item.jobId));
|
newItems.forEach((item) => processedIds.add(item.id || item.jobId));
|
||||||
const delay = 50;
|
const delay = 50;
|
||||||
newItems.forEach((item, index) => {
|
newItems.forEach((item, index) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dataSource.value.push(item);
|
dataSource.value.push(item);
|
||||||
}, index * delay);
|
}, index * delay);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{ immediate: true, deep: true } // 建议加上 deep,虽然这里监听的是数组引用变化
|
{ immediate: true, deep: true } // 建议加上 deep,虽然这里监听的是数组引用变化
|
||||||
);
|
);
|
||||||
|
|
||||||
function nextDetail(job) {
|
function nextDetail(job) {
|
||||||
// 记录岗位类型,用作数据分析
|
// 记录岗位类型,用作数据分析
|
||||||
if (job.jobCategory) {
|
if (job.jobCategory) {
|
||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}&dataType=1`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&dataType=1`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
<transition-group name="blur-fade-stagger" tag="view">
|
<transition-group name="blur-fade-stagger" tag="view">
|
||||||
<view v-for="job in dataSource" :key="job.id" :style="{ '--i': 2 }">
|
<!-- #endif -->
|
||||||
<view v-if="!job.isTitle" class="cards" @click="nextDetail(job)">
|
<view v-for="job in dataSource" :key="job.id" :style="{ '--i': 2 }">
|
||||||
<view class="card-company">
|
<view v-if="!job.isTitle" class="cards" @click="nextDetail(job)">
|
||||||
<text class="company">{{ job.gwmc }}</text>
|
<view class="card-company">
|
||||||
<view class="salary">
|
<text class="company">{{ job.gwmc }}</text>
|
||||||
<Salary-Expectation
|
<view class="salary">
|
||||||
:max-salary="job.maxSalary"
|
<Salary-Expectation
|
||||||
:min-salary="job.minSalary"
|
:max-salary="job.maxSalary"
|
||||||
></Salary-Expectation>
|
:min-salary="job.minSalary"
|
||||||
</view>
|
></Salary-Expectation>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-companyName">{{ job.gsmc }}</view>
|
</view>
|
||||||
<view class="card-tags">
|
<view class="card-companyName">{{ job.gsmc }}</view>
|
||||||
<view class="tag">
|
<view class="card-tags">
|
||||||
{{ job.xlyq == '不限' ? '学历不限' : job.xlyq }}
|
<view class="tag">
|
||||||
</view>
|
{{ job.xlyq == '不限' ? '学历不限' : job.xlyq }}
|
||||||
<view class="tag">
|
</view>
|
||||||
{{ job.gwgzjy == '不限' ? '经验不限' : job.gwgzjy }}
|
<view class="tag">
|
||||||
</view>
|
{{ job.gwgzjy == '不限' ? '经验不限' : job.gwgzjy }}
|
||||||
<view class="tag">
|
</view>
|
||||||
{{ vacanciesTo(job.zprs) }}
|
<view class="tag">
|
||||||
</view>
|
{{ vacanciesTo(job.zprs) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="card-bottom">
|
</view>
|
||||||
<view>{{ parseDateTime(job.createTime).date }}</view>
|
<view class="card-bottom">
|
||||||
<view>
|
<view>{{ parseDateTime(job.createTime).date }}</view>
|
||||||
<!-- <convert-distance
|
<view>
|
||||||
|
<!-- <convert-distance
|
||||||
:alat="job.latitude"
|
:alat="job.latitude"
|
||||||
:along="job.longitude"
|
:along="job.longitude"
|
||||||
:blat="latitude"
|
:blat="latitude"
|
||||||
:blong="longitude"
|
:blong="longitude"
|
||||||
></convert-distance>
|
></convert-distance>
|
||||||
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label> -->
|
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label> -->
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="date-jobTitle" v-else>
|
|
||||||
{{ job.title }}
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="date-jobTitle" v-else>
|
||||||
|
{{ job.title }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
</transition-group>
|
</transition-group>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -50,76 +56,76 @@ import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js
|
|||||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: '标题',
|
default: '标题',
|
||||||
},
|
},
|
||||||
longitude: {
|
longitude: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 120.382665,
|
default: 120.382665,
|
||||||
},
|
},
|
||||||
latitude: {
|
latitude: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 36.066938,
|
default: 36.066938,
|
||||||
},
|
},
|
||||||
seeDate: {
|
seeDate: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const listData = computed(() => {
|
const listData = computed(() => {
|
||||||
if (props.seeDate && props.list.length) {
|
if (props.seeDate && props.list.length) {
|
||||||
const ulist = toRaw(props.list);
|
const ulist = toRaw(props.list);
|
||||||
const [reslist, lastDate] = insertSortData(ulist, props.seeDate);
|
const [reslist, lastDate] = insertSortData(ulist, props.seeDate);
|
||||||
return reslist;
|
return reslist;
|
||||||
}
|
}
|
||||||
return props.list;
|
return props.list;
|
||||||
});
|
});
|
||||||
|
|
||||||
const processedIds = new Set();
|
const processedIds = new Set();
|
||||||
watch(
|
watch(
|
||||||
() => props.list,
|
() => props.list,
|
||||||
(newList) => {
|
(newList) => {
|
||||||
if (!Array.isArray(newList)) return;
|
if (!Array.isArray(newList)) return;
|
||||||
const newItems = newList.filter((item) => !processedIds.has(item.id));
|
const newItems = newList.filter((item) => !processedIds.has(item.id));
|
||||||
if (newItems.length === 0) return;
|
if (newItems.length === 0) return;
|
||||||
newItems.forEach((item) => processedIds.add(item.id));
|
newItems.forEach((item) => processedIds.add(item.id));
|
||||||
const delay = 50;
|
const delay = 50;
|
||||||
newItems.forEach((item, index) => {
|
newItems.forEach((item, index) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dataSource.value.push(item);
|
dataSource.value.push(item);
|
||||||
}, index * delay);
|
}, index * delay);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
function nextDetail(job) {
|
function nextDetail(job) {
|
||||||
// 记录岗位类型,用作数据分析
|
// 记录岗位类型,用作数据分析
|
||||||
if (job.jobCategory) {
|
if (job.jobCategory) {
|
||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.id)}&dataType=2`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.id)}&dataType=2`);
|
||||||
}
|
}
|
||||||
function parseDateTime(datetimeStr) {
|
function parseDateTime(datetimeStr) {
|
||||||
if (!datetimeStr) return { time: '', date: '' };
|
if (!datetimeStr) return { time: '', date: '' };
|
||||||
|
|
||||||
const dateObj = new Date(datetimeStr);
|
const dateObj = new Date(datetimeStr);
|
||||||
|
|
||||||
if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间
|
if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间
|
||||||
|
|
||||||
const year = dateObj.getFullYear();
|
const year = dateObj.getFullYear();
|
||||||
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
|
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
|
||||||
const day = String(dateObj.getDate()).padStart(2, '0');
|
const day = String(dateObj.getDate()).padStart(2, '0');
|
||||||
const hours = String(dateObj.getHours()).padStart(2, '0');
|
const hours = String(dateObj.getHours()).padStart(2, '0');
|
||||||
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
|
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
time: `${hours}:${minutes}`,
|
time: `${hours}:${minutes}`,
|
||||||
date: `${year}-${month}-${day}`,
|
date: `${year}-${month}-${day}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ const zphId = ref('');
|
|||||||
const pageOptions = ref({});
|
const pageOptions = ref({});
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
|
console.log(options,'++')
|
||||||
zphId.value = options.jobFairId;
|
zphId.value = options.jobFairId;
|
||||||
pageOptions.value = options;
|
pageOptions.value = options;
|
||||||
getJobFairInfo(options.jobFairId, options.jobFairName);
|
getJobFairInfo(options.jobFairId, options.jobFairName);
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ const explainUrlRef = ref('');
|
|||||||
const dataType = ref(1); // 1: 原数据, 2: 第三方数据
|
const dataType = ref(1); // 1: 原数据, 2: 第三方数据
|
||||||
|
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
|
console.log(option,'+++++')
|
||||||
if (option.jobId) {
|
if (option.jobId) {
|
||||||
dataType.value = option.dataType ? parseInt(option.dataType) : 1;
|
dataType.value = option.dataType ? parseInt(option.dataType) : 1;
|
||||||
initLoad(option);
|
initLoad(option);
|
||||||
@@ -210,15 +211,17 @@ onLoad((option) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
// #ifdef H5
|
||||||
const option = parseQueryParams(); // 兼容微信内置浏览器
|
const option = parseQueryParams(); // 兼容微信内置浏览器
|
||||||
if (option.jobId) {
|
if (option.jobId) {
|
||||||
dataType.value = option.dataType ? parseInt(option.dataType) : 1;
|
dataType.value = option.dataType ? parseInt(option.dataType) : 1;
|
||||||
initLoad(option);
|
initLoad(option);
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
});
|
});
|
||||||
|
|
||||||
function initLoad(option) {
|
function initLoad(option) {
|
||||||
const jobId = atob(option.jobId);
|
const jobId = decodeURIComponent(option.jobId);
|
||||||
if (jobId !== jobIdRef.value) {
|
if (jobId !== jobIdRef.value) {
|
||||||
jobIdRef.value = jobId;
|
jobIdRef.value = jobId;
|
||||||
getDetail(jobId);
|
getDetail(jobId);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function nextDetail() {
|
|||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
console.log(job.jobId);
|
console.log(job.jobId);
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextVideoSrc(num) {
|
function getNextVideoSrc(num) {
|
||||||
|
|||||||
@@ -1,112 +1,112 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-custom-root">
|
<view class="app-custom-root">
|
||||||
<view class="app-container">
|
<view class="app-container">
|
||||||
<!-- 顶部头部区域 -->
|
<!-- 顶部头部区域 -->
|
||||||
<view class="container-header">
|
<view class="container-header">
|
||||||
<view class="header-top">
|
<view class="header-top">
|
||||||
<view class="header-btnLf button-click" @click="seemsg(0)" :class="{ active: state.current === 0 }">
|
<view class="header-btnLf button-click" @click="seemsg(0)" :class="{ active: state.current === 0 }">
|
||||||
现场招聘
|
现场招聘
|
||||||
</view>
|
</view>
|
||||||
<view class="header-btnLf button-click" @click="seemsg(1)" :class="{ active: state.current === 1 }">
|
<view class="header-btnLf button-click" @click="seemsg(1)" :class="{ active: state.current === 1 }">
|
||||||
VR虚拟招聘会
|
VR虚拟招聘会
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="header-input btn-feel">
|
<view class="header-input btn-feel">
|
||||||
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
|
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
|
||||||
<input
|
<input
|
||||||
v-model="pageState.zphmc"
|
v-model="pageState.zphmc"
|
||||||
confirm-type="search"
|
confirm-type="search"
|
||||||
@confirm="getFair"
|
@confirm="getFair"
|
||||||
class="input"
|
class="input"
|
||||||
placeholder="招聘会"
|
placeholder="招聘会"
|
||||||
placeholder-class="inputplace"
|
placeholder-class="inputplace"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="header-date">
|
<view class="header-date">
|
||||||
<view class="data-week">
|
<view class="data-week">
|
||||||
<view
|
<view
|
||||||
class="weel-days button-click"
|
class="weel-days button-click"
|
||||||
:class="{ active: currentDay.fullDate === item.fullDate }"
|
:class="{ active: currentDay.fullDate === item.fullDate }"
|
||||||
v-for="(item, index) in weekList"
|
v-for="(item, index) in weekList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="selectDate(item)"
|
@click="selectDate(item)"
|
||||||
>
|
>
|
||||||
<view class="label">{{ item.day }}</view>
|
<view class="label">{{ item.day }}</view>
|
||||||
<view class="day">{{ item.date }}</view>
|
<view class="day">{{ item.date }}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="data-all">
|
|
||||||
<image class="allimg button-click" @click="toSelectDate" src="/static/icon/date1.png"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="data-all">
|
||||||
|
<image class="allimg button-click" @click="toSelectDate" src="/static/icon/date1.png"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 主体内容区域 -->
|
<!-- 主体内容区域 -->
|
||||||
<view class="container-main">
|
<view class="container-main">
|
||||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
|
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
|
||||||
<view class="cards">
|
<view class="cards">
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<transition-group name="stagger" tag="view" :css="true">
|
<transition-group name="stagger" tag="view" :css="true">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view
|
<view
|
||||||
class="card press-button"
|
class="card press-button"
|
||||||
v-for="(item, index) in fairList"
|
v-for="(item, index) in fairList"
|
||||||
:key="item.zphID"
|
:key="item.zphID"
|
||||||
:style="{ '--i': index }"
|
:style="{ '--i': index }"
|
||||||
@click="
|
@click="
|
||||||
navTo(
|
navTo(
|
||||||
'/packageA/pages/exhibitors/exhibitors?jobFairId=' +
|
'/packageA/pages/exhibitors/exhibitors?jobFairId=' +
|
||||||
item.zphID +
|
item.zphID +
|
||||||
'&jobFairName=' +
|
'&jobFairName=' +
|
||||||
item.zphmc
|
item.zphmc
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<view class="card-title">{{ item.zphmc }}</view>
|
<view class="card-title">{{ item.zphmc }}</view>
|
||||||
<view class="card-row">
|
<view class="card-row">
|
||||||
<text class="">{{ item.jbf }}</text>
|
<text class="">{{ item.jbf }}</text>
|
||||||
<text class="">
|
<text class="">
|
||||||
<!-- <convert-distance
|
<!-- <convert-distance
|
||||||
:alat="item.latitude"
|
:alat="item.latitude"
|
||||||
:along="item.longitude"
|
:along="item.longitude"
|
||||||
:blat="latitudeVal"
|
:blat="latitudeVal"
|
||||||
:blong="longitudeVal"
|
:blong="longitudeVal"
|
||||||
></convert-distance> -->
|
></convert-distance> -->
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-times">
|
<view class="card-times">
|
||||||
<view class="time-left">
|
<view class="time-left">
|
||||||
<view class="left-date">{{ parseDateTime(item.zphjbsj).time }}</view>
|
<view class="left-date">{{ parseDateTime(item.zphjbsj).time }}</view>
|
||||||
<view class="left-dateDay">{{ parseDateTime(item.zphjbsj).date }}</view>
|
<view class="left-dateDay">{{ parseDateTime(item.zphjbsj).date }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="time-center">
|
<view class="time-center">
|
||||||
<view class="center-date">
|
<view class="center-date">
|
||||||
{{ getTimeStatus(item.zphjbsj, item.zphjzsj).statusText }}
|
{{ getTimeStatus(item.zphjbsj, item.zphjzsj).statusText }}
|
||||||
</view>
|
|
||||||
<view class="center-dateDay">
|
|
||||||
{{ getHoursBetween(item.zphjbsj, item.zphjzsj) }}小时
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="line"></view>
|
|
||||||
<view class="time-right">
|
|
||||||
<view class="left-date">{{ parseDateTime(item.zphjzsj).time }}</view>
|
|
||||||
<view class="left-dateDay">{{ parseDateTime(item.zphjzsj).date }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="recommend-card-line"></view>
|
|
||||||
<view class="card-footer">内容简介:{{ item.zphjj }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- #ifdef H5 -->
|
|
||||||
</transition-group>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
</view>
|
||||||
<empty v-if="!fairList.length" content="暂时没有结果,下一天也许就有惊喜"></empty>
|
<view class="center-dateDay">
|
||||||
</scroll-view>
|
{{ getHoursBetween(item.zphjbsj, item.zphjzsj) }}小时
|
||||||
</view>
|
</view>
|
||||||
<!-- <Tabbar :currentpage="1"></Tabbar> -->
|
</view>
|
||||||
</view>
|
<view class="line"></view>
|
||||||
|
<view class="time-right">
|
||||||
|
<view class="left-date">{{ parseDateTime(item.zphjzsj).time }}</view>
|
||||||
|
<view class="left-dateDay">{{ parseDateTime(item.zphjzsj).date }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="recommend-card-line"></view>
|
||||||
|
<view class="card-footer">内容简介:{{ item.zphjj }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
</transition-group>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
<empty v-if="!fairList.length" content="暂时没有结果,下一天也许就有惊喜"></empty>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
<!-- <Tabbar :currentpage="1"></Tabbar> -->
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -117,210 +117,214 @@ import useLocationStore from '@/stores/useLocationStore';
|
|||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||||
const { $api, navTo, cloneDeep, debounce } = inject('globalFunction');
|
const { $api, navTo, } = inject('globalFunction');
|
||||||
const weekList = ref([]);
|
const weekList = ref([]);
|
||||||
const fairList = ref([]);
|
const fairList = ref([]);
|
||||||
const currentDay = ref({});
|
const currentDay = ref({});
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
current: 0,
|
current: 0,
|
||||||
all: [{}],
|
all: [{}],
|
||||||
});
|
});
|
||||||
const pageState = reactive({
|
const pageState = reactive({
|
||||||
page: 0,
|
page: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
maxPage: 2,
|
maxPage: 2,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
zphmc: '',
|
zphmc: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const year = today.getFullYear();
|
const year = today.getFullYear();
|
||||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
const day = String(today.getDate()).padStart(2, '0');
|
const day = String(today.getDate()).padStart(2, '0');
|
||||||
|
|
||||||
const currentDate = `${year}-${month}-${day}`;
|
const currentDate = `${year}-${month}-${day}`;
|
||||||
const result = getNextDates({
|
const result = getNextDates({
|
||||||
startDate: currentDate,
|
startDate: currentDate,
|
||||||
});
|
});
|
||||||
weekList.value = result;
|
weekList.value = result;
|
||||||
currentDay.value.fullDate = result[0].fullDate;
|
currentDay.value.fullDate = result[0].fullDate;
|
||||||
getFair('refresh');
|
getFair('refresh');
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleItemClick = (item) => {
|
const handleItemClick = (item) => {
|
||||||
|
try {
|
||||||
lightAppJssdk.navigation.hide({
|
lightAppJssdk.navigation.hide({
|
||||||
url: config.virtualJobFair,
|
url: config.virtualJobFair,
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
$api.msg('功能确定中');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function toSelectDate() {
|
function toSelectDate() {
|
||||||
navTo('/packageA/pages/selectDate/selectDate', {
|
navTo('/packageA/pages/selectDate/selectDate', {
|
||||||
query: {
|
query: {
|
||||||
date: currentDay.value.fullDate,
|
date: currentDay.value.fullDate,
|
||||||
entrance: 'careerfair',
|
entrance: 'careerfair',
|
||||||
},
|
},
|
||||||
onBack: (res) => {
|
onBack: (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
const result = getNextDates({
|
const result = getNextDates({
|
||||||
startDate: res.date,
|
startDate: res.date,
|
||||||
});
|
});
|
||||||
const formattedDate = res.date.slice(5); // MM-DD
|
const formattedDate = res.date.slice(5); // MM-DD
|
||||||
const dateFull = {
|
const dateFull = {
|
||||||
date: res.date.slice(5),
|
date: res.date.slice(5),
|
||||||
day: '周' + res.week,
|
day: '周' + res.week,
|
||||||
fullDate: res.date,
|
fullDate: res.date,
|
||||||
};
|
};
|
||||||
currentDay.value = dateFull;
|
currentDay.value = dateFull;
|
||||||
weekList.value = result;
|
weekList.value = result;
|
||||||
getFair('refresh');
|
getFair('refresh');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 查看消息类型
|
// 查看消息类型
|
||||||
function changeSwiperMsgType(e) {
|
function changeSwiperMsgType(e) {
|
||||||
const currented = e.detail.current;
|
const currented = e.detail.current;
|
||||||
state.current = currented;
|
state.current = currented;
|
||||||
}
|
}
|
||||||
|
|
||||||
function seemsg(index) {
|
function seemsg(index) {
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
handleItemClick();
|
handleItemClick();
|
||||||
// $api.msg('功能确定中');
|
// $api.msg('功能确定中');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.current = index;
|
state.current = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleScrollToLower = () => {
|
const handleScrollToLower = () => {
|
||||||
return;
|
return;
|
||||||
getFair();
|
getFair();
|
||||||
console.log('触底');
|
console.log('触底');
|
||||||
};
|
};
|
||||||
|
|
||||||
function getFair(type = 'add') {
|
function getFair(type = 'add') {
|
||||||
if (type === 'refresh') {
|
if (type === 'refresh') {
|
||||||
pageState.page = 1;
|
pageState.page = 1;
|
||||||
pageState.maxPage = 1;
|
pageState.maxPage = 1;
|
||||||
|
}
|
||||||
|
if (type === 'add' && pageState.page < pageState.maxPage) {
|
||||||
|
pageState.page += 1;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
zphmc: pageState.zphmc,
|
||||||
|
// current: pageState.page,
|
||||||
|
// pageSize: pageState.pageSize,
|
||||||
|
};
|
||||||
|
// if (currentDay.value?.fullDate) {
|
||||||
|
// params.queryDate = currentDay.value.fullDate;
|
||||||
|
// }
|
||||||
|
if (currentDay.value?.fullDate) {
|
||||||
|
params.zphjbsj = currentDay.value.fullDate.replace(/-/g, '');
|
||||||
|
}
|
||||||
|
$api.createRequest('/app/internal/jobFairThirdPart', params, 'GET', false).then((resData) => {
|
||||||
|
const { rows, total } = resData;
|
||||||
|
if (type === 'add') {
|
||||||
|
// const str = pageState.pageSize * (pageState.page - 1);
|
||||||
|
// const end = fairList.value.length;
|
||||||
|
// const reslist = rows;
|
||||||
|
// fairList.value.splice(str, end, ...reslist);
|
||||||
|
fairList.value = rows;
|
||||||
|
} else {
|
||||||
|
fairList.value = rows;
|
||||||
}
|
}
|
||||||
if (type === 'add' && pageState.page < pageState.maxPage) {
|
// pageState.list = resData.rows;
|
||||||
pageState.page += 1;
|
pageState.total = resData.total;
|
||||||
}
|
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||||
let params = {
|
});
|
||||||
zphmc: pageState.zphmc,
|
|
||||||
// current: pageState.page,
|
|
||||||
// pageSize: pageState.pageSize,
|
|
||||||
};
|
|
||||||
// if (currentDay.value?.fullDate) {
|
|
||||||
// params.queryDate = currentDay.value.fullDate;
|
|
||||||
// }
|
|
||||||
if (currentDay.value?.fullDate) {
|
|
||||||
params.zphjbsj = currentDay.value.fullDate.replace(/-/g, '');
|
|
||||||
}
|
|
||||||
$api.createRequest('/app/internal/jobFairThirdPart', params, 'GET', false).then((resData) => {
|
|
||||||
const { rows, total } = resData;
|
|
||||||
if (type === 'add') {
|
|
||||||
// const str = pageState.pageSize * (pageState.page - 1);
|
|
||||||
// const end = fairList.value.length;
|
|
||||||
// const reslist = rows;
|
|
||||||
// fairList.value.splice(str, end, ...reslist);
|
|
||||||
fairList.value = rows;
|
|
||||||
} else {
|
|
||||||
fairList.value = rows;
|
|
||||||
}
|
|
||||||
// pageState.list = resData.rows;
|
|
||||||
pageState.total = resData.total;
|
|
||||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseDateTime(datetimeStr) {
|
function parseDateTime(datetimeStr) {
|
||||||
if (!datetimeStr) return { time: '', date: '' };
|
if (!datetimeStr) return { time: '', date: '' };
|
||||||
|
|
||||||
const dateObj = new Date(datetimeStr);
|
const dateObj = new Date(datetimeStr);
|
||||||
|
|
||||||
if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间
|
if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间
|
||||||
|
|
||||||
const year = dateObj.getFullYear();
|
const year = dateObj.getFullYear();
|
||||||
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
|
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
|
||||||
const day = String(dateObj.getDate()).padStart(2, '0');
|
const day = String(dateObj.getDate()).padStart(2, '0');
|
||||||
const hours = String(dateObj.getHours()).padStart(2, '0');
|
const hours = String(dateObj.getHours()).padStart(2, '0');
|
||||||
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
|
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
time: `${hours}:${minutes}`,
|
time: `${hours}:${minutes}`,
|
||||||
date: `${year}年${month}月${day}日`,
|
date: `${year}年${month}月${day}日`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTimeStatus(startTimeStr, endTimeStr) {
|
function getTimeStatus(startTimeStr, endTimeStr) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const startTime = new Date(startTimeStr);
|
const startTime = new Date(startTimeStr);
|
||||||
const endTime = new Date(endTimeStr);
|
const endTime = new Date(endTimeStr);
|
||||||
|
|
||||||
// 判断状态:0 开始中,1 过期,2 待开始
|
// 判断状态:0 开始中,1 过期,2 待开始
|
||||||
let status = 0;
|
let status = 0;
|
||||||
let statusText = '开始中';
|
let statusText = '开始中';
|
||||||
if (now < startTime) {
|
if (now < startTime) {
|
||||||
status = 2; // 待开始
|
status = 2; // 待开始
|
||||||
statusText = '待开始';
|
statusText = '待开始';
|
||||||
} else if (now > endTime) {
|
} else if (now > endTime) {
|
||||||
status = 1; // 已过期
|
status = 1; // 已过期
|
||||||
statusText = '已过期';
|
statusText = '已过期';
|
||||||
} else {
|
} else {
|
||||||
status = 0; // 进行中
|
status = 0; // 进行中
|
||||||
statusText = '进行中';
|
statusText = '进行中';
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
status, // 0: 进行中,1: 已过期,2: 待开始
|
status, // 0: 进行中,1: 已过期,2: 待开始
|
||||||
statusText,
|
statusText,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHoursBetween(startTimeStr, endTimeStr) {
|
function getHoursBetween(startTimeStr, endTimeStr) {
|
||||||
const start = new Date(startTimeStr);
|
const start = new Date(startTimeStr);
|
||||||
const end = new Date(endTimeStr);
|
const end = new Date(endTimeStr);
|
||||||
|
|
||||||
const diffMs = end - start;
|
const diffMs = end - start;
|
||||||
const diffHours = diffMs / (1000 * 60 * 60);
|
const diffHours = diffMs / (1000 * 60 * 60);
|
||||||
|
|
||||||
return +diffHours.toFixed(2); // 保留 2 位小数
|
return +diffHours.toFixed(2); // 保留 2 位小数
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectDate = (item) => {
|
const selectDate = (item) => {
|
||||||
if (currentDay.value?.fullDate === item.fullDate) {
|
if (currentDay.value?.fullDate === item.fullDate) {
|
||||||
// currentDay.value = {};
|
// currentDay.value = {};
|
||||||
// getFair('refresh');
|
// getFair('refresh');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentDay.value = item;
|
currentDay.value = item;
|
||||||
getFair('refresh');
|
getFair('refresh');
|
||||||
};
|
};
|
||||||
|
|
||||||
function getNextDates({ startDate = '', count = 6 }) {
|
function getNextDates({ startDate = '', count = 6 }) {
|
||||||
const baseDate = startDate ? new Date(startDate) : new Date(); // 指定起点或今天
|
const baseDate = startDate ? new Date(startDate) : new Date(); // 指定起点或今天
|
||||||
const dates = [];
|
const dates = [];
|
||||||
const dayNames = ['日', '一', '二', '三', '四', '五', '六'];
|
const dayNames = ['日', '一', '二', '三', '四', '五', '六'];
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
const date = new Date(baseDate);
|
const date = new Date(baseDate);
|
||||||
date.setDate(baseDate.getDate() + i);
|
date.setDate(baseDate.getDate() + i);
|
||||||
|
|
||||||
const fullDate = date.toISOString().slice(0, 10); // YYYY-MM-DD
|
const fullDate = date.toISOString().slice(0, 10); // YYYY-MM-DD
|
||||||
const formattedDate = fullDate.slice(5); // MM-DD
|
const formattedDate = fullDate.slice(5); // MM-DD
|
||||||
const dayOfWeek = dayNames[date.getDay()];
|
const dayOfWeek = dayNames[date.getDay()];
|
||||||
|
|
||||||
dates.push({
|
dates.push({
|
||||||
date: formattedDate,
|
date: formattedDate,
|
||||||
fullDate,
|
fullDate,
|
||||||
day: '周' + dayOfWeek,
|
day: '周' + dayOfWeek,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 可选设置默认选中项
|
// 可选设置默认选中项
|
||||||
// currentDay.value = dates[0];
|
// currentDay.value = dates[0];
|
||||||
|
|
||||||
return dates;
|
return dates;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,9 @@ export default {
|
|||||||
import * as PIXI from "pixi.js";
|
import * as PIXI from "pixi.js";
|
||||||
|
|
||||||
// PIXI 变量
|
// PIXI 变量
|
||||||
let app = null;
|
|
||||||
let tagsContainer = null;
|
let tagsContainer = null;
|
||||||
let activeTagInstances = [];
|
let activeTagInstances = [];
|
||||||
|
|
||||||
|
|
||||||
// 配置数据
|
// 配置数据
|
||||||
const mockTags = [
|
const mockTags = [
|
||||||
{ name: "医生", bgColor: 0x0069fe, fontColor: 0xffffff, size: 17, opacity: 1.0, angle: 0, radius: 0 },
|
{ name: "医生", bgColor: 0x0069fe, fontColor: 0xffffff, size: 17, opacity: 1.0, angle: 0, radius: 0 },
|
||||||
@@ -149,12 +147,13 @@ const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
app:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (app) {
|
if (this.app) {
|
||||||
app.destroy(true, { children: true, texture: true, baseTexture: true });
|
this.app.destroy(true, { children: true, texture: true, baseTexture: true });
|
||||||
app = null;
|
this.app = null;
|
||||||
}
|
}
|
||||||
window.removeEventListener("resize", this.handleResize());
|
window.removeEventListener("resize", this.handleResize());
|
||||||
},
|
},
|
||||||
@@ -168,9 +167,9 @@ export default {
|
|||||||
const height = container.clientHeight || 300;
|
const height = container.clientHeight || 300;
|
||||||
console.log(width,height);
|
console.log(width,height);
|
||||||
|
|
||||||
if (app) return;
|
if (this.app) return;
|
||||||
|
|
||||||
app = new PIXI.Application({
|
this.app = new PIXI.Application({
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
backgroundAlpha: 0,
|
backgroundAlpha: 0,
|
||||||
@@ -179,12 +178,12 @@ export default {
|
|||||||
resolution: window?.devicePixelRatio ?? 1,
|
resolution: window?.devicePixelRatio ?? 1,
|
||||||
autoDensity: true,
|
autoDensity: true,
|
||||||
});
|
});
|
||||||
app.view.style.touchAction = "auto";
|
this.app.view.style.touchAction = "auto";
|
||||||
|
|
||||||
container.appendChild(app.view);
|
container.appendChild(this.app.view);
|
||||||
|
|
||||||
tagsContainer = new PIXI.Container();
|
tagsContainer = new PIXI.Container();
|
||||||
app.stage.addChild(tagsContainer);
|
this.app.stage.addChild(tagsContainer);
|
||||||
|
|
||||||
this.renderScene(width, height);
|
this.renderScene(width, height);
|
||||||
window.addEventListener("resize", this.handleResize());
|
window.addEventListener("resize", this.handleResize());
|
||||||
@@ -238,8 +237,8 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 动画循环
|
// 动画循环
|
||||||
app.ticker.add(() => {
|
this.app.ticker.add(() => {
|
||||||
const screenH = app.screen.height;
|
const screenH = this.app.screen.height;
|
||||||
|
|
||||||
activeTagInstances.forEach((tag) => {
|
activeTagInstances.forEach((tag) => {
|
||||||
const meta = tag.userData;
|
const meta = tag.userData;
|
||||||
@@ -348,11 +347,11 @@ export default {
|
|||||||
|
|
||||||
handleResize () {
|
handleResize () {
|
||||||
const container = document.querySelector('#pixi-box');
|
const container = document.querySelector('#pixi-box');
|
||||||
if (!app || !container) return;
|
if (!this.app || !container) return;
|
||||||
const w = container.clientWidth || 300;
|
const w = container.clientWidth || 300;
|
||||||
const h = container.clientHeight || 300;
|
const h = container.clientHeight || 300;
|
||||||
|
|
||||||
app.renderer.resize(w, h);
|
this.app.renderer.resize(w, h);
|
||||||
|
|
||||||
activeTagInstances.forEach((tag) => {
|
activeTagInstances.forEach((tag) => {
|
||||||
const meta = tag.userData;
|
const meta = tag.userData;
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openFilter() {
|
function openFilter() {
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openFilter() {
|
function openFilter() {
|
||||||
@@ -608,8 +608,9 @@ function getJobRecommend(type = 'add') {
|
|||||||
list.value.push(...reslist);
|
list.value.push(...reslist);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
const reslist = dataToImg(data);
|
// const reslist = dataToImg(data);
|
||||||
list.value.push(...reslist);
|
// list.value.push(...reslist);
|
||||||
|
console.log(err,'+++')
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
list.value = dataToImg(data);
|
list.value = dataToImg(data);
|
||||||
@@ -1107,7 +1108,7 @@ defineExpose({ loadData });
|
|||||||
bottom:50rpx;
|
bottom:50rpx;
|
||||||
width:264rpx;
|
width:264rpx;
|
||||||
height:298rpx;
|
height:298rpx;
|
||||||
z-index:6
|
z-index:7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.no-radius
|
.no-radius
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nextVideo(job) {
|
function nextVideo(job) {
|
||||||
@@ -208,7 +208,8 @@ defineExpose({ loadData });
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-filter
|
.nav-filter
|
||||||
padding: 16rpx 28rpx 30rpx 28rpx
|
padding: 16rpx 28rpx 30rpx 28rpx;
|
||||||
|
padding-top:calc(var(--window-top) + var(--status-bar-height) + 20rpx);
|
||||||
.filter-top
|
.filter-top
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ onLoad(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function navToPost(jobId) {
|
function navToPost(jobId) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nextVideo(job) {
|
function nextVideo(job) {
|
||||||
|
|||||||
1108
static/js/pixi.min.js
vendored
1108
static/js/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
// BaseDBStore.js
|
// BaseDBStore.js
|
||||||
import IndexedDBHelper from '@/common/IndexedDBHelper.js'
|
import IndexedDBHelper from '@/common/IndexedDBHelper.js'
|
||||||
// import UniStorageHelper from '../common/UniStorageHelper'
|
import UniStorageHelper from '../common/UniStorageHelper'
|
||||||
import useChatGroupDBStore from '@/stores/userChatGroupStore'
|
import useChatGroupDBStore from '@/stores/userChatGroupStore'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
|
|
||||||
@@ -43,6 +43,10 @@ class BaseStore {
|
|||||||
this.db = new IndexedDBHelper(this.dbName, config.DBversion);
|
this.db = new IndexedDBHelper(this.dbName, config.DBversion);
|
||||||
// // #endif
|
// // #endif
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.db = new UniStorageHelper(this.dbName, );
|
||||||
|
// #endif
|
||||||
|
|
||||||
return this.db.openDB([{
|
return this.db.openDB([{
|
||||||
name: 'record',
|
name: 'record',
|
||||||
keyPath: "id",
|
keyPath: "id",
|
||||||
|
|||||||
Reference in New Issue
Block a user