flat: 消息

This commit is contained in:
史典卓
2025-05-15 14:17:51 +08:00
parent 5333254c58
commit a93907018c
40 changed files with 875 additions and 56 deletions

View File

@@ -110,8 +110,14 @@ const pageState = reactive({
});
onLoad(() => {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
const currentDate = `${year}-${month}-${day}`;
const result = getNextDates({
startDate: '2025-04-21',
startDate: currentDate,
});
weekList.value = result;
getFair('refresh');
@@ -123,9 +129,17 @@ function toSelectDate() {
date: currentDay.value.fullDate,
},
onBack: (res) => {
console.log(res);
const result = getNextDates({
startDate: res.date,
});
const formattedDate = res.date.slice(5); // MM-DD
const dateFull = {
date: res.date.slice(5),
day: '周' + res.week,
fullDate: res.date,
};
currentDay.value = dateFull;
weekList.value = result;
getFair('refresh');
},
@@ -151,7 +165,7 @@ const handleScrollToLower = () => {
function getFair(type = 'add') {
if (type === 'refresh') {
pageState.page = 0;
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
@@ -262,7 +276,6 @@ function getNextDates({ startDate = '', count = 6 }) {
date: formattedDate,
fullDate,
day: '周' + dayOfWeek,
isToday: i === 0,
});
}

View File

@@ -183,6 +183,10 @@
</view>
<!-- btn -->
<CollapseTransition :show="showfile">
<view class="area-tips">
<uni-icons type="info-filled" color="#ADADAD" size="15"></uni-icons>
上传后自动解析简历内容
</view>
<view class="area-file">
<view class="file-card" @click="uploadCamera">
<image class="card-img" src="/static/icon/file1.png"></image>
@@ -957,12 +961,18 @@ image-margin-top = 40rpx
transform: rotate(45deg)
transition: transform 0.5s ease;
}
.area-tips{
font-weight: 400;
font-size: 26rpx;
color: #434343;
margin-top: 18rpx
}
.area-file
display: grid
width: 100%
grid-template-columns: repeat(3, 1fr)
grid-gap: 20rpx
padding: 32rpx 0 0 0;
padding: 20rpx 0 0 0;
.file-card
display: flex
flex-direction: column

View File

@@ -304,7 +304,7 @@ function choosePosition(index) {
getJobRecommend('refresh');
} else {
// const id = useUserStore().userInfo.jobTitleId.split(',')[index];
pageState.search.jobTitle = useUserStore().userInfo.jobTitle[index];
pageState.search.jobTitle = userInfo.value.jobTitle[index];
inputText.value = '';
getJobList('refresh');
}

View File

@@ -4,12 +4,12 @@
<!-- 顶部头部区域 -->
<view class="container-header">
<view class="header-btnLf button-click" @click="changeType(0)" :class="{ active: state.current === 0 }">
已读消息
<view class="btns-wd"></view>
全部消息
<!-- <view class="btns-wd"></view> -->
</view>
<view class="header-btnLf button-click" @click="changeType(1)" :class="{ active: state.current === 1 }">
未读消息
<view class="btns-wd"></view>
<view class="btns-wd" v-if="unreadCount"></view>
</view>
</view>
@@ -39,7 +39,14 @@ import UnreadComponent from './unread.vue';
const loadedMap = reactive([false, false]);
const swiperRefs = [ref(null), ref(null)];
const components = [ReadComponent, UnreadComponent];
import { storeToRefs } from 'pinia';
import { useReadMsg } from '@/stores/useReadMsg';
const { unreadCount } = storeToRefs(useReadMsg());
onShow(() => {
// 获取消息列表
useReadMsg().fetchMessages();
});
const state = reactive({
current: 0,
all: [{}],

View File

@@ -1,16 +1,38 @@
<template>
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<scroll-view scroll-y class="main-scroll">
<view class="scrollmain">
<view class="list-card btn-feel" v-for="(item, index) in 20" :key="index">
<view
class="list-card btn-feel"
v-for="(item, index) in msgList"
:key="index"
@click="seeDetail(item, index)"
>
<view class="card-img">
<image class="card-img-flame" src="/static/icon/msgtype.png"></image>
<image
class="card-img-flame"
v-if="item.title === '招聘会预约提醒'"
src="/static/icon/msgtype.png"
></image>
<image
class="card-img-flame"
v-if="item.title === '职位上新'"
src="/static/icon/msgtype2.png"
></image>
<image
class="card-img-flame"
v-if="item.title === '系统通知'"
src="/static/icon/msgtype3.png"
></image>
<view class="subscript" v-if="item.notReadCount || !item.isRead">
{{ item.notReadCount || '' }}
</view>
</view>
<view class="card-info">
<view class="info-title">
<text>今日推荐</text>
<view class="card-time">刚才</view>
<text>{{ item.title }}</text>
<view class="card-time">{{ item.date }}</view>
</view>
<view class="info-text line_2">这里有9个职位很适合你快来看看吧</view>
<view class="info-text line_2">{{ item.subTitle || '消息' }}</view>
</view>
</view>
</view>
@@ -19,7 +41,12 @@
<script setup>
import { reactive, inject, ref } from 'vue';
const { $api, navTo, debounce } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import { useReadMsg } from '@/stores/useReadMsg';
const { msgList } = storeToRefs(useReadMsg());
const isLoaded = ref(false);
async function loadData() {
try {
if (isLoaded.value) return;
@@ -30,7 +57,22 @@ async function loadData() {
}
}
function handleScrollToLower() {}
function seeDetail(item, index) {
switch (item.title) {
case '职位上新':
useReadMsg().markAsRead(item, index);
navTo('/packageA/pages/newJobPosition/newJobPosition');
break;
case '招聘会预约提醒':
useReadMsg().markAsRead(item, index);
navTo('/packageA/pages/reservation/reservation');
break;
case '系统通知':
navTo('/packageA/pages/systemNotification/systemNotification');
break;
}
}
defineExpose({ loadData });
</script>
@@ -41,6 +83,9 @@ defineExpose({ loadData });
}
.scrollmain{
padding: 28rpx
}
.read{
}
.list-card
background: #FFFFFF;
@@ -57,9 +102,25 @@ defineExpose({ loadData });
display: grid;
place-items: center;
margin-right: 30rpx;
position: relative;
.card-img-flame
width: 100%;
height: 100%
.subscript
position: absolute;
right: 0;
top: 0;
min-width: 26rpx;
height: 26rpx;
padding: 0 8rpx; /* 横向内边距控制宽度自适应 */
border-radius: 1000rpx; /* 实现椭圆形/圆角 */
text-align: center;
line-height: 26rpx;
background: #F73636;
font-weight: 600;
font-size: 20rpx;
color: #FFFFFF;
box-sizing: border-box;
.card-info
flex: 1;
display: flex;

View File

@@ -1,16 +1,36 @@
<template>
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<scroll-view scroll-y class="main-scroll">
<view class="scrollmain">
<view class="list-card btn-feel" v-for="(item, index) in 20" :key="index">
<view
class="list-card btn-feel"
v-for="(item, index) in unreadMsgList"
:key="index"
@click="seeDetail(item)"
>
<view class="card-img">
<image class="card-img-flame" src="/static/icon/msgtype.png"></image>
<image
class="card-img-flame"
v-if="item.title === '招聘会预约提醒'"
src="/static/icon/msgtype.png"
></image>
<image
class="card-img-flame"
v-if="item.title === '职位上新'"
src="/static/icon/msgtype2.png"
></image>
<image
class="card-img-flame"
v-if="item.title === '系统通知'"
src="/static/icon/msgtype3.png"
></image>
<view class="subscript" v-if="item.notReadCount">{{ item.notReadCount }}</view>
</view>
<view class="card-info">
<view class="info-title">
<text>今日推荐</text>
<view class="card-time">刚才</view>
<text>{{ item.title }}</text>
<view class="card-time">{{ item.date }}</view>
</view>
<view class="info-text line_2">这里有9个职位很适合你快来看看吧</view>
<view class="info-text line_2">{{ item.subTitle || '消息' }}</view>
</view>
</view>
</view>
@@ -19,7 +39,12 @@
<script setup>
import { reactive, inject, ref } from 'vue';
const { $api, navTo, debounce } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import { useReadMsg } from '@/stores/useReadMsg';
const { unreadMsgList } = storeToRefs(useReadMsg());
const isLoaded = ref(false);
async function loadData() {
try {
if (isLoaded.value) return;
@@ -30,7 +55,10 @@ async function loadData() {
}
}
function handleScrollToLower() {}
function seeDetail(item) {
console.log(item);
}
defineExpose({ loadData });
</script>
@@ -41,6 +69,9 @@ defineExpose({ loadData });
}
.scrollmain{
padding: 28rpx
}
.read{
}
.list-card
background: #FFFFFF;
@@ -57,9 +88,25 @@ defineExpose({ loadData });
display: grid;
place-items: center;
margin-right: 30rpx;
position: relative;
.card-img-flame
width: 100%;
height: 100%
.subscript
position: absolute;
right: 0;
top: 0;
min-width: 26rpx;
height: 26rpx;
padding: 0 8rpx; /* 横向内边距控制宽度自适应 */
border-radius: 1000rpx; /* 实现椭圆形/圆角 */
text-align: center;
line-height: 26rpx;
background: #F73636;
font-weight: 600;
font-size: 20rpx;
color: #FFFFFF;
box-sizing: border-box;
.card-info
flex: 1;
display: flex;

View File

@@ -23,7 +23,7 @@
</view>
<scroll-view scroll-y class="Detailscroll-view" v-show="list.length" @scrolltolower="getJobList('add')">
<view class="cards-box">
<renderJobs :list="list" :longitude="longitude" :latitude="latitude"></renderJobs>
<renderJobs :list="list" :longitude="longitudeVal" :latitude="latitudeVal"></renderJobs>
</view>
</scroll-view>
<view class="main-content" v-show="!list.length">
@@ -44,12 +44,12 @@
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
import { onLoad, onShow } from '@dcloudio/uni-app';
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
const { $api, navBack } = inject('globalFunction');
import useLocationStore from '@/stores/useLocationStore';
const { getLocation, longitude, latitude } = useLocationStore();
import { storeToRefs } from 'pinia';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const searchValue = ref('');
const historyList = ref([]);
const list = ref([]);