Commit 604e7c30 authored by 李明环(东信)'s avatar 李明环(东信)

201102问题修复

parent 55501178
<template>
<div class="filter" :style="{paddingTop: statusBarHeight+'px'}" id="filter">
<div class="filter" :style="{ paddingTop: statusBarHeight + 'px' }" id="filter" v-if="show">
<div class="menu">
<p v-for="v in menuList" :class="{ active: v.active }" :key="v.name" @click="onClickMenu(v)">{{ v.name }}</p>
</div>
......@@ -21,9 +21,9 @@
</div>
<!-- 年龄要求 -->
<div class="filter-item age">
<p class="title" style="margin-top: 0;">年龄要求</p>
<p class="title" style="margin-top: 0">年龄要求</p>
<wd-slider
style="margin: 0 25rpx"
style="margin: 0 25rpx"
v-model="age"
:step="1"
hide-min-max
......@@ -88,9 +88,13 @@
<script setup>
import { getEumData } from "@/utils/utils";
import { dictJobTypeApi } from "@/api/common";
const statusBarHeight = ref(uni.getWindowInfo().screenTop)
const statusBarHeight = ref(uni.getWindowInfo().screenTop);
const { show } = defineProps({
show: {
type: Boolean,
default: false
}
});
// 导航
const menuList = ref([]);
......@@ -127,7 +131,6 @@ const onClickMajor = v => {
};
// 初始化数据
const initData = async () => {
/* 初始化菜单 */
menuList.value = [
{ active: true, name: "学历", className: "education" },
......
......@@ -5,7 +5,7 @@ import Vconsole from "vconsole";
import NavBar from "@/components/navBar/index.vue";
// 字体
import "@/assets/font.css";
import { formatTimestamp } from "@/utils/utils";
import { formatTimestamp } from "@/utils/formatTimestamp";
export function createApp() {
const app = createSSRApp(App);
app.config.globalProperties.$formatTimestamp = formatTimestamp;
......
......@@ -4,7 +4,9 @@
<scroll-view :scroll-y="true" @scrolltolower="getList">
<view class="system">
<view class="item flex-between" v-for="(v, i) in list" :key="i" @click="goToDetail(v)">
<img src="@/static/image/user/default-avatar.png" alt="" />
<div class="img-wrap">
<img :src="v.iconUrl" alt="" />
</div>
<view class="content">
<view class="name-date flex-between">
<text class="name">{{ v.title || "" }}</text>
......@@ -27,10 +29,21 @@
<script setup>
import { getMessagePageList } from "@/api/message";
import { ref } from "vue";
import { getEnumText } from "@/utils/utils";
import { getEnumText, getEumData } from "@/utils/utils";
import _ from "lodash";
const list = ref([]);
getEumData("EnumMessageType").then(res => {
console.log(res);
});
const iconUrlObj = {
3: new URL("@/static/image/icon/message3.png", import.meta.url).href,
4: new URL("@/static/image/icon/message4.png", import.meta.url).href,
5: new URL("@/static/image/icon/message5.png", import.meta.url).href,
6: new URL("@/static/image/icon/message6.png", import.meta.url).href,
7: new URL("@/static/image/icon/message7.png", import.meta.url).href,
8: new URL("@/static/image/icon/message8.png", import.meta.url).href,
default: new URL("@/static/image/icon/message-default.png", import.meta.url).href
};
const params = ref({
pageNo: 1,
pageSize: 10,
......@@ -72,6 +85,8 @@ const getList = () => {
}
res.data.forEach(async v => {
v.typeText = await getEnumText("EnumMessageType", v.type);
v.iconUrl = iconUrlObj[v.type] || iconUrlObj.default;
console.log(v.iconUrl);
});
params.value.pageNo += 1;
list.value = list.value.concat(res.data);
......@@ -209,12 +224,15 @@ scroll-view {
}
.system {
.item {
align-items: flex-start;
padding: 32rpx;
border-bottom: 16rpx solid #f3f4f8;
img {
width: 86rpx;
height: 86rpx;
border-radius: 50%;
.img-wrap {
img {
width: 36rpx;
height: 36rpx;
border-radius: 50%;
}
}
.content {
flex: 1;
......
......@@ -54,7 +54,7 @@ onLoad(({ jobId, status }) => {
} else {
apiParams.status = status * 1;
}
apiParams.jobId = jobId;
apiParams.positionId = jobId;
getApplicationList();
xma.xh.getSystemInfo({
success(res) {
......@@ -70,7 +70,7 @@ onLoad(({ jobId, status }) => {
/* 获取列表 */
const apiParams = reactive({
status: "",
jobId: "",
positionId: "",
pageNo: 1,
pageSize: 10
});
......@@ -78,7 +78,7 @@ const list = ref([]);
let flag = true;
const getApplicationList = () => {
if (!flag) return;
uni.showLoading({ title: "加载中...",mask:true });
uni.showLoading({ title: "加载中...", mask: true });
getApplicationListApi(apiParams).then(res => {
if (res.data?.length && flag) {
list.value.push(...res.data);
......
......@@ -56,7 +56,7 @@
</view>
</view>
<!-- 筛选弹窗 -->
<Filter v-if="showOtherFilter" @confirm="filterConfirm" @cancel="showOtherFilter = false" />
<Filter v-show="showOtherFilter" :show="showOtherFilter" @confirm="filterConfirm" @cancel="showOtherFilter = false" />
</div>
</template>
<script setup>
......@@ -85,7 +85,7 @@ const activeTab = ref("求职推荐");
const changeActiveTab = tab => {
activeTab.value = tab;
isEnd.value = false;
applicationList.value = []
applicationList.value = [];
// resetParams();
getResumeRecommendList();
/* getTopFilter();
......@@ -104,11 +104,11 @@ function getJobListApiFn() {
getPositionListApi({ status: 3 }).then(res => {
if (res.code == 200) {
jobListColumns.value = res.data;
if (res.data.length) {
getResumeRecommendListParams.value.positionId = res.data[0].id
jobTypeText.value = res.data[0].name
if (res.data.length) {
getResumeRecommendListParams.value.positionId = res.data[0].id;
jobTypeText.value = res.data[0].name;
}
getResumeRecommendList()
getResumeRecommendList();
}
});
}
......@@ -242,7 +242,7 @@ const getResumeRecommendList = () => {
});
}
};
const companyReviewInfoFn = () => {
const companyReviewInfoFn = () => {
companyReviewInfo().then(res => {
if (!res.data) {
uni.navigateTo({
......@@ -253,13 +253,13 @@ const companyReviewInfoFn = () => {
};
companyReviewInfoFn();
// 第一次不执行推荐列表需要(需要拉取到列表在执行)
let notFirst = false
let notFirst = false;
onShow(() => {
resetPageParams();
if (notFirst) {
if (notFirst) {
getResumeRecommendList();
}
notFirst = true
notFirst = true;
getUserInfo();
});
// 城市筛选
......
import { defineStore } from "pinia";
import { reactive } from "vue";
export const useEnumStore = defineStore("enum", () => {
const data = reactive({});
const setEnumData = (key, value) => {
data[key] = JSON.stringify(value);
};
const getEnumData = key => {
return data[key] && JSON.parse(data[key]);
};
return {
data,
setEnumData,
getEnumData
};
});
export const formatTimestamp = (timestamp, formatString = "YYYY-MM-DD hh:mm:ss") => {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);
const hour = ("0" + date.getHours()).slice(-2);
const minute = ("0" + date.getMinutes()).slice(-2);
const second = ("0" + date.getSeconds()).slice(-2);
// 替换格式字符串中的占位符
return formatString
.replace(/YYYY/g, year)
.replace(/MM/g, month)
.replace(/DD/g, day)
.replace(/hh/g, hour)
.replace(/mm/g, minute)
.replace(/ss/g, second);
};
import { getDictDataApi } from "@/api/common";
import { useEnumStore } from "@/store/enum";
const { data, setEnumData, getEnumData } = useEnumStore();
/**
* 根据类型获取EUM数据。
* 该函数用于根据给定的类型从本地存储或服务器获取EUM数据。如果数据已在本地存储中,则直接返回;
......@@ -9,7 +11,7 @@ import { getDictDataApi } from "@/api/common";
*/
export const getEumData = type => {
// const storage = getStorageSync(type);
const storage = false;
const storage = getEnumData(type);
const codeToNumbers = data => {
data.forEach(v => {
v.code = Number(v.code);
......@@ -22,7 +24,8 @@ export const getEumData = type => {
} else {
getDictDataApi([type]).then(res => {
const data = res.data[type];
setStorageSync(type, data);
// setStorageSync(type, data);
setEnumData(type, data);
resolve(codeToNumbers(data));
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment