flat: 暂存,新增一体机sdk,和一体机环境

This commit is contained in:
Apcallover
2025-12-16 15:36:42 +08:00
parent 33f1d0a8ab
commit 77dfab84f1
11 changed files with 214 additions and 60 deletions

View File

@@ -259,7 +259,7 @@ const { $api, navTo, vacanciesTo, formatTotal, throttle } = inject('globalFuncti
import { onLoad, onShow } from '@dcloudio/uni-app';
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
const { userInfo } = storeToRefs(useUserStore());
const { userInfo, hasLogin } = storeToRefs(useUserStore());
import useDictStore from '@/stores/useDictStore';
const { getTransformChildren, oneDictData } = useDictStore();
import useLocationStore from '@/stores/useLocationStore';
@@ -316,6 +316,49 @@ const isLoaded = ref(false);
const colors = ['#0069FE', '#FF9400', '#FF6969', '#21EA85', '#87E2EC'];
const occupations = [
'律师',
'工程师',
'医生',
'教师',
'设计师',
'程序员',
'会计师',
'建筑师',
'护士',
'销售',
'经理',
'顾问',
'分析师',
'研究员',
'编辑',
'记者',
'摄影师',
'厨师',
'司机',
'保安',
'客服',
'行政',
'人事',
'市场',
'运营',
'产品',
'测试',
'运维',
'前端',
'后端',
'全栈',
'数据',
'策划',
'导演',
'演员',
'歌手',
'作家',
'画家',
'翻译',
'导游',
];
onMounted(() => {
let firstEntry = uni.getStorageSync('firstEntry') === false ? false : true; // 默认未读
maskFirstEntry.value = firstEntry;
@@ -323,17 +366,34 @@ onMounted(() => {
});
async function getMatchTags() {
try {
matchLoading.value = true;
const { data } = await $api.createRequest('/app/user/getJobAdviceByResume');
matchTags.value = data;
matchLoading.value = false;
} catch (err) {
console.err('简历匹配职位获取失败');
} finally {
if (hasLogin.value) {
try {
matchLoading.value = true;
const { data } = await $api.createRequest('/app/user/getJobAdviceByResume');
matchTags.value = data;
matchLoading.value = false;
} catch (err) {
console.error('简历匹配职位获取失败');
}
} else {
const vals = getRandomStrings(occupations).map((text) => ({
job_name: text,
score: 0,
}));
matchTags.value = vals;
}
}
function getRandomStrings(arr, count = 10) {
const size = Math.min(arr.length, count);
const shuffled = [...arr];
for (let i = shuffled.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
}
return shuffled.slice(0, size);
}
const checkStickyStatus = (e) => {
scrollTop.value = e.detail.scrollTop;
nextTick(() => {