招聘会模块

This commit is contained in:
2025-11-03 15:08:39 +08:00
parent 4ba6539850
commit 2fbd8ade5b
3 changed files with 236 additions and 157 deletions

View File

@@ -47,23 +47,6 @@
v-model="pageState.jobFairTitle"
/>
</view>
<!-- <view class="header-date">
<view class="data-week">
<view
class="weel-days button-click"
:class="{ active: currentDay.fullDate === item.fullDate }"
v-for="(item, index) in weekList"
:key="index"
@click="selectDate(item)"
>
<view class="label">{{ item.day }}</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>
<!-- 主体内容区域 -->
@@ -85,17 +68,14 @@
)
"
>
<view class="card-title">{{ item.jobFairTitle }}</view>
<view class="card-title">
{{ item.jobFairTitle }}
<view class="center-date" :style="{ color: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color }">
{{ getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).statusText }}
</view>
</view>
<view class="card-row">
<text class="">{{ item.jobFairAddress }}</text>
<text class="">
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitudeVal"
:blong="longitudeVal"
></convert-distance>
</text>
</view>
<view class="card-times">
<view class="time-left">
@@ -108,12 +88,6 @@
</view>
<view class="line"></view>
<view class="time-center">
<view class="center-date">
{{
getTimeStatus(item.jobFairStartTime, item.jobFairEndTime)
.statusText
}}
</view>
<view class="center-dateDay">
{{
getHoursBetween(
@@ -161,6 +135,7 @@ import useLocationStore from "@/stores/useLocationStore";
import { storeToRefs } from "pinia";
import { tabbarManager } from "@/utils/tabbarManager";
import WxAuthLogin from "@/components/WxAuthLogin/WxAuthLogin.vue";
import config from "@/config.js";
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const wxAuthLoginRef = ref(null);
const { $api, navTo, cloneDeep } = inject("globalFunction");
@@ -180,6 +155,7 @@ const pageState = reactive({
pageSize: 10,
jobFairTitle: "",
});
const baseUrl = config.imgBaseUrl;
onLoad(() => {
// const today = new Date();
@@ -246,7 +222,7 @@ function changeSwiperMsgType(e) {
function seemsg(index) {
state.current = index;
console.log(index, 'index');
console.log(index, "index");
if (index != 3) {
getFair("refresh");
@@ -276,7 +252,7 @@ const handleScrollToLower = () => {
} else {
this.$nextTick(() => {
getMyFair();
})
});
}
}
};
@@ -337,16 +313,18 @@ function getMyFair(type = "add") {
params.personId = userInfo.value.info.userId;
}
}
$api.myRequest("/jobfair/public/jobfair/enterprise/my-sign-up-job-fair", params).then((resData) => {
if (type === "add") {
const reslist = resData.data.list;
fairList.value = fairList.value.concat(reslist);
} else {
fairList.value = resData.data.list;
}
pageState.total = resData.data.total;
pageState.maxPage = resData.data.pages;
});
$api
.myRequest("/jobfair/public/jobfair/enterprise/my-sign-up-job-fair", params)
.then((resData) => {
if (type === "add") {
const reslist = resData.data.list;
fairList.value = fairList.value.concat(reslist);
} else {
fairList.value = resData.data.list;
}
pageState.total = resData.data.total;
pageState.maxPage = resData.data.pages;
});
}
function getFair(type = "add") {
if (type === "refresh") {
@@ -384,18 +362,18 @@ function getFair(type = "add") {
function toIOSDate(input) {
if (!input) return null;
if (input instanceof Date) return isNaN(input.getTime()) ? null : input;
if (typeof input === 'number') {
if (typeof input === "number") {
const d = new Date(input);
return isNaN(d.getTime()) ? null : d;
}
if (typeof input !== 'string') return null;
if (typeof input !== "string") return null;
let s = input.trim();
// "YYYY-MM-DD HH:mm[:ss]" -> "YYYY-MM-DDTHH:mm[:ss]"
if (/^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}(:\d{2})?$/.test(s)) {
s = s.replace(' ', 'T');
s = s.replace(" ", "T");
// 仅到分钟则补秒
if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(s)) {
s = s + ':00';
s = s + ":00";
}
}
// 其余已是 iOS 可解析格式:"YYYY/MM/DD[ HH:mm:ss]"、"YYYY-MM-DD"、ISO 8601 等
@@ -406,23 +384,23 @@ function toIOSDate(input) {
function parseDateTime(datetimeStr) {
if (!datetimeStr)
return {
time: '',
date: '',
time: "",
date: "",
};
const dateObj = toIOSDate(datetimeStr);
if (!dateObj)
return {
time: '',
date: '',
time: "",
date: "",
}; // 无效时间
const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
const day = String(dateObj.getDate()).padStart(2, '0');
const hours = String(dateObj.getHours()).padStart(2, '0');
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
const month = String(dateObj.getMonth() + 1).padStart(2, "0");
const day = String(dateObj.getDate()).padStart(2, "0");
const hours = String(dateObj.getHours()).padStart(2, "0");
const minutes = String(dateObj.getMinutes()).padStart(2, "0");
return {
time: `${hours}:${minutes}`,
@@ -436,25 +414,30 @@ function getTimeStatus(startTimeStr, endTimeStr) {
const endTime = toIOSDate(endTimeStr);
if (!startTime || !endTime) {
return { status: 1, statusText: '时间异常' };
return { status: 1, statusText: "时间异常", color: "#999999" };
}
// 判断状态0 开始中1 过期2 开始
// 判断状态0 开始中1 过期2 开始
let status = 0;
let statusText = '开始中';
let statusText = "开始中";
let color = "#13C57C"; // 进行中 - 绿色
if (now < startTime) {
status = 2; // 开始
statusText = '待开始';
status = 2; // 开始
statusText = "未开始";
color = "#015EEA"; // 未开始 - 蓝色
} else if (now > endTime) {
status = 1; // 已过期
statusText = '已过期';
statusText = "已过期";
color = "#999999"; // 已过期 - 灰色
} else {
status = 0; // 进行中
statusText = '进行中';
statusText = "进行中";
color = "#13C57C"; // 进行中 - 绿色
}
return {
status, // 0: 进行中1: 已过期2: 开始
status, // 0: 进行中1: 已过期2: 开始
statusText,
color
};
}
@@ -481,7 +464,7 @@ const selectDate = (item) => {
};
function getNextDates({ startDate = "", count = 6 }) {
const baseDate = startDate ? (toIOSDate(startDate) || new Date()) : new Date(); // 指定起点或今天
const baseDate = startDate ? toIOSDate(startDate) || new Date() : new Date(); // 指定起点或今天
const dates = [];
const dayNames = ["日", "一", "二", "三", "四", "五", "六"];
@@ -507,7 +490,7 @@ function getNextDates({ startDate = "", count = 6 }) {
}
</script>
<style scoped>
<style scoped lang="stylus">
.app-custom-root {
position: fixed;
z-index: 10;
@@ -659,7 +642,7 @@ function getNextDates({ startDate = "", count = 6 }) {
.cards .card {
margin-top: 28rpx;
padding: 32rpx;
background: #ffffff;
background: linear-gradient(to bottom, #e3efff 0%, #fbfdff 100%);
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 20rpx;
}
@@ -667,18 +650,36 @@ function getNextDates({ startDate = "", count = 6 }) {
.cards .card-title {
font-family: "PingFangSC-Medium", "PingFang SC", "Helvetica Neue", Helvetica,
Arial, "Microsoft YaHei", sans-serif;
font-weight: 500;
font-size: 32rpx;
color: #333333;
font-weight: 600;
font-size: 34rpx;
color: #005eb6;
text-align: center;
position relative
&::after {
content: "";
width: 120rpx;
height: 4rpx;
background: linear-gradient(to right, #015EEA 0%, #00C0FA 100%);
position: absolute;
left: 50%;
bottom: -14rpx;
transform: translate(-50%, -50%);
}
.center-date {
font-weight: 400;
font-size: 28rpx;
color: #ff881a;
position: absolute;
right: 0;
}
}
.cards .card-row {
display: flex;
justify-content: space-between;
font-weight: 400;
font-size: 28rpx;
color: #495265;
margin-top: 4rpx;
justify-content: center;
font-size: 26rpx;
color: #3e8ff3;
margin-top: 23rpx;
}
.cards .card-times {
@@ -694,11 +695,13 @@ function getNextDates({ startDate = "", count = 6 }) {
}
.cards .card-times .left-date {
font-weight: 500;
font-weight: 600;
font-size: 48rpx;
color: #333333;
font-family: "PingFangSC-Medium", "PingFang SC", "Helvetica Neue", Helvetica,
Arial, "Microsoft YaHei", sans-serif;
background: linear-gradient(180deg, #015EEA 0%, #00C0FA 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.cards .card-times .left-dateDay {
@@ -710,8 +713,8 @@ function getNextDates({ startDate = "", count = 6 }) {
.cards .card-times .line {
width: 40rpx;
height: 0;
border: 2rpx solid #d4d4d4;
height: 2rpx;
background: #7BB6FF;
margin-top: 64rpx;
}
@@ -723,30 +726,25 @@ function getNextDates({ startDate = "", count = 6 }) {
align-items: center;
}
.cards .card-times .time-center .center-date {
font-weight: 400;
font-size: 28rpx;
color: #ff881a;
padding-top: 10rpx;
}
.cards .card-times .time-center .center-dateDay {
font-weight: 400;
font-size: 24rpx;
color: #333333;
color: #fff;
margin-top: 6rpx;
line-height: 48rpx;
width: 104rpx;
width: max-content;
height: 48rpx;
background: #f9f9f9;
background: #71B1FF;
border-radius: 8rpx;
padding: 0 30rpx;
}
.cards .recommend-card-line {
width: 100%;
height: 0;
border-radius: 0;
border: 2rpx dashed rgba(0, 0, 0, 0.14);
border-bottom: 2rpx dashed rgba(0, 0, 0, 0.14);
margin-top: 32rpx;
position: relative;
}
@@ -781,6 +779,7 @@ function getNextDates({ startDate = "", count = 6 }) {
font-weight: 400;
font-size: 28rpx;
color: #6c7282;
text-align: center;
}
.cards .card:first-child {