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

201102问题修复

parent 55501178
<template> <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"> <div class="menu">
<p v-for="v in menuList" :class="{ active: v.active }" :key="v.name" @click="onClickMenu(v)">{{ v.name }}</p> <p v-for="v in menuList" :class="{ active: v.active }" :key="v.name" @click="onClickMenu(v)">{{ v.name }}</p>
</div> </div>
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
</div> </div>
<!-- 年龄要求 --> <!-- 年龄要求 -->
<div class="filter-item age"> <div class="filter-item age">
<p class="title" style="margin-top: 0;">年龄要求</p> <p class="title" style="margin-top: 0">年龄要求</p>
<wd-slider <wd-slider
style="margin: 0 25rpx" style="margin: 0 25rpx"
v-model="age" v-model="age"
:step="1" :step="1"
hide-min-max hide-min-max
...@@ -88,9 +88,13 @@ ...@@ -88,9 +88,13 @@
<script setup> <script setup>
import { getEumData } from "@/utils/utils"; import { getEumData } from "@/utils/utils";
import { dictJobTypeApi } from "@/api/common"; 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([]); const menuList = ref([]);
...@@ -127,7 +131,6 @@ const onClickMajor = v => { ...@@ -127,7 +131,6 @@ const onClickMajor = v => {
}; };
// 初始化数据 // 初始化数据
const initData = async () => { const initData = async () => {
/* 初始化菜单 */ /* 初始化菜单 */
menuList.value = [ menuList.value = [
{ active: true, name: "学历", className: "education" }, { active: true, name: "学历", className: "education" },
......
...@@ -5,7 +5,7 @@ import Vconsole from "vconsole"; ...@@ -5,7 +5,7 @@ import Vconsole from "vconsole";
import NavBar from "@/components/navBar/index.vue"; import NavBar from "@/components/navBar/index.vue";
// 字体 // 字体
import "@/assets/font.css"; import "@/assets/font.css";
import { formatTimestamp } from "@/utils/utils"; import { formatTimestamp } from "@/utils/formatTimestamp";
export function createApp() { export function createApp() {
const app = createSSRApp(App); const app = createSSRApp(App);
app.config.globalProperties.$formatTimestamp = formatTimestamp; app.config.globalProperties.$formatTimestamp = formatTimestamp;
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<scroll-view :scroll-y="true" @scrolltolower="getList"> <scroll-view :scroll-y="true" @scrolltolower="getList">
<view class="system"> <view class="system">
<view class="item flex-between" v-for="(v, i) in list" :key="i" @click="goToDetail(v)"> <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="content">
<view class="name-date flex-between"> <view class="name-date flex-between">
<text class="name">{{ v.title || "" }}</text> <text class="name">{{ v.title || "" }}</text>
...@@ -27,10 +29,21 @@ ...@@ -27,10 +29,21 @@
<script setup> <script setup>
import { getMessagePageList } from "@/api/message"; import { getMessagePageList } from "@/api/message";
import { ref } from "vue"; import { ref } from "vue";
import { getEnumText } from "@/utils/utils"; import { getEnumText, getEumData } from "@/utils/utils";
import _ from "lodash"; import _ from "lodash";
const list = ref([]); 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({ const params = ref({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
...@@ -72,6 +85,8 @@ const getList = () => { ...@@ -72,6 +85,8 @@ const getList = () => {
} }
res.data.forEach(async v => { res.data.forEach(async v => {
v.typeText = await getEnumText("EnumMessageType", v.type); v.typeText = await getEnumText("EnumMessageType", v.type);
v.iconUrl = iconUrlObj[v.type] || iconUrlObj.default;
console.log(v.iconUrl);
}); });
params.value.pageNo += 1; params.value.pageNo += 1;
list.value = list.value.concat(res.data); list.value = list.value.concat(res.data);
...@@ -209,12 +224,15 @@ scroll-view { ...@@ -209,12 +224,15 @@ scroll-view {
} }
.system { .system {
.item { .item {
align-items: flex-start;
padding: 32rpx; padding: 32rpx;
border-bottom: 16rpx solid #f3f4f8; border-bottom: 16rpx solid #f3f4f8;
img { .img-wrap {
width: 86rpx; img {
height: 86rpx; width: 36rpx;
border-radius: 50%; height: 36rpx;
border-radius: 50%;
}
} }
.content { .content {
flex: 1; flex: 1;
......
...@@ -54,7 +54,7 @@ onLoad(({ jobId, status }) => { ...@@ -54,7 +54,7 @@ onLoad(({ jobId, status }) => {
} else { } else {
apiParams.status = status * 1; apiParams.status = status * 1;
} }
apiParams.jobId = jobId; apiParams.positionId = jobId;
getApplicationList(); getApplicationList();
xma.xh.getSystemInfo({ xma.xh.getSystemInfo({
success(res) { success(res) {
...@@ -70,7 +70,7 @@ onLoad(({ jobId, status }) => { ...@@ -70,7 +70,7 @@ onLoad(({ jobId, status }) => {
/* 获取列表 */ /* 获取列表 */
const apiParams = reactive({ const apiParams = reactive({
status: "", status: "",
jobId: "", positionId: "",
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}); });
...@@ -78,7 +78,7 @@ const list = ref([]); ...@@ -78,7 +78,7 @@ const list = ref([]);
let flag = true; let flag = true;
const getApplicationList = () => { const getApplicationList = () => {
if (!flag) return; if (!flag) return;
uni.showLoading({ title: "加载中...",mask:true }); uni.showLoading({ title: "加载中...", mask: true });
getApplicationListApi(apiParams).then(res => { getApplicationListApi(apiParams).then(res => {
if (res.data?.length && flag) { if (res.data?.length && flag) {
list.value.push(...res.data); list.value.push(...res.data);
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</view> </view>
</view> </view>
<!-- 筛选弹窗 --> <!-- 筛选弹窗 -->
<Filter v-if="showOtherFilter" @confirm="filterConfirm" @cancel="showOtherFilter = false" /> <Filter v-show="showOtherFilter" :show="showOtherFilter" @confirm="filterConfirm" @cancel="showOtherFilter = false" />
</div> </div>
</template> </template>
<script setup> <script setup>
...@@ -85,7 +85,7 @@ const activeTab = ref("求职推荐"); ...@@ -85,7 +85,7 @@ const activeTab = ref("求职推荐");
const changeActiveTab = tab => { const changeActiveTab = tab => {
activeTab.value = tab; activeTab.value = tab;
isEnd.value = false; isEnd.value = false;
applicationList.value = [] applicationList.value = [];
// resetParams(); // resetParams();
getResumeRecommendList(); getResumeRecommendList();
/* getTopFilter(); /* getTopFilter();
...@@ -104,11 +104,11 @@ function getJobListApiFn() { ...@@ -104,11 +104,11 @@ function getJobListApiFn() {
getPositionListApi({ status: 3 }).then(res => { getPositionListApi({ status: 3 }).then(res => {
if (res.code == 200) { if (res.code == 200) {
jobListColumns.value = res.data; jobListColumns.value = res.data;
if (res.data.length) { if (res.data.length) {
getResumeRecommendListParams.value.positionId = res.data[0].id getResumeRecommendListParams.value.positionId = res.data[0].id;
jobTypeText.value = res.data[0].name jobTypeText.value = res.data[0].name;
} }
getResumeRecommendList() getResumeRecommendList();
} }
}); });
} }
...@@ -242,7 +242,7 @@ const getResumeRecommendList = () => { ...@@ -242,7 +242,7 @@ const getResumeRecommendList = () => {
}); });
} }
}; };
const companyReviewInfoFn = () => { const companyReviewInfoFn = () => {
companyReviewInfo().then(res => { companyReviewInfo().then(res => {
if (!res.data) { if (!res.data) {
uni.navigateTo({ uni.navigateTo({
...@@ -253,13 +253,13 @@ const companyReviewInfoFn = () => { ...@@ -253,13 +253,13 @@ const companyReviewInfoFn = () => {
}; };
companyReviewInfoFn(); companyReviewInfoFn();
// 第一次不执行推荐列表需要(需要拉取到列表在执行) // 第一次不执行推荐列表需要(需要拉取到列表在执行)
let notFirst = false let notFirst = false;
onShow(() => { onShow(() => {
resetPageParams(); resetPageParams();
if (notFirst) { if (notFirst) {
getResumeRecommendList(); getResumeRecommendList();
} }
notFirst = true notFirst = true;
getUserInfo(); 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 { getDictDataApi } from "@/api/common";
import { useEnumStore } from "@/store/enum";
const { data, setEnumData, getEnumData } = useEnumStore();
/** /**
* 根据类型获取EUM数据。 * 根据类型获取EUM数据。
* 该函数用于根据给定的类型从本地存储或服务器获取EUM数据。如果数据已在本地存储中,则直接返回; * 该函数用于根据给定的类型从本地存储或服务器获取EUM数据。如果数据已在本地存储中,则直接返回;
...@@ -9,7 +11,7 @@ import { getDictDataApi } from "@/api/common"; ...@@ -9,7 +11,7 @@ import { getDictDataApi } from "@/api/common";
*/ */
export const getEumData = type => { export const getEumData = type => {
// const storage = getStorageSync(type); // const storage = getStorageSync(type);
const storage = false; const storage = getEnumData(type);
const codeToNumbers = data => { const codeToNumbers = data => {
data.forEach(v => { data.forEach(v => {
v.code = Number(v.code); v.code = Number(v.code);
...@@ -22,7 +24,8 @@ export const getEumData = type => { ...@@ -22,7 +24,8 @@ export const getEumData = type => {
} else { } else {
getDictDataApi([type]).then(res => { getDictDataApi([type]).then(res => {
const data = res.data[type]; const data = res.data[type];
setStorageSync(type, data); // setStorageSync(type, data);
setEnumData(type, data);
resolve(codeToNumbers(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