Compare commits
16 Commits
b7b43c0b42
...
kslc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14dafac147 | ||
|
|
028e3202bd | ||
|
|
7307335487 | ||
| cc925b74a2 | |||
|
|
3d2c26650c | ||
|
|
3d7cb0c561 | ||
|
|
ee57ac7568 | ||
|
|
7d2faa6c1b | ||
|
|
07b2aa5f80 | ||
|
|
58c36c01a0 | ||
|
|
ea04387b58 | ||
|
|
ec2dc5f659 | ||
|
|
645c2552f6 | ||
|
|
36798d3054 | ||
|
|
857dedad01 | ||
|
|
d97a712fd1 |
53
App.vue
@@ -4,21 +4,25 @@ import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
|
||||
import useUserStore from './stores/useUserStore';
|
||||
import useDictStore from './stores/useDictStore';
|
||||
const { $api, navTo, appendScriptTagElement } = inject('globalFunction');
|
||||
import config from '@/config.js';
|
||||
|
||||
onLaunch((options) => {
|
||||
useUserStore().initSeesionId(); //更新
|
||||
useDictStore().getDictData();
|
||||
// uni.onTabBarMidButtonTap(() => {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/chat/chat',
|
||||
// });
|
||||
// });
|
||||
// uni.hideTabBar();
|
||||
|
||||
// 登录
|
||||
let token = uni.getStorageSync('token') || ''; // 同步获取 缓存信息
|
||||
if (token) {
|
||||
useUserStore()
|
||||
.loginSetToken(token)
|
||||
.then(() => {
|
||||
$api.msg('登录成功');
|
||||
})
|
||||
.catch(() => {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login',
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
@@ -29,15 +33,10 @@ onLaunch((options) => {
|
||||
|
||||
onMounted(() => {
|
||||
// #ifndef MP-WEIXIN
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
appendScriptTagElement('./static/js/jweixin-1.4.0.js').then(() => {
|
||||
console.log('✅ 微信 JSSDK 加载完成');
|
||||
});
|
||||
} else {
|
||||
appendScriptTagElement('/static/js/jweixin-1.4.0.js').then(() => {
|
||||
console.log('✅ 微信 JSSDK 加载完成');
|
||||
});
|
||||
}
|
||||
appendScriptTagElement('https://qd.zhaopinzao8dian.com/file/csn/jweixin-1.4.0.js').then(() => {
|
||||
console.log('✅ 微信 JSSDK 加载完成');
|
||||
// signatureFn();
|
||||
});
|
||||
// #endif
|
||||
});
|
||||
|
||||
@@ -52,6 +51,7 @@ onHide(() => {
|
||||
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
@import '@/common/animation.css';
|
||||
@import '@/common/common.css';
|
||||
/* 修改pages tabbar样式 H5有效 */
|
||||
.uni-tabbar .uni-tabbar__item:nth-child(4) .uni-tabbar__bd .uni-tabbar__icon {
|
||||
@@ -77,6 +77,29 @@ uni-modal,
|
||||
|
||||
@font-face {
|
||||
font-family: DingTalk JinBuTi;
|
||||
src: url('@/static/font/DingTalk JinBuTi_min.ttf');
|
||||
src: url('/static/font/DingTalk JinBuTi_min.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: PingFangSC-Regular;
|
||||
src: url('https://qd.zhaopinzao8dian.com/file/csn/PingFangSC-Regular.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: PingFangSC-Medium;
|
||||
src: url('https://qd.zhaopinzao8dian.com/file/csn/PingFangSC-Medium.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: DIN-Medium;
|
||||
src: url('https://qd.zhaopinzao8dian.com/file/csn/DIN-Medium.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
|
||||
193
common/animation.css
Normal file
@@ -0,0 +1,193 @@
|
||||
/*base code*/
|
||||
.animated {
|
||||
-webkit-animation-duration: 1s;
|
||||
animation-duration: 1s;
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
.animated.infinite {
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
|
||||
.animated.hinge {
|
||||
-webkit-animation-duration: 2s;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
|
||||
/*the animation definition*/
|
||||
@-webkit-keyframes tada {
|
||||
0% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
|
||||
10%,
|
||||
20% {
|
||||
-webkit-transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)
|
||||
}
|
||||
|
||||
30%,
|
||||
50%,
|
||||
70%,
|
||||
90% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)
|
||||
}
|
||||
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes tada {
|
||||
0% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
-ms-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
|
||||
10%,
|
||||
20% {
|
||||
-webkit-transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg);
|
||||
-ms-transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)
|
||||
}
|
||||
|
||||
30%,
|
||||
50%,
|
||||
70%,
|
||||
90% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
-ms-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)
|
||||
}
|
||||
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
-ms-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
-ms-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
.tada {
|
||||
-webkit-animation-name: tada;
|
||||
animation-name: tada
|
||||
}
|
||||
|
||||
|
||||
.btn-tada:active {
|
||||
-webkit-animation-name: tada;
|
||||
animation-name: tada
|
||||
}
|
||||
|
||||
/*the animation definition*/
|
||||
@-webkit-keyframes rubberBand {
|
||||
0% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
|
||||
30% {
|
||||
-webkit-transform: scale3d(1.25, .75, 1);
|
||||
transform: scale3d(1.25, .75, 1)
|
||||
}
|
||||
|
||||
40% {
|
||||
-webkit-transform: scale3d(0.75, 1.25, 1);
|
||||
transform: scale3d(0.75, 1.25, 1)
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale3d(1.15, .85, 1);
|
||||
transform: scale3d(1.15, .85, 1)
|
||||
}
|
||||
|
||||
65% {
|
||||
-webkit-transform: scale3d(.95, 1.05, 1);
|
||||
transform: scale3d(.95, 1.05, 1)
|
||||
}
|
||||
|
||||
75% {
|
||||
-webkit-transform: scale3d(1.05, .95, 1);
|
||||
transform: scale3d(1.05, .95, 1)
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rubberBand {
|
||||
0% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
-ms-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
|
||||
30% {
|
||||
-webkit-transform: scale3d(1.25, .75, 1);
|
||||
-ms-transform: scale3d(1.25, .75, 1);
|
||||
transform: scale3d(1.25, .75, 1)
|
||||
}
|
||||
|
||||
40% {
|
||||
-webkit-transform: scale3d(0.75, 1.25, 1);
|
||||
-ms-transform: scale3d(0.75, 1.25, 1);
|
||||
transform: scale3d(0.75, 1.25, 1)
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale3d(1.15, .85, 1);
|
||||
-ms-transform: scale3d(1.15, .85, 1);
|
||||
transform: scale3d(1.15, .85, 1)
|
||||
}
|
||||
|
||||
65% {
|
||||
-webkit-transform: scale3d(.95, 1.05, 1);
|
||||
-ms-transform: scale3d(.95, 1.05, 1);
|
||||
transform: scale3d(.95, 1.05, 1)
|
||||
}
|
||||
|
||||
75% {
|
||||
-webkit-transform: scale3d(1.05, .95, 1);
|
||||
-ms-transform: scale3d(1.05, .95, 1);
|
||||
transform: scale3d(1.05, .95, 1)
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
-ms-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
.rubberBand {
|
||||
-webkit-animation-name: rubberBand;
|
||||
animation-name: rubberBand
|
||||
}
|
||||
|
||||
|
||||
.btn-rubberBand:active {
|
||||
-webkit-animation-name: tada;
|
||||
animation-name: tada
|
||||
}
|
||||
@@ -56,6 +56,7 @@ html {
|
||||
background-color: rgba(189, 197, 254, 0.15);
|
||||
}
|
||||
|
||||
|
||||
.btn-incline {
|
||||
transition: transform 0.2s ease;
|
||||
transform-style: preserve-3d;
|
||||
@@ -74,6 +75,23 @@ html {
|
||||
transform: perspective(600px) rotateX(6deg) scale(0.98);
|
||||
}
|
||||
|
||||
.press-button {
|
||||
padding: 10px 20px;
|
||||
background: #3A4750;
|
||||
/* 深灰蓝 */
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.1s ease, box-shadow 0.1s ease;
|
||||
/* box-shadow: 0 4px 0 #2C3E50; */
|
||||
}
|
||||
|
||||
.press-button:active {
|
||||
transform: scale(0.95) translateY(2px);
|
||||
/* box-shadow: 0 2px 0 #1C2833; */
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
.btn-shaky:active {
|
||||
|
||||
@@ -542,6 +542,336 @@ function isInWechatMiniProgramWebview() {
|
||||
function isEmptyObject(obj) {
|
||||
return obj && typeof obj === 'object' && !Array.isArray(obj) && Object.keys(obj).length === 0;
|
||||
}
|
||||
/**
|
||||
* 身份证号码校验工具
|
||||
* 支持15位和18位身份证号码校验
|
||||
* 提供详细的校验结果和错误信息
|
||||
*/
|
||||
export const IdCardValidator = {
|
||||
// 每位加权因子
|
||||
powers: ['7', '9', '10', '5', '8', '4', '2', '1', '6', '3', '7', '9', '10', '5', '8', '4', '2'],
|
||||
|
||||
// 第18位校检码
|
||||
parityBit: ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'],
|
||||
|
||||
// 省市地区码映射
|
||||
provinceAndCitys: {
|
||||
11: '北京',
|
||||
12: '天津',
|
||||
13: '河北',
|
||||
14: '山西',
|
||||
15: '内蒙古',
|
||||
21: '辽宁',
|
||||
22: '吉林',
|
||||
23: '黑龙江',
|
||||
31: '上海',
|
||||
32: '江苏',
|
||||
33: '浙江',
|
||||
34: '安徽',
|
||||
35: '福建',
|
||||
36: '江西',
|
||||
37: '山东',
|
||||
41: '河南',
|
||||
42: '湖北',
|
||||
43: '湖南',
|
||||
44: '广东',
|
||||
45: '广西',
|
||||
46: '海南',
|
||||
50: '重庆',
|
||||
51: '四川',
|
||||
52: '贵州',
|
||||
53: '云南',
|
||||
54: '西藏',
|
||||
61: '陕西',
|
||||
62: '甘肃',
|
||||
63: '青海',
|
||||
64: '宁夏',
|
||||
65: '新疆',
|
||||
71: '台湾',
|
||||
81: '香港',
|
||||
82: '澳门',
|
||||
91: '国外'
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证身份证号码
|
||||
* @param {string} idCardNo - 身份证号码
|
||||
* @returns {Object} 校验结果 { valid: boolean, message: string, info: Object }
|
||||
*/
|
||||
validate(idCardNo) {
|
||||
// 检查是否为空
|
||||
if (this._isEmpty(idCardNo)) {
|
||||
return this._createResult(false, '身份证号码不能为空');
|
||||
}
|
||||
|
||||
// 去除空格
|
||||
idCardNo = idCardNo.trim();
|
||||
|
||||
// 检查长度,支持15位和18位
|
||||
if (idCardNo.length === 15) {
|
||||
return this._validate15IdCardNo(idCardNo);
|
||||
} else if (idCardNo.length === 18) {
|
||||
return this._validate18IdCardNo(idCardNo);
|
||||
} else {
|
||||
return this._createResult(false, '身份证号码长度必须是15位或18位');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证18位身份证号码
|
||||
* @param {string} idCardNo - 18位身份证号码
|
||||
* @returns {Object} 校验结果
|
||||
*/
|
||||
_validate18IdCardNo(idCardNo) {
|
||||
// 18位身份证号码的基本格式校验
|
||||
if (!/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(
|
||||
idCardNo)) {
|
||||
return this._createResult(false, '身份证号码格式不正确');
|
||||
}
|
||||
|
||||
// 校验地址码
|
||||
const addressCode = idCardNo.substring(0, 6);
|
||||
const addressResult = this._checkAddressCode(addressCode);
|
||||
if (!addressResult.valid) {
|
||||
return addressResult;
|
||||
}
|
||||
|
||||
// 校验日期码
|
||||
const birDayCode = idCardNo.substring(6, 14);
|
||||
const birthResult = this._checkBirthDayCode(birDayCode);
|
||||
if (!birthResult.valid) {
|
||||
return birthResult;
|
||||
}
|
||||
|
||||
// 验证校检码
|
||||
if (!this._checkParityBit(idCardNo)) {
|
||||
return this._createResult(false, '身份证号码校验码错误');
|
||||
}
|
||||
|
||||
// 提取身份证信息
|
||||
const info = this._extractInfo(idCardNo, 18);
|
||||
|
||||
return this._createResult(true, '身份证号码校验通过', info);
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证15位身份证号码
|
||||
* @param {string} idCardNo - 15位身份证号码
|
||||
* @returns {Object} 校验结果
|
||||
*/
|
||||
_validate15IdCardNo(idCardNo) {
|
||||
// 15位身份证号码的基本格式校验
|
||||
if (!/^[1-9]\d{5}\d{2}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo)) {
|
||||
return this._createResult(false, '身份证号码格式不正确');
|
||||
}
|
||||
|
||||
// 校验地址码
|
||||
const addressCode = idCardNo.substring(0, 6);
|
||||
const addressResult = this._checkAddressCode(addressCode);
|
||||
if (!addressResult.valid) {
|
||||
return addressResult;
|
||||
}
|
||||
|
||||
// 校验日期码(15位身份证年份是两位,这里转换为四位)
|
||||
const year = `19${idCardNo.substring(6, 8)}`; // 15位身份证一般是1900年以后出生
|
||||
const month = idCardNo.substring(8, 10);
|
||||
const day = idCardNo.substring(10, 12);
|
||||
const birDayCode = `${year}${month}${day}`;
|
||||
|
||||
const birthResult = this._checkBirthDayCode(birDayCode);
|
||||
if (!birthResult.valid) {
|
||||
return birthResult;
|
||||
}
|
||||
|
||||
// 提取身份证信息
|
||||
const info = this._extractInfo(idCardNo, 15);
|
||||
|
||||
return this._createResult(true, '身份证号码校验通过', info);
|
||||
},
|
||||
|
||||
/**
|
||||
* 校验地址码
|
||||
* @param {string} addressCode - 地址码
|
||||
* @returns {Object} 校验结果
|
||||
*/
|
||||
_checkAddressCode(addressCode) {
|
||||
if (!/^[1-9]\d{5}$/.test(addressCode)) {
|
||||
return this._createResult(false, '地址码格式不正确');
|
||||
}
|
||||
|
||||
const provinceCode = parseInt(addressCode.substring(0, 2));
|
||||
if (!this.provinceAndCitys[provinceCode]) {
|
||||
return this._createResult(false, '地址码对应的地区不存在');
|
||||
}
|
||||
|
||||
return this._createResult(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* 校验日期码
|
||||
* @param {string} birDayCode - 日期码 (格式:YYYYMMDD)
|
||||
* @returns {Object} 校验结果
|
||||
*/
|
||||
_checkBirthDayCode(birDayCode) {
|
||||
if (!/^[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birDayCode)) {
|
||||
return this._createResult(false, '出生日期格式不正确');
|
||||
}
|
||||
|
||||
const year = parseInt(birDayCode.substring(0, 4), 10);
|
||||
const month = parseInt(birDayCode.substring(4, 6), 10);
|
||||
const day = parseInt(birDayCode.substring(6), 10);
|
||||
|
||||
// 检查年份范围(合理的出生年份范围)
|
||||
const currentYear = new Date().getFullYear();
|
||||
if (year < 1900 || year > currentYear) {
|
||||
return this._createResult(false, '出生年份超出合理范围');
|
||||
}
|
||||
|
||||
// 检查日期有效性
|
||||
const date = new Date(year, month - 1, day);
|
||||
if (
|
||||
date.getFullYear() !== year ||
|
||||
date.getMonth() !== month - 1 ||
|
||||
date.getDate() !== day
|
||||
) {
|
||||
return this._createResult(false, '出生日期无效');
|
||||
}
|
||||
|
||||
// 检查是否为未来日期
|
||||
if (date > new Date()) {
|
||||
return this._createResult(false, '出生日期不能是未来日期');
|
||||
}
|
||||
|
||||
return this._createResult(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证校检码
|
||||
* @param {string} idCardNo - 18位身份证号码
|
||||
* @returns {boolean} 校验结果
|
||||
*/
|
||||
_checkParityBit(idCardNo) {
|
||||
const parityBit = idCardNo.charAt(17).toUpperCase();
|
||||
return this._getParityBit(idCardNo) === parityBit;
|
||||
},
|
||||
|
||||
/**
|
||||
* 计算校检码
|
||||
* @param {string} idCardNo - 18位身份证号码
|
||||
* @returns {string} 校检码
|
||||
*/
|
||||
_getParityBit(idCardNo) {
|
||||
const id17 = idCardNo.substring(0, 17);
|
||||
let power = 0;
|
||||
|
||||
for (let i = 0; i < 17; i++) {
|
||||
power += parseInt(id17.charAt(i), 10) * parseInt(this.powers[i], 10);
|
||||
}
|
||||
|
||||
const mod = power % 11;
|
||||
return this.parityBit[mod];
|
||||
},
|
||||
|
||||
/**
|
||||
* 提取身份证信息
|
||||
* @param {string} idCardNo - 身份证号码
|
||||
* @param {number} type - 类型 15或18
|
||||
* @returns {Object} 身份证信息
|
||||
*/
|
||||
_extractInfo(idCardNo, type) {
|
||||
let addressCode, birthYear, birthMonth, birthDay, genderCode, gender;
|
||||
|
||||
// 地址码
|
||||
addressCode = idCardNo.substring(0, 6);
|
||||
const provinceCode = parseInt(addressCode.substring(0, 2));
|
||||
const province = this.provinceAndCitys[provinceCode] || '';
|
||||
|
||||
// 出生日期
|
||||
if (type === 18) {
|
||||
birthYear = idCardNo.substring(6, 10);
|
||||
birthMonth = idCardNo.substring(10, 12);
|
||||
birthDay = idCardNo.substring(12, 14);
|
||||
genderCode = idCardNo.substring(14, 17);
|
||||
} else {
|
||||
birthYear = `19${idCardNo.substring(6, 8)}`;
|
||||
birthMonth = idCardNo.substring(8, 10);
|
||||
birthDay = idCardNo.substring(10, 12);
|
||||
genderCode = idCardNo.substring(12, 15);
|
||||
}
|
||||
|
||||
// 性别
|
||||
gender = parseInt(genderCode, 10) % 2 === 1 ? '男' : '女';
|
||||
|
||||
return {
|
||||
addressCode,
|
||||
province,
|
||||
birthday: `${birthYear}-${birthMonth}-${birthDay}`,
|
||||
gender,
|
||||
length: type
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 检查是否为空
|
||||
* @param {*} value - 要检查的值
|
||||
* @returns {boolean} 是否为空
|
||||
*/
|
||||
_isEmpty(value) {
|
||||
return value === null || value === undefined || value === '';
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建校验结果对象
|
||||
* @param {boolean} valid - 是否有效
|
||||
* @param {string} message - 消息
|
||||
* @param {Object} info - 附加信息
|
||||
* @returns {Object} 校验结果
|
||||
*/
|
||||
_createResult(valid, message = '', info = {}) {
|
||||
return {
|
||||
valid,
|
||||
message,
|
||||
info
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 将15位身份证升级为18位
|
||||
* @param {string} idCardNo - 15位身份证号码
|
||||
* @returns {string|boolean} 18位身份证号码或false(无效的15位身份证)
|
||||
*/
|
||||
upgrade15To18(idCardNo) {
|
||||
if (idCardNo.length !== 15) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 先验证15位身份证是否有效
|
||||
const validateResult = this._validate15IdCardNo(idCardNo);
|
||||
if (!validateResult.valid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 转换出生年份为4位
|
||||
const year = `19${idCardNo.substring(6, 8)}`;
|
||||
const rest = idCardNo.substring(8);
|
||||
|
||||
// 拼接17位
|
||||
const id17 = `${idCardNo.substring(0, 6)}${year}${rest}`;
|
||||
|
||||
// 计算校验码
|
||||
let power = 0;
|
||||
for (let i = 0; i < 17; i++) {
|
||||
power += parseInt(id17.charAt(i), 10) * parseInt(this.powers[i], 10);
|
||||
}
|
||||
const mod = power % 11;
|
||||
const parityBit = this.parityBit[mod];
|
||||
|
||||
// 拼接18位身份证
|
||||
return `${id17}${parityBit}`;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const $api = {
|
||||
msg,
|
||||
@@ -566,6 +896,7 @@ export default {
|
||||
navBack,
|
||||
cloneDeep,
|
||||
formatDate,
|
||||
IdCardValidator,
|
||||
getdeviceInfo,
|
||||
checkingPhoneRegExp,
|
||||
checkingEmailRegExp,
|
||||
@@ -584,5 +915,5 @@ export default {
|
||||
appendScriptTagElement,
|
||||
insertSortData,
|
||||
isInWechatMiniProgramWebview,
|
||||
isEmptyObject
|
||||
isEmptyObject,
|
||||
}
|
||||
BIN
components/.DS_Store
vendored
@@ -110,9 +110,11 @@ const handleScrollToLower = () => {
|
||||
align-items: center;
|
||||
padding: 7rpx 3rpx;
|
||||
.header-title {
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
.subtitle-text {
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
312
components/TikTok/TikTok.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<swiper
|
||||
class="m-tiktok-video-swiper"
|
||||
circular
|
||||
@change="swiperChange"
|
||||
:current="state.current"
|
||||
:vertical="true"
|
||||
duration="300"
|
||||
>
|
||||
<swiper-item v-for="(item, index) in state.displaySwiperList" :key="index">
|
||||
<view class="swiper-item" @click="(e) => handleClick(index, e)">
|
||||
<video
|
||||
:id="`video__${index}`"
|
||||
:controls="controls"
|
||||
:autoplay="false"
|
||||
:loop="loop"
|
||||
@ended="ended"
|
||||
@controlstoggle="controlstoggle"
|
||||
@play="onPlay"
|
||||
@error="emits('error')"
|
||||
class="m-tiktok-video-player"
|
||||
:src="item.src || item.explainUrl"
|
||||
v-if="index === 0 || !state.isFirstLoad"
|
||||
></video>
|
||||
<view class="cover-triangle" v-if="pause"></view>
|
||||
<image
|
||||
v-if="item.poster && state.displayIndex != index"
|
||||
:src="item.poster"
|
||||
class="m-tiktok-video-poster"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<slot :item="item"></slot>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, getCurrentInstance, watch, nextTick } from 'vue';
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
const _this = getCurrentInstance();
|
||||
const emits = defineEmits(['play', 'error', 'loadMore', 'change', 'controlstoggle', 'click', 'ended']);
|
||||
|
||||
const lastTapTime = ref(0);
|
||||
const pause = ref(false);
|
||||
const props = defineProps({
|
||||
/**
|
||||
* 视频列表
|
||||
*/
|
||||
videoList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
/**
|
||||
* 是否循环播放一个视频
|
||||
*/
|
||||
loop: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
/**
|
||||
* 显示原生控制栏
|
||||
*/
|
||||
controls: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
/**
|
||||
* 是否自动播放
|
||||
*/
|
||||
autoplay: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
/**
|
||||
* 是否自动滚动播放
|
||||
*/
|
||||
autoChange: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 滚动加载阈值(即播放到剩余多少个之后触发加载更多
|
||||
*/
|
||||
loadMoreOffsetCount: {
|
||||
type: Number,
|
||||
default: 2,
|
||||
},
|
||||
/**
|
||||
* 暂停 1 单机暂停; 2 双击暂停; 0关闭
|
||||
*/
|
||||
pauseType: {
|
||||
type: Number,
|
||||
default: 2,
|
||||
},
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
originList: [], // 源数据
|
||||
displaySwiperList: [], // swiper需要的数据
|
||||
displayIndex: 0, // 用于显示swiper的真正的下标数值只有:0,1,2。
|
||||
originIndex: 0, // 记录源数据的下标
|
||||
current: 0,
|
||||
oid: 0,
|
||||
showControls: '',
|
||||
toggleShow: true, // 显示面板
|
||||
videoContexts: [],
|
||||
isFirstLoad: true,
|
||||
});
|
||||
|
||||
const initVideoContexts = () => {
|
||||
state.videoContexts = [
|
||||
uni.createVideoContext('video__0', _this),
|
||||
uni.createVideoContext('video__1', _this),
|
||||
uni.createVideoContext('video__2', _this),
|
||||
];
|
||||
};
|
||||
|
||||
const onPlay = (e) => {
|
||||
emits('play', e);
|
||||
};
|
||||
|
||||
const setVideoRef = (el, index) => {
|
||||
if (el) {
|
||||
videoRefs.value[index] = el;
|
||||
}
|
||||
};
|
||||
|
||||
function handleClick(index, e) {
|
||||
const now = Date.now();
|
||||
switch (props.pauseType) {
|
||||
case 1:
|
||||
if (pause.value) {
|
||||
state.videoContexts[index].play();
|
||||
pause.value = false;
|
||||
} else {
|
||||
state.videoContexts[index].pause();
|
||||
pause.value = true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (now - lastTapTime.value < 300) {
|
||||
if (pause.value) {
|
||||
state.videoContexts[index].play();
|
||||
pause.value = false;
|
||||
} else {
|
||||
state.videoContexts[index].pause();
|
||||
pause.value = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
lastTapTime.value = now;
|
||||
state.toggleShow = !state.toggleShow;
|
||||
emits('click', e);
|
||||
}
|
||||
function ended() {
|
||||
// 自动切换下一个视频
|
||||
if (props.autoChange) {
|
||||
if (state.displayIndex < 2) {
|
||||
state.current = state.displayIndex + 1;
|
||||
} else {
|
||||
state.current = 0;
|
||||
}
|
||||
}
|
||||
emits('ended');
|
||||
}
|
||||
/**
|
||||
* 初始一个显示的swiper数据
|
||||
* @originIndex 从源数据的哪个开始显示默认0,如从其他页面跳转进来,要显示第n个,这个参数就是他的下标
|
||||
*/
|
||||
function initSwiperData(originIndex = state.originIndex) {
|
||||
const originListLength = state.originList.length; // 源数据长度
|
||||
const displayList = [];
|
||||
displayList[state.displayIndex] = state.originList[originIndex];
|
||||
displayList[state.displayIndex - 1 == -1 ? 2 : state.displayIndex - 1] =
|
||||
state.originList[originIndex - 1 == -1 ? originListLength - 1 : originIndex - 1];
|
||||
displayList[state.displayIndex + 1 == 3 ? 0 : state.displayIndex + 1] =
|
||||
state.originList[originIndex + 1 == originListLength ? 0 : originIndex + 1];
|
||||
state.displaySwiperList = displayList;
|
||||
|
||||
if (state.oid >= state.originList.length) {
|
||||
state.oid = 0;
|
||||
}
|
||||
if (state.oid < 0) {
|
||||
state.oid = state.originList.length - 1;
|
||||
}
|
||||
// 暂停所有视频
|
||||
state.videoContexts.map((item) => item?.stop());
|
||||
setTimeout(() => {
|
||||
// 当前视频
|
||||
if (props.autoplay) {
|
||||
uni.createVideoContext(`video__${state.displayIndex}`, _this).play();
|
||||
}
|
||||
}, 500);
|
||||
// 数据改变
|
||||
emits('change', {
|
||||
index: originIndex,
|
||||
detail: state.originList[originIndex],
|
||||
});
|
||||
// 加载更多
|
||||
var pCount = state.originList.length - props.loadMoreOffsetCount;
|
||||
if (originIndex == pCount) {
|
||||
emits('loadMore');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* swiper滑动时候
|
||||
*/
|
||||
function swiperChange(event) {
|
||||
const { current } = event.detail;
|
||||
state.isFirstLoad = false;
|
||||
const originListLength = state.originList.length; // 源数据长度
|
||||
// 向后滚动
|
||||
if (state.displayIndex - current == 2 || state.displayIndex - current == -1) {
|
||||
state.originIndex = state.originIndex + 1 == originListLength ? 0 : state.originIndex + 1;
|
||||
state.displayIndex = state.displayIndex + 1 == 3 ? 0 : state.displayIndex + 1;
|
||||
state.oid = state.originIndex - 1;
|
||||
initSwiperData(state.originIndex);
|
||||
}
|
||||
// 如果两者的差为-2或者1则是向前滑动
|
||||
else if (state.displayIndex - current == -2 || state.displayIndex - current == 1) {
|
||||
state.originIndex = state.originIndex - 1 == -1 ? originListLength - 1 : state.originIndex - 1;
|
||||
state.displayIndex = state.displayIndex - 1 == -1 ? 2 : state.displayIndex - 1;
|
||||
state.oid = state.originIndex + 1;
|
||||
initSwiperData(state.originIndex);
|
||||
}
|
||||
state.toggleShow = true;
|
||||
}
|
||||
|
||||
function controlstoggle(e) {
|
||||
state.showControls = e.detail.show;
|
||||
emits('controlstoggle', e);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.videoList,
|
||||
() => {
|
||||
if (props.videoList?.length) {
|
||||
state.originList = props.videoList;
|
||||
if (state.isFirstLoad || !state.videoContexts?.length) {
|
||||
initSwiperData();
|
||||
initVideoContexts();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
let loadTimer = null;
|
||||
onLoad(() => {
|
||||
// 为了首次只加载一条视频(提高首次加载性能),延迟加载后续视频
|
||||
loadTimer = setTimeout(() => {
|
||||
state.isFirstLoad = false;
|
||||
clearTimeout(loadTimer);
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
onUnload(() => {
|
||||
clearTimeout(loadTimer);
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
initSwiperData,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.m-tiktok-video-swiper,
|
||||
.m-tiktok-video-player {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000;
|
||||
}
|
||||
.m-tiktok-video-swiper {
|
||||
.swiper-item {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
.m-tiktok-video-poster {
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.cover-triangle{
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%)
|
||||
width: 132rpx
|
||||
height: 132rpx
|
||||
border-radius: 50%;
|
||||
background: rgba(0,0,0,0.3)
|
||||
}
|
||||
.cover-triangle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-40%, -50%) rotate(90deg);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 40rpx solid transparent;
|
||||
border-right: 40rpx solid transparent;
|
||||
border-bottom: 60rpx solid #fff;
|
||||
}
|
||||
</style>
|
||||
100
components/UserTypeSwitcher/UserTypeSwitcher.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="user-type-switcher">
|
||||
<view class="switcher-title">用户类型切换(测试用)</view>
|
||||
<view class="switcher-buttons">
|
||||
<button
|
||||
v-for="(type, index) in userTypes"
|
||||
:key="index"
|
||||
:class="['type-btn', { active: currentUserType === type.value }]"
|
||||
@click="switchUserType(type.value)"
|
||||
>
|
||||
{{ type.label }}
|
||||
</button>
|
||||
</view>
|
||||
<view class="current-type">
|
||||
当前用户类型:{{ getCurrentTypeLabel() }} ({{ currentUserType }})
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
|
||||
const userTypes = [
|
||||
{ value: 0, label: '企业用户' },
|
||||
{ value: 1, label: '求职者' },
|
||||
{ value: 2, label: '网格员' },
|
||||
{ value: 3, label: '政府人员' }
|
||||
];
|
||||
|
||||
const currentUserType = computed(() => userInfo.value?.userType || 0);
|
||||
|
||||
const switchUserType = (userType) => {
|
||||
console.log('切换用户类型:', userType);
|
||||
console.log('切换前 userInfo:', userInfo.value);
|
||||
|
||||
userInfo.value.userType = userType;
|
||||
|
||||
console.log('切换后 userInfo:', userInfo.value);
|
||||
|
||||
// 保存到本地存储
|
||||
uni.setStorageSync('userInfo', userInfo.value);
|
||||
|
||||
uni.showToast({
|
||||
title: `已切换到${getCurrentTypeLabel()}`,
|
||||
icon: 'success'
|
||||
});
|
||||
};
|
||||
|
||||
const getCurrentTypeLabel = () => {
|
||||
const type = userTypes.find(t => t.value === currentUserType.value);
|
||||
return type ? type.label : '未知';
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.user-type-switcher {
|
||||
padding: 20rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 10rpx;
|
||||
margin: 20rpx;
|
||||
|
||||
.switcher-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.switcher-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.type-btn {
|
||||
padding: 10rpx 20rpx;
|
||||
border: 2rpx solid #ddd;
|
||||
border-radius: 8rpx;
|
||||
background: #fff;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
|
||||
&.active {
|
||||
background: #256BFA;
|
||||
color: #fff;
|
||||
border-color: #256BFA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.current-type {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -24,11 +24,13 @@ const renderedHtml = computed(() => parseMarkdown(props.content));
|
||||
|
||||
const handleItemClick = (e) => {
|
||||
let { attrs } = e.detail.node;
|
||||
console.log(attrs);
|
||||
let { 'data-copy-index': codeDataIndex, 'data-job-id': jobId, class: className } = attrs;
|
||||
switch (className) {
|
||||
case 'custom-card':
|
||||
navTo('/packageA/pages/post/post?jobId=' + jobId);
|
||||
return;
|
||||
return navTo('/packageA/pages/post/post?jobId=' + jobId);
|
||||
case 'custom-more':
|
||||
return navTo('/packageA/pages/moreJobs/moreJobs?jobId=' + jobId);
|
||||
case 'copy-btn':
|
||||
uni.setClipboardData({
|
||||
data: codeDataList[codeDataIndex],
|
||||
@@ -40,6 +42,7 @@ const handleItemClick = (e) => {
|
||||
});
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -258,6 +261,47 @@ ol {
|
||||
</style>
|
||||
|
||||
<style lang="stylus">
|
||||
.custom-more{
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: center
|
||||
color: #FFFFFF
|
||||
background: linear-gradient(135deg, #256BFA 0%, #9E74FD 100%)
|
||||
border-radius: 50rpx
|
||||
padding: 20rpx 32rpx
|
||||
margin: 20rpx 0
|
||||
font-size: 28rpx
|
||||
font-weight: 600
|
||||
box-shadow: 0rpx 8rpx 24rpx rgba(37, 107, 250, 0.3)
|
||||
transition: all 0.3s ease
|
||||
position: relative
|
||||
overflow: hidden
|
||||
.more-icon{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
background: url('@/static/svg/seemore.svg') center center no-repeat;
|
||||
background-size: 100% 100%
|
||||
margin-left: 12rpx
|
||||
filter: brightness(0) invert(1)
|
||||
}
|
||||
&::before {
|
||||
content: ''
|
||||
position: absolute
|
||||
top: 0
|
||||
left: -100%
|
||||
width: 100%
|
||||
height: 100%
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent)
|
||||
transition: left 0.5s ease
|
||||
}
|
||||
&:active {
|
||||
transform: translateY(2rpx)
|
||||
box-shadow: 0rpx 4rpx 16rpx rgba(37, 107, 250, 0.4)
|
||||
}
|
||||
&:active::before {
|
||||
left: 100%
|
||||
}
|
||||
}
|
||||
.custom-card
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
|
||||
@@ -276,11 +320,13 @@ ol {
|
||||
align-items: center;
|
||||
justify-content: space-between
|
||||
.title-text
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
max-width: calc(100% - 160rpx);
|
||||
overflow: hidden
|
||||
text-overflow: ellipsis
|
||||
font-size: 30rpx
|
||||
.card-salary
|
||||
font-family: DIN-Medium;
|
||||
font-size: 28rpx;
|
||||
color: #FF6E1C;
|
||||
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
<dict-tree-Label class="mar_ri10" dictType="industry" :value="job.industry"></dict-tree-Label>
|
||||
<dict-Label dictType="scale" :value="job.scale"></dict-Label>
|
||||
</view>
|
||||
<view>
|
||||
<text class="color_256BFA fs_14">在招职位·{{ job.totalRecruitment || '-' }}个</text>
|
||||
<view class="ris">
|
||||
<text class="fs_14">
|
||||
在招职位·
|
||||
<text class="color_256BFA">{{ job.totalRecruitment || '-' }}</text>
|
||||
个
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-tags">
|
||||
@@ -76,6 +80,7 @@ function nextDetail(company) {
|
||||
justify-content: space-between
|
||||
align-items: flex-start
|
||||
.company{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
@@ -97,6 +102,7 @@ function nextDetail(company) {
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
.tag{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
background: #F4F4F4;
|
||||
@@ -121,4 +127,7 @@ function nextDetail(company) {
|
||||
color: #6C7282;
|
||||
}
|
||||
}
|
||||
.ris{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -99,11 +99,13 @@ function nextDetail(job) {
|
||||
justify-content: space-between
|
||||
align-items: flex-start
|
||||
.company{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.salary{
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
@@ -120,6 +122,7 @@ function nextDetail(job) {
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
.tag{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
background: #F4F4F4;
|
||||
|
||||
267
components/renderJobs/renderJobsCheckBox.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<view v-for="job in listData" :key="job.id">
|
||||
<view
|
||||
v-if="!job.isTitle"
|
||||
class="cards"
|
||||
@click="handleCardClick(job, $event)"
|
||||
:class="{ 'card-selected': selectedJobs.includes(job.jobId) }"
|
||||
>
|
||||
<!-- 新增复选框 -->
|
||||
|
||||
<view class="card-content">
|
||||
<view class="card-company">
|
||||
<view class="company">{{ job.jobTitle }}</view>
|
||||
<view class="salary">
|
||||
<Salary-Expectation
|
||||
:max-salary="job.maxSalary"
|
||||
:min-salary="job.minSalary"
|
||||
></Salary-Expectation>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 其他原有内容保持不变 -->
|
||||
<view class="card-companyName">{{ job.companyName }}</view>
|
||||
<view class="card-tags">
|
||||
<view class="card-tag">
|
||||
<view class="tag">
|
||||
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
||||
</view>
|
||||
<view class="tag">
|
||||
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
||||
</view>
|
||||
<view class="tag">
|
||||
{{ vacanciesTo(job.vacancies) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="custom-checkbox" :class="{ checked: selectedJobs.includes(job.jobId) }">
|
||||
<view
|
||||
class="check-icon"
|
||||
@click.stop="toggleSelect(job.jobId)"
|
||||
:checked="selectedJobs.includes(job.jobId)"
|
||||
color="#4C6EFB"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-bottom">
|
||||
<view>{{ job.postingDate }}</view>
|
||||
<view>
|
||||
<convert-distance
|
||||
:alat="job.latitude"
|
||||
:along="job.longitude"
|
||||
:blat="latitude"
|
||||
:blong="longitude"
|
||||
></convert-distance>
|
||||
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="date-jobTitle" v-else>
|
||||
{{ job.title }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, computed, toRaw, ref, defineExpose } from 'vue';
|
||||
const { insertSortData, navTo, vacanciesTo } = inject('globalFunction');
|
||||
import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js';
|
||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||
// 选中的岗位ID集合
|
||||
const selectedJobs = ref([]);
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: '标题',
|
||||
},
|
||||
longitude: {
|
||||
type: Number,
|
||||
default: 120.382665,
|
||||
},
|
||||
latitude: {
|
||||
type: Number,
|
||||
default: 36.066938,
|
||||
},
|
||||
seeDate: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['update:selected']);
|
||||
|
||||
const listData = computed(() => {
|
||||
if (props.seeDate && props.list.length) {
|
||||
const ulist = toRaw(props.list);
|
||||
const [reslist, lastDate] = insertSortData(ulist, props.seeDate);
|
||||
return reslist;
|
||||
}
|
||||
return props.list;
|
||||
});
|
||||
|
||||
function nextDetail(job) {
|
||||
// 记录岗位类型,用作数据分析
|
||||
if (job.jobCategory) {
|
||||
const recordData = recommedIndexDb.JobParameter(job);
|
||||
recommedIndexDb.addRecord(recordData);
|
||||
}
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
}
|
||||
|
||||
function toggleSelect(jobId) {
|
||||
const index = selectedJobs.value.indexOf(jobId);
|
||||
if (index > -1) {
|
||||
selectedJobs.value.splice(index, 1);
|
||||
} else {
|
||||
selectedJobs.value.push(jobId);
|
||||
}
|
||||
emit('update:selected', selectedJobs.value);
|
||||
}
|
||||
|
||||
// 修改:卡片点击事件,避免点击复选框时触发跳转
|
||||
function handleCardClick(job, e) {
|
||||
if (job.jobCategory) {
|
||||
const recordData = recommedIndexDb.JobParameter(job);
|
||||
recommedIndexDb.addRecord(recordData);
|
||||
}
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
}
|
||||
|
||||
// 新增:提供选中状态和切换方法给父组件
|
||||
defineExpose({
|
||||
selectedJobs,
|
||||
toggleSelect,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
// 新增样式
|
||||
.cards {
|
||||
position: relative;
|
||||
padding-left: 60rpx; /* 给复选框留出空间 */
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
// position: absolute;
|
||||
// left: 20rpx;
|
||||
// top: 50%;
|
||||
// transform: translateY(-50%);
|
||||
// z-index: 10;
|
||||
}
|
||||
|
||||
.card-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 选中状态样式
|
||||
.card-selected {
|
||||
border: 2rpx solid #4C6EFB;
|
||||
background-color: #F0F5FF;
|
||||
}
|
||||
|
||||
.date-jobTitle{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #495265;
|
||||
padding: 28rpx 0 0 20rpx
|
||||
}
|
||||
.cards{
|
||||
padding: 32rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
margin-top: 22rpx;
|
||||
.card-company{
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
align-items: flex-start
|
||||
.company{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
flex: 1
|
||||
}
|
||||
.salary{
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
white-space: nowrap
|
||||
line-height: 48rpx
|
||||
}
|
||||
}
|
||||
.card-companyName{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #6C7282;
|
||||
}
|
||||
.card-tags{
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
}
|
||||
.card-tag{
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
.tag{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
background: #F4F4F4;
|
||||
border-radius: 4rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
line-height: 30rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #6C7282;
|
||||
text-align: center;
|
||||
margin-top: 14rpx;
|
||||
white-space: nowrap
|
||||
margin-right: 20rpx
|
||||
}
|
||||
}
|
||||
.card-bottom{
|
||||
margin-top: 32rpx
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
font-size: 28rpx;
|
||||
color: #6C7282;
|
||||
}
|
||||
}
|
||||
|
||||
/* 复选框容器样式 */
|
||||
.checkbox {
|
||||
/* 保留之前的定位样式,确保复选框在正确位置 */
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 自定义圆形复选框样式 */
|
||||
.custom-checkbox {
|
||||
width: 40rpx; /* 宽度 */
|
||||
height: 40rpx; /* 高度(与宽度一致形成圆形) */
|
||||
border-radius: 50%; /* 圆角设为50%变成圆形 */
|
||||
border: 2rpx solid #ccc; /* 未选中时的边框 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #fff; /* 背景色 */
|
||||
transition: all 0.3s; /* 过渡动画 */
|
||||
}
|
||||
|
||||
/* 选中状态样式 */
|
||||
.custom-checkbox.checked {
|
||||
border-color: #4C6EFB; /* 选中时的边框颜色 */
|
||||
background-color: #4C6EFB; /* 选中时的背景色 */
|
||||
}
|
||||
/* 选中时的对勾图标 */
|
||||
.check-icon {
|
||||
margin-top: -4rpx;
|
||||
width: 20rpx;
|
||||
height: 10rpx;
|
||||
border-bottom: 3rpx solid #fff; /* 对勾下边框 */
|
||||
border-left: 3rpx solid #fff; /* 对勾左边框 */
|
||||
transform: rotate(-45deg); /* 旋转形成对勾形状 */
|
||||
}
|
||||
</style>
|
||||
@@ -6,6 +6,7 @@
|
||||
background-color="#FFFFFF"
|
||||
@maskClick="maskClickFn"
|
||||
:mask-click="maskClick"
|
||||
class="popup-fix"
|
||||
>
|
||||
<view class="popup-content">
|
||||
<view class="popup-header">
|
||||
@@ -71,6 +72,16 @@ import { ref, reactive, nextTick, onBeforeMount } from 'vue';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const { getTransformChildren } = useDictStore();
|
||||
|
||||
// 岗位类型数据
|
||||
const getJobTypeData = () => {
|
||||
return [
|
||||
{ label: '常规岗位', value: 'regular', text: '常规岗位' },
|
||||
{ label: '就业见习岗位', value: 'internship', text: '就业见习岗位' },
|
||||
{ label: '实习实训岗位', value: 'training', text: '实习实训岗位' },
|
||||
{ label: '社区实践岗位', value: 'community', text: '社区实践岗位' }
|
||||
];
|
||||
};
|
||||
|
||||
const area = ref(true);
|
||||
const maskClick = ref(false);
|
||||
const maskClickFn = ref(null);
|
||||
@@ -163,6 +174,12 @@ function getoptions() {
|
||||
if (area.value) {
|
||||
arr.push(getTransformChildren('area', '区域'));
|
||||
}
|
||||
// 添加岗位类型选项
|
||||
arr.push({
|
||||
label: '岗位类型',
|
||||
key: 'jobType',
|
||||
options: getJobTypeData()
|
||||
});
|
||||
filterOptions.value = arr;
|
||||
activeTab.value = 'education';
|
||||
}
|
||||
@@ -183,6 +200,15 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup-fix {
|
||||
position: fixed !important;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
z-index: 9999;
|
||||
}
|
||||
.popup-content {
|
||||
color: #000000;
|
||||
height: 80vh;
|
||||
@@ -320,7 +346,7 @@ defineExpose({
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 15rpx;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
}
|
||||
.content-item:first-child {
|
||||
@@ -329,8 +355,8 @@ defineExpose({
|
||||
|
||||
.check-content {
|
||||
display: grid;
|
||||
gap:16rpx;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180rpx, 1fr));
|
||||
gap: 16rpx;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180rpx, 1fr));
|
||||
place-items: stretch;
|
||||
|
||||
.checkbox-item {
|
||||
@@ -338,9 +364,9 @@ defineExpose({
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
background-color: #d9d9d9;
|
||||
|
||||
min-width: 0;
|
||||
padding: 0 10rpx;
|
||||
|
||||
min-width: 0;
|
||||
padding: 0 10rpx;
|
||||
height: 80rpx;
|
||||
background: #e8eaee;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
@@ -348,12 +374,11 @@ defineExpose({
|
||||
.option-label {
|
||||
font-size: 28rpx;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.checkedstyle {
|
||||
|
||||
height: 76rpx;
|
||||
background: rgba(37, 107, 250, 0.06);
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
@@ -362,4 +387,4 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -58,9 +58,9 @@ const state = reactive({
|
||||
visible: false,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
serchforIt();
|
||||
});
|
||||
// onMounted(() => {
|
||||
// serchforIt();
|
||||
// });
|
||||
|
||||
// 统一处理二维数组格式
|
||||
const processedListData = computed(() => {
|
||||
@@ -82,11 +82,11 @@ const open = (newConfig = {}) => {
|
||||
rowLabel: configRowLabel = 'label',
|
||||
rowKey: configRowKey = 'value',
|
||||
maskClick: configMaskClick = false,
|
||||
defaultIndex = [],
|
||||
defaultId = '',
|
||||
} = newConfig;
|
||||
|
||||
reset();
|
||||
serchforIt();
|
||||
serchforIt(defaultId);
|
||||
|
||||
if (configTitle) title.value = configTitle;
|
||||
if (typeof success === 'function') confirmCallback.value = success;
|
||||
@@ -143,11 +143,13 @@ const handleClick = async (callback) => {
|
||||
console.error('confirmCallback 执行出错:', error);
|
||||
}
|
||||
};
|
||||
function serchforIt() {
|
||||
function serchforIt(defaultId) {
|
||||
if (state.stations.length) {
|
||||
const ids = userInfo.value.jobTitleId.split(',').map((id) => Number(id));
|
||||
const ids = defaultId
|
||||
? defaultId.split(',').map((id) => Number(id))
|
||||
: userInfo.value.jobTitleId.split(',').map((id) => Number(id));
|
||||
count.value = ids.length;
|
||||
state.jobTitleId = userInfo.value.jobTitleId;
|
||||
state.jobTitleId = defaultId ? defaultId : userInfo.value.jobTitleId;
|
||||
setCheckedNodes(state.stations, ids);
|
||||
state.visible = true;
|
||||
return;
|
||||
@@ -166,14 +168,14 @@ function serchforIt() {
|
||||
|
||||
const reset = () => {
|
||||
maskClick.value = false;
|
||||
confirmCallback.value = null;
|
||||
cancelCallback.value = null;
|
||||
changeCallback.value = null;
|
||||
listData.value = [];
|
||||
selectedIndex.value = [0, 0, 0];
|
||||
rowLabel.value = 'label';
|
||||
rowKey.value = 'value';
|
||||
selectedItems.value = [];
|
||||
JobsIdsValue.value = '';
|
||||
JobsLabelValue.value = '';
|
||||
};
|
||||
|
||||
// 暴露方法给父组件
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<template>
|
||||
<view class="tabbar_container">
|
||||
<view class="tabbar_item" v-for="(item, index) in tabbarList" :key="index" @click="changeItem(item)">
|
||||
<view class="item-top" :class="[item.centerItem ? 'center-item-img' : '']">
|
||||
<view
|
||||
class="item-top"
|
||||
:class="[
|
||||
item.centerItem ? 'center-item-img ' : '',
|
||||
item.centerItem && currentItem === item.id ? 'rubberBand animated' : '',
|
||||
]"
|
||||
>
|
||||
<image :src="currentItem == item.id ? item.selectedIconPath : item.iconPath"></image>
|
||||
</view>
|
||||
<view class="badge" v-if="item.badge">{{ item.badge }}</view>
|
||||
<view class="item-bottom" :class="[currentItem == item.id ? 'item-active' : '']">
|
||||
<text>{{ item.text }}</text>
|
||||
</view>
|
||||
@@ -11,90 +18,153 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentItem: 0,
|
||||
tabbarList: [
|
||||
{
|
||||
id: 0,
|
||||
text: '首页',
|
||||
path: '/pages/index/index',
|
||||
iconPath: '../../static/tabbar/calendar.png',
|
||||
selectedIconPath: '../../static/tabbar/calendared.png',
|
||||
centerItem: false,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
text: '招聘会',
|
||||
path: '/pages/careerfair/careerfair',
|
||||
iconPath: '../../static/tabbar/post.png',
|
||||
selectedIconPath: '../../static/tabbar/posted.png',
|
||||
centerItem: false,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
text: '',
|
||||
path: '/pages/chat/chat',
|
||||
iconPath: '../../static/tabbar/logo2copy.png',
|
||||
selectedIconPath: '../../static/tabbar/logo2copy.png',
|
||||
centerItem: true,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
text: '消息',
|
||||
path: '/pages/msglog/msglog',
|
||||
iconPath: '../../static/tabbar/chat4.png',
|
||||
selectedIconPath: '../../static/tabbar/chat4ed.png',
|
||||
centerItem: false,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
text: '我的',
|
||||
path: '/pages/mine/mine',
|
||||
iconPath: '../../static/tabbar/mine.png',
|
||||
selectedIconPath: '../../static/tabbar/mined.png',
|
||||
centerItem: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
<script setup>
|
||||
import { ref, defineProps, onMounted, computed } from 'vue';
|
||||
import { useReadMsg } from '@/stores/useReadMsg';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
|
||||
const props = defineProps({
|
||||
currentpage: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0,
|
||||
},
|
||||
props: {
|
||||
currentpage: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0,
|
||||
});
|
||||
|
||||
const readMsg = useReadMsg();
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const currentItem = ref(0);
|
||||
|
||||
// 根据用户类型生成不同的导航栏配置
|
||||
const tabbarList = computed(() => {
|
||||
const baseItems = [
|
||||
{
|
||||
id: 0,
|
||||
text: '首页',
|
||||
path: '/pages/index/index',
|
||||
iconPath: '../../static/tabbar/calendar.png',
|
||||
selectedIconPath: '../../static/tabbar/calendared.png',
|
||||
centerItem: false,
|
||||
badge: readMsg.badges[0].count,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.currentItem = this.currentpage;
|
||||
uni.hideTabBar();
|
||||
},
|
||||
methods: {
|
||||
changeItem(item) {
|
||||
uni.switchTab({
|
||||
url: item.path,
|
||||
});
|
||||
{
|
||||
id: 2,
|
||||
text: '',
|
||||
path: '/pages/chat/chat',
|
||||
iconPath: '../../static/tabbar/logo3.png',
|
||||
selectedIconPath: '../../static/tabbar/logo3.png',
|
||||
centerItem: true,
|
||||
badge: readMsg.badges[2].count,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
text: '消息',
|
||||
path: '/pages/msglog/msglog',
|
||||
iconPath: '../../static/tabbar/chat4.png',
|
||||
selectedIconPath: '../../static/tabbar/chat4ed.png',
|
||||
centerItem: false,
|
||||
badge: readMsg.badges[3].count,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
text: '我的',
|
||||
path: '/pages/mine/mine',
|
||||
iconPath: '../../static/tabbar/mine.png',
|
||||
selectedIconPath: '../../static/tabbar/mined.png',
|
||||
centerItem: false,
|
||||
badge: readMsg.badges[4].count,
|
||||
},
|
||||
];
|
||||
|
||||
// 根据用户类型添加不同的导航项
|
||||
const userType = userInfo.value?.userType || 0;
|
||||
|
||||
if (userType === 0) {
|
||||
// 企业用户:显示发布岗位,隐藏招聘会
|
||||
baseItems.splice(1, 0, {
|
||||
id: 1,
|
||||
text: '发布岗位',
|
||||
path: '/pages/job/publishJob',
|
||||
iconPath: '../../static/tabbar/publish-job.svg',
|
||||
selectedIconPath: '../../static/tabbar/publish-job-selected.svg',
|
||||
centerItem: false,
|
||||
badge: 0,
|
||||
});
|
||||
} else {
|
||||
// 普通用户、网格员、政府人员:显示招聘会
|
||||
baseItems.splice(1, 0, {
|
||||
id: 1,
|
||||
text: '招聘会',
|
||||
path: '/pages/careerfair/careerfair',
|
||||
iconPath: '../../static/tabbar/post.png',
|
||||
selectedIconPath: '../../static/tabbar/posted.png',
|
||||
centerItem: false,
|
||||
badge: readMsg.badges[1].count,
|
||||
});
|
||||
}
|
||||
|
||||
return baseItems;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
uni.hideTabBar();
|
||||
currentItem.value = props.currentpage;
|
||||
});
|
||||
|
||||
const changeItem = (item) => {
|
||||
// 判断是否为 tabBar 页面
|
||||
const tabBarPages = [
|
||||
'/pages/index/index',
|
||||
'/pages/careerfair/careerfair',
|
||||
'/pages/chat/chat',
|
||||
'/pages/msglog/msglog',
|
||||
'/pages/mine/mine'
|
||||
];
|
||||
|
||||
if (tabBarPages.includes(item.path)) {
|
||||
// tabBar 页面使用 switchTab
|
||||
uni.switchTab({
|
||||
url: item.path,
|
||||
});
|
||||
} else {
|
||||
// 非 tabBar 页面使用 navigateTo
|
||||
uni.navigateTo({
|
||||
url: item.path,
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: 4rpx;
|
||||
right: 20rpx;
|
||||
min-width: 30rpx;
|
||||
height: 30rpx;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
border-radius: 15rpx;
|
||||
text-align: center;
|
||||
line-height: 30rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.tabbar_container {
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
left: 0rpx;
|
||||
width: 100%;
|
||||
height: 126rpx;
|
||||
// box-shadow: 0 0 5px #999;
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5rpx 0;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 998;
|
||||
overflow: hidden;
|
||||
// position: fixed;
|
||||
// bottom: 0rpx;
|
||||
// left: 0rpx;
|
||||
// box-shadow: 0 0 5px #999;
|
||||
// padding-bottom: env(safe-area-inset-bottom);
|
||||
// z-index: 998;
|
||||
.tabbar_item {
|
||||
width: 33.33%;
|
||||
height: 100rpx;
|
||||
@@ -120,12 +190,12 @@ export default {
|
||||
}
|
||||
}
|
||||
.center-item-img {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
width: 96rpx !important;
|
||||
height: 96rpx !important;
|
||||
// position: absolute;
|
||||
// top: 0rpx;
|
||||
// left: 50%;
|
||||
// transform: translate(-50%, 0);
|
||||
width: 108rpx !important;
|
||||
height: 98rpx !important;
|
||||
}
|
||||
.item-active {
|
||||
color: #256bfa;
|
||||
|
||||
23
config.js
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
||||
baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
|
||||
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
||||
// sseAI+
|
||||
// StreamBaseURl: 'http://39.98.44.136:8000',
|
||||
StreamBaseURl: 'https://qd.zhaopinzao8dian.com/ai',
|
||||
@@ -14,12 +14,14 @@ export default {
|
||||
DBversion: 2,
|
||||
// 只使用本地缓寸的数据
|
||||
OnlyUseCachedDB: true,
|
||||
// 使用模拟定位
|
||||
UsingSimulatedPositioning: true,
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
name: "青岛市就业服务",
|
||||
// 地区名
|
||||
areaName: '青岛市',
|
||||
areaName: '喀什',
|
||||
// AI名称
|
||||
AIName: '小红',
|
||||
// 应用版本
|
||||
@@ -39,7 +41,9 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
// AI -> 上传文件数量
|
||||
allowedFileNumber: 2,
|
||||
// AI -> 上传文件类型
|
||||
allowedFileTypes: [
|
||||
"text/plain", // .txt
|
||||
"text/markdown", // .md
|
||||
@@ -52,5 +56,18 @@ export default {
|
||||
"text/csv", // .csv
|
||||
"application/vnd.ms-excel", // .xls
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" // .xlsx
|
||||
]
|
||||
],
|
||||
// 首页询问 -> 推荐权重
|
||||
weights: {
|
||||
categories: 1, //岗位
|
||||
experience: 0.3, //经验
|
||||
salary: 0.5, // 薪资
|
||||
areas: 0.5 // 区域
|
||||
},
|
||||
shareConfig: {
|
||||
baseUrl: 'https://qd.zhaopinzao8dian.com',
|
||||
title: '找工作,用 AI 更高效|青岛市智能求职平台',
|
||||
desc: '融合海量岗位、智能简历匹配、竞争力分析,助你精准锁定理想职位!',
|
||||
imgUrl: 'https://qd.zhaopinzao8dian.com/file/csn/qd_shareLogo.jpg',
|
||||
}
|
||||
}
|
||||
173
hook/usePagination.js
Normal file
@@ -0,0 +1,173 @@
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
watch,
|
||||
isRef,
|
||||
nextTick
|
||||
} from 'vue'
|
||||
|
||||
export function usePagination(
|
||||
requestFn,
|
||||
transformFn,
|
||||
options = {}
|
||||
) {
|
||||
const list = ref([])
|
||||
const loading = ref(false)
|
||||
const error = ref(false)
|
||||
const finished = ref(false)
|
||||
const firstLoading = ref(true)
|
||||
const empty = ref(false)
|
||||
|
||||
const {
|
||||
pageSize = 10,
|
||||
search = {},
|
||||
autoWatchSearch = false,
|
||||
debounceTime = 300,
|
||||
autoFetch = false,
|
||||
|
||||
// 字段映射
|
||||
dataKey = 'rows',
|
||||
totalKey = 'total',
|
||||
|
||||
// 分页字段名映射
|
||||
pageField = 'current',
|
||||
sizeField = 'pageSize',
|
||||
|
||||
onBeforeRequest,
|
||||
onAfterRequest
|
||||
} = options
|
||||
|
||||
const pageState = reactive({
|
||||
page: 1,
|
||||
pageSize: isRef(pageSize) ? pageSize.value : pageSize,
|
||||
total: 0,
|
||||
maxPage: 1,
|
||||
search: isRef(search) ? search.value : search
|
||||
})
|
||||
|
||||
let debounceTimer = null
|
||||
|
||||
const fetchData = async (type = 'refresh') => {
|
||||
if (loading.value) return Promise.resolve()
|
||||
console.log(type)
|
||||
loading.value = true
|
||||
error.value = false
|
||||
|
||||
if (typeof onBeforeRequest === 'function') {
|
||||
try {
|
||||
onBeforeRequest(type, pageState)
|
||||
} catch (err) {
|
||||
console.warn('onBeforeRequest 执行异常:', err)
|
||||
}
|
||||
}
|
||||
|
||||
if (type === 'refresh') {
|
||||
pageState.page = 1
|
||||
finished.value = false
|
||||
if (list.value.length === 0) {
|
||||
firstLoading.value = true
|
||||
}
|
||||
} else if (type === 'loadMore') {
|
||||
if (pageState.page >= pageState.maxPage) {
|
||||
loading.value = false
|
||||
finished.value = true
|
||||
return Promise.resolve('no more')
|
||||
}
|
||||
pageState.page += 1
|
||||
}
|
||||
|
||||
const params = {
|
||||
...pageState.search,
|
||||
[pageField]: pageState.page,
|
||||
[sizeField]: pageState.pageSize,
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await requestFn(params)
|
||||
|
||||
const rawData = res[dataKey]
|
||||
const total = res[totalKey] || 99999999
|
||||
console.log(total, rawData)
|
||||
const data = typeof transformFn === 'function' ? transformFn(rawData) : rawData
|
||||
|
||||
if (type === 'refresh') {
|
||||
list.value = data
|
||||
} else {
|
||||
list.value.push(...data)
|
||||
}
|
||||
|
||||
pageState.total = total
|
||||
pageState.maxPage = Math.ceil(total / pageState.pageSize)
|
||||
|
||||
finished.value = list.value.length >= total
|
||||
empty.value = list.value.length === 0
|
||||
} catch (err) {
|
||||
console.error('分页请求失败:', err)
|
||||
error.value = true
|
||||
} finally {
|
||||
loading.value = false
|
||||
firstLoading.value = false
|
||||
|
||||
if (typeof onAfterRequest === 'function') {
|
||||
try {
|
||||
onAfterRequest(type, pageState, {
|
||||
error: error.value
|
||||
})
|
||||
} catch (err) {
|
||||
console.warn('onAfterRequest 执行异常:', err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const refresh = () => fetchData('refresh')
|
||||
const loadMore = () => fetchData('loadMore')
|
||||
|
||||
const resetPagination = () => {
|
||||
list.value = []
|
||||
pageState.page = 1
|
||||
pageState.total = 0
|
||||
pageState.maxPage = 1
|
||||
finished.value = false
|
||||
error.value = false
|
||||
firstLoading.value = true
|
||||
empty.value = false
|
||||
}
|
||||
|
||||
if (autoWatchSearch && isRef(search)) {
|
||||
watch(search, (newVal) => {
|
||||
pageState.search = newVal
|
||||
clearTimeout(debounceTimer)
|
||||
debounceTimer = setTimeout(() => {
|
||||
refresh()
|
||||
}, debounceTime)
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
}
|
||||
|
||||
watch(pageSize, (newVal) => {
|
||||
pageState.pageSize = newVal
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
|
||||
if (autoFetch) {
|
||||
nextTick(() => {
|
||||
refresh()
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
list,
|
||||
loading,
|
||||
error,
|
||||
finished,
|
||||
firstLoading,
|
||||
empty,
|
||||
pageState,
|
||||
refresh,
|
||||
loadMore,
|
||||
resetPagination
|
||||
}
|
||||
}
|
||||
@@ -1,387 +1,246 @@
|
||||
import {
|
||||
ref,
|
||||
onUnmounted
|
||||
} from 'vue';
|
||||
} from 'vue'
|
||||
import {
|
||||
$api,
|
||||
|
||||
function mergeText(prevText, newText) {
|
||||
if (newText.startsWith(prevText)) {
|
||||
return newText; // 直接替换,避免重复拼接
|
||||
} from '../common/globalFunction';
|
||||
|
||||
import config from '@/config'
|
||||
|
||||
export function useAudioRecorder() {
|
||||
const isRecording = ref(false)
|
||||
const isStopping = ref(false)
|
||||
const isSocketConnected = ref(false)
|
||||
const recordingDuration = ref(0)
|
||||
|
||||
const audioDataForDisplay = ref(new Array(16).fill(0))
|
||||
const volumeLevel = ref(0)
|
||||
|
||||
const recognizedText = ref('')
|
||||
const lastFinalText = ref('')
|
||||
|
||||
let audioStream = null
|
||||
let audioContext = null
|
||||
let audioInput = null
|
||||
let scriptProcessor = null
|
||||
let websocket = null
|
||||
let durationTimer = null
|
||||
|
||||
const generateUUID = () => {
|
||||
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11)
|
||||
.replace(/[018]/g, c =>
|
||||
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
||||
).replace(/-/g, '')
|
||||
}
|
||||
return prevText + newText; // 兼容意外情况
|
||||
}
|
||||
|
||||
export function useAudioRecorder(wsUrl) {
|
||||
// 状态变量
|
||||
const isRecording = ref(false);
|
||||
const isStopping = ref(false);
|
||||
const isSocketConnected = ref(false);
|
||||
const recordingDuration = ref(0);
|
||||
const audioDataForDisplay = ref(new Array(16).fill(0.01));
|
||||
const volumeLevel = ref(0);
|
||||
const fetchWsUrl = async () => {
|
||||
const res = await $api.createRequest('/app/speech/getToken')
|
||||
if (res.code !== 200) throw new Error('无法获取语音识别 wsUrl')
|
||||
const wsUrl = res.msg
|
||||
return wsUrl
|
||||
}
|
||||
|
||||
// 音频相关
|
||||
const audioContext = ref(null);
|
||||
const mediaStream = ref(null);
|
||||
const workletNode = ref(null);
|
||||
const analyser = ref(null);
|
||||
|
||||
// 网络相关
|
||||
const socket = ref(null);
|
||||
|
||||
// 配置常量
|
||||
const SAMPLE_RATE = 16000;
|
||||
const SILENCE_THRESHOLD = 0.02; // 静音阈值 (0-1)
|
||||
const SILENCE_DURATION = 100; // 静音持续时间(ms)后切片
|
||||
const MIN_SOUND_DURATION = 200; // 最小有效声音持续时间(ms)
|
||||
|
||||
// 音频处理变量
|
||||
const lastSoundTime = ref(0);
|
||||
const audioChunks = ref([]);
|
||||
const currentChunkStartTime = ref(0);
|
||||
const silenceStartTime = ref(0);
|
||||
|
||||
// 语音识别结果
|
||||
const recognizedText = ref('');
|
||||
const lastFinalText = ref(''); // 保存最终确认的文本
|
||||
|
||||
// AudioWorklet处理器代码
|
||||
const workletProcessorCode = `
|
||||
class AudioProcessor extends AudioWorkletProcessor {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.silenceThreshold = options.processorOptions.silenceThreshold;
|
||||
this.sampleRate = options.processorOptions.sampleRate;
|
||||
this.samplesPerChunk = Math.floor(this.sampleRate * 0.05); // 50ms的块
|
||||
this.buffer = new Int16Array(this.samplesPerChunk);
|
||||
this.index = 0;
|
||||
this.lastUpdate = 0;
|
||||
}
|
||||
|
||||
calculateVolume(inputs) {
|
||||
const input = inputs[0];
|
||||
if (!input || input.length === 0) return 0;
|
||||
|
||||
let sum = 0;
|
||||
const inputChannel = input[0];
|
||||
for (let i = 0; i < inputChannel.length; i++) {
|
||||
sum += inputChannel[i] * inputChannel[i];
|
||||
}
|
||||
return Math.sqrt(sum / inputChannel.length);
|
||||
}
|
||||
|
||||
process(inputs) {
|
||||
const now = currentTime;
|
||||
const volume = this.calculateVolume(inputs);
|
||||
|
||||
// 每50ms发送一次分析数据
|
||||
if (now - this.lastUpdate > 0.05) {
|
||||
this.lastUpdate = now;
|
||||
|
||||
// 简单的频率分析 (模拟16个频段)
|
||||
const simulatedFreqData = [];
|
||||
for (let i = 0; i < 16; i++) {
|
||||
simulatedFreqData.push(
|
||||
Math.min(1, volume * 10 + (Math.random() * 0.2 - 0.1))
|
||||
);
|
||||
}
|
||||
|
||||
this.port.postMessage({
|
||||
type: 'analysis',
|
||||
volume: volume,
|
||||
frequencyData: simulatedFreqData,
|
||||
isSilent: volume < this.silenceThreshold,
|
||||
timestamp: now
|
||||
});
|
||||
}
|
||||
|
||||
// 原始音频处理
|
||||
const input = inputs[0];
|
||||
if (input && input.length > 0) {
|
||||
const inputChannel = input[0];
|
||||
for (let i = 0; i < inputChannel.length; i++) {
|
||||
this.buffer[this.index++] = Math.max(-32768, Math.min(32767, inputChannel[i] * 32767));
|
||||
|
||||
if (this.index >= this.samplesPerChunk) {
|
||||
this.port.postMessage({
|
||||
type: 'audio',
|
||||
audioData: this.buffer.buffer,
|
||||
timestamp: now
|
||||
}, [this.buffer.buffer]);
|
||||
|
||||
this.buffer = new Int16Array(this.samplesPerChunk);
|
||||
this.index = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
function extractWsParams(wsUrl) {
|
||||
const url = new URL(wsUrl)
|
||||
const appkey = url.searchParams.get('appkey')
|
||||
const token = url.searchParams.get('token')
|
||||
return {
|
||||
appkey,
|
||||
token
|
||||
}
|
||||
}
|
||||
registerProcessor('audio-processor', AudioProcessor);
|
||||
`;
|
||||
|
||||
// 初始化WebSocket连接
|
||||
const initSocket = (wsUrl) => {
|
||||
|
||||
const connectWebSocket = async () => {
|
||||
const wsUrl = await fetchWsUrl()
|
||||
const {
|
||||
appkey,
|
||||
token
|
||||
} = extractWsParams(wsUrl)
|
||||
return new Promise((resolve, reject) => {
|
||||
socket.value = new WebSocket(wsUrl);
|
||||
websocket = new WebSocket(wsUrl)
|
||||
websocket.binaryType = 'arraybuffer'
|
||||
|
||||
socket.value.onopen = () => {
|
||||
console.log('open')
|
||||
isSocketConnected.value = true;
|
||||
resolve();
|
||||
};
|
||||
websocket.onopen = () => {
|
||||
isSocketConnected.value = true
|
||||
|
||||
socket.value.onerror = (error) => {
|
||||
reject(error);
|
||||
};
|
||||
// 发送 StartTranscription 消息(参考 demo.html)
|
||||
const startTranscriptionMessage = {
|
||||
header: {
|
||||
appkey: appkey, // 不影响使用,可留空或由 wsUrl 带入
|
||||
namespace: 'SpeechTranscriber',
|
||||
name: 'StartTranscription',
|
||||
task_id: generateUUID(),
|
||||
message_id: generateUUID()
|
||||
},
|
||||
payload: {
|
||||
format: 'pcm',
|
||||
sample_rate: 16000,
|
||||
enable_intermediate_result: true,
|
||||
enable_punctuation_prediction: true,
|
||||
enable_inverse_text_normalization: true
|
||||
}
|
||||
}
|
||||
websocket.send(JSON.stringify(startTranscriptionMessage))
|
||||
resolve()
|
||||
}
|
||||
|
||||
socket.value.onclose = () => {
|
||||
isSocketConnected.value = false;
|
||||
};
|
||||
websocket.onerror = (e) => {
|
||||
isSocketConnected.value = false
|
||||
reject(e)
|
||||
}
|
||||
|
||||
socket.value.onmessage = handleMessage;
|
||||
});
|
||||
};
|
||||
websocket.onclose = () => {
|
||||
isSocketConnected.value = false
|
||||
}
|
||||
|
||||
const handleMessage = (values) => {
|
||||
try {
|
||||
const data = JSON.parse(event.data);
|
||||
if (data.text) {
|
||||
const {
|
||||
asrEnd,
|
||||
text
|
||||
} = data
|
||||
if (asrEnd === 'true') {
|
||||
recognizedText.value += data.text;
|
||||
} else {
|
||||
lastFinalText.value = '';
|
||||
websocket.onmessage = (e) => {
|
||||
const msg = JSON.parse(e.data)
|
||||
const name = msg?.header?.name
|
||||
const payload = msg?.payload
|
||||
|
||||
switch (name) {
|
||||
case 'TranscriptionResultChanged': {
|
||||
// 中间识别文本(可选:使用 stash_result.unfixedText 更精确)
|
||||
const text = payload?.unfixed_result || payload?.result || ''
|
||||
lastFinalText.value = text
|
||||
break
|
||||
}
|
||||
case 'SentenceBegin': {
|
||||
// 可选:开始新的一句,重置状态
|
||||
// console.log('开始新的句子识别')
|
||||
break
|
||||
}
|
||||
case 'SentenceEnd': {
|
||||
const text = payload?.result || ''
|
||||
const confidence = payload?.confidence || 0
|
||||
if (text && confidence > 0.5) {
|
||||
recognizedText.value += text
|
||||
lastFinalText.value = ''
|
||||
// console.log('识别完成:', {
|
||||
// text,
|
||||
// confidence
|
||||
// })
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'TranscriptionStarted': {
|
||||
// console.log('识别任务已开始')
|
||||
break
|
||||
}
|
||||
case 'TranscriptionCompleted': {
|
||||
lastFinalText.value = ''
|
||||
// console.log('识别全部完成')
|
||||
break
|
||||
}
|
||||
case 'TaskFailed': {
|
||||
console.error('识别失败:', msg?.header?.status_text)
|
||||
break
|
||||
}
|
||||
default:
|
||||
console.log('未知消息类型:', name, msg)
|
||||
break
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('解析识别结果失败:', error);
|
||||
})
|
||||
}
|
||||
|
||||
const startRecording = async () => {
|
||||
if (isRecording.value) return
|
||||
try {
|
||||
recognizedText.value = ''
|
||||
lastFinalText.value = ''
|
||||
await connectWebSocket()
|
||||
|
||||
audioStream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: true
|
||||
})
|
||||
audioContext = new(window.AudioContext || window.webkitAudioContext)({
|
||||
sampleRate: 16000
|
||||
})
|
||||
audioInput = audioContext.createMediaStreamSource(audioStream)
|
||||
scriptProcessor = audioContext.createScriptProcessor(2048, 1, 1)
|
||||
|
||||
scriptProcessor.onaudioprocess = (event) => {
|
||||
const input = event.inputBuffer.getChannelData(0)
|
||||
const pcm = new Int16Array(input.length)
|
||||
let sum = 0
|
||||
for (let i = 0; i < input.length; ++i) {
|
||||
const s = Math.max(-1, Math.min(1, input[i]))
|
||||
pcm[i] = s * 0x7FFF
|
||||
sum += s * s
|
||||
}
|
||||
|
||||
volumeLevel.value = Math.sqrt(sum / input.length)
|
||||
audioDataForDisplay.value = Array(16).fill(volumeLevel.value)
|
||||
|
||||
if (websocket?.readyState === WebSocket.OPEN) {
|
||||
websocket.send(pcm.buffer)
|
||||
}
|
||||
}
|
||||
|
||||
audioInput.connect(scriptProcessor)
|
||||
scriptProcessor.connect(audioContext.destination)
|
||||
|
||||
isRecording.value = true
|
||||
recordingDuration.value = 0
|
||||
durationTimer = setInterval(() => recordingDuration.value++, 1000)
|
||||
} catch (err) {
|
||||
console.error('启动失败:', err)
|
||||
cleanup()
|
||||
}
|
||||
}
|
||||
|
||||
// 处理音频切片
|
||||
const processAudioChunk = (isSilent) => {
|
||||
const now = Date.now();
|
||||
const stopRecording = () => {
|
||||
if (!isRecording.value || isStopping.value) return
|
||||
isStopping.value = true
|
||||
|
||||
if (!isSilent) {
|
||||
// 检测到声音
|
||||
lastSoundTime.value = now;
|
||||
|
||||
if (silenceStartTime.value > 0) {
|
||||
// 从静音恢复到有声音
|
||||
silenceStartTime.value = 0;
|
||||
}
|
||||
} else {
|
||||
// 静音状态
|
||||
if (silenceStartTime.value === 0) {
|
||||
silenceStartTime.value = now;
|
||||
}
|
||||
|
||||
// 检查是否达到静音切片条件
|
||||
if (now - silenceStartTime.value >= SILENCE_DURATION &&
|
||||
now - currentChunkStartTime.value >= MIN_SOUND_DURATION) {
|
||||
sendCurrentChunk();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 发送当前音频块
|
||||
const sendCurrentChunk = () => {
|
||||
if (audioChunks.value.length === 0 || !socket.value || socket.value.readyState !== WebSocket.OPEN) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 合并所有块
|
||||
const totalBytes = audioChunks.value.reduce((total, chunk) => total + chunk.byteLength, 0);
|
||||
const combined = new Int16Array(totalBytes / 2);
|
||||
let offset = 0;
|
||||
|
||||
audioChunks.value.forEach(chunk => {
|
||||
const samples = new Int16Array(chunk);
|
||||
combined.set(samples, offset);
|
||||
offset += samples.length;
|
||||
});
|
||||
|
||||
// 发送合并后的数据
|
||||
socket.value.send(combined.buffer);
|
||||
audioChunks.value = [];
|
||||
|
||||
// 记录新块的开始时间
|
||||
currentChunkStartTime.value = Date.now();
|
||||
silenceStartTime.value = 0;
|
||||
} catch (error) {
|
||||
console.error('发送音频数据时出错:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 开始录音
|
||||
const startRecording = async () => {
|
||||
if (isRecording.value) return;
|
||||
|
||||
try {
|
||||
// 重置状态
|
||||
recognizedText.value = '';
|
||||
lastFinalText.value = '';
|
||||
// 重置状态
|
||||
recordingDuration.value = 0;
|
||||
audioChunks.value = [];
|
||||
lastSoundTime.value = 0;
|
||||
currentChunkStartTime.value = Date.now();
|
||||
silenceStartTime.value = 0;
|
||||
|
||||
// 初始化WebSocket
|
||||
await initSocket(wsUrl);
|
||||
|
||||
// 获取音频流
|
||||
mediaStream.value = await navigator.mediaDevices.getUserMedia({
|
||||
audio: {
|
||||
sampleRate: SAMPLE_RATE,
|
||||
channelCount: 1,
|
||||
echoCancellation: true,
|
||||
noiseSuppression: true,
|
||||
autoGainControl: false
|
||||
},
|
||||
video: false
|
||||
});
|
||||
|
||||
// 创建音频上下文
|
||||
audioContext.value = new(window.AudioContext || window.webkitAudioContext)({
|
||||
sampleRate: SAMPLE_RATE
|
||||
});
|
||||
|
||||
// 注册AudioWorklet
|
||||
const blob = new Blob([workletProcessorCode], {
|
||||
type: 'application/javascript'
|
||||
});
|
||||
const workletUrl = URL.createObjectURL(blob);
|
||||
await audioContext.value.audioWorklet.addModule(workletUrl);
|
||||
URL.revokeObjectURL(workletUrl);
|
||||
|
||||
// 创建AudioWorkletNode
|
||||
workletNode.value = new AudioWorkletNode(audioContext.value, 'audio-processor', {
|
||||
processorOptions: {
|
||||
silenceThreshold: SILENCE_THRESHOLD,
|
||||
sampleRate: SAMPLE_RATE
|
||||
if (websocket?.readyState === WebSocket.OPEN) {
|
||||
websocket.send(JSON.stringify({
|
||||
header: {
|
||||
namespace: 'SpeechTranscriber',
|
||||
name: 'StopTranscription',
|
||||
message_id: generateUUID()
|
||||
}
|
||||
});
|
||||
|
||||
// 处理音频数据
|
||||
workletNode.value.port.onmessage = (e) => {
|
||||
if (e.data.type === 'audio') {
|
||||
audioChunks.value.push(e.data.audioData);
|
||||
} else if (e.data.type === 'analysis') {
|
||||
audioDataForDisplay.value = e.data.frequencyData;
|
||||
volumeLevel.value = e.data.volume;
|
||||
processAudioChunk(e.data.isSilent);
|
||||
}
|
||||
};
|
||||
|
||||
// 连接音频节点
|
||||
const source = audioContext.value.createMediaStreamSource(mediaStream.value);
|
||||
source.connect(workletNode.value);
|
||||
workletNode.value.connect(audioContext.value.destination);
|
||||
|
||||
isRecording.value = true;
|
||||
|
||||
} catch (error) {
|
||||
console.error('启动录音失败:', error);
|
||||
cleanup();
|
||||
throw error;
|
||||
}))
|
||||
websocket.close()
|
||||
}
|
||||
};
|
||||
|
||||
// 停止录音
|
||||
const stopRecording = async () => {
|
||||
if (!isRecording.value || isStopping.value) return;
|
||||
cleanup()
|
||||
isStopping.value = false
|
||||
}
|
||||
|
||||
isStopping.value = true;
|
||||
const cancelRecording = () => {
|
||||
if (!isRecording.value || isStopping.value) return
|
||||
isStopping.value = true
|
||||
websocket?.close()
|
||||
cleanup()
|
||||
isStopping.value = false
|
||||
}
|
||||
|
||||
try {
|
||||
// 发送最后一个音频块(无论是否静音)
|
||||
sendCurrentChunk();
|
||||
|
||||
// 发送结束标记
|
||||
if (socket.value?.readyState === WebSocket.OPEN) {
|
||||
socket.value.send(JSON.stringify({
|
||||
action: 'end',
|
||||
duration: recordingDuration.value
|
||||
}));
|
||||
|
||||
await new Promise(resolve => {
|
||||
if (socket.value.bufferedAmount === 0) {
|
||||
resolve();
|
||||
} else {
|
||||
const timer = setInterval(() => {
|
||||
if (socket.value.bufferedAmount === 0) {
|
||||
clearInterval(timer);
|
||||
resolve();
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
socket.value.close();
|
||||
}
|
||||
|
||||
cleanup();
|
||||
|
||||
} catch (error) {
|
||||
console.error('停止录音时出错:', error);
|
||||
throw error;
|
||||
} finally {
|
||||
isStopping.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 清理资源
|
||||
const cleanup = () => {
|
||||
if (mediaStream.value) {
|
||||
mediaStream.value.getTracks().forEach(track => track.stop());
|
||||
mediaStream.value = null;
|
||||
}
|
||||
clearInterval(durationTimer)
|
||||
|
||||
if (workletNode.value) {
|
||||
workletNode.value.disconnect();
|
||||
workletNode.value = null;
|
||||
}
|
||||
scriptProcessor?.disconnect()
|
||||
audioInput?.disconnect()
|
||||
audioStream?.getTracks().forEach(track => track.stop())
|
||||
audioContext?.close()
|
||||
|
||||
if (audioContext.value && audioContext.value.state !== 'closed') {
|
||||
audioContext.value.close();
|
||||
audioContext.value = null;
|
||||
}
|
||||
audioStream = null
|
||||
audioContext = null
|
||||
audioInput = null
|
||||
scriptProcessor = null
|
||||
websocket = null
|
||||
|
||||
audioChunks.value = [];
|
||||
isRecording.value = false;
|
||||
isSocketConnected.value = false;
|
||||
};
|
||||
|
||||
/// 取消录音
|
||||
const cancelRecording = async () => {
|
||||
if (!isRecording.value || isStopping.value) return;
|
||||
isStopping.value = true;
|
||||
try {
|
||||
if (socket.value?.readyState === WebSocket.OPEN) {
|
||||
console.log('发送结束标记...');
|
||||
socket.value.send(JSON.stringify({
|
||||
action: 'cancel'
|
||||
}));
|
||||
socket.value.close();
|
||||
}
|
||||
cleanup()
|
||||
} catch (error) {
|
||||
console.error('取消录音时出错:', error);
|
||||
throw error;
|
||||
} finally {
|
||||
isStopping.value = false;
|
||||
}
|
||||
};
|
||||
isRecording.value = false
|
||||
isSocketConnected.value = false
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (isRecording.value) {
|
||||
stopRecording();
|
||||
}
|
||||
});
|
||||
if (isRecording.value) stopRecording()
|
||||
})
|
||||
|
||||
return {
|
||||
isRecording,
|
||||
@@ -390,10 +249,10 @@ export function useAudioRecorder(wsUrl) {
|
||||
recordingDuration,
|
||||
audioDataForDisplay,
|
||||
volumeLevel,
|
||||
startRecording,
|
||||
stopRecording,
|
||||
recognizedText,
|
||||
lastFinalText,
|
||||
startRecording,
|
||||
stopRecording,
|
||||
cancelRecording
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -28,27 +28,57 @@ export function useTTSPlayer(wsUrl) {
|
||||
let activePlayId = 0
|
||||
|
||||
const speak = (text) => {
|
||||
console.log('🎤 TTS speak function called');
|
||||
console.log('📝 Text to synthesize:', text ? text.substring(0, 100) + '...' : 'No text');
|
||||
console.log('🔗 WebSocket URL:', wsUrl);
|
||||
|
||||
currentPlayId++
|
||||
const myPlayId = currentPlayId
|
||||
console.log('🆔 Play ID:', myPlayId);
|
||||
|
||||
reset()
|
||||
pendingText = text
|
||||
activePlayId = myPlayId
|
||||
|
||||
console.log('✅ Speak function setup complete');
|
||||
}
|
||||
|
||||
const pause = () => {
|
||||
console.log('⏸️ TTS pause called');
|
||||
console.log('🔊 AudioContext state:', audioContext.state);
|
||||
console.log('🔊 Is speaking before pause:', isSpeaking.value);
|
||||
console.log('⏸️ Is paused before pause:', isPaused.value);
|
||||
|
||||
if (audioContext.state === 'running') {
|
||||
audioContext.suspend()
|
||||
isPaused.value = true
|
||||
isSpeaking.value = false
|
||||
// 不要设置 isSpeaking.value = false,保持当前状态
|
||||
console.log('✅ Audio paused successfully');
|
||||
} else {
|
||||
console.log('⚠️ AudioContext is not running, cannot pause');
|
||||
}
|
||||
|
||||
console.log('🔊 Is speaking after pause:', isSpeaking.value);
|
||||
console.log('⏸️ Is paused after pause:', isPaused.value);
|
||||
}
|
||||
|
||||
const resume = () => {
|
||||
console.log('▶️ TTS resume called');
|
||||
console.log('🔊 AudioContext state:', audioContext.state);
|
||||
console.log('🔊 Is speaking before resume:', isSpeaking.value);
|
||||
console.log('⏸️ Is paused before resume:', isPaused.value);
|
||||
|
||||
if (audioContext.state === 'suspended') {
|
||||
audioContext.resume()
|
||||
isPaused.value = false
|
||||
isSpeaking.value = true
|
||||
console.log('✅ Audio resumed successfully');
|
||||
} else {
|
||||
console.log('⚠️ AudioContext is not suspended, cannot resume');
|
||||
}
|
||||
|
||||
console.log('🔊 Is speaking after resume:', isSpeaking.value);
|
||||
console.log('⏸️ Is paused after resume:', isPaused.value);
|
||||
}
|
||||
|
||||
const cancelAudio = () => {
|
||||
@@ -89,16 +119,42 @@ export function useTTSPlayer(wsUrl) {
|
||||
|
||||
const initWebSocket = () => {
|
||||
const thisPlayId = currentPlayId
|
||||
console.log('🔌 Initializing WebSocket connection');
|
||||
console.log('🔗 WebSocket URL:', wsUrl);
|
||||
console.log('🆔 This play ID:', thisPlayId);
|
||||
|
||||
socket = new WebSocket(wsUrl)
|
||||
socket.binaryType = 'arraybuffer'
|
||||
|
||||
// 设置心跳检测,避免超时
|
||||
const heartbeatInterval = setInterval(() => {
|
||||
if (socket && socket.readyState === WebSocket.OPEN) {
|
||||
socket.send(JSON.stringify({ type: 'ping' }));
|
||||
}
|
||||
}, 30000); // 每30秒发送一次心跳
|
||||
|
||||
socket.onopen = () => {
|
||||
console.log('✅ WebSocket connection opened');
|
||||
if (pendingText && thisPlayId === activePlayId) {
|
||||
const seepdText = extractSpeechText(pendingText)
|
||||
console.log('📤 Sending text to TTS server:', seepdText.substring(0, 100) + '...');
|
||||
socket.send(seepdText)
|
||||
pendingText = null
|
||||
} else {
|
||||
console.log('❌ No pending text or play ID mismatch');
|
||||
console.log('📝 Pending text exists:', !!pendingText);
|
||||
console.log('🆔 Play ID match:', thisPlayId === activePlayId);
|
||||
}
|
||||
}
|
||||
|
||||
socket.onerror = (error) => {
|
||||
console.error('❌ WebSocket error:', error);
|
||||
}
|
||||
|
||||
socket.onclose = (event) => {
|
||||
console.log('🔌 WebSocket connection closed:', event.code, event.reason);
|
||||
clearInterval(heartbeatInterval);
|
||||
}
|
||||
|
||||
socket.onmessage = async (e) => {
|
||||
if (thisPlayId !== activePlayId) return // 忽略旧播放的消息
|
||||
@@ -106,13 +162,19 @@ export function useTTSPlayer(wsUrl) {
|
||||
if (typeof e.data === 'string') {
|
||||
try {
|
||||
const msg = JSON.parse(e.data)
|
||||
console.log('📨 TTS server message:', msg);
|
||||
if (msg.status === 'complete') {
|
||||
console.log('✅ TTS synthesis completed');
|
||||
isComplete.value = true
|
||||
// 计算剩余播放时间,确保播放完整
|
||||
const remainingTime = Math.max(0, (playTime - audioContext.currentTime) * 1000);
|
||||
console.log('⏱️ Remaining play time:', remainingTime + 'ms');
|
||||
setTimeout(() => {
|
||||
if (thisPlayId === activePlayId) {
|
||||
console.log('🔇 TTS playback finished, setting isSpeaking to false');
|
||||
isSpeaking.value = false
|
||||
}
|
||||
}, (playTime - audioContext.currentTime) * 1000)
|
||||
}, remainingTime + 500) // 额外500ms缓冲时间
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[TTSPlayer] 文本消息:', e.data)
|
||||
@@ -156,8 +218,10 @@ export function useTTSPlayer(wsUrl) {
|
||||
}
|
||||
|
||||
const playBuffer = (audioBuffer) => {
|
||||
console.log('🎵 playBuffer called, duration:', audioBuffer.duration + 's');
|
||||
if (!isSpeaking.value) {
|
||||
playTime = audioContext.currentTime
|
||||
console.log('🎵 Starting new audio playback at time:', playTime);
|
||||
}
|
||||
const source = audioContext.createBufferSource()
|
||||
source.buffer = audioBuffer
|
||||
@@ -166,6 +230,12 @@ export function useTTSPlayer(wsUrl) {
|
||||
sourceNodes.push(source)
|
||||
playTime += audioBuffer.duration
|
||||
isSpeaking.value = true
|
||||
console.log('🎵 Audio scheduled, new playTime:', playTime);
|
||||
|
||||
// 添加音频播放结束监听
|
||||
source.onended = () => {
|
||||
console.log('🎵 Audio buffer finished playing');
|
||||
}
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -203,6 +273,10 @@ export function useTTSPlayer(wsUrl) {
|
||||
}
|
||||
|
||||
function extractSpeechText(markdown) {
|
||||
console.log('🔍 extractSpeechText called');
|
||||
console.log('📝 Input markdown length:', markdown ? markdown.length : 0);
|
||||
console.log('📝 Input markdown preview:', markdown ? markdown.substring(0, 200) + '...' : 'No markdown');
|
||||
|
||||
const jobRegex = /``` job-json\s*({[\s\S]*?})\s*```/g;
|
||||
const jobs = [];
|
||||
let match;
|
||||
@@ -219,11 +293,16 @@ function extractSpeechText(markdown) {
|
||||
firstJobStartIndex = match.index;
|
||||
}
|
||||
lastJobEndIndex = jobRegex.lastIndex;
|
||||
console.log('✅ Found job:', job.jobTitle);
|
||||
} catch (e) {
|
||||
console.warn('JSON 解析失败', e);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('📊 Jobs found:', jobs.length);
|
||||
console.log('📍 First job start index:', firstJobStartIndex);
|
||||
console.log('📍 Last job end index:', lastJobEndIndex);
|
||||
|
||||
// 提取引导语(第一个 job-json 之前的文字)
|
||||
const guideText = firstJobStartIndex > 0 ?
|
||||
markdown.slice(0, firstJobStartIndex).trim() :
|
||||
@@ -234,6 +313,9 @@ function extractSpeechText(markdown) {
|
||||
markdown.slice(lastJobEndIndex).trim() :
|
||||
'';
|
||||
|
||||
console.log('📝 Guide text:', guideText);
|
||||
console.log('📝 Ending text:', endingText);
|
||||
|
||||
// 岗位信息格式化为语音文本
|
||||
const jobTexts = jobs.map((job, index) => {
|
||||
return `第 ${index + 1} 个岗位,岗位名称是:${job.jobTitle},公司是:${job.companyName},薪资:${job.salary},地点:${job.location},学历要求:${job.education},经验要求:${job.experience}。`;
|
||||
@@ -245,5 +327,10 @@ function extractSpeechText(markdown) {
|
||||
finalTextParts.push(...jobTexts);
|
||||
if (endingText) finalTextParts.push(endingText);
|
||||
|
||||
return finalTextParts.join('\n');
|
||||
const finalText = finalTextParts.join('\n');
|
||||
console.log('🎤 Final TTS text length:', finalText.length);
|
||||
console.log('🎤 Final TTS text preview:', finalText.substring(0, 200) + '...');
|
||||
console.log('🎤 Final TTS text parts count:', finalTextParts.length);
|
||||
|
||||
return finalText;
|
||||
}
|
||||
@@ -18,14 +18,14 @@
|
||||
</script>
|
||||
<title></title>
|
||||
<!-- vconsole -->
|
||||
<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
||||
<script>
|
||||
var vConsole = new window.VConsole();
|
||||
vConsole.destroy();
|
||||
</script> -->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
<!-- <body> -->
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
4
main.js
@@ -3,6 +3,7 @@ import * as Pinia from 'pinia'
|
||||
import globalFunction from '@/common/globalFunction'
|
||||
import '@/lib/string-similarity.min.js'
|
||||
import similarityJobs from '@/utils/similarity_Job.js';
|
||||
import config from '@/config.js';
|
||||
// 组件
|
||||
import AppLayout from './components/AppLayout/AppLayout.vue';
|
||||
import Empty from './components/empty/empty.vue';
|
||||
@@ -47,7 +48,8 @@ export function createApp() {
|
||||
|
||||
app.provide('globalFunction', {
|
||||
...globalFunction,
|
||||
similarityJobs
|
||||
similarityJobs,
|
||||
config
|
||||
});
|
||||
app.provide('deviceInfo', globalFunction.getdeviceInfo());
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
"locale": "zh-Hans",
|
||||
"h5": {
|
||||
"router": {
|
||||
"base": "/app/",
|
||||
"base": "/ks_app/",
|
||||
"mode": "hash"
|
||||
},
|
||||
"title": "青岛智慧就业服务",
|
||||
|
||||
BIN
packageA/.DS_Store
vendored
Normal file
BIN
packageA/pages/.DS_Store
vendored
Normal file
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<AppLayout title="" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
@@ -143,12 +143,16 @@ function expand() {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btnback{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
image {
|
||||
height: 100%;
|
||||
|
||||
380
packageA/pages/addWorkExperience/addWorkExperience.vue
Normal file
@@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<AppLayout
|
||||
title="添加工作经历"
|
||||
border
|
||||
back-gorund-color="#ffffff"
|
||||
:show-bg-image="false"
|
||||
>
|
||||
<template #headerleft>
|
||||
<view class="btn mar_le20 button-click" @click="navBack">取消</view>
|
||||
</template>
|
||||
<template #headerright>
|
||||
<view class="btn mar_ri20 button-click" @click="handleConfirm">确认</view>
|
||||
</template>
|
||||
<view class="content">
|
||||
<view class="content-input">
|
||||
<view class="input-titile">公司名称</view>
|
||||
<input class="input-con" v-model="formData.companyName" maxlength="200" placeholder-style="font-size: 16px" placeholder="请输入公司名称" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">职位名称</view>
|
||||
<input class="input-con" v-model="formData.position" maxlength="100" placeholder-style="font-size: 16px" placeholder="请输入职位名称" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">工作时间</view>
|
||||
<view class="date-range-container">
|
||||
<picker mode="date" :value="startDate === '至今' ? currentDate : startDate" :start="minDate" :end="currentDate" @change="bindStartDateChange">
|
||||
<view class="date-picker-item">
|
||||
<text class="date-label">开始时间</text>
|
||||
<view class="date-display" :class="{ 'current-text': startDate === '至今' }">{{startDate || '请选择开始时间'}}</view>
|
||||
</view>
|
||||
</picker>
|
||||
<view class="date-separator">至</view>
|
||||
<picker mode="date" :value="endDate === '至今' ? currentDate : endDate" :start="startDate === '至今' ? minDate : startDate" :end="currentDate" @change="bindEndDateChange">
|
||||
<view class="date-picker-item">
|
||||
<text class="date-label">结束时间</text>
|
||||
<view class="date-display" :class="{ 'current-text': endDate === '至今' }">{{endDate}}</view>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">工作描述</view>
|
||||
<!-- <input class="input-con" placeholder="请输入工作描述" /> -->
|
||||
<textarea class="textarea-con" v-model="formData.description" placeholder-style="font-size: 16px" maxlength="500" placeholder="请输入工作描述"/>
|
||||
</view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
|
||||
const { $api, navTo, navBack, config } = inject('globalFunction');
|
||||
const { userInfo } = useUserStore();
|
||||
|
||||
// 页面参数
|
||||
const pageType = ref('add'); // add: 添加, edit: 编辑
|
||||
const editData = ref(null); // 编辑时的数据
|
||||
|
||||
// 获取当前日期
|
||||
const getDate = (options = {}) => {
|
||||
const date = new Date();
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
|
||||
if (options.format) {
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
return date;
|
||||
};
|
||||
|
||||
const currentDate = getDate({ format: true });
|
||||
const minDate = '1990-01-01'; // 开始时间最早只能选择到1990年
|
||||
|
||||
// 定义响应式数据
|
||||
const startDate = ref(''); // 开始时间需要选择
|
||||
const endDate = ref('至今'); // 结束时间默认为"至今"
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
companyName: '',
|
||||
position: '',
|
||||
userId: '', // 将在确认时动态获取
|
||||
startDate: '',
|
||||
endDate: '至今', // 设置默认值为"至今"
|
||||
description: ''
|
||||
});
|
||||
|
||||
// 页面加载时解析参数
|
||||
onLoad((options) => {
|
||||
console.log('页面参数:', options);
|
||||
|
||||
// 解析页面类型
|
||||
if (options.type) {
|
||||
pageType.value = options.type;
|
||||
}
|
||||
|
||||
// 如果是编辑模式,解析传递的数据
|
||||
if (options.type === 'edit' && options.data) {
|
||||
try {
|
||||
editData.value = JSON.parse(decodeURIComponent(options.data));
|
||||
console.log('编辑数据:', editData.value);
|
||||
|
||||
// 回显数据到表单
|
||||
if (editData.value) {
|
||||
formData.companyName = editData.value.companyName || '';
|
||||
formData.position = editData.value.position || '';
|
||||
formData.startDate = editData.value.startDate || '';
|
||||
formData.endDate = editData.value.endDate || '至今';
|
||||
formData.description = editData.value.description || '';
|
||||
|
||||
// 同步日期选择器的显示
|
||||
startDate.value = editData.value.startDate || '';
|
||||
endDate.value = editData.value.endDate || '至今';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('解析编辑数据失败:', error);
|
||||
$api.msg('数据解析失败');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
lfsalay: [2, 5, 10, 15, 20, 25, 30, 50],
|
||||
risalay: [2, 5, 10, 15, 20, 25, 30, 50], // 修复未定义的salay变量
|
||||
salayText: '',
|
||||
areaText: '',
|
||||
jobsText: []
|
||||
});
|
||||
|
||||
// 开始日期选择器变化事件
|
||||
const bindStartDateChange = (e) => {
|
||||
const selectedDate = e.detail.value;
|
||||
if (selectedDate === currentDate) {
|
||||
// 如果选择的是今天,设置为"至今"
|
||||
startDate.value = '至今';
|
||||
formData.startDate = '至今';
|
||||
} else {
|
||||
startDate.value = selectedDate;
|
||||
formData.startDate = selectedDate;
|
||||
}
|
||||
// 如果结束日期早于开始日期且结束日期不是"至今",清空结束日期
|
||||
if (endDate.value && endDate.value !== '至今' && endDate.value < startDate.value) {
|
||||
endDate.value = '至今';
|
||||
formData.endDate = '至今';
|
||||
}
|
||||
};
|
||||
|
||||
// 结束日期选择器变化事件
|
||||
const bindEndDateChange = (e) => {
|
||||
const selectedDate = e.detail.value;
|
||||
if (selectedDate === currentDate) {
|
||||
// 如果选择的是今天,设置为"至今"
|
||||
endDate.value = '至今';
|
||||
formData.endDate = '至今';
|
||||
} else {
|
||||
endDate.value = selectedDate;
|
||||
formData.endDate = selectedDate;
|
||||
}
|
||||
};
|
||||
|
||||
// 确认保存工作经历
|
||||
const handleConfirm = async () => {
|
||||
// 表单验证
|
||||
if (!formData.companyName.trim()) {
|
||||
$api.msg('请输入公司名称');
|
||||
return;
|
||||
}
|
||||
if (!formData.position.trim()) {
|
||||
$api.msg('请输入职位名称');
|
||||
return;
|
||||
}
|
||||
if (!formData.startDate) {
|
||||
$api.msg('请选择开始时间');
|
||||
return;
|
||||
}
|
||||
if (!formData.description.trim()) {
|
||||
$api.msg('请输入工作描述');
|
||||
return;
|
||||
}
|
||||
console.log(userInfo.userId)
|
||||
// 调试:打印表单数据
|
||||
console.log('表单数据:', formData);
|
||||
console.log('结束时间:', formData.endDate);
|
||||
|
||||
try {
|
||||
// 处理结束时间:如果是"至今",则使用当前日期
|
||||
const endDateValue = formData.endDate === '至今' ? currentDate : formData.endDate;
|
||||
console.log('处理后的结束时间:', endDateValue);
|
||||
|
||||
// 准备请求参数(不包含userId,让后端通过token获取)
|
||||
const params = {
|
||||
companyName: formData.companyName.trim(),
|
||||
position: formData.position.trim(),
|
||||
startDate: formData.startDate,
|
||||
endDate: endDateValue, // 使用处理后的结束时间
|
||||
description: formData.description.trim()
|
||||
};
|
||||
|
||||
console.log('请求参数:', params);
|
||||
console.log('页面类型:', pageType.value);
|
||||
|
||||
let resData;
|
||||
alert(editData.value.id)
|
||||
// 根据页面类型调用不同的接口
|
||||
if (pageType.value === 'edit' && editData.value?.id) {
|
||||
// 编辑模式:调用更新接口
|
||||
resData = await $api.createRequest(`/app/userworkexperiences/edit`, {...params, id: editData.value.id}, 'put');
|
||||
console.log('编辑接口响应:', resData);
|
||||
} else {
|
||||
// 添加模式:调用新增接口
|
||||
resData = await $api.createRequest('/app/userworkexperiences/add', params, 'post');
|
||||
console.log('新增接口响应:', resData);
|
||||
}
|
||||
|
||||
if (resData.code === 200) {
|
||||
$api.msg(pageType.value === 'edit' ? '工作经历更新成功' : '工作经历保存成功');
|
||||
// 返回上一页
|
||||
navBack();
|
||||
} else {
|
||||
$api.msg(resData.msg || '操作失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('保存工作经历失败:', error);
|
||||
$api.msg('保存失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.content{
|
||||
padding: 28rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start
|
||||
height: calc(100% - 120rpx)
|
||||
}
|
||||
.content-input
|
||||
margin-bottom: 52rpx
|
||||
.input-titile
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #6A6A6A;
|
||||
.input-con
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 80rpx;
|
||||
height: 80rpx;
|
||||
border-bottom: 2rpx solid #EBEBEB
|
||||
position: relative;
|
||||
.triangle::before
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: calc(50% - 2rpx);
|
||||
content: '';
|
||||
width: 4rpx;
|
||||
height: 18rpx;
|
||||
border-radius: 2rpx
|
||||
background: #697279;
|
||||
transform: translate(0, -50%) rotate(-45deg) ;
|
||||
.triangle::after
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
content: '';
|
||||
width: 4rpx;
|
||||
height: 18rpx;
|
||||
border-radius: 2rpx
|
||||
background: #697279;
|
||||
transform: rotate(45deg)
|
||||
.textarea-con
|
||||
border: 2rpx solid #EBEBEB
|
||||
width: 95%
|
||||
height: 400rpx
|
||||
margin-top: 20rpx
|
||||
padding: 15rpx
|
||||
|
||||
.date-range-container
|
||||
display: flex
|
||||
align-items: flex-end
|
||||
justify-content: space-between
|
||||
margin-top: 20rpx
|
||||
position: relative
|
||||
border-bottom: 2rpx solid #EBEBEB
|
||||
|
||||
.date-picker-item
|
||||
flex: 1
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
|
||||
.date-label
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
margin-bottom: 10rpx
|
||||
|
||||
.date-display
|
||||
width: 100%
|
||||
height: 80rpx
|
||||
line-height: 80rpx
|
||||
font-size: 32rpx
|
||||
color: #333333
|
||||
text-align: center
|
||||
position: relative
|
||||
|
||||
&.current-text
|
||||
color: #256BFA
|
||||
font-weight: 500
|
||||
|
||||
.date-separator
|
||||
position: absolute
|
||||
left: 50%
|
||||
bottom: 40rpx
|
||||
transform: translateX(-50%)
|
||||
font-size: 28rpx
|
||||
color: #666666
|
||||
background-color: #ffffff
|
||||
padding: 0 10rpx
|
||||
z-index: 2
|
||||
height: 20rpx
|
||||
line-height: 20rpx
|
||||
display: flex
|
||||
align-items: center
|
||||
// .content-sex
|
||||
// height: 110rpx;
|
||||
// display: flex
|
||||
// justify-content: space-between;
|
||||
// align-items: flex-start;
|
||||
// border-bottom: 2rpx solid #EBEBEB
|
||||
// margin-bottom: 52rpx
|
||||
// .sex-titile
|
||||
// line-height: 80rpx;
|
||||
// .sext-ri
|
||||
// display: flex
|
||||
// align-items: center;
|
||||
// .sext-box
|
||||
// height: 76rpx;
|
||||
// width: 152rpx;
|
||||
// text-align: center;
|
||||
// line-height: 80rpx;
|
||||
// border-radius: 12rpx 12rpx 12rpx 12rpx
|
||||
// border: 2rpx solid #E8EAEE;
|
||||
// margin-left: 28rpx
|
||||
// font-weight: 400;
|
||||
// font-size: 28rpx;
|
||||
// .sext-boxactive
|
||||
// color: #256BFA
|
||||
// background: rgba(37,107,250,0.1);
|
||||
// border: 2rpx solid #256BFA;
|
||||
// .next-btn
|
||||
// width: 100%;
|
||||
// height: 90rpx;
|
||||
// background: #256BFA;
|
||||
// border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
// font-weight: 500;
|
||||
// font-size: 32rpx;
|
||||
// color: #FFFFFF;
|
||||
// text-align: center;
|
||||
// line-height: 90rpx
|
||||
// .input-nx
|
||||
// position: relative
|
||||
// border-bottom: 2rpx solid #EBEBEB
|
||||
// padding-bottom: 30rpx
|
||||
// display: flex
|
||||
// flex-wrap: wrap
|
||||
// .nx-item
|
||||
// padding: 20rpx 28rpx
|
||||
// width: fit-content
|
||||
// border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
// border: 2rpx solid #E8EAEE;
|
||||
// margin-right: 24rpx
|
||||
// margin-top: 24rpx
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<AppLayout title="我的浏览" :show-bg-image="false" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
@@ -152,12 +152,16 @@ function getPreviousDay(dateStr) {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btnback{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
image {
|
||||
height: 100%;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<view class="main">
|
||||
<view class="main-header">
|
||||
<view class="header-title btn-feel">企业推荐站</view>
|
||||
<view class="header-text btn-feel">AI智联青岛,岗位触手可“职”!</view>
|
||||
<view class="header-text btn-feel">AI智联{{ config.appInfo.areaName }},岗位触手可“职”!</view>
|
||||
<image class="header-img btn-shaky" src="/static/icon/companyBG.png"></image>
|
||||
</view>
|
||||
<view class="main-content">
|
||||
@@ -24,7 +24,7 @@
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navBack, navTo } = inject('globalFunction');
|
||||
const { $api, navBack, navTo, config } = inject('globalFunction');
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
const { getUserResume } = useUserStore();
|
||||
@@ -88,6 +88,7 @@ function seeDetail(item) {
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.card-text{
|
||||
margin-top: 16rpx
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" @onScrollBottom="getDataList('add')">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
@@ -101,12 +101,16 @@ function getDataList(type = 'add') {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btnback{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
image {
|
||||
height: 100%;
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
<swiper-item class="list">
|
||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
|
||||
<view class="mian">
|
||||
<renderJobs
|
||||
<renderJobsCheckBox
|
||||
ref="jobListRef"
|
||||
:list="pageState.list"
|
||||
v-if="pageState.list.length"
|
||||
:longitude="longitudeVal"
|
||||
:latitude="latitudeVal"
|
||||
></renderJobs>
|
||||
@update:selected="updateSelectedCount"
|
||||
></renderJobsCheckBox>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -41,18 +43,28 @@
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view v-if="selectedJobCount > 0 && type === 0" class="compare-bar">
|
||||
<view class="selected-count">已选中 {{ selectedJobCount }} 个岗位</view>
|
||||
<button class="compare-btn" @click="handleCompare">岗位对比</button>
|
||||
</view>
|
||||
</template>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { inject, ref, reactive, nextTick } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import renderJobsCheckBox from '@/components/renderJobs/renderJobsCheckBox.vue';
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
const { $api, navBack } = inject('globalFunction');
|
||||
const { $api, navBack, navTo } = inject('globalFunction');
|
||||
const type = ref(0);
|
||||
|
||||
// 新增:获取renderJobs组件实例
|
||||
const jobListRef = ref(null);
|
||||
// 新增:选中的岗位数量
|
||||
const selectedJobCount = ref(0);
|
||||
const pageState = reactive({
|
||||
page: 0,
|
||||
list: [],
|
||||
@@ -83,6 +95,32 @@ function changeType(e) {
|
||||
type.value = e;
|
||||
}
|
||||
|
||||
// 监听选中数量变化
|
||||
function updateSelectedCount() {
|
||||
nextTick(() => {
|
||||
if (jobListRef.value) {
|
||||
selectedJobCount.value = jobListRef.value.selectedJobs.length;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 新增:对比按钮点击事件
|
||||
function handleCompare() {
|
||||
if (selectedJobCount.value < 2) {
|
||||
uni.showToast({
|
||||
title: '请至少选择2个岗位进行对比',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 获取选中的岗位数据
|
||||
const selectedJobs = jobListRef.value.selectedJobs;
|
||||
const selectedJobData = pageState.list.filter((job) => selectedJobs.includes(job.jobId));
|
||||
uni.setStorageSync('compare', selectedJobData);
|
||||
// 跳转到对比页面(假设已创建对比页面)
|
||||
navTo('/packageA/pages/collection/compare');
|
||||
}
|
||||
|
||||
function handleScrollToLower() {
|
||||
getJobList();
|
||||
}
|
||||
@@ -149,6 +187,35 @@ function getCompanyList(type = 'add') {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
// 新增底部对比栏样式
|
||||
.compare-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-top: 1rpx solid #eee;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
|
||||
|
||||
.selected-count {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.compare-btn {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background-color: #4C6EFB;
|
||||
color: #fff;
|
||||
border-radius: 30rpx;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
208
packageA/pages/collection/compare.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="job-comparison-container">
|
||||
<scroll-view class="horizontal-scroll" scroll-x="true">
|
||||
<view class="comparison-table">
|
||||
<view class="table-row table-header">
|
||||
<view class="table-cell fixed-column"></view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell job-title-cell">
|
||||
<text>{{ job.jobTitle }}</text>
|
||||
<text class="company">{{ job.company }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>薪资</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>
|
||||
<Salary-Expectation
|
||||
:max-salary="job.maxSalary"
|
||||
:min-salary="job.minSalary"
|
||||
:is-month="true"
|
||||
></Salary-Expectation>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>公司名称</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>{{ job.companyName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>学历</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view><dict-Label dictType="education" :value="job.education"></dict-Label></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>经验</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view><dict-Label dictType="experience" :value="job.experience"></dict-Label></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>工作地点</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>{{ job.jobLocation }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>来源</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>{{ job.dataSource }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>职位描述</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>{{ job.description }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>工业</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>
|
||||
<dict-tree-Label
|
||||
v-if="jobInfo.company && jobInfo.company.industry"
|
||||
dictType="industry"
|
||||
:value="jobInfo.company.industry"
|
||||
></dict-tree-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>企业规模</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>
|
||||
<dict-Label dictType="scale" :value="jobInfo.company?.scale"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-row">
|
||||
<view class="table-cell fixed-column detail-label">
|
||||
<text>热门</text>
|
||||
</view>
|
||||
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
|
||||
<view>
|
||||
{{ job.isHot ? '是' : '否' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, computed, nextTick } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const jobs = ref([]);
|
||||
|
||||
onLoad(() => {
|
||||
let compareData = uni.getStorageSync('compare');
|
||||
jobs.value = compareData;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.job-comparison-container {
|
||||
padding: 10px;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.horizontal-scroll {
|
||||
width: 100%;
|
||||
white-space: nowrap; /* 保持 flex 子项在同一行 */
|
||||
}
|
||||
|
||||
.comparison-table {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.table-row:first-child {
|
||||
border-bottom: 2px solid #ccc;
|
||||
}
|
||||
|
||||
.table-cell {
|
||||
flex-shrink: 0;
|
||||
padding: 15px 10px;
|
||||
border-right: 1px solid #e0e0e0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 150px;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.table-cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.fixed-column {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
background-color: #fff;
|
||||
border-right: 2px solid #ccc;
|
||||
width: 120px; /* 固定左侧列的宽度 */
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
background-color: #f1f1f1;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.job-title-cell {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.company {
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<AppLayout title="" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
@@ -219,12 +219,16 @@ function getHoursBetween(startTimeStr, endTimeStr) {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btnback{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
image {
|
||||
height: 100%;
|
||||
@@ -251,6 +255,7 @@ image {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.row2{
|
||||
font-weight: 400;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
const { $api, navTo, navBack, config } = inject('globalFunction');
|
||||
const openSelectPopup = inject('openSelectPopup');
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
@@ -137,7 +137,7 @@ function changeArea() {
|
||||
data: [oneDictData('area')],
|
||||
success: (_, [value]) => {
|
||||
fromValue.area = value.value;
|
||||
state.areaText = '青岛市-' + value.label;
|
||||
state.areaText = config.appInfo.areaName + '-' + value.label;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -145,10 +145,17 @@ function changeArea() {
|
||||
function changeJobs() {
|
||||
selectJobsModel.value?.open({
|
||||
title: '添加岗位',
|
||||
defaultId: fromValue.jobTitleId,
|
||||
success: (ids, labels) => {
|
||||
console.log(ids, labels);
|
||||
fromValue.jobTitleId = ids;
|
||||
state.jobsText = labels.split(',');
|
||||
},
|
||||
cancel: (ids, labels) => {
|
||||
console.log(ids, labels);
|
||||
// fromValue.jobTitleId = ids;
|
||||
// state.jobsText = labels.split(',');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
73
packageA/pages/moreJobs/moreJobs.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<view class="collection-content">
|
||||
<renderJobs :list="list" :longitude="longitudeVal" :latitude="latitudeVal"></renderJobs>
|
||||
<loadmore ref="loadmoreRef"></loadmore>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dictLabel from '@/components/dict-Label/dict-Label.vue';
|
||||
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
const { $api, navTo, navBack, vacanciesTo } = inject('globalFunction');
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import { usePagination } from '@/hook/usePagination';
|
||||
import { jobMoreMap } from '@/utils/markdownParser';
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
const loadmoreRef = ref(null);
|
||||
|
||||
// 响应式搜索条件(可以被修改)
|
||||
const searchParams = ref({});
|
||||
const pageSize = ref(10);
|
||||
const { list, loading, refresh, loadMore } = usePagination(
|
||||
(params) => $api.createRequest('/app/job/list', params, 'GET', true),
|
||||
null, // 转换函数
|
||||
{
|
||||
pageSize: pageSize,
|
||||
search: searchParams,
|
||||
autoWatchSearch: true,
|
||||
onBeforeRequest: () => {
|
||||
loadmoreRef.value?.change('loading');
|
||||
},
|
||||
onAfterRequest: () => {
|
||||
loadmoreRef.value?.change('more');
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
onLoad((options) => {
|
||||
let params = jobMoreMap.get(options.jobId);
|
||||
if (params) {
|
||||
uni.setStorageSync('jobMoreMap', params);
|
||||
} else {
|
||||
params = uni.getStorageSync('jobMoreMap');
|
||||
}
|
||||
const objs = removeNullProperties(params);
|
||||
searchParams.value = objs;
|
||||
refresh();
|
||||
});
|
||||
|
||||
function removeNullProperties(obj) {
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key) && obj[key] === null) {
|
||||
delete obj[key]; // 删除值为 null 的属性
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
onReachBottom(() => {
|
||||
loadMore();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.collection-content{
|
||||
padding: 1rpx 28rpx 20rpx 28rpx;
|
||||
background: #F4F4F4;
|
||||
height: 100%
|
||||
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
|
||||
}
|
||||
</style>
|
||||
97
packageA/pages/myResume/corporateInformation.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="info-card">
|
||||
<view class="card-title">企业基本信息</view>
|
||||
<view class="info-item">
|
||||
<text class="label">企业名称</text>
|
||||
<text class="value">泰科电子(上海)有限公司</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">法人名称</text>
|
||||
<text class="value">李某</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">统一社会信用代码</text>
|
||||
<text class="value">913100007504791552</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-card">
|
||||
<view class="card-title">营业执照</view>
|
||||
<view class="info-item">
|
||||
<text class="label">营业执照图片</text>
|
||||
<image class="license-image" src="/static/business-license.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-card">
|
||||
<view class="card-title">企业联系人</view>
|
||||
<view class="info-item">
|
||||
<text class="label">联系人</text>
|
||||
<text class="value">张三</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">联系人电话</text>
|
||||
<text class="value">13812345678</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
padding: 20rpx; /* 使用 rpx 适配不同屏幕 */
|
||||
background-color: #f5f5f5; /* 页面背景色 */
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
margin-bottom: 24rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 15rpx 0;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.info-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.license-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
min-height: 300rpx; /* 设置最小高度以保证布局 */
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -54,8 +54,8 @@
|
||||
<text>{{ userInfo.salaryMin / 1000 }}k-{{ userInfo.salaryMax / 1000 }}k</text>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望工资地:</text>
|
||||
<text>青岛市-</text>
|
||||
<text>期望工作地:</text>
|
||||
<text>{{ config.appInfo.areaName }}-</text>
|
||||
<dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label>
|
||||
</view>
|
||||
<view class="mys-list">
|
||||
@@ -64,12 +64,92 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 工作经历 -->
|
||||
<view class="work-experience-container">
|
||||
<!-- 标题栏:标题 + 编辑/添加按钮 -->
|
||||
<view class="exp-header">
|
||||
<text class="exp-title">工作经历</text>
|
||||
<button class="exp-edit-btn" @click="handleEditOrAdd" size="mini" type="primary">
|
||||
<!-- <text> {{ workExperiences.length > 0 ? '编辑' : '添加经历' }}</text> -->
|
||||
添加经历
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 工作经历列表 -->
|
||||
<view class="exp-list" v-if="workExperiences.length > 0">
|
||||
<view class="exp-item" v-for="(item, index) in workExperiences" :key="item.id">
|
||||
<!-- 公司名称 + 职位 -->
|
||||
<view class="exp-company-row">
|
||||
<text class="exp-company">{{ item.companyName }}</text>
|
||||
<text class="exp-position">{{ item.position }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 工作时间 -->
|
||||
<view class="exp-date-row">
|
||||
<text class="exp-label">工作时间:</text>
|
||||
<text class="exp-date">{{ item.startDate }} - {{ item.endDate || '至今' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 工作描述(支持多行) -->
|
||||
<view class="exp-desc-row" v-if="item.description">
|
||||
<text class="exp-label">工作描述:</text>
|
||||
<text class="exp-desc">{{ item.description }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮(编辑/删除) -->
|
||||
<view class="exp-op-btn-row">
|
||||
<button class="exp-op-btn edit-btn" size="mini" @click.stop="handleEditItem(item)">编辑</button>
|
||||
<button
|
||||
class="exp-op-btn delete-btn"
|
||||
size="mini"
|
||||
type="warn"
|
||||
@click.stop="handleDeleteItem(item,index)"
|
||||
>
|
||||
删除
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 分隔线(最后一项不显示) -->
|
||||
<view class="exp-divider" v-if="index !== workExperiences.length - 1"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态提示(无工作经历时显示) -->
|
||||
<view class="exp-empty" v-else>
|
||||
<image class="empty-img" src="/static/icons/empty-work.png" mode="widthFix"></image>
|
||||
<text class="empty-text">暂无工作经历,点击"添加经历"完善信息</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 4. 新增:简历上传区域(固定在页面底部) -->
|
||||
<view class="resume-upload-section">
|
||||
<!-- 上传按钮 -->
|
||||
<button class="upload-btn" @click="handleResumeUpload" :loading="isUploading" :disabled="isUploading">
|
||||
<uni-icons type="cloud-upload" size="20"></uni-icons>
|
||||
<!-- <image class="upload-icon" src="/static/icons/upload-file.png" mode="widthFix"></image> -->
|
||||
<text class="upload-text">
|
||||
{{ uploadedResumeName || '上传简历' }}
|
||||
</text>
|
||||
<!-- 已上传时显示“重新上传”文字 -->
|
||||
<text class="reupload-text" v-if="uploadedResumeName">(重新上传)</text>
|
||||
</button>
|
||||
|
||||
<!-- 上传说明 -->
|
||||
<text class="upload-tip">支持 PDF、Word 格式,文件大小不超过 20MB</text>
|
||||
|
||||
<!-- 已上传文件信息(可选) -->
|
||||
<view class="uploaded-file-info" v-if="uploadedResumeName">
|
||||
<image class="file-icon" src="/static/icons/file-icon.png" mode="widthFix"></image>
|
||||
<text class="file-name">{{ uploadedResumeName }}</text>
|
||||
<button class="delete-file-btn" size="mini" @click.stop="handleDeleteResume">删除</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
const { $api, navTo } = inject('globalFunction');
|
||||
const { $api, navTo, config } = inject('globalFunction');
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
@@ -77,6 +157,125 @@ import useDictStore from '@/stores/useDictStore';
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const { getUserResume } = useUserStore();
|
||||
const { getDictData, oneDictData } = useDictStore();
|
||||
|
||||
const isUploading = ref(false); // 上传中状态
|
||||
const uploadedResumeName = ref(''); // 已上传简历文件名
|
||||
const uploadedResumeUrl = ref(''); // 已上传
|
||||
const workExperiences = ref([]); // 工作经历列表
|
||||
const isLoading = ref(false); // 加载状态
|
||||
|
||||
// 获取工作经历列表
|
||||
const getWorkExperiences = async () => {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
console.log('完整用户信息:', userInfo.value);
|
||||
|
||||
// 获取用户ID - 使用可选链操作符避免错误
|
||||
const userId = userInfo.value?.userId;
|
||||
console.log('用户ID:', userId);
|
||||
|
||||
if (!userId) {
|
||||
console.log('用户ID为空,等待用户信息加载...');
|
||||
// 如果用户ID为空,不执行任何操作,避免触发退出登录
|
||||
return;
|
||||
}
|
||||
|
||||
// 只传递userId参数
|
||||
console.log('请求参数:', { userId });
|
||||
|
||||
// 使用try-catch包装请求,避免自动退出登录
|
||||
try {
|
||||
// 参数拼接到URL后面
|
||||
const resData = await $api.createRequest(`/app/userworkexperiences/list?userId=${userId}`, {}, 'get');
|
||||
console.log('工作经历列表响应:', resData);
|
||||
|
||||
if (resData.code === 200 && resData.rows) {
|
||||
workExperiences.value = resData.rows;
|
||||
console.log('工作经历数据设置成功:', resData.rows);
|
||||
console.log('总数量:', resData.total);
|
||||
} else {
|
||||
console.log('接口返回非200状态或无数据:', resData);
|
||||
// 如果接口返回错误,不显示错误提示,避免用户困惑
|
||||
workExperiences.value = []; // 设置为空数组
|
||||
}
|
||||
} catch (requestError) {
|
||||
console.error('接口请求失败:', requestError);
|
||||
// 接口请求失败时,不显示错误提示,静默处理
|
||||
workExperiences.value = []; // 设置为空数组
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('获取工作经历失败:', error);
|
||||
// 静默处理错误,不显示错误提示
|
||||
workExperiences.value = [];
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 页面加载时获取数据
|
||||
onLoad(() => {
|
||||
// 延迟获取数据,确保用户信息完全加载
|
||||
setTimeout(() => {
|
||||
if (userInfo.value?.userId) {
|
||||
getWorkExperiences();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// 页面显示时刷新数据
|
||||
onShow(() => {
|
||||
// 延迟获取数据,确保用户信息完全加载
|
||||
setTimeout(() => {
|
||||
if (userInfo.value?.userId) {
|
||||
getWorkExperiences();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// 整体编辑/添加(跳转编辑页)
|
||||
const handleEditOrAdd = () => {
|
||||
// 跳转到添加经历页面,传递添加标识
|
||||
navTo('/packageA/pages/addWorkExperience/addWorkExperience?type=add');
|
||||
};
|
||||
|
||||
// 编辑单个经历
|
||||
const handleEditItem = (item) => {
|
||||
// 跳转到编辑页面,传递编辑标识和数据
|
||||
const itemData = encodeURIComponent(JSON.stringify(item));
|
||||
navTo(`/packageA/pages/addWorkExperience/addWorkExperience?type=edit&data=${itemData}`);
|
||||
};
|
||||
|
||||
// 删除单个经历(带确认弹窗)
|
||||
const handleDeleteItem = async (item, index) => {
|
||||
uni.showModal({
|
||||
title: '确认删除',
|
||||
content: '此操作将删除该工作经历,是否继续?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
// 调用删除接口
|
||||
const deleteRes = await $api.createRequest(`/app/userworkexperiences/${item.id}`, {}, 'delete');
|
||||
if (deleteRes.code === 200) {
|
||||
workExperiences.value.splice(index, 1); // 删除本地数据
|
||||
$api.msg('删除成功');
|
||||
} else {
|
||||
$api.msg(deleteRes.msg || '删除失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除工作经历失败:', error);
|
||||
$api.msg('删除失败,请重试');
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 简历上传核心逻辑
|
||||
const handleResumeUpload = () => {};
|
||||
|
||||
// 删除已上传的简历
|
||||
const handleDeleteResume = () => {};
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -85,12 +284,15 @@ image{
|
||||
height: 100%
|
||||
}
|
||||
.mys-container{
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
.mys-tops{
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
padding: 52rpx 48rpx
|
||||
.tops-left{
|
||||
.name{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 44rpx;
|
||||
color: #333333;
|
||||
@@ -140,6 +342,7 @@ image{
|
||||
.mys-info{
|
||||
padding: 28rpx
|
||||
.mys-h4{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
@@ -177,4 +380,218 @@ image{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 容器样式(适配多端,用rpx做单位) */
|
||||
.work-experience-container {
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin: 20rpx;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* 标题栏:两端对齐 */
|
||||
.exp-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 25rpx;
|
||||
}
|
||||
|
||||
.exp-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 编辑/添加按钮(UniApp按钮样式重置) */
|
||||
.exp-edit-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
font-size: 24rpx;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
/* 经历列表容器 */
|
||||
.exp-list {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
/* 单个经历卡片 */
|
||||
.exp-item {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
/* 公司名称 + 职位(横向排列,职位右对齐) */
|
||||
.exp-company-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.exp-company {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.exp-position {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 工作时间/描述:标签+内容横向排列 */
|
||||
.exp-date-row, .exp-desc-row {
|
||||
display: flex;
|
||||
margin-bottom: 12rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* 标签样式(固定宽度,统一对齐) */
|
||||
.exp-label {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
min-width: 160rpx;
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.exp-date, .exp-desc {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
flex: 1; /* 内容占满剩余宽度,支持换行 */
|
||||
}
|
||||
|
||||
/* 工作描述(支持多行换行) */
|
||||
.exp-desc {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* 操作按钮行(编辑+删除) */
|
||||
.exp-op-btn-row {
|
||||
display: flex;
|
||||
gap: 15rpx;
|
||||
margin-top: 15rpx;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.exp-op-btn {
|
||||
padding: 0 15rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background-color: #e8f3ff;
|
||||
color: #1677ff;
|
||||
}
|
||||
|
||||
/* 分隔线 */
|
||||
.exp-divider {
|
||||
height: 1rpx;
|
||||
background-color: #f5f5f5;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/* 空状态样式 */
|
||||
.exp-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 80rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: 140rpx;
|
||||
height: auto;
|
||||
margin-bottom: 25rpx;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
||||
/* 新增:简历上传区域样式 */
|
||||
.resume-upload-section {
|
||||
margin-top: 30rpx;
|
||||
padding-top: 25rpx;
|
||||
border-top: 1px dashed #eee; /* 分隔线区分内容区域 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 上传按钮 */
|
||||
.upload-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #f5f7fa;
|
||||
color: #1677ff;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.upload-icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.reupload-text {
|
||||
font-size: 22rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 上传说明文字 */
|
||||
.upload-tip {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 已上传文件信息 */
|
||||
.uploaded-file-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15rpx;
|
||||
padding: 15rpx 20rpx;
|
||||
background-color: #fafafa;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.file-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
max-width: 400rpx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.delete-file-btn {
|
||||
padding: 0 15rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
font-size: 22rpx;
|
||||
color: #ff4d4f;
|
||||
background-color: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
placeholder="请选择您的政治面貌"
|
||||
/>
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">身份证</view>
|
||||
<input class="input-con" v-model="fromValue.idcard" placeholder="空" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">手机号码</view>
|
||||
<input class="input-con" v-model="fromValue.phone" placeholder="请输入您的手机号码" />
|
||||
@@ -81,6 +85,7 @@ const fromValue = reactive({
|
||||
birthDate: '',
|
||||
education: '',
|
||||
politicalAffiliation: '',
|
||||
idcard: '',
|
||||
});
|
||||
onLoad(() => {
|
||||
initLoad();
|
||||
@@ -101,6 +106,7 @@ function initLoad() {
|
||||
fromValue.birthDate = userInfo.value.birthDate;
|
||||
fromValue.education = userInfo.value.education;
|
||||
fromValue.politicalAffiliation = userInfo.value.politicalAffiliation;
|
||||
fromValue.idcard = userInfo.value.idcard;
|
||||
// 回显
|
||||
state.educationText = dictLabel('education', userInfo.value.education);
|
||||
state.politicalAffiliationText = dictLabel('affiliation', userInfo.value.politicalAffiliation);
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<template>
|
||||
<AppLayout title="" backGorundColor="#F4F4F4">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
<template #headerright>
|
||||
<!-- <view class="btnshare">
|
||||
<image src="@/static/icon/share.png" @click="shareJob"></image>
|
||||
</view> -->
|
||||
<view class="btn mar_ri10">
|
||||
<image src="@/static/icon/collect3.png" v-if="!jobInfo.isCollection" @click="jobCollection"></image>
|
||||
<image src="@/static/icon/collect2.png" v-else @click="jobCollection"></image>
|
||||
@@ -13,7 +16,13 @@
|
||||
</template>
|
||||
<view class="content" v-show="!isEmptyObject(jobInfo)">
|
||||
<view class="content-top btn-feel">
|
||||
<view class="top-salary">{{ jobInfo.minSalary }}-{{ jobInfo.maxSalary }}/月</view>
|
||||
<view class="top-salary">
|
||||
<Salary-Expectation
|
||||
:max-salary="jobInfo.maxSalary"
|
||||
:min-salary="jobInfo.minSalary"
|
||||
:is-month="true"
|
||||
></Salary-Expectation>
|
||||
</view>
|
||||
<view class="top-name">{{ jobInfo.jobTitle }}</view>
|
||||
<view class="top-info">
|
||||
<view class="info-img"><image src="/static/icon/post12.png"></image></view>
|
||||
@@ -47,6 +56,7 @@
|
||||
{{ jobInfo.description }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 公司信息 -->
|
||||
<view class="content-card">
|
||||
<view class="card-title">
|
||||
<text class="title">公司信息</text>
|
||||
@@ -88,7 +98,7 @@
|
||||
></map>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-card">
|
||||
<view class="content-card" v-if="!userInfo.isCompanyUser">
|
||||
<view class="card-title">
|
||||
<text class="title">竞争力分析</text>
|
||||
</view>
|
||||
@@ -107,10 +117,7 @@
|
||||
v-for="(item, index) in matchingDegree"
|
||||
:key="index"
|
||||
class="progress-item"
|
||||
:class="{
|
||||
active: index < currentStep - 1,
|
||||
half: index < currentStep && currentStep < index + 1, // 半条
|
||||
}"
|
||||
:class="getClass(index)"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -119,8 +126,52 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 24px"></view>
|
||||
<view class="content-card" v-else>
|
||||
<view class="card-title">
|
||||
<view class="title">申请人列表</view>
|
||||
</view>
|
||||
<view class="applicant-list">
|
||||
<view v-for="applicant in applicants" :key="applicant.userId" class="applicant-item">
|
||||
<view class="item-header">
|
||||
<view class="name">{{ applicant.name }}</view>
|
||||
<view class="right-header">
|
||||
<view class="matching-degree">匹配度:{{ applicant.matchingDegree }}</view>
|
||||
<button class="resume-button" @click="viewResume(applicant.userId)">查看简历</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-details">
|
||||
<view class="detail-text">
|
||||
<view class="label">年龄:{{ applicant.age }}</view>
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
<view class="label">
|
||||
学历:
|
||||
<dict-Label dictType="education" :value="applicant.education"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
<view class="label">
|
||||
经验:
|
||||
<dict-Label dictType="experience" :value="applicant.experience"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
<view class="label">
|
||||
期望薪资:
|
||||
<Salary-Expectation
|
||||
style="display: inline-block"
|
||||
:max-salary="applicant.maxSalary"
|
||||
:min-salary="applicant.minSalary"
|
||||
:is-month="true"
|
||||
></Salary-Expectation>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 34px"></view>
|
||||
<template #footer>
|
||||
<view class="footer">
|
||||
<view class="btn-wq button-click" @click="jobApply">立即前往</view>
|
||||
@@ -134,10 +185,14 @@
|
||||
import point from '@/static/icon/point.png';
|
||||
import VideoPlayer from './component/videoPlayer.vue';
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { onLoad, onShow, onHide } from '@dcloudio/uni-app';
|
||||
import dictLabel from '@/components/dict-Label/dict-Label.vue';
|
||||
const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction');
|
||||
import RadarMap from './component/radarMap.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction');
|
||||
import config from '@/config.js';
|
||||
const matchingDegree = ref(['一般', '良好', '优秀', '极好']);
|
||||
const currentStep = ref(1);
|
||||
const companyCount = ref(0);
|
||||
@@ -149,6 +204,33 @@ const raderData = ref({});
|
||||
const videoPalyerRef = ref(null);
|
||||
const explainUrlRef = ref('');
|
||||
|
||||
const applicants = ref([
|
||||
{
|
||||
createTime: null,
|
||||
userId: 1,
|
||||
name: '青岛测试账号331',
|
||||
age: '28', // 假设年龄有值
|
||||
sex: '1',
|
||||
birthDate: null,
|
||||
education: '4',
|
||||
politicalAffiliation: '',
|
||||
phone: '',
|
||||
avatar: '',
|
||||
salaryMin: '10000',
|
||||
salaryMax: '15000',
|
||||
area: '3',
|
||||
status: '0',
|
||||
loginIp: '',
|
||||
loginDate: null,
|
||||
jobTitleId: '157,233,373',
|
||||
experience: '3',
|
||||
isRecommend: 1,
|
||||
jobTitle: ['人力资源专员/助理', 'Java', '运维工程师'],
|
||||
applyDate: '2025-09-26',
|
||||
matchingDegree: 1,
|
||||
},
|
||||
]);
|
||||
|
||||
onLoad((option) => {
|
||||
if (option.jobId) {
|
||||
initLoad(option);
|
||||
@@ -179,30 +261,36 @@ function seeExplain() {
|
||||
}
|
||||
|
||||
function getDetail(jobId) {
|
||||
$api.createRequest(`/app/job/${jobId}`).then((resData) => {
|
||||
const { latitude, longitude, companyName, companyId } = resData.data;
|
||||
jobInfo.value = resData.data;
|
||||
getCompanyIsAJobs(companyId);
|
||||
getCompetivetuveness(jobId);
|
||||
if (latitude && longitude) {
|
||||
mapCovers.value = [
|
||||
{
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
iconPath: point,
|
||||
label: {
|
||||
content: companyName,
|
||||
textAlign: 'center',
|
||||
padding: 3,
|
||||
fontSize: 12,
|
||||
bgColor: '#FFFFFF',
|
||||
anchorX: getTextWidth(companyName), // X 轴调整,负数向左
|
||||
borderRadius: 5,
|
||||
return new Promise((reslove, reject) => {
|
||||
$api.createRequest(`/app/job/${jobId}`).then((resData) => {
|
||||
const { latitude, longitude, companyName, companyId, isCompanyUser } = resData.data;
|
||||
jobInfo.value = resData.data;
|
||||
reslove(resData.data);
|
||||
getCompanyIsAJobs(companyId);
|
||||
if (isCompanyUser) {
|
||||
getCompetivetuveness(jobId);
|
||||
}
|
||||
// getCompetivetuveness(jobId);
|
||||
if (latitude && longitude) {
|
||||
mapCovers.value = [
|
||||
{
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
iconPath: point,
|
||||
label: {
|
||||
content: companyName,
|
||||
textAlign: 'center',
|
||||
padding: 3,
|
||||
fontSize: 12,
|
||||
bgColor: '#FFFFFF',
|
||||
anchorX: getTextWidth(companyName), // X 轴调整,负数向左
|
||||
borderRadius: 5,
|
||||
},
|
||||
width: 34,
|
||||
},
|
||||
width: 34,
|
||||
},
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -257,15 +345,39 @@ function jobCollection() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getClass(index) {
|
||||
const current = currentStep.value;
|
||||
const floorIndex = Math.floor(current);
|
||||
|
||||
if (index < floorIndex) {
|
||||
return 'active';
|
||||
} else if (index === floorIndex) {
|
||||
const decimal = current % 1;
|
||||
const percent = Math.round(decimal * 100);
|
||||
return `half${percent}`;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btnback{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
.btnshare {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 46rpx;
|
||||
}
|
||||
image {
|
||||
height: 100%;
|
||||
@@ -307,17 +419,19 @@ image {
|
||||
}
|
||||
|
||||
/* 当前进度进行中的格子 */
|
||||
.progress-item.half::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%; /* 根据 currentStep 小数动态控制 */
|
||||
// background: linear-gradient(to right, #256bfa, #8c68ff);
|
||||
background: linear-gradient(to right, #256bfa 50%, #eaeaea 50%);
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
for i in 0..100
|
||||
.progress-item.half{i}::before
|
||||
content ''
|
||||
position absolute
|
||||
left 0
|
||||
top 0
|
||||
bottom 0
|
||||
width 100%
|
||||
background linear-gradient(to right, #256bfa (i)%, #eaeaea (i)%)
|
||||
border-radius 24rpx
|
||||
|
||||
|
||||
|
||||
.card-footer{
|
||||
.footer-title{
|
||||
font-weight: 600;
|
||||
@@ -529,4 +643,100 @@ image {
|
||||
line-height: 90rpx
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.content-card {
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
margin: 10px;
|
||||
padding: 15px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.applicant-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.applicant-item {
|
||||
padding: 15px;
|
||||
background-color: #fafafa;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between; /* 名字和右侧部分分开 */
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.right-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
max-width: 100px; /* 限制名字的最大宽度,根据你的布局调整 */
|
||||
overflow: hidden; /* 隐藏超出部分 */
|
||||
white-space: nowrap; /* 不换行 */
|
||||
text-overflow: ellipsis; /* 显示省略号 */
|
||||
}
|
||||
|
||||
.matching-degree {
|
||||
font-size: 14px;
|
||||
color: #4CAF50;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.resume-button {
|
||||
font-size: 12px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 20px;
|
||||
border: 1px solid #007aff;
|
||||
color: #007aff;
|
||||
background-color: transparent;
|
||||
line-height: 1;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.resume-button::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.item-details {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.detail-text {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
/* 确保标签和值在同一行 */
|
||||
display: flex;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -125,6 +125,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.time-block {
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
|
||||
@@ -141,6 +141,7 @@ function getList(type = 'add', loading = true) {
|
||||
color: #666D7F;
|
||||
}
|
||||
.active{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
@@ -167,6 +168,7 @@ function getList(type = 'add', loading = true) {
|
||||
}
|
||||
}
|
||||
.card-Title{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
line-height: 70rpx
|
||||
|
||||
136
packageA/pages/tiktok/tiktok.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div class="video-container">
|
||||
<view class="back-box">
|
||||
<view class="btn">
|
||||
<uni-icons type="left" size="26" color="#FFFFFF" @click="navBack"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<mTikTok :video-list="state.videoList" :pause-type="1" :controls="false" @loadMore="loadMore" @change="change">
|
||||
<template v-slot="data">
|
||||
<view class="video-layer">
|
||||
<view class="title line_1">{{ currentItem.companyName }}</view>
|
||||
<view class="discription">
|
||||
<text class="line_1">
|
||||
{{ currentItem.jobTitle }}
|
||||
</text>
|
||||
<view class="seedetail" @click="nextDetail">
|
||||
查看详情
|
||||
<uni-icons type="right" color="#FFFFFF" size="14"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</mTikTok>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navBack, navTo } = inject('globalFunction');
|
||||
import mTikTok from '@/components/TikTok/TikTok.vue';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js';
|
||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||
const state = reactive({
|
||||
videoList: [],
|
||||
});
|
||||
const currentItem = ref(null);
|
||||
|
||||
onLoad(() => {
|
||||
const jobInfo = uni.getStorageSync(`job-Info`);
|
||||
if (jobInfo) {
|
||||
currentItem.value = jobInfo;
|
||||
state.videoList.push(jobInfo);
|
||||
}
|
||||
getNextVideoSrc(2);
|
||||
});
|
||||
|
||||
function nextDetail() {
|
||||
const job = currentItem.value;
|
||||
// 记录岗位类型,用作数据分析
|
||||
if (job.jobCategory) {
|
||||
const recordData = recommedIndexDb.JobParameter(job);
|
||||
recommedIndexDb.addRecord(recordData);
|
||||
}
|
||||
console.log(job.jobId);
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
}
|
||||
|
||||
function getNextVideoSrc(num) {
|
||||
let params = {
|
||||
uuid: useUserStore().seesionId,
|
||||
count: num || 1,
|
||||
};
|
||||
$api.createRequest('/app/job/littleVideo/random', params).then((resData) => {
|
||||
const { data, code } = resData;
|
||||
state.videoList.push(...data);
|
||||
});
|
||||
}
|
||||
|
||||
const loadMore = () => {
|
||||
// 触发加载更多
|
||||
console.log('加载更多');
|
||||
getNextVideoSrc();
|
||||
};
|
||||
|
||||
const change = (e) => {
|
||||
currentItem.value = e.detail;
|
||||
console.log('🚀 ~ file: index.vue:53 ~ change ~ data:', e);
|
||||
};
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.video-container{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: relative
|
||||
.back-box{
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
top: 20rpx
|
||||
color: #FFFFFF
|
||||
z-index: 2
|
||||
}
|
||||
}
|
||||
.video-layer {
|
||||
position: absolute;
|
||||
left: 24rpx;
|
||||
right: 24rpx;
|
||||
bottom: 30rpx;
|
||||
color: #fff;
|
||||
.title{
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
}
|
||||
.discription{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 0%;
|
||||
margin-top: 20rpx
|
||||
display: flex
|
||||
align-items: center
|
||||
.seedetail{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
white-space: nowrap
|
||||
padding-left: 20rpx
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
|
||||
image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
53
pages.json
@@ -47,6 +47,20 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/userTypeTest",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户类型测试",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/job/publishJob",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发布岗位",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/chat/chat",
|
||||
"style": {
|
||||
@@ -65,6 +79,14 @@
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "packageA/pages/addWorkExperience/addWorkExperience",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "添加工作经历",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
@@ -186,10 +208,41 @@
|
||||
"navigationBarTitleText": "系统通知",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tiktok/tiktok",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/moreJobs/moreJobs",
|
||||
"style": {
|
||||
"navigationBarTitleText": "更多岗位",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/collection/compare",
|
||||
"style": {
|
||||
"navigationBarTitleText": " 岗位对比",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/myResume/corporateInformation",
|
||||
"style": {
|
||||
"navigationBarTitleText": " 企业详情",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
]
|
||||
}],
|
||||
"tabBar": {
|
||||
"custom": true,
|
||||
"display": "none",
|
||||
"color": "#5E5F60",
|
||||
"selectedColor": "#256BFA",
|
||||
"borderStyle": "black",
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
|
||||
<view class="cards" v-if="fairList.length">
|
||||
<view
|
||||
class="card btn-incline"
|
||||
class="card press-button"
|
||||
v-for="(item, index) in fairList"
|
||||
:key="index"
|
||||
@click="navTo('/packageA/pages/exhibitors/exhibitors?jobFairId=' + item.jobFairId)"
|
||||
@@ -83,6 +83,7 @@
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<Tabbar :currentpage="1"></Tabbar>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -90,6 +91,7 @@
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import Tabbar from '@/components/tabbar/midell-box.vue';
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import { storeToRefs } from 'pinia';
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
@@ -371,6 +373,7 @@ function getNextDates({ startDate = '', count = 6 }) {
|
||||
flex-wrap: nowrap
|
||||
overflow: hidden
|
||||
.weel-days{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
display: flex
|
||||
justify-content: center
|
||||
flex-direction: column
|
||||
@@ -424,6 +427,7 @@ function getNextDates({ startDate = '', count = 6 }) {
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
.card-title{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
@@ -448,6 +452,7 @@ function getNextDates({ startDate = '', count = 6 }) {
|
||||
font-weight: 500;
|
||||
font-size: 48rpx;
|
||||
color: #333333;
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.left-dateDay{
|
||||
font-weight: 400;
|
||||
|
||||
@@ -55,24 +55,26 @@
|
||||
<header class="head">
|
||||
<view class="main-header">
|
||||
<image src="/static/icon/Hamburger-button.png" @click="toggleDrawer"></image>
|
||||
<view class="title">青岛市岗位推荐</view>
|
||||
<view class="title">{{ config.appInfo.areaName }}岗位推荐</view>
|
||||
<image src="/static/icon/Comment-one.png" @click="addNewDialogue"></image>
|
||||
</view>
|
||||
</header>
|
||||
<view class="chatmain-warpper">
|
||||
<ai-paging ref="paging"></ai-paging>
|
||||
</view>
|
||||
<!-- 自定义tabbar -->
|
||||
<view class="chatmain-footer" v-show="!isDrawerOpen">
|
||||
<Tabbar :currentpage="2"></Tabbar>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自定义tabbar -->
|
||||
<!-- <tabbar-custom :currentpage="2"></tabbar-custom> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject, nextTick, computed } from 'vue';
|
||||
const { $api, navTo, insertSortData } = inject('globalFunction');
|
||||
const { $api, navTo, insertSortData, config } = inject('globalFunction');
|
||||
import { onLoad, onShow, onHide } from '@dcloudio/uni-app';
|
||||
import Tabbar from '@/components/tabbar/midell-box.vue';
|
||||
import useChatGroupDBStore from '@/stores/userChatGroupStore';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import aiPaging from './components/ai-paging.vue';
|
||||
@@ -81,13 +83,13 @@ const { isTyping, tabeList, chatSessionID } = storeToRefs(useChatGroupDBStore())
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const isDrawerOpen = ref(false);
|
||||
const scrollIntoView = ref(false);
|
||||
import config from '@/config';
|
||||
|
||||
const searchText = ref('');
|
||||
const paging = ref(null);
|
||||
|
||||
// 实时过滤
|
||||
const filteredList = computed(() => {
|
||||
// console.log(tabeList.value);
|
||||
if (!searchText.value) return tabeList.value;
|
||||
const list = tabeList.value.filter((item) => !item.isTitle && item.title.includes(searchText.value));
|
||||
const [result, lastData] = $api.insertSortData(list);
|
||||
@@ -108,16 +110,16 @@ onHide(() => {
|
||||
paging.value?.handleTouchCancel();
|
||||
if (isDrawerOpen.value) {
|
||||
isDrawerOpen.value = false;
|
||||
uni.showTabBar();
|
||||
// uni.showTabBar();
|
||||
}
|
||||
});
|
||||
|
||||
const toggleDrawer = () => {
|
||||
isDrawerOpen.value = !isDrawerOpen.value;
|
||||
if (isDrawerOpen.value) {
|
||||
uni.hideTabBar();
|
||||
// uni.hideTabBar();
|
||||
} else {
|
||||
uni.showTabBar();
|
||||
// uni.showTabBar();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -144,6 +146,7 @@ function updateSetting() {
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
header-height = 88rpx
|
||||
footer-height = 98rpx
|
||||
|
||||
/* 页面容器 */
|
||||
.container {
|
||||
@@ -277,6 +280,8 @@ header-height = 88rpx
|
||||
transition: margin-left 0.3s ease-in-out;
|
||||
position: relative
|
||||
background: #FFFFFF
|
||||
display: flex
|
||||
flex-direction: column
|
||||
.head
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
@@ -304,15 +309,20 @@ header-height = 88rpx
|
||||
height: 37rpx;
|
||||
|
||||
.chatmain-warpper
|
||||
height: 'calc(100% - %s)' % header-height
|
||||
height: 'calc(100% - %s)' %( header-height + footer-height)
|
||||
position: relative;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
border-top: 2rpx solid #F4F4F4;
|
||||
flex: 1
|
||||
|
||||
/* 页面被挤压时向右移动 */
|
||||
.main-content.shift {
|
||||
margin-left: 500rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
.chatmain-footer{
|
||||
height: footer-height;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<view class="chat-background" v-fade:600="!messages.length">
|
||||
<!-- #endif -->
|
||||
<image class="backlogo" src="/static/icon/backAI.png"></image>
|
||||
<view class="back-rowTitle">嗨!欢迎使用青岛AI智能求职</view>
|
||||
<view class="back-rowTitle">嗨!欢迎使用{{ config.appInfo.areaName }}AI智能求职</view>
|
||||
<view class="back-rowText">
|
||||
我可以根据您的简历和求职需求,帮你精准匹配青岛市互联网招聘信息,对比招聘信息的优缺点,提供面试指导等,请把你的任务交给我吧~
|
||||
我可以根据您的简历和求职需求,帮你精准匹配{{ config.appInfo.areaName }}互联网招聘信息,对比招聘信息的优缺点,提供面试指导等,请把你的任务交给我吧~
|
||||
</view>
|
||||
<view class="back-rowh3">猜你所想</view>
|
||||
<view
|
||||
@@ -259,7 +259,7 @@ import {
|
||||
watch,
|
||||
} from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import config from '@/config.js';
|
||||
// import config from '@/config.js';
|
||||
import useChatGroupDBStore from '@/stores/userChatGroupStore';
|
||||
import MdRender from '@/components/md-render/md-render.vue';
|
||||
import CollapseTransition from '@/components/CollapseTransition/CollapseTransition.vue';
|
||||
@@ -271,7 +271,7 @@ import FileText from './fileText.vue';
|
||||
import { useAudioRecorder } from '@/hook/useRealtimeRecorder.js';
|
||||
import { useTTSPlayer } from '@/hook/useTTSPlayer.js';
|
||||
// 全局
|
||||
const { $api, navTo, throttle } = inject('globalFunction');
|
||||
const { $api, navTo, throttle, config } = inject('globalFunction');
|
||||
const emit = defineEmits(['onConfirm']);
|
||||
const { messages, isTyping, textInput, chatSessionID } = storeToRefs(useChatGroupDBStore());
|
||||
import successIcon from '@/static/icon/success.png';
|
||||
@@ -285,9 +285,9 @@ const {
|
||||
volumeLevel,
|
||||
recognizedText,
|
||||
lastFinalText,
|
||||
} = useAudioRecorder(config.vioceBaseURl);
|
||||
} = useAudioRecorder();
|
||||
|
||||
const { speak, pause, resume, isSpeaking, isPaused, cancelAudio, audioUrl } = useTTSPlayer(config.speechSynthesis);
|
||||
const { speak, pause, resume, isSpeaking, isPaused, cancelAudio } = useTTSPlayer(config.speechSynthesis);
|
||||
|
||||
// state
|
||||
const queries = ref([]);
|
||||
@@ -370,7 +370,57 @@ const sendMessage = (text) => {
|
||||
filesList.value = [];
|
||||
useChatGroupDBStore()
|
||||
.getStearm(values, normalArr, scrollToBottom, {
|
||||
onComplete: () => console.log('Display complete'),
|
||||
onDataReceived: (data, message, index) => {
|
||||
// 流式朗读:只在内容足够长且包含完整信息时才开始朗读
|
||||
if (!message.self && message.displayText && message.displayText.trim()) {
|
||||
// 检查是否已经开始朗读这条消息
|
||||
if (speechIndex.value !== index) {
|
||||
// 延迟TTS,等待内容更完整
|
||||
// 只有在内容长度超过50个字符或者包含岗位信息时才开始朗读
|
||||
const hasJobInfo = message.displayText.includes('```job-json') ||
|
||||
message.displayText.includes('岗位') ||
|
||||
message.displayText.includes('公司') ||
|
||||
message.displayText.includes('薪资');
|
||||
|
||||
if (message.displayText.length > 50 || hasJobInfo) {
|
||||
console.log('🎵 Starting streaming TTS for message index:', index);
|
||||
console.log('📝 Current text length:', message.displayText.length);
|
||||
console.log('📝 Has job info:', hasJobInfo);
|
||||
|
||||
// 开始朗读当前消息
|
||||
speechIndex.value = index;
|
||||
readMarkdown(message.displayText, index);
|
||||
} else {
|
||||
console.log('⏳ Waiting for more content before TTS, current length:', message.displayText.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onComplete: () => {
|
||||
console.log('🎯 onComplete callback triggered');
|
||||
console.log('📊 Messages array length:', messages.value.length);
|
||||
|
||||
// 确保最后一条AI消息的朗读完成
|
||||
const lastMessageIndex = messages.value.length - 1;
|
||||
if (lastMessageIndex >= 0) {
|
||||
const lastMessage = messages.value[lastMessageIndex];
|
||||
if (!lastMessage.self && lastMessage.displayText && lastMessage.displayText.trim()) {
|
||||
console.log('🎵 Final TTS for complete message');
|
||||
console.log('📝 Final text length:', lastMessage.displayText.length);
|
||||
console.log('📝 Final text preview:', lastMessage.displayText.substring(0, 100) + '...');
|
||||
|
||||
// 停止当前的朗读(如果有的话)
|
||||
if (isSpeaking.value) {
|
||||
console.log('🛑 Stopping current TTS to start final complete TTS');
|
||||
cancelAudio();
|
||||
}
|
||||
|
||||
// 开始朗读完整的内容
|
||||
speechIndex.value = lastMessageIndex;
|
||||
readMarkdown(lastMessage.displayText, lastMessageIndex);
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
getGuess();
|
||||
@@ -620,21 +670,71 @@ function confirmFeeBack(value) {
|
||||
});
|
||||
}
|
||||
|
||||
// 防抖定时器
|
||||
let ttsDebounceTimer = null;
|
||||
|
||||
function readMarkdown(value, index) {
|
||||
speechIndex.value = index;
|
||||
if (speechIndex.value !== index) {
|
||||
console.log('🎤 readMarkdown called');
|
||||
console.log('📝 Text to speak:', value ? value.substring(0, 100) + '...' : 'No text');
|
||||
console.log('🔢 Index:', index);
|
||||
console.log('🔢 Current speechIndex:', speechIndex.value);
|
||||
console.log('⏸️ Is paused:', isPaused.value);
|
||||
console.log('🔊 Is speaking:', isSpeaking.value);
|
||||
|
||||
// 清除之前的防抖定时器
|
||||
if (ttsDebounceTimer) {
|
||||
clearTimeout(ttsDebounceTimer);
|
||||
}
|
||||
|
||||
// 如果当前正在播放其他消息,先停止
|
||||
if (speechIndex.value !== index && speechIndex.value !== 0) {
|
||||
console.log('🛑 Stopping current speech and starting new one');
|
||||
speechIndex.value = index;
|
||||
speak(value);
|
||||
return;
|
||||
}
|
||||
if (isPaused.value) {
|
||||
|
||||
speechIndex.value = index;
|
||||
|
||||
// 如果当前正在播放且暂停了,直接恢复
|
||||
if (isPaused.value && isSpeaking.value) {
|
||||
console.log('▶️ Resuming paused speech');
|
||||
resume();
|
||||
} else {
|
||||
speak(value);
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果当前正在播放且没有暂停,不需要重新开始
|
||||
if (isSpeaking.value && !isPaused.value) {
|
||||
console.log('🔊 Already speaking, no need to restart');
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用防抖,避免频繁调用TTS
|
||||
ttsDebounceTimer = setTimeout(() => {
|
||||
console.log('🎵 Starting new speech');
|
||||
console.log('🎵 Calling speak function with text length:', value ? value.length : 0);
|
||||
try {
|
||||
speak(value);
|
||||
console.log('✅ Speak function called successfully');
|
||||
} catch (error) {
|
||||
console.error('❌ Error calling speak function:', error);
|
||||
}
|
||||
}, 300); // 300ms防抖延迟
|
||||
}
|
||||
function stopMarkdown(value, index) {
|
||||
pause(value);
|
||||
console.log('⏸️ stopMarkdown called for index:', index);
|
||||
console.log('🔢 Current speechIndex:', speechIndex.value);
|
||||
console.log('🔊 Is speaking:', isSpeaking.value);
|
||||
console.log('⏸️ Is paused:', isPaused.value);
|
||||
|
||||
// 清除防抖定时器
|
||||
if (ttsDebounceTimer) {
|
||||
clearTimeout(ttsDebounceTimer);
|
||||
ttsDebounceTimer = null;
|
||||
}
|
||||
|
||||
speechIndex.value = index;
|
||||
pause();
|
||||
}
|
||||
function refreshMarkdown(index) {
|
||||
if (isTyping.value) {
|
||||
|
||||
1171
pages/index/components/index-one.vue
Normal file
333
pages/index/components/index-two.vue
Normal file
@@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<view class="app-container">
|
||||
<view class="nav-filter">
|
||||
<view class="filter-top" @touchmove.stop.prevent>
|
||||
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
|
||||
<view class="jobs-left">
|
||||
<view
|
||||
class="job button-click"
|
||||
:class="{ active: state.tabIndex === 'all' }"
|
||||
@click="choosePosition('all')"
|
||||
>
|
||||
全部
|
||||
</view>
|
||||
<view
|
||||
class="job button-click"
|
||||
:class="{ active: state.tabIndex === index }"
|
||||
v-for="(item, index) in userInfo.jobTitle"
|
||||
:key="index"
|
||||
@click="choosePosition(index)"
|
||||
>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="jobs-add button-click" @click="navTo('/pages/search/search')">
|
||||
<uni-icons class="iconsearch" color="#666D7F" type="search" size="18"></uni-icons>
|
||||
<text>搜索</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cards">
|
||||
<scroll-view :scroll-y="true" class="tab-scroll" @scrolltolower="scrollBottom">
|
||||
<view class="scroll-content">
|
||||
<custom-waterfalls-flow
|
||||
ref="waterfallsFlowRef"
|
||||
:column="columnCount"
|
||||
:columnSpace="columnSpace"
|
||||
@loaded="imageloaded"
|
||||
:value="list"
|
||||
>
|
||||
<template v-slot:default="job">
|
||||
<view class="slot-item">
|
||||
<view class="job-image btn-feel" @click="nextVideo(job)">
|
||||
<image class="cover-image" :src="job.cover" mode="aspectFill"></image>
|
||||
<view class="cover-triangle"></view>
|
||||
</view>
|
||||
<view class="job-info" @click="nextDetail(job)">
|
||||
<view class="salary">
|
||||
<Salary-Expectation
|
||||
:max-salary="job.maxSalary"
|
||||
:min-salary="job.minSalary"
|
||||
:is-month="true"
|
||||
></Salary-Expectation>
|
||||
<image v-if="job.isHot" class="flame" src="/static/icon/flame.png"></image>
|
||||
</view>
|
||||
<view class="title">{{ job.jobTitle }}</view>
|
||||
<view class="desc">
|
||||
<image class="point3" src="/static/icon/point3.png"></image>
|
||||
<!-- <uni-icons type="location" size="14"></uni-icons> -->
|
||||
<view class="descText">{{ job.companyName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</custom-waterfalls-flow>
|
||||
<loadmore ref="loadmoreRef"></loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, watchEffect, nextTick } from 'vue';
|
||||
import { usePagination } from '@/hook/usePagination';
|
||||
const { $api, navTo } = inject('globalFunction');
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import img from '@/static/icon/filter.png';
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import { useColumnCount } from '@/hook/useColumnCount';
|
||||
import { useRecommedIndexedDBStore, jobRecommender } from '@/stores/useRecommedIndexedDBStore.js';
|
||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||
// status
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const isLoaded = ref(false);
|
||||
const waterfallsFlowRef = ref(null);
|
||||
const loadmoreRef = ref(null);
|
||||
const state = reactive({
|
||||
tabIndex: 'all',
|
||||
});
|
||||
|
||||
// 响应式搜索条件(可以被修改)
|
||||
const searchParams = ref({});
|
||||
const pageSize = ref(10);
|
||||
const { list, loading, refresh, loadMore } = usePagination(
|
||||
(params) => $api.createRequest('/app/job/littleVideo', params),
|
||||
dataToImg, // 转换函数
|
||||
{
|
||||
pageSize: pageSize,
|
||||
search: searchParams,
|
||||
dataKey: 'data',
|
||||
onBeforeRequest: () => {
|
||||
loadmoreRef.value?.change('loading');
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
function imageloaded() {
|
||||
loadmoreRef.value?.change('more');
|
||||
}
|
||||
|
||||
const { columnCount, columnSpace } = useColumnCount(() => {
|
||||
pageSize.value = 10 * (columnCount.value - 1);
|
||||
nextTick(() => {
|
||||
waterfallsFlowRef.value?.refresh?.();
|
||||
useLocationStore().getLocation();
|
||||
});
|
||||
});
|
||||
|
||||
async function loadData() {
|
||||
try {
|
||||
if (isLoaded.value) return;
|
||||
isLoaded.value = true;
|
||||
refresh();
|
||||
} catch (err) {
|
||||
isLoaded.value = false; // 重置状态允许重试
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async function choosePosition(index) {
|
||||
state.tabIndex = index;
|
||||
if (index === 'all') {
|
||||
searchParams.value.jobTitle = '';
|
||||
} else {
|
||||
searchParams.value.jobTitle = userInfo.value.jobTitle[index];
|
||||
}
|
||||
console.log(searchParams.value);
|
||||
refresh('refresh');
|
||||
waterfallsFlowRef.value.refresh();
|
||||
}
|
||||
|
||||
function scrollBottom() {
|
||||
loadMore();
|
||||
}
|
||||
|
||||
function nextDetail(job) {
|
||||
// 记录岗位类型,用作数据分析
|
||||
if (job.jobCategory) {
|
||||
const recordData = recommedIndexDb.JobParameter(job);
|
||||
recommedIndexDb.addRecord(recordData);
|
||||
}
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
}
|
||||
|
||||
function nextVideo(job) {
|
||||
uni.setStorageSync(`job-Info`, job);
|
||||
navTo(`/packageA/pages/tiktok/tiktok`);
|
||||
}
|
||||
|
||||
function dataToImg(data) {
|
||||
return data.map((item) => ({
|
||||
...item,
|
||||
// image: item.cover,
|
||||
image: img,
|
||||
hide: true,
|
||||
}));
|
||||
}
|
||||
|
||||
defineExpose({ loadData });
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.app-container
|
||||
width: 100%;
|
||||
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
|
||||
background: url('@/static/icon/background2.png') 0 0 no-repeat;
|
||||
background-size: 100% 728rpx;
|
||||
// background-color: #FFFFFF;
|
||||
display: flex;
|
||||
flex-direction: column
|
||||
.cards
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
.tab-scroll
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
text-overflow: clip;
|
||||
.scroll-content{
|
||||
padding: 24rpx
|
||||
}
|
||||
|
||||
.nav-filter
|
||||
padding: 16rpx 28rpx 30rpx 28rpx
|
||||
.filter-top
|
||||
display: flex
|
||||
justify-content: space-between;
|
||||
.tab-scroll
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: clip;
|
||||
-webkit-mask-image: linear-gradient(to right, black 60%, transparent);
|
||||
mask-image: linear-gradient(to right, black 60%, transparent);
|
||||
.jobs-left
|
||||
display: flex
|
||||
flex-wrap: nowrap
|
||||
align-items: center
|
||||
.job
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666D7F;
|
||||
margin-right: 32rpx;
|
||||
white-space: nowrap
|
||||
.active
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
.jobs-add
|
||||
display: flex
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666D7F;
|
||||
line-height: 38rpx;
|
||||
.iconsearch
|
||||
margin-right: 6rpx
|
||||
.filter-bottom
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
padding: 24rpx 0
|
||||
.btm-left
|
||||
display: flex
|
||||
.filterbtm
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #666D7F;
|
||||
margin-right: 24rpx
|
||||
padding: 0rpx 16rpx
|
||||
.active
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #256BFA;
|
||||
.btm-right
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #6C7282;
|
||||
.right-sx
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
.active
|
||||
transform: rotate(180deg)
|
||||
|
||||
.slot-item
|
||||
background: #f4f4f4;
|
||||
// background: #f6f8fa;
|
||||
.job-image{
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
position: relative;
|
||||
.cover-image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.cover-triangle{
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 20rpx
|
||||
width: 36rpx
|
||||
height: 36rpx
|
||||
border-radius: 50%
|
||||
background: rgba(0,0,0,0.3)
|
||||
}
|
||||
.cover-triangle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-40%, -50%) rotate(90deg);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 8rpx solid transparent;
|
||||
border-right: 8rpx solid transparent;
|
||||
border-bottom: 12rpx solid #fff;
|
||||
}
|
||||
}
|
||||
.job-info{
|
||||
padding: 10rpx 10rpx 24rpx 24rpx
|
||||
}
|
||||
.salary
|
||||
color: #4C6EFB;
|
||||
font-size: 28rpx
|
||||
display: flex
|
||||
align-items: flex-start
|
||||
justify-content: space-between
|
||||
font-family: DIN-Medium;
|
||||
.flame
|
||||
margin-top: 4rpx
|
||||
margin-right: 4rpx
|
||||
width: 24rpx
|
||||
height: 31rpx
|
||||
.title
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-top: 6rpx;
|
||||
white-space: pre-wrap
|
||||
.desc
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #6C7282;
|
||||
margin-top: 6rpx;
|
||||
display: flex
|
||||
align-items: flex-start
|
||||
.descText{
|
||||
flex: 1
|
||||
white-space: pre-wrap
|
||||
}
|
||||
.point3{
|
||||
margin: 4rpx 4rpx 0 0
|
||||
height: 26rpx
|
||||
width: 26rpx
|
||||
}
|
||||
</style>
|
||||
@@ -1,734 +1,187 @@
|
||||
<template>
|
||||
<view class="app-container">
|
||||
<view class="nav-hidden hidden-animation" :class="{ 'hidden-height': isScrollingDown }">
|
||||
<view class="container-search">
|
||||
<view class="search-input button-click" @click="navTo('/pages/search/search')">
|
||||
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
|
||||
<text class="inpute">职位名称、薪资要求等</text>
|
||||
</view>
|
||||
<view class="chart button-click">职业图谱</view>
|
||||
</view>
|
||||
<view class="cards">
|
||||
<view class="card btn-feel" @click="navTo('/pages/nearby/nearby')">
|
||||
<view class="card-title">附近工作</view>
|
||||
<view class="card-text">好岗职等你来</view>
|
||||
</view>
|
||||
<view class="card btn-feel" @click="navTo('/packageA/pages/choiceness/choiceness')">
|
||||
<view class="card-title">精选企业</view>
|
||||
<view class="card-text">优选职得信赖</view>
|
||||
</view>
|
||||
<view class="app-custom-root">
|
||||
<view class="app-container">
|
||||
<!-- 主体内容区域 -->
|
||||
<view class="container-main">
|
||||
<IndexOne @onShowTabbar="changeShowTabbar" />
|
||||
</view>
|
||||
|
||||
<Tabbar :currentpage="0"></Tabbar>
|
||||
</view>
|
||||
<view class="nav-filter">
|
||||
<view class="filter-top">
|
||||
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
|
||||
<view class="jobs-left">
|
||||
<view
|
||||
class="job button-click"
|
||||
:class="{ active: state.tabIndex === 'all' }"
|
||||
@click="choosePosition('all')"
|
||||
>
|
||||
全部
|
||||
</view>
|
||||
<view
|
||||
class="job button-click"
|
||||
:class="{ active: state.tabIndex === index }"
|
||||
v-for="(item, index) in userInfo.jobTitle"
|
||||
:key="index"
|
||||
@click="choosePosition(index)"
|
||||
>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="jobs-add button-click" @click="navTo('/packageA/pages/addPosition/addPosition')">
|
||||
<uni-icons class="iconsearch" color="#666D7F" type="plusempty" size="18"></uni-icons>
|
||||
<text>添加</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter-bottom">
|
||||
<view class="btm-left">
|
||||
<view
|
||||
class="button-click filterbtm"
|
||||
:class="{ active: pageState.search.order === item.value }"
|
||||
v-for="item in rangeOptions"
|
||||
@click="handelHostestSearch(item)"
|
||||
:key="item.value"
|
||||
>
|
||||
{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btm-right button-click" @click="openFilter">
|
||||
筛选
|
||||
<image class="right-sx" :class="{ active: showFilter }" src="@/static/icon/shaixun.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-list">
|
||||
<scroll-view :scroll-y="true" class="falls-scroll" @scroll="handleScroll" @scrolltolower="scrollBottom">
|
||||
<view class="falls" v-if="list.length">
|
||||
<custom-waterfalls-flow
|
||||
:column="columnCount"
|
||||
:columnSpace="columnSpace"
|
||||
ref="waterfallsFlowRef"
|
||||
:value="list"
|
||||
>
|
||||
<template v-slot:default="job">
|
||||
<view class="item btn-feel" v-if="!job.recommend">
|
||||
<view class="falls-card" @click="nextDetail(job)">
|
||||
<view class="falls-card-pay">
|
||||
<view class="pay-text">
|
||||
<Salary-Expectation
|
||||
:max-salary="job.maxSalary"
|
||||
:min-salary="job.minSalary"
|
||||
:is-month="true"
|
||||
></Salary-Expectation>
|
||||
</view>
|
||||
<image v-if="job.isHot" class="flame" src="/static/icon/flame.png"></image>
|
||||
</view>
|
||||
<view class="falls-card-title">{{ job.jobTitle }}</view>
|
||||
<view class="fl_box fl_warp">
|
||||
<view class="falls-card-education mar_ri10" v-if="job.education">
|
||||
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
||||
</view>
|
||||
<view class="falls-card-experience" v-if="job.experience">
|
||||
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="falls-card-company">{{ job.companyName }}</view>
|
||||
<view class="falls-card-company">
|
||||
青岛
|
||||
<dict-Label dictType="area" :value="job.jobLocationAreaCode"></dict-Label>
|
||||
</view>
|
||||
<view class="falls-card-pepleNumber">
|
||||
<view>{{ job.postingDate || '发布日期' }}</view>
|
||||
<view>{{ vacanciesTo(job.vacancies) }}</view>
|
||||
</view>
|
||||
<!-- <view class="falls-card-matchingrate">
|
||||
<view class=""><matchingDegree :job="job"></matchingDegree></view>
|
||||
<uni-icons type="star" size="30"></uni-icons>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" :class="{ isBut: job.isBut }" v-else>
|
||||
<view class="recommend-card">
|
||||
<view class="card-content">
|
||||
<view class="recommend-card-title">在找「{{ job.jobCategory }}」工作吗?</view>
|
||||
<view class="recommend-card-tip">{{ job.tip }}</view>
|
||||
<view class="recommend-card-line"></view>
|
||||
<view class="recommend-card-controll">
|
||||
<view class="controll-no" @click="clearfindJob(job)">不是</view>
|
||||
<view class="controll-yes" @click="findJob(job)">是的</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</custom-waterfalls-flow>
|
||||
<loadmore ref="loadmoreRef"></loadmore>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 筛选 -->
|
||||
<select-filter ref="selectFilterModel"></select-filter>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, watchEffect, nextTick } from 'vue';
|
||||
import img from '@/static/icon/filter.png';
|
||||
import dictLabel from '@/components/dict-Label/dict-Label.vue';
|
||||
const { $api, navTo, vacanciesTo, formatTotal } = inject('globalFunction');
|
||||
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import Tabbar from '@/components/tabbar/midell-box.vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import IndexOne from './components/index-one.vue';
|
||||
// import IndexTwo from './components/index-two.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const { getTransformChildren, oneDictData } = useDictStore();
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import selectFilter from '@/components/selectFilter/selectFilter.vue';
|
||||
import { useRecommedIndexedDBStore, jobRecommender } from '@/stores/useRecommedIndexedDBStore.js';
|
||||
import { useScrollDirection } from '@/hook/useScrollDirection';
|
||||
import { useColumnCount } from '@/hook/useColumnCount';
|
||||
const { isScrollingDown, handleScroll } = useScrollDirection();
|
||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||
import { useReadMsg } from '@/stores/useReadMsg';
|
||||
const { unreadCount } = storeToRefs(useReadMsg());
|
||||
|
||||
const waterfallsFlowRef = ref(null);
|
||||
const loadmoreRef = ref(null);
|
||||
const conditionSearch = ref({});
|
||||
const waterfallcolumn = ref(2);
|
||||
const state = reactive({
|
||||
tabIndex: 'all',
|
||||
onLoad(() => {
|
||||
useReadMsg().fetchMessages();
|
||||
});
|
||||
const list = ref([]);
|
||||
const pageState = reactive({
|
||||
page: 0,
|
||||
total: 0,
|
||||
maxPage: 2,
|
||||
pageSize: 10,
|
||||
search: {
|
||||
order: 0,
|
||||
},
|
||||
});
|
||||
const inputText = ref('');
|
||||
const showFilter = ref(false);
|
||||
const selectFilterModel = ref(null);
|
||||
const showModel = ref(false);
|
||||
const rangeOptions = ref([
|
||||
{ value: 0, text: '推荐' },
|
||||
{ value: 1, text: '最热' },
|
||||
{ value: 2, text: '最新发布' },
|
||||
]);
|
||||
// const jobList = ref([
|
||||
// { name: '销售顾问', highlight: true },
|
||||
// { name: '销售管理', highlight: true },
|
||||
// { name: '销售工程师', highlight: true },
|
||||
// { name: '算法工程师', highlight: false },
|
||||
// { name: '生产经理', highlight: false },
|
||||
// { name: '市场策划', highlight: false },
|
||||
// { name: '商务服务', highlight: false },
|
||||
// { name: '客服', highlight: false },
|
||||
// { name: '创意总监', highlight: false },
|
||||
// ]);
|
||||
|
||||
const { columnCount, columnSpace } = useColumnCount(() => {
|
||||
pageState.pageSize = 10 * (columnCount.value - 1);
|
||||
getJobRecommend('refresh');
|
||||
nextTick(() => {
|
||||
waterfallsFlowRef.value?.refresh?.();
|
||||
useLocationStore().getLocation();
|
||||
});
|
||||
});
|
||||
|
||||
// onLoad(() => {
|
||||
// getJobRecommend('refresh');
|
||||
// });
|
||||
|
||||
function scrollBottom() {
|
||||
loadmoreRef.value.change('loading');
|
||||
if (state.tabIndex === 'all') {
|
||||
getJobRecommend();
|
||||
} else {
|
||||
getJobList();
|
||||
}
|
||||
}
|
||||
|
||||
function findJob(job) {
|
||||
if (job.isBut) {
|
||||
$api.msg('已确认');
|
||||
} else {
|
||||
list.value = list.value.map((item) => {
|
||||
if (item.recommend && item.jobCategory === job.jobCategory) {
|
||||
return {
|
||||
...item,
|
||||
isBut: true,
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
const jobstr = job.jobCategory;
|
||||
const jobsObj = {
|
||||
地区: 'area',
|
||||
岗位: 'jobTitle',
|
||||
经验: 'experience',
|
||||
};
|
||||
const [name, value] = jobstr.split(':');
|
||||
const nameAttr = jobsObj[name];
|
||||
if (name === '岗位') {
|
||||
conditionSearch.value[nameAttr] = value;
|
||||
} else {
|
||||
const valueAttr = oneDictData(nameAttr).filter((item) => item.label === value);
|
||||
if (valueAttr.length) {
|
||||
const val = valueAttr[0].value;
|
||||
conditionSearch.value[nameAttr] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clearfindJob(job) {
|
||||
if (job.isBut) {
|
||||
$api.msg('已确认');
|
||||
} else {
|
||||
list.value = list.value.map((item) => {
|
||||
if (item.recommend && item.jobCategory === job.jobCategory) {
|
||||
return {
|
||||
...item,
|
||||
isBut: true,
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
recommedIndexDb.deleteRecords(job);
|
||||
}
|
||||
}
|
||||
|
||||
function nextDetail(job) {
|
||||
// 记录岗位类型,用作数据分析
|
||||
if (job.jobCategory) {
|
||||
const recordData = recommedIndexDb.JobParameter(job);
|
||||
recommedIndexDb.addRecord(recordData);
|
||||
}
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
}
|
||||
|
||||
function openFilter() {
|
||||
showFilter.value = true;
|
||||
selectFilterModel.value?.open({
|
||||
title: '筛选',
|
||||
maskClick: true,
|
||||
success: (values) => {
|
||||
pageState.search = {
|
||||
...pageState.search,
|
||||
};
|
||||
for (const [key, value] of Object.entries(values)) {
|
||||
pageState.search[key] = value.join(',');
|
||||
}
|
||||
showFilter.value = false;
|
||||
getJobList('refresh');
|
||||
},
|
||||
cancel: () => {
|
||||
showFilter.value = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleFilterConfirm(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
function choosePosition(index) {
|
||||
state.tabIndex = index;
|
||||
list.value = [];
|
||||
if (index === 'all') {
|
||||
pageState.search = {
|
||||
order: pageState.search.order,
|
||||
};
|
||||
inputText.value = '';
|
||||
getJobRecommend('refresh');
|
||||
} else {
|
||||
// const id = useUserStore().userInfo.jobTitleId.split(',')[index];
|
||||
pageState.search.jobTitle = userInfo.value.jobTitle[index];
|
||||
inputText.value = '';
|
||||
getJobList('refresh');
|
||||
}
|
||||
}
|
||||
|
||||
function handelHostestSearch(val) {
|
||||
pageState.search.order = val.value;
|
||||
if (state.tabIndex === 'all') {
|
||||
getJobRecommend('refresh');
|
||||
} else {
|
||||
getJobList('refresh');
|
||||
}
|
||||
}
|
||||
|
||||
function getJobRecommend(type = 'add') {
|
||||
if (type === 'refresh') {
|
||||
list.value = [];
|
||||
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
|
||||
}
|
||||
let params = {
|
||||
pageSize: pageState.pageSize,
|
||||
sessionId: useUserStore().seesionId,
|
||||
...pageState.search,
|
||||
...conditionSearch.value,
|
||||
};
|
||||
let comd = { recommend: true, jobCategory: '', tip: '确认你的兴趣,为您推荐更多合适的岗位' };
|
||||
$api.createRequest('/app/job/recommend', params).then((resData) => {
|
||||
const { data, total } = resData;
|
||||
pageState.total = 0;
|
||||
if (type === 'add') {
|
||||
// 记录系统
|
||||
recommedIndexDb.getRecord().then((res) => {
|
||||
if (res.length) {
|
||||
// 数据分析系统
|
||||
const resultData = recommedIndexDb.analyzer(res);
|
||||
const { sort, result } = resultData;
|
||||
// 岗位询问系统
|
||||
const conditionCounts = Object.fromEntries(
|
||||
sort.filter((item) => item[1] > 1) // 过滤掉次数为 1 的项
|
||||
);
|
||||
jobRecommender.updateConditions(conditionCounts);
|
||||
|
||||
const question = jobRecommender.getNextQuestion();
|
||||
|
||||
if (question) {
|
||||
comd.jobCategory = question;
|
||||
data.unshift(comd);
|
||||
}
|
||||
}
|
||||
const reslist = dataToImg(data);
|
||||
list.value.push(...reslist);
|
||||
});
|
||||
} else {
|
||||
list.value = dataToImg(data);
|
||||
}
|
||||
// 切换状态
|
||||
if (data.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
}
|
||||
// 当没有岗位,刷新sessionId重新啦
|
||||
if (!data.length) {
|
||||
useUserStore().initSeesionId();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getJobList(type = 'add') {
|
||||
if (type === 'add' && pageState.page < pageState.maxPage) {
|
||||
pageState.page += 1;
|
||||
}
|
||||
if (type === 'refresh') {
|
||||
list.value = [];
|
||||
pageState.page = 1;
|
||||
pageState.maxPage = 2;
|
||||
waterfallsFlowRef.value.refresh();
|
||||
}
|
||||
let params = {
|
||||
current: pageState.page,
|
||||
pageSize: pageState.pageSize,
|
||||
...pageState.search,
|
||||
};
|
||||
|
||||
$api.createRequest('/app/job/list', params).then((resData) => {
|
||||
const { rows, total } = resData;
|
||||
if (type === 'add') {
|
||||
const str = pageState.pageSize * (pageState.page - 1);
|
||||
const end = list.value.length;
|
||||
const reslist = dataToImg(rows);
|
||||
list.value.splice(str, end, ...reslist);
|
||||
} else {
|
||||
list.value = dataToImg(rows);
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value?.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value?.change('more');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dataToImg(data) {
|
||||
return data.map((item) => ({
|
||||
...item,
|
||||
image: img,
|
||||
hide: true,
|
||||
}));
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
.app-container
|
||||
width: 100%;
|
||||
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
|
||||
background: url('@/static/icon/background2.png') 0 0 no-repeat;
|
||||
background-size: 100% 728rpx;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
flex-direction: column
|
||||
.hidden-animation
|
||||
max-height: 1000px;
|
||||
transition: all 0.3s ease;
|
||||
overflow: hidden;
|
||||
.hidden-height
|
||||
max-height: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
.container-search
|
||||
padding: 16rpx 24rpx
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
.search-input
|
||||
display: flex
|
||||
align-items: center;
|
||||
width: 100%
|
||||
height: 80rpx;
|
||||
line-height: 80rpx
|
||||
margin-right: 24rpx
|
||||
background: #FFFFFF;
|
||||
border-radius: 75rpx 75rpx 75rpx 75rpx;
|
||||
.iconsearch
|
||||
padding-left: 36rpx
|
||||
.inpute
|
||||
margin-left: 20rpx
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #B5B5B5;
|
||||
width: 100%
|
||||
.chart
|
||||
width: 170rpx;
|
||||
background: radial-gradient( 0% 56% at 87% 61%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.47) 100%);
|
||||
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(210,210,210,0.14);
|
||||
border-radius: 80rpx 80rpx 80rpx 80rpx;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
text-align: center
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
height: 36rpx;
|
||||
color: #000000;
|
||||
padding: 20rpx 30rpx
|
||||
.cards
|
||||
padding: 10rpx 28rpx
|
||||
display: grid
|
||||
grid-gap: 38rpx;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
.card
|
||||
height: calc(158rpx - 40rpx);
|
||||
padding: 22rpx 26rpx
|
||||
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(210,210,210,0.14);
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
.card-title
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
.card-text
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #9E9E9E;
|
||||
margin-top: 4rpx
|
||||
.card:first-child
|
||||
background: radial-gradient( 0% 56% at 87% 61%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.47) 100%),
|
||||
url('@/static/icon/fujin.png');
|
||||
background-size: 100%, 100%
|
||||
.card:last-child
|
||||
background: radial-gradient( 0% 56% at 87% 61%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.47) 100%),
|
||||
url('@/static/icon/jinxuan.png');
|
||||
background-size: 100%, 100%
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
|
||||
.nav-filter
|
||||
padding: 16rpx 28rpx 0 28rpx
|
||||
.filter-top
|
||||
display: flex
|
||||
justify-content: space-between;
|
||||
.tab-scroll
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: clip;
|
||||
-webkit-mask-image: linear-gradient(to right, black 60%, transparent);
|
||||
mask-image: linear-gradient(to right, black 60%, transparent);
|
||||
.jobs-left
|
||||
display: flex
|
||||
flex-wrap: nowrap
|
||||
.job
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #666D7F;
|
||||
margin-right: 32rpx;
|
||||
white-space: nowrap
|
||||
.active
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
.jobs-add
|
||||
display: flex
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #666D7F;
|
||||
line-height: 38rpx;
|
||||
.filter-bottom
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
padding: 24rpx 0
|
||||
.btm-left
|
||||
display: flex
|
||||
.filterbtm
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #666D7F;
|
||||
margin-right: 24rpx
|
||||
padding: 0rpx 16rpx
|
||||
.active
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #256BFA;
|
||||
.btm-right
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #6C7282;
|
||||
.right-sx
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
.active
|
||||
transform: rotate(180deg)
|
||||
.table-list
|
||||
background: #F4F4F4
|
||||
flex: 1
|
||||
overflow: hidden
|
||||
.falls-scroll
|
||||
width: 100%
|
||||
height: 100%
|
||||
.falls
|
||||
padding: 28rpx 28rpx;
|
||||
.item
|
||||
position: relative;
|
||||
// background: linear-gradient( 180deg, rgba(19, 197, 124, 0.4) 0%, rgba(255, 255, 255, 0) 30%), rgba(255, 255, 255, 0);
|
||||
.falls-card
|
||||
padding: 30rpx;
|
||||
.falls-card-title
|
||||
color: #606060;
|
||||
line-height: 49rpx;
|
||||
text-align: left;
|
||||
word-break:break-all
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
.falls-card-pay
|
||||
// height: 50rpx;
|
||||
word-break:break-all
|
||||
color: #002979;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
position: relative
|
||||
.pay-text
|
||||
color: #4C6EFB;
|
||||
padding-right: 10rpx
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
.flame
|
||||
position: absolute
|
||||
bottom: 0
|
||||
right: -10rpx
|
||||
transform: translate(0, -30%)
|
||||
width: 24rpx
|
||||
height: 31rpx
|
||||
.falls-card-education,.falls-card-experience
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
background: #F4F4F4;
|
||||
border-radius: 4rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
line-height: 30rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #6C7282;
|
||||
text-align: center;
|
||||
margin-top: 14rpx;
|
||||
white-space: nowrap
|
||||
|
||||
.falls-card-company,.falls-card-pepleNumber
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #606060;
|
||||
line-height: 25rpx;
|
||||
text-align: left;
|
||||
.falls-card-pepleNumber
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 38rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #6C7282;
|
||||
.falls-card-matchingrate
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 21rpx;
|
||||
color: #4778EC;
|
||||
text-align: left;
|
||||
// 推荐卡片
|
||||
.recommend-card::before
|
||||
position: absolute
|
||||
left: 0
|
||||
top: 0
|
||||
content: ''
|
||||
height: 60rpx
|
||||
width: 100%
|
||||
height: 8rpx;
|
||||
background: linear-gradient( to left, #9E74FD 0%, #256BFA 100%);
|
||||
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(0,54,170,0.15);
|
||||
.recommend-card
|
||||
padding: 24rpx
|
||||
.card-content
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
.recommend-card-title
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
.recommend-card-tip
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #6C7282;
|
||||
margin-top: 20rpx
|
||||
.recommend-card-line
|
||||
width: calc(100%);
|
||||
height: 0rpx;
|
||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
border: 2rpx dashed rgba(0,0,0,0.14);
|
||||
margin-top: 50rpx
|
||||
position: relative
|
||||
.recommend-card-line::before
|
||||
position: absolute
|
||||
content: ''
|
||||
left: 0
|
||||
top: 0
|
||||
transform: translate(-50% - 90rpx, -50%)
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
background: #F4F4F4;
|
||||
border-radius: 50%;
|
||||
.recommend-card-line::after
|
||||
position: absolute
|
||||
content: ''
|
||||
right: 0
|
||||
top: 0
|
||||
transform: translate(50% + 90rpx, -50%)
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
background: #F4F4F4;
|
||||
border-radius: 50%;
|
||||
.recommend-card-controll
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
margin-top: 40rpx
|
||||
padding: 0 6rpx;
|
||||
.controll-yes
|
||||
width: 124rpx;
|
||||
height: 70rpx;
|
||||
background: rgba(37,107,250,0.1);
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
text-align: center;
|
||||
line-height:70rpx
|
||||
color: #256BFA
|
||||
.controll-no
|
||||
width: 124rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
border: 2rpx solid #DEDEDE;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
.controll-yes:active, .controll-no:active
|
||||
width: 120rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx
|
||||
background: #e8e8e8
|
||||
border: 2rpx solid #e8e8e8
|
||||
.isBut{
|
||||
filter: grayscale(100%);
|
||||
.app-custom-root {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
width: 100vw;
|
||||
height: calc(100% - var(--window-bottom));
|
||||
overflow: hidden;
|
||||
}
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.container-header {
|
||||
height: calc(88rpx - 14rpx);
|
||||
text-align: center;
|
||||
line-height: calc(88rpx - 14rpx);
|
||||
font-size: 32rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 16rpx 44rpx 36rpx 44rpx;
|
||||
background: url('@/static/icon/msgTopbg.png') 0 0 no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.header-title {
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.header-btnLf {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
width: calc(60rpx * 3);
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #696969;
|
||||
margin-right: 44rpx;
|
||||
position: relative;
|
||||
.btns-wd{
|
||||
position: absolute
|
||||
top: 2rpx;
|
||||
right: 2rpx
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background: #F73636;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #EEEEFF;
|
||||
}
|
||||
}
|
||||
.active {
|
||||
font-weight: 600;
|
||||
font-size: 40rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.container-main {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.main-scroll {
|
||||
width: 100%
|
||||
height: 100%;
|
||||
}
|
||||
.scrollmain{
|
||||
padding: 28rpx
|
||||
}
|
||||
.swiper
|
||||
height: 100%;
|
||||
width: 100%
|
||||
.list
|
||||
width: 100%
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
// mask:
|
||||
.maskFristEntry
|
||||
position: fixed;
|
||||
// right: 20rpx;
|
||||
// bottom: calc(50% - 200rpx);
|
||||
height: 100vh
|
||||
width: 100vw
|
||||
background: rgba(0,0,0,0.3)
|
||||
.entry-content
|
||||
display: flex;
|
||||
align-items: center
|
||||
position: absolute
|
||||
left: 50%
|
||||
top: 35%
|
||||
transform: translate(-50%, -50%)
|
||||
flex-direction: column
|
||||
background: url('@/static/imgs/fristEntry.png') 0 0 no-repeat;
|
||||
background-size: 100% 100%;
|
||||
width: 480rpx
|
||||
height: 584rpx
|
||||
// padding-left: 80rpx
|
||||
.text1
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
margin-top: 370rpx
|
||||
font-size: 36rpx
|
||||
background: linear-gradient(273.34deg, #356CFA 3.58%, #A47FFD 85.84%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text; /* 有些浏览器兼容用 */
|
||||
text-fill-color: transparent;
|
||||
padding-left: 28rpx
|
||||
.text2
|
||||
padding-left: 28rpx
|
||||
margin-top: 8rpx
|
||||
font-size: 20rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
.indicateArrow
|
||||
height: 76rpx
|
||||
width: 68rpx
|
||||
.indicatefristEntry
|
||||
width: 244rpx
|
||||
height: 244rpx
|
||||
.goExperience
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
margin-left: 28rpx
|
||||
margin-top: 28rpx
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
background: linear-gradient( 180deg, #9974FD 0%, #286BFA 100%);
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 60rpx
|
||||
.maskFristEntry-Close
|
||||
position: absolute;
|
||||
left: calc(50% - 10rpx);
|
||||
bottom: -130rpx
|
||||
width: 42rpx
|
||||
height: 42rpx
|
||||
background: linear-gradient(273.34deg, #356CFA 3.58%, #A47FFD 85.84%);
|
||||
border-radius: 50%;
|
||||
.maskFristEntry-Close::before
|
||||
position: absolute;
|
||||
left: calc( 50% - 2rpx)
|
||||
top: calc( 50% - 10rpx)
|
||||
transform: rotate(45deg);
|
||||
content: ''
|
||||
background: #FFFFFF
|
||||
width: 4rpx
|
||||
height: 20rpx
|
||||
.maskFristEntry-Close::after
|
||||
position: absolute;
|
||||
left: calc( 50% - 2rpx)
|
||||
top: calc( 50% - 10rpx)
|
||||
transform: rotate(-45deg);
|
||||
content: ''
|
||||
background: #FFFFFF
|
||||
width: 4rpx
|
||||
height: 20rpx
|
||||
</style>
|
||||
|
||||
454
pages/job/publishJob.vue
Normal file
@@ -0,0 +1,454 @@
|
||||
<template>
|
||||
<view class="publish-job-page">
|
||||
<!-- 头部导航 -->
|
||||
<view class="header">
|
||||
<view class="header-left" @click="goBack">
|
||||
<image src="@/static/icon/back.png" class="back-icon"></image>
|
||||
</view>
|
||||
<view class="header-title">发布岗位</view>
|
||||
<view class="header-right"></view>
|
||||
</view>
|
||||
|
||||
<!-- 主要内容 -->
|
||||
<view class="content">
|
||||
<!-- 岗位基本信息 -->
|
||||
<view class="section">
|
||||
<view class="section-title">岗位基本信息</view>
|
||||
<view class="form-group">
|
||||
<view class="label">岗位名称 *</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入岗位名称"
|
||||
v-model="formData.jobTitle"
|
||||
/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">岗位类型 *</view>
|
||||
<picker
|
||||
mode="selector"
|
||||
:range="jobTypes"
|
||||
@change="onJobTypeChange"
|
||||
class="picker"
|
||||
>
|
||||
<view class="picker-text">{{ selectedJobType || '请选择岗位类型' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">工作地点 *</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入工作地点"
|
||||
v-model="formData.workLocation"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 薪资待遇 -->
|
||||
<view class="section">
|
||||
<view class="section-title">薪资待遇</view>
|
||||
<view class="salary-row">
|
||||
<view class="form-group">
|
||||
<view class="label">最低薪资</view>
|
||||
<input
|
||||
class="input salary-input"
|
||||
placeholder="0"
|
||||
type="number"
|
||||
v-model="formData.minSalary"
|
||||
/>
|
||||
</view>
|
||||
<view class="salary-separator">-</view>
|
||||
<view class="form-group">
|
||||
<view class="label">最高薪资</view>
|
||||
<input
|
||||
class="input salary-input"
|
||||
placeholder="0"
|
||||
type="number"
|
||||
v-model="formData.maxSalary"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">薪资单位</view>
|
||||
<picker
|
||||
mode="selector"
|
||||
:range="salaryUnits"
|
||||
@change="onSalaryUnitChange"
|
||||
class="picker"
|
||||
>
|
||||
<view class="picker-text">{{ selectedSalaryUnit || '请选择薪资单位' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 任职要求 -->
|
||||
<view class="section">
|
||||
<view class="section-title">任职要求</view>
|
||||
<view class="form-group">
|
||||
<view class="label">学历要求</view>
|
||||
<picker
|
||||
mode="selector"
|
||||
:range="educationLevels"
|
||||
@change="onEducationChange"
|
||||
class="picker"
|
||||
>
|
||||
<view class="picker-text">{{ selectedEducation || '请选择学历要求' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">工作经验</view>
|
||||
<picker
|
||||
mode="selector"
|
||||
:range="experienceLevels"
|
||||
@change="onExperienceChange"
|
||||
class="picker"
|
||||
>
|
||||
<view class="picker-text">{{ selectedExperience || '请选择工作经验' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">招聘人数</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入招聘人数"
|
||||
type="number"
|
||||
v-model="formData.recruitCount"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 岗位描述 -->
|
||||
<view class="section">
|
||||
<view class="section-title">岗位描述</view>
|
||||
<view class="form-group">
|
||||
<view class="label">岗位职责</view>
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="请详细描述岗位职责和工作内容"
|
||||
v-model="formData.jobDescription"
|
||||
></textarea>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">任职要求</view>
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="请描述对候选人的具体要求"
|
||||
v-model="formData.jobRequirements"
|
||||
></textarea>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<view class="section">
|
||||
<view class="section-title">联系方式</view>
|
||||
<view class="form-group">
|
||||
<view class="label">联系人</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入联系人姓名"
|
||||
v-model="formData.contactPerson"
|
||||
/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">联系电话</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入联系电话"
|
||||
v-model="formData.contactPhone"
|
||||
/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">联系邮箱</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入联系邮箱"
|
||||
v-model="formData.contactEmail"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="footer">
|
||||
<view class="btn-group">
|
||||
<button class="btn btn-cancel" @click="goBack">取消</button>
|
||||
<button class="btn btn-publish" @click="publishJob">发布岗位</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
jobTitle: '',
|
||||
workLocation: '',
|
||||
minSalary: '',
|
||||
maxSalary: '',
|
||||
recruitCount: '',
|
||||
jobDescription: '',
|
||||
jobRequirements: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
contactEmail: ''
|
||||
});
|
||||
|
||||
// 选择器数据
|
||||
const jobTypes = ['技术类', '销售类', '管理类', '服务类', '其他'];
|
||||
const salaryUnits = ['元/月', '元/年', '元/小时'];
|
||||
const educationLevels = ['不限', '高中', '大专', '本科', '硕士', '博士'];
|
||||
const experienceLevels = ['不限', '应届毕业生', '1-3年', '3-5年', '5-10年', '10年以上'];
|
||||
|
||||
// 选中的值
|
||||
const selectedJobType = ref('');
|
||||
const selectedSalaryUnit = ref('');
|
||||
const selectedEducation = ref('');
|
||||
const selectedExperience = ref('');
|
||||
|
||||
// 选择器事件处理
|
||||
const onJobTypeChange = (e) => {
|
||||
selectedJobType.value = jobTypes[e.detail.value];
|
||||
};
|
||||
|
||||
const onSalaryUnitChange = (e) => {
|
||||
selectedSalaryUnit.value = salaryUnits[e.detail.value];
|
||||
};
|
||||
|
||||
const onEducationChange = (e) => {
|
||||
selectedEducation.value = educationLevels[e.detail.value];
|
||||
};
|
||||
|
||||
const onExperienceChange = (e) => {
|
||||
selectedExperience.value = experienceLevels[e.detail.value];
|
||||
};
|
||||
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
// 发布岗位
|
||||
const publishJob = () => {
|
||||
// 简单验证
|
||||
if (!formData.jobTitle) {
|
||||
uni.showToast({
|
||||
title: '请输入岗位名称',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!formData.workLocation) {
|
||||
uni.showToast({
|
||||
title: '请输入工作地点',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 模拟发布成功
|
||||
uni.showLoading({
|
||||
title: '发布中...'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '发布成功',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
// 延迟返回
|
||||
setTimeout(() => {
|
||||
goBack();
|
||||
}, 1500);
|
||||
}, 2000);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.publish-job-page {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 30rpx;
|
||||
background: #fff;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
|
||||
.header-left {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.back-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
width: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.section {
|
||||
background: #fff;
|
||||
border-radius: 0;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
width: 100%;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 15rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-bottom: 2rpx solid #e0e0e0;
|
||||
border-radius: 0;
|
||||
padding: 0 0 10rpx 0;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
&:focus {
|
||||
border-bottom-color: #256BFA;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.textarea {
|
||||
width: 100%;
|
||||
min-height: 120rpx;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-bottom: 2rpx solid #e0e0e0;
|
||||
border-radius: 0;
|
||||
padding: 20rpx 0 10rpx 0;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
&:focus {
|
||||
border-bottom-color: #256BFA;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.picker {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-bottom: 2rpx solid #e0e0e0;
|
||||
border-radius: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 0 10rpx 0;
|
||||
|
||||
.picker-text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.salary-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
.form-group {
|
||||
flex: 1;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.salary-separator {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.salary-input {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
border: none;
|
||||
|
||||
&.btn-cancel {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
&.btn-publish {
|
||||
background: #256BFA;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,12 +3,12 @@
|
||||
<tabcontrolVue :current="tabCurrent">
|
||||
<template v-slot:tab0>
|
||||
<view class="login-content">
|
||||
<image class="logo" src="../../static/logo.png"></image>
|
||||
<image class="logo" src="@/static/logo.png"></image>
|
||||
<view class="logo-title">就业</view>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<button class="wxlogin" @click="loginTest">内测登录</button>
|
||||
<view class="wxaddress">青岛市公共就业和人才服务中心</view>
|
||||
<view class="wxaddress">{{ config.appInfo.areaName }}公共就业和人才服务中心</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-slot:tab1>
|
||||
@@ -56,6 +56,10 @@
|
||||
<view class="input-titile">学历</view>
|
||||
<input class="input-con" v-model="state.educationText" disabled placeholder="本科" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">身份证</view>
|
||||
<input class="input-con2" v-model="fromValue.idcard" maxlength="18" placeholder="本科" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="next-btn" @tap="nextStep">下一步</view>
|
||||
</view>
|
||||
@@ -119,10 +123,11 @@ import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const { $api, navTo } = inject('globalFunction');
|
||||
const { $api, navTo, config, IdCardValidator } = inject('globalFunction');
|
||||
const { loginSetToken, getUserResume } = useUserStore();
|
||||
const { getDictSelectOption, oneDictData } = useDictStore();
|
||||
const openSelectPopup = inject('openSelectPopup');
|
||||
// console.log(config.appInfo.areaName);
|
||||
// status
|
||||
const selectJobsModel = ref();
|
||||
const tabCurrent = ref(0);
|
||||
@@ -146,6 +151,7 @@ const fromValue = reactive({
|
||||
area: 0,
|
||||
jobTitleId: '',
|
||||
experience: '1',
|
||||
idcard: '',
|
||||
});
|
||||
|
||||
onLoad((parmas) => {
|
||||
@@ -192,7 +198,7 @@ function changeArea() {
|
||||
data: [oneDictData('area')],
|
||||
success: (_, [value]) => {
|
||||
fromValue.area = value.value;
|
||||
state.areaText = '青岛市-' + value.label;
|
||||
state.areaText = config.appInfo.areaName + '-' + value.label;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -245,6 +251,18 @@ function getTreeselect() {
|
||||
|
||||
// 登录
|
||||
function loginTest() {
|
||||
// uni.share({
|
||||
// provider: 'weixin',
|
||||
// scene: 'WXSceneSession',
|
||||
// type: 2,
|
||||
// imageUrl: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png',
|
||||
// success: function (res) {
|
||||
// console.log('success:' + JSON.stringify(res));
|
||||
// },
|
||||
// fail: function (err) {
|
||||
// console.log('fail:' + JSON.stringify(err));
|
||||
// },
|
||||
// });
|
||||
const params = {
|
||||
username: 'test',
|
||||
password: 'test',
|
||||
@@ -266,13 +284,22 @@ function loginTest() {
|
||||
}
|
||||
|
||||
function complete() {
|
||||
$api.createRequest('/app/user/resume', fromValue, 'post').then((resData) => {
|
||||
$api.msg('完成');
|
||||
getUserResume();
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
const result = IdCardValidator.validate(fromValue.idcard);
|
||||
if (result.valid) {
|
||||
$api.createRequest('/app/user/resume', fromValue, 'post').then((resData) => {
|
||||
$api.msg('完成');
|
||||
// 获取用户信息并存储到store中
|
||||
getUserResume().then((userInfo) => {
|
||||
console.log('用户信息已存储到store:', userInfo);
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$api.msg('身份证校验失败');
|
||||
console.log('验证失败:', result.message);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -389,6 +416,13 @@ function complete() {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #6A6A6A;
|
||||
.input-con2
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 80rpx;
|
||||
height: 80rpx;
|
||||
border-bottom: 2rpx solid #EBEBEB
|
||||
.input-con
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<AppLayout title="我的" back-gorund-color="#F4F4F4">
|
||||
<view class="mine-userinfo btn-feel" @click="navTo('/packageA/pages/myResume/myResume')">
|
||||
<view class="mine-userinfo btn-feel" @click="seeDetail">
|
||||
<view class="userindo-head">
|
||||
<image class="userindo-head-img" v-if="userInfo.sex === '0'" src="/static/icon/boy.png"></image>
|
||||
<image class="userindo-head-img" v-else src="/static/icon/girl.png"></image>
|
||||
@@ -96,12 +96,16 @@
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
<template #footer>
|
||||
<Tabbar :currentpage="4"></Tabbar>
|
||||
</template>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import Tabbar from '@/components/tabbar/midell-box.vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo } = inject('globalFunction');
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
@@ -131,6 +135,13 @@ function getUserstatistics() {
|
||||
counts.value = resData.data;
|
||||
});
|
||||
}
|
||||
function seeDetail() {
|
||||
if (userInfo.isCompanyUser) {
|
||||
navTo('/packageA/pages/myResume/corporateInformation');
|
||||
} else {
|
||||
navTo('/packageA/pages/myResume/myResume');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -153,6 +164,7 @@ function getUserstatistics() {
|
||||
padding: 36rpx 36rpx 64rpx 36rpx
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
position: relative
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
.top-title{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
@@ -170,7 +182,7 @@ function getUserstatistics() {
|
||||
width: auto;
|
||||
max-width: 60%;
|
||||
white-space: nowrap
|
||||
overflow:hidden;
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.top-btn{
|
||||
@@ -214,6 +226,7 @@ function getUserstatistics() {
|
||||
margin: 32rpx 16rpx 32rpx 10rpx
|
||||
}
|
||||
.left-text{
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
@@ -248,8 +261,9 @@ function getUserstatistics() {
|
||||
justify-content: center
|
||||
align-items: center
|
||||
.mini-num{
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 44rpx;
|
||||
font-size: 46rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.mini-text{
|
||||
@@ -279,6 +293,7 @@ function getUserstatistics() {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
.userinfo-ls-name
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 40rpx;
|
||||
color: #333333;
|
||||
@@ -307,4 +322,4 @@ function getUserstatistics() {
|
||||
border-radius: 2rpx
|
||||
background: #A2A2A2;
|
||||
transform: rotate(45deg)
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<Tabbar :currentpage="3"></Tabbar>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -34,6 +36,7 @@
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import Tabbar from '@/components/tabbar/midell-box.vue';
|
||||
import ReadComponent from './read.vue';
|
||||
import UnreadComponent from './unread.vue';
|
||||
const loadedMap = reactive([false, false]);
|
||||
@@ -115,6 +118,7 @@ function changeSwiperMsgType(e) {
|
||||
font-weight: bold;
|
||||
}
|
||||
.header-btnLf {
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<scroll-view scroll-y class="main-scroll">
|
||||
<view class="scrollmain">
|
||||
<view
|
||||
class="list-card btn-feel"
|
||||
class="list-card press-button"
|
||||
v-for="(item, index) in msgList"
|
||||
:key="index"
|
||||
@click="seeDetail(item, index)"
|
||||
@@ -133,6 +133,8 @@ defineExpose({ loadData });
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%
|
||||
text
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
.card-time
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<scroll-view scroll-y class="main-scroll">
|
||||
<view class="scrollmain">
|
||||
<view
|
||||
class="list-card btn-feel"
|
||||
class="list-card press-button"
|
||||
v-for="(item, index) in unreadMsgList"
|
||||
:key="index"
|
||||
@click="seeDetail(item)"
|
||||
@@ -119,6 +119,8 @@ defineExpose({ loadData });
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%
|
||||
text
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
.card-time
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
|
||||
@@ -118,6 +118,7 @@ const rangeOptions = ref([
|
||||
{ value: 0, text: '推荐' },
|
||||
{ value: 1, text: '最热' },
|
||||
{ value: 2, text: '最新发布' },
|
||||
{ value: 3, text: '疆外' },
|
||||
]);
|
||||
|
||||
function choosePosition(index) {
|
||||
@@ -241,10 +242,12 @@ function getJobList(type = 'add') {
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -294,6 +297,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
background: #F6F6F6;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
.active
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
color: #256BFA;
|
||||
background: #E9F0FF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
@@ -330,6 +334,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
margin-right: 32rpx;
|
||||
white-space: nowrap
|
||||
.active
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
|
||||
@@ -145,6 +145,7 @@ const rangeOptions = ref([
|
||||
{ value: 0, text: '推荐' },
|
||||
{ value: 1, text: '最热' },
|
||||
{ value: 2, text: '最新发布' },
|
||||
{ value: 3, text: '疆外' },
|
||||
]);
|
||||
|
||||
function changeRangeShow() {
|
||||
@@ -292,10 +293,12 @@ function getJobList(type = 'add') {
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -398,6 +401,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
margin-right: 32rpx;
|
||||
white-space: nowrap
|
||||
.active
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
|
||||
@@ -33,7 +33,14 @@
|
||||
donted: index === state.dont,
|
||||
}"
|
||||
></view>
|
||||
<view class="item-text">{{ item.stationName }}</view>
|
||||
<view
|
||||
class="item-text"
|
||||
:class="{
|
||||
textActive: index === state.dont,
|
||||
}"
|
||||
>
|
||||
{{ item.stationName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -152,6 +159,7 @@ const rangeOptions = ref([
|
||||
{ value: 0, text: '推荐' },
|
||||
{ value: 1, text: '最热' },
|
||||
{ value: 2, text: '最新发布' },
|
||||
{ value: 3, text: '疆外' },
|
||||
]);
|
||||
onLoad(() => {
|
||||
getSubway();
|
||||
@@ -185,7 +193,6 @@ function openFilter() {
|
||||
pageState.search[key] = value.join(',');
|
||||
}
|
||||
showFilter.value = false;
|
||||
console.log(pageState.search);
|
||||
getJobList('refresh');
|
||||
},
|
||||
cancel: () => {
|
||||
@@ -311,10 +318,12 @@ function getJobList(type = 'add') {
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -408,44 +417,43 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-bottom: 20rpx;
|
||||
.donted::after
|
||||
.item-dont::before
|
||||
position: absolute;
|
||||
content: '';
|
||||
color: #FFFFFF;
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
top: -5rpx;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%)
|
||||
width: 27rpx;
|
||||
height: 27rpx;
|
||||
line-height: 28rpx;
|
||||
background: blue !important;
|
||||
background: #F7B000;
|
||||
border-radius: 50%;
|
||||
.dontstart::after
|
||||
.item-dont::after
|
||||
position: absolute;
|
||||
content: '始';
|
||||
color: #FFFFFF;
|
||||
// content: '始';
|
||||
content: '';
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
top: -5rpx;
|
||||
width: 27rpx;
|
||||
height: 27rpx;
|
||||
line-height: 28rpx;
|
||||
background: #666666;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%)
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 50%;
|
||||
// .dontend::after
|
||||
// .donted::after
|
||||
// position: absolute;
|
||||
// content: '终';
|
||||
// color: #FFFFFF;
|
||||
// content: '';
|
||||
// font-size: 20rpx;
|
||||
// text-align: center;
|
||||
// left: 0;
|
||||
// top: -5rpx;
|
||||
// width: 27rpx;
|
||||
// height: 27rpx;
|
||||
// line-height: 28rpx;
|
||||
// background: #666666;
|
||||
// left: 50%;
|
||||
// top: 50%;
|
||||
// transform: translate(-50%, -50%)
|
||||
// width: 14rpx;
|
||||
// height: 14rpx;
|
||||
// background: #F7B000 !important;
|
||||
// border-radius: 50%;
|
||||
.item-text
|
||||
position: absolute
|
||||
@@ -458,6 +466,8 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
text-align: center;
|
||||
white-space: nowrap
|
||||
transform: translate(-50% + 8rpx, 0)
|
||||
.textActive
|
||||
color: #F7B000
|
||||
.three-item:nth-child(2n)
|
||||
.item-text
|
||||
margin-top: -90rpx;
|
||||
@@ -468,7 +478,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
top: -17rpx;
|
||||
width: 100%;
|
||||
height: 17rpx;
|
||||
background: #FFCB47;
|
||||
background: #F7B000;
|
||||
border-radius: 17rpx 17rpx 17rpx 17rpx;
|
||||
z-index: 1;
|
||||
.nearby-list
|
||||
@@ -503,6 +513,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
margin-right: 32rpx;
|
||||
white-space: nowrap
|
||||
.active
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
|
||||
@@ -122,6 +122,7 @@ const rangeOptions = ref([
|
||||
{ value: 0, text: '推荐' },
|
||||
{ value: 1, text: '最热' },
|
||||
{ value: 2, text: '最新发布' },
|
||||
{ value: 3, text: '疆外' },
|
||||
]);
|
||||
|
||||
function choosePosition(index) {
|
||||
@@ -222,10 +223,12 @@ function getJobList(type = 'add') {
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
|
||||
if (rows.length < pageState.pageSize) {
|
||||
loadmoreRef.value.change('noMore');
|
||||
} else {
|
||||
loadmoreRef.value.change('more');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -276,6 +279,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
background: #F6F6F6;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
.active
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
color: #256BFA;
|
||||
background: #E9F0FF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
@@ -311,6 +315,7 @@ defineExpose({ loadData, handleFilterConfirm });
|
||||
margin-right: 32rpx;
|
||||
white-space: nowrap
|
||||
.active
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<AppLayout title="附近" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
@@ -9,7 +9,7 @@
|
||||
<view class="nearby-head">
|
||||
<view class="head-item" :class="{ actived: state.current === 0 }" @click="changeType(0)">附近工作</view>
|
||||
<view class="head-item" :class="{ actived: state.current === 1 }" @click="changeType(1)">区县工作</view>
|
||||
<view class="head-item" :class="{ actived: state.current === 2 }" @click="changeType(2)">地铁周边</view>
|
||||
<view class="head-item" :class="{ actived: state.current === 2 }" @click="changeType(2)">公交周边</view>
|
||||
<view class="head-item" :class="{ actived: state.current === 3 }" @click="changeType(3)">商圈附近</view>
|
||||
</view>
|
||||
<view class="nearby-content">
|
||||
@@ -83,12 +83,16 @@ function handleTabChange(index) {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btnback{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
image {
|
||||
height: 100%;
|
||||
|
||||
@@ -1,33 +1,35 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="top">
|
||||
<image class="btnback button-click" src="@/static/icon/back.png" @click="navBack"></image>
|
||||
<view class="search-box">
|
||||
<uni-icons
|
||||
class="iconsearch"
|
||||
color="#666666"
|
||||
type="search"
|
||||
size="18"
|
||||
@confirm="searchCollection"
|
||||
></uni-icons>
|
||||
<input
|
||||
class="inputed"
|
||||
type="text"
|
||||
focus
|
||||
v-model="searchValue"
|
||||
placeholder="搜索职位名称"
|
||||
placeholder-class="placeholder"
|
||||
@confirm="searchBtn"
|
||||
/>
|
||||
<view>
|
||||
<view class="top">
|
||||
<image class="btnback button-click" src="@/static/icon/back.png" @click="navBack"></image>
|
||||
<view class="search-box">
|
||||
<uni-icons
|
||||
class="iconsearch"
|
||||
color="#666666"
|
||||
type="search"
|
||||
size="18"
|
||||
@confirm="searchCollection"
|
||||
></uni-icons>
|
||||
<input
|
||||
class="inputed"
|
||||
type="text"
|
||||
focus
|
||||
v-model="searchValue"
|
||||
placeholder="搜索职位名称"
|
||||
placeholder-class="placeholder"
|
||||
@confirm="searchBtn"
|
||||
/>
|
||||
</view>
|
||||
<view class="search-btn button-click" @click="searchBtn">搜索</view>
|
||||
</view>
|
||||
<view class="search-btn button-click" @click="searchBtn">搜索</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="Detailscroll-view" v-show="list.length" @scrolltolower="getJobList('add')">
|
||||
<scroll-view scroll-y class="Detailscroll-view" v-show="listCom.length" @scrolltolower="choosePosition">
|
||||
<view class="cards-box">
|
||||
<renderJobs :list="list" :longitude="longitudeVal" :latitude="latitudeVal"></renderJobs>
|
||||
<renderJobs :list="listCom" :longitude="longitudeVal" :latitude="latitudeVal"></renderJobs>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="main-content" v-show="!list.length">
|
||||
<view class="main-content" v-show="!listCom.length">
|
||||
<view class="content-top">
|
||||
<view class="top-left">历史搜索</view>
|
||||
<view class="top-right button-click" @click="remove">
|
||||
@@ -44,16 +46,20 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { inject, ref, reactive, nextTick } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
|
||||
const { $api, navBack } = inject('globalFunction');
|
||||
const { $api, navBack, navTo } = inject('globalFunction');
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useColumnCount } from '@/hook/useColumnCount';
|
||||
import { usePagination } from '@/hook/usePagination';
|
||||
import img from '@/static/icon/filter.png';
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
const searchValue = ref('');
|
||||
const historyList = ref([]);
|
||||
const list = ref([]);
|
||||
const searchParams = ref({});
|
||||
const listCom = ref([]);
|
||||
const pageState = reactive({
|
||||
page: 0,
|
||||
total: 0,
|
||||
@@ -63,6 +69,11 @@ const pageState = reactive({
|
||||
order: 0,
|
||||
},
|
||||
});
|
||||
// 响应式搜索条件(可以被修改)
|
||||
|
||||
async function choosePosition(index) {
|
||||
getJobList('add');
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
let arr = uni.getStorageSync('searchList');
|
||||
@@ -71,6 +82,9 @@ onLoad(() => {
|
||||
}
|
||||
});
|
||||
|
||||
function changeType(type) {
|
||||
getJobList('refresh');
|
||||
}
|
||||
function searchFn(item) {
|
||||
searchValue.value = item;
|
||||
searchBtn();
|
||||
@@ -83,6 +97,9 @@ function searchBtn() {
|
||||
historyList.value.unshift(searchValue.value);
|
||||
historyList.value = unique(historyList.value);
|
||||
uni.setStorageSync('searchList', historyList.value);
|
||||
searchParams.value = {
|
||||
jobTitle: searchValue,
|
||||
};
|
||||
getJobList('refresh');
|
||||
}
|
||||
|
||||
@@ -112,12 +129,25 @@ function remove() {
|
||||
historyList.value = [];
|
||||
}
|
||||
|
||||
function nextDetail(job) {
|
||||
// 记录岗位类型,用作数据分析
|
||||
if (job.jobCategory) {
|
||||
const recordData = recommedIndexDb.JobParameter(job);
|
||||
recommedIndexDb.addRecord(recordData);
|
||||
}
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
}
|
||||
|
||||
function nextVideo(job) {
|
||||
uni.setStorageSync(`job-Info`, job);
|
||||
navTo(`/packageA/pages/tiktok/tiktok`);
|
||||
}
|
||||
|
||||
function getJobList(type = 'add') {
|
||||
if (type === 'add' && pageState.page < pageState.maxPage) {
|
||||
pageState.page += 1;
|
||||
}
|
||||
if (type === 'refresh') {
|
||||
list.value = [];
|
||||
pageState.page = 1;
|
||||
pageState.maxPage = 2;
|
||||
}
|
||||
@@ -128,15 +158,15 @@ function getJobList(type = 'add') {
|
||||
jobTitle: searchValue.value,
|
||||
};
|
||||
|
||||
$api.createRequest('/app/job/list', params).then((resData) => {
|
||||
$api.createRequest('/app/job/list', params, 'GET', true).then((resData) => {
|
||||
const { rows, total } = resData;
|
||||
if (type === 'add') {
|
||||
const str = pageState.pageSize * (pageState.page - 1);
|
||||
const end = list.value.length;
|
||||
const end = listCom.value.length;
|
||||
const reslist = rows;
|
||||
list.value.splice(str, end, ...reslist);
|
||||
listCom.value.splice(str, end, ...reslist);
|
||||
} else {
|
||||
list.value = rows;
|
||||
listCom.value = rows;
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
@@ -147,6 +177,15 @@ function getJobList(type = 'add') {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dataToImg(data) {
|
||||
return data.map((item) => ({
|
||||
...item,
|
||||
// image: item.cover,
|
||||
image: img,
|
||||
hide: true,
|
||||
}));
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -156,12 +195,35 @@ function getJobList(type = 'add') {
|
||||
.Detailscroll-view{
|
||||
flex: 1
|
||||
overflow: hidden
|
||||
|
||||
}
|
||||
.container{
|
||||
display: flex
|
||||
flex-direction: column
|
||||
background: #F4f4f4
|
||||
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
|
||||
.view-top{
|
||||
display: flex;
|
||||
justify-content: space-around
|
||||
background: #FFFFFF;
|
||||
.top-item{
|
||||
padding: 6rpx 0 18rpx 0
|
||||
}
|
||||
.active{
|
||||
color: #256BFA;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
}
|
||||
.active::after{
|
||||
position: absolute;
|
||||
content: ''
|
||||
left: calc(50% - 12rpx)
|
||||
bottom: 10rpx
|
||||
width: 24rpx
|
||||
height: 6rpx
|
||||
background: #256BFA
|
||||
}
|
||||
}
|
||||
.main-content{
|
||||
background: #FFFFFF
|
||||
height: 100%
|
||||
@@ -244,4 +306,67 @@ function getJobList(type = 'add') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.slot-item
|
||||
// background: #f4f4f4;
|
||||
background: #FFFFFF;
|
||||
.job-info{
|
||||
padding: 10rpx 24rpx 24rpx 24rpx
|
||||
}
|
||||
.job-image{
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
position: relative;
|
||||
.cover-image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.cover-triangle{
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 20rpx
|
||||
width: 36rpx
|
||||
height: 36rpx
|
||||
border-radius: 50%
|
||||
background: rgba(0,0,0,0.3)
|
||||
}
|
||||
.cover-triangle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-40%, -50%) rotate(90deg);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 8rpx solid transparent;
|
||||
border-right: 8rpx solid transparent;
|
||||
border-bottom: 12rpx solid #fff;
|
||||
}
|
||||
}
|
||||
.salary
|
||||
color: #4C6EFB;
|
||||
font-size: 28rpx
|
||||
display: flex
|
||||
align-items: flex-start
|
||||
justify-content: space-between
|
||||
.flame
|
||||
margin-top: 4rpx
|
||||
margin-right: 4rpx
|
||||
width: 24rpx
|
||||
height: 31rpx
|
||||
.title
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-top: 6rpx;
|
||||
white-space: pre-wrap
|
||||
.desc
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #6C7282;
|
||||
margin-top: 6rpx;
|
||||
</style>
|
||||
|
||||
218
pages/test/userTypeTest.vue
Normal file
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<view class="test-page">
|
||||
<view class="header">
|
||||
<text class="title">用户类型测试页面</text>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<view class="current-info">
|
||||
<text class="label">当前用户类型:</text>
|
||||
<text class="value">{{ getCurrentTypeLabel() }}</text>
|
||||
</view>
|
||||
|
||||
<view class="type-switcher">
|
||||
<text class="section-title">切换用户类型:</text>
|
||||
<view class="buttons">
|
||||
<button
|
||||
v-for="(type, index) in userTypes"
|
||||
:key="index"
|
||||
:class="['btn', { active: currentUserType === type.value }]"
|
||||
@click="switchUserType(type.value)"
|
||||
>
|
||||
{{ type.label }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="navigation-info">
|
||||
<text class="section-title">底部导航栏配置:</text>
|
||||
<view class="nav-items">
|
||||
<view
|
||||
v-for="(item, index) in tabbarConfig"
|
||||
:key="index"
|
||||
class="nav-item"
|
||||
>
|
||||
<text class="nav-text">{{ item.text || 'AI助手' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="description">
|
||||
<text class="desc-title">说明:</text>
|
||||
<text class="desc-text">• 企业用户(userType=0):显示"发布岗位"导航,隐藏"招聘会"</text>
|
||||
<text class="desc-text">• 其他用户(userType=1,2,3):显示"招聘会"导航</text>
|
||||
<text class="desc-text">• 切换用户类型后,底部导航栏会自动更新</text>
|
||||
<text class="desc-text">• 企业用户模式下,"招聘会"导航项完全隐藏</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
|
||||
const userTypes = [
|
||||
{ value: 0, label: '企业用户' },
|
||||
{ value: 1, label: '求职者' },
|
||||
{ value: 2, label: '网格员' },
|
||||
{ value: 3, label: '政府人员' }
|
||||
];
|
||||
|
||||
const currentUserType = computed(() => userInfo.value?.userType || 0);
|
||||
|
||||
const switchUserType = (userType) => {
|
||||
userInfo.value.userType = userType;
|
||||
uni.setStorageSync('userInfo', userInfo.value);
|
||||
uni.showToast({
|
||||
title: `已切换到${getCurrentTypeLabel()}`,
|
||||
icon: 'success'
|
||||
});
|
||||
};
|
||||
|
||||
const getCurrentTypeLabel = () => {
|
||||
const type = userTypes.find(t => t.value === currentUserType.value);
|
||||
return type ? type.label : '未知';
|
||||
};
|
||||
|
||||
const tabbarConfig = computed(() => {
|
||||
const baseItems = [
|
||||
{ text: '首页' },
|
||||
{ text: currentUserType.value === 0 ? '发布岗位' : '招聘会' },
|
||||
{ text: '' }, // AI助手
|
||||
{ text: '消息' },
|
||||
{ text: '我的' }
|
||||
];
|
||||
return baseItems;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.test-page {
|
||||
padding: 40rpx;
|
||||
background: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.current-info {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #256BFA;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.type-switcher {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.section-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 15rpx;
|
||||
|
||||
.btn {
|
||||
padding: 15rpx 30rpx;
|
||||
border: 2rpx solid #ddd;
|
||||
border-radius: 8rpx;
|
||||
background: #fff;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
|
||||
&.active {
|
||||
background: #256BFA;
|
||||
color: #fff;
|
||||
border-color: #256BFA;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navigation-info {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.section-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-items {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
.nav-item {
|
||||
text-align: center;
|
||||
|
||||
.nav-text {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.desc-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 15rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.desc-text {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
display: block;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
static/.DS_Store
vendored
BIN
static/font/.DS_Store
vendored
BIN
static/font/DingTalk JinBuTi_min.woff2
Normal file
BIN
static/gif/.DS_Store
vendored
Normal file
BIN
static/gif/logo.gif
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
static/icon/pintDate.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
static/icon/point3.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
static/icon/pointpeople.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/icon/share.png
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
static/imgs/fristEntry.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
36
static/share.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>找工作,用 AI 更高效|青岛市智能求职平台</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<!-- 微信分享卡片标签(动态填充) -->
|
||||
<meta property="og:title" content="找工作,用 AI 更高效|青岛市智能求职平台" />
|
||||
<meta property="og:description" content="融合海量岗位、智能简历匹配、竞争力分析,助你精准锁定理想职位!" />
|
||||
<meta property="og:image" content="https://qd.zhaopinzao8dian.com/file/csn/qd_shareLogo.jpg" />
|
||||
<meta property="og:url" content="https://qd.zhaopinzao8dian.com" />
|
||||
<meta name="description" content="融合海量岗位、智能简历匹配、竞争力分析,助你精准锁定理想职位!">
|
||||
|
||||
<script>
|
||||
const params = new URLSearchParams(location.search)
|
||||
const jobId = params.get('jobId')
|
||||
// document.querySelector('meta[property="og:url"]').setAttribute('content', location.href)
|
||||
|
||||
// 延迟跳转到 Vue 页面
|
||||
setTimeout(() => {
|
||||
if (jobId) {
|
||||
window.location.href = `/#/packageA/pages/post/post?jobId=${jobId}`
|
||||
} else {
|
||||
window.location.href = '/#/'
|
||||
}
|
||||
}, 300)
|
||||
// 测试使用 分享等形式打开
|
||||
// http://localhost:5173/app/static/share.html?jobId=MTE4MzQ4NTE4
|
||||
// http://localhost:5173/app/static/share.html?jobId=MTE4MzQ4NTE4&_t=1752221704007#/
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>正在加载中...</p>
|
||||
</body>
|
||||
</html>
|
||||
1
static/svg/seemore.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1753846081356" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1008" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M256 384c38.272 0 72.576 16.768 96 43.392C332.16 449.92 320 479.552 320 512c0 32.448 12.096 62.08 32 84.608A128 128 0 1 1 256 384zM512 384c38.272 0 72.576 16.768 96 43.392C588.16 449.92 576 479.552 576 512c0 32.448 12.096 62.08 32 84.608A128 128 0 1 1 512 384z" fill="#256BFA" p-id="1009"></path><path d="M768 512m-128 0a128 128 0 1 0 256 0 128 128 0 1 0-256 0Z" fill="#256BFA" p-id="1010"></path></svg>
|
||||
|
After Width: | Height: | Size: 736 B |
3
static/tabbar/publish-job-selected.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg t="1760603654562" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19476" width="200" height="200">
|
||||
<path d="M599.4 850.3c-16.6 0-32.2-8.1-41.9-21.7l-3.4-5.8-0.2 0.1-108.3-179.3-222.6-17-5.7-0.4c-21.1-3-38.4-18.9-43.3-39.9-5-21.1 3.3-42.5 21.7-55.8l529.5-348.3c8.8-6.1 19-9.3 29.5-9.3 6.1 0 12.2 1.1 18 3.3 24.4 9.4 37.5 34.8 32 62L650 808.4l-0.1 0.3c-4.3 20.3-19.8 35.9-40.5 40.6-3.6 0.7-6.8 1-10 1z m-5.6-90.9l135.6-499.3-460.6 302.8 195.1 14.9c8.7 1.6 13.5 2.5 16.1 3.4 1.7 0.6 2.5 1.2 5.7 3.6 1.8 1.6 3 2.6 3.4 3l5.3 6.9 99.4 164.7z" fill="#256BFA" p-id="19477"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 633 B |
3
static/tabbar/publish-job.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg t="1760603654562" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19476" width="200" height="200">
|
||||
<path d="M599.4 850.3c-16.6 0-32.2-8.1-41.9-21.7l-3.4-5.8-0.2 0.1-108.3-179.3-222.6-17-5.7-0.4c-21.1-3-38.4-18.9-43.3-39.9-5-21.1 3.3-42.5 21.7-55.8l529.5-348.3c8.8-6.1 19-9.3 29.5-9.3 6.1 0 12.2 1.1 18 3.3 24.4 9.4 37.5 34.8 32 62L650 808.4l-0.1 0.3c-4.3 20.3-19.8 35.9-40.5 40.6-3.6 0.7-6.8 1-10 1z m-5.6-90.9l135.6-499.3-460.6 302.8 195.1 14.9c8.7 1.6 13.5 2.5 16.1 3.4 1.7 0.6 2.5 1.2 5.7 3.6 1.8 1.6 3 2.6 3.4 3l5.3 6.9 99.4 164.7z" fill="#666666" p-id="19477"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 633 B |
@@ -135,6 +135,7 @@ const useDictStore = defineStore("dict", () => {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
async function getDictSelectOption(dictType, isDigital) {
|
||||
const resp = await createRequest(`/app/common/dict/${dictType}`);
|
||||
if (resp.code === 200 && resp.data) {
|
||||
|
||||
@@ -7,6 +7,8 @@ import {
|
||||
import {
|
||||
msg
|
||||
} from '@/common/globalFunction.js'
|
||||
import config from '../config';
|
||||
|
||||
const useLocationStore = defineStore("location", () => {
|
||||
// 定义状态
|
||||
const longitudeVal = ref(null) // 经度
|
||||
@@ -25,10 +27,17 @@ const useLocationStore = defineStore("location", () => {
|
||||
longitude: 120.382665,
|
||||
latitude: 36.066938
|
||||
}
|
||||
longitudeVal.value = resd.longitude
|
||||
latitudeVal.value = resd.latitude
|
||||
msg('用户位置获取成功')
|
||||
resole(resd)
|
||||
if (config.UsingSimulatedPositioning) { // 使用模拟定位
|
||||
longitudeVal.value = resd.longitude
|
||||
latitudeVal.value = resd.latitude
|
||||
msg('用户位置获取成功')
|
||||
resole(resd)
|
||||
} else {
|
||||
longitudeVal.value = res.longitude
|
||||
latitudeVal.value = res.latitude
|
||||
msg('用户位置获取成功')
|
||||
resole(res)
|
||||
}
|
||||
},
|
||||
fail: function(err) {
|
||||
// longitudeVal.value = ''
|
||||
|
||||
@@ -15,6 +15,22 @@ import {
|
||||
// 控制消息
|
||||
export const useReadMsg = defineStore('readMsg', () => {
|
||||
const msgList = ref([])
|
||||
const badges = ref([{
|
||||
count: 0
|
||||
},
|
||||
{
|
||||
count: 0
|
||||
},
|
||||
{
|
||||
count: 0
|
||||
},
|
||||
{
|
||||
count: 0
|
||||
},
|
||||
{
|
||||
count: 0
|
||||
},
|
||||
])
|
||||
|
||||
// 计算总未读数量,基于 notReadCount 字段
|
||||
const unreadCount = computed(() =>
|
||||
@@ -30,14 +46,22 @@ export const useReadMsg = defineStore('readMsg', () => {
|
||||
// 设置 TabBar 角标
|
||||
function updateTabBarBadge() {
|
||||
const count = unreadCount.value
|
||||
const index = 3
|
||||
const countVal = count > 99 ? '99+' : String(count)
|
||||
if (count === 0) {
|
||||
uni.removeTabBarBadge({
|
||||
index: 3
|
||||
index
|
||||
}) // 替换为你消息页面的 TabBar index
|
||||
badges.value[index] = {
|
||||
count: 0
|
||||
}
|
||||
} else {
|
||||
badges.value[index] = {
|
||||
count: countVal
|
||||
}
|
||||
uni.setTabBarBadge({
|
||||
index: 3,
|
||||
text: count > 99 ? '99+' : String(count)
|
||||
index,
|
||||
text: countVal
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -76,6 +100,7 @@ export const useReadMsg = defineStore('readMsg', () => {
|
||||
}
|
||||
|
||||
return {
|
||||
badges,
|
||||
msgList,
|
||||
unreadMsgList,
|
||||
unreadCount,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
msg
|
||||
} from '@/common/globalFunction.js'
|
||||
import baseDB from './BaseDBStore';
|
||||
|
||||
import config from '../config';
|
||||
|
||||
class JobRecommendation {
|
||||
constructor() {
|
||||
@@ -62,6 +62,30 @@ class JobRecommendation {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算加权用户行为偏好
|
||||
* @param {Object} data - 用户行为数据,包括 categories、experience、areas、salary 等
|
||||
* @param {Object} weights - 每一类行为的权重
|
||||
* @returns {Object} 加权合并后的结果(key 为行为项,value 为权重后的分值)
|
||||
*/
|
||||
function applyWeightsToUserData(data, weights) {
|
||||
const result = {}
|
||||
|
||||
for (const key in data) {
|
||||
if (key === 'salary') {
|
||||
result.salary = weights.salary
|
||||
} else if (typeof data[key] === 'object') {
|
||||
result[key] = {}
|
||||
for (const itemKey in data[key]) {
|
||||
const rawValue = data[key][itemKey]
|
||||
result[key][itemKey] = parseFloat((rawValue * weights[key]).toFixed(2))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// **🔹 创建推荐系统**
|
||||
export const jobRecommender = new JobRecommendation();
|
||||
|
||||
@@ -121,8 +145,9 @@ export const useRecommedIndexedDBStore = defineStore("indexedDB", () => {
|
||||
}
|
||||
|
||||
function analyzer(jobsData) {
|
||||
const result = jobAnalyzer.analyze(jobsData)
|
||||
const sort = jobAnalyzer.printUnifiedResults(result)
|
||||
const result = jobAnalyzer.analyze(jobsData) // 转换格式化
|
||||
const result2 = applyWeightsToUserData(result, config.weights) // 添加权重
|
||||
const sort = jobAnalyzer.printUnifiedResults(result2) // 转换格式化
|
||||
return {
|
||||
result,
|
||||
sort
|
||||
|
||||
@@ -57,7 +57,7 @@ const useUserStore = defineStore("user", () => {
|
||||
hasLogin.value = true;
|
||||
userInfo.value = value;
|
||||
openId.value = value.wxOpenId;
|
||||
token.value = value.token
|
||||
token.value = value.token;
|
||||
uni.setStorage({
|
||||
key: 'token',
|
||||
data: value.token
|
||||
@@ -93,7 +93,7 @@ const useUserStore = defineStore("user", () => {
|
||||
similarityJobs.setUserInfo(resume.data)
|
||||
setUserInfo(resume);
|
||||
reslove(resume)
|
||||
});
|
||||
}).catch(() => reject());
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,8 +108,17 @@ const useUserStore = defineStore("user", () => {
|
||||
|
||||
const setUserInfo = (values) => {
|
||||
userInfo.value = values.data;
|
||||
resume.value = values.data; // 将用户信息同时存储到resume中
|
||||
// role.value = values.role;
|
||||
hasLogin.value = true;
|
||||
|
||||
// 模拟添加用户类型字段,实际项目中应该从接口获取
|
||||
if (!userInfo.value.userType) {
|
||||
userInfo.value.userType = 0; // 默认设置为企业用户
|
||||
}
|
||||
|
||||
// 持久化存储用户信息到本地缓存
|
||||
uni.setStorageSync('userInfo', values.data);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +136,21 @@ const useUserStore = defineStore("user", () => {
|
||||
seesionId.value = seesionIdVal
|
||||
}
|
||||
|
||||
// 从本地缓存恢复用户信息
|
||||
const restoreUserInfo = () => {
|
||||
const cachedUserInfo = uni.getStorageSync('userInfo');
|
||||
const cachedToken = uni.getStorageSync('token');
|
||||
if (cachedUserInfo && cachedToken) {
|
||||
userInfo.value = cachedUserInfo;
|
||||
resume.value = cachedUserInfo;
|
||||
token.value = cachedToken;
|
||||
hasLogin.value = true;
|
||||
Completion.value = getResumeCompletionPercentage(cachedUserInfo);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 导入
|
||||
return {
|
||||
hasLogin,
|
||||
@@ -139,7 +163,8 @@ const useUserStore = defineStore("user", () => {
|
||||
getUserResume,
|
||||
initSeesionId,
|
||||
seesionId,
|
||||
Completion
|
||||
Completion,
|
||||
restoreUserInfo
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ import {
|
||||
UUID
|
||||
} from '../lib/uuid-min';
|
||||
import config from '../config';
|
||||
import {
|
||||
clearJobMoreMap
|
||||
} from '@/utils/markdownParser';
|
||||
|
||||
const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
const tableName = ref('messageGroup')
|
||||
@@ -57,6 +60,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
if (!baseDB.isDBReady) await baseDB.initDB();
|
||||
chatSessionID.value = sessionId
|
||||
const list = await baseDB.db.queryByField(massageName.value, 'parentGroupId', sessionId);
|
||||
clearJobMoreMap() // 清空对话 加载更多参数
|
||||
if (list.length) {
|
||||
console.log('本地数据库存在该对话数据', list)
|
||||
messages.value = list
|
||||
@@ -103,7 +107,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
return await baseDB.db.add(massageName.value, payload);
|
||||
}
|
||||
|
||||
async function getStearm(text, fileUrls = [], progress) {
|
||||
async function getStearm(text, fileUrls = [], progress, options = {}) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
@@ -159,6 +163,11 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
...newMsg
|
||||
};
|
||||
progress && progress();
|
||||
|
||||
// 调用外部传入的onDataReceived回调
|
||||
if (options.onDataReceived) {
|
||||
options.onDataReceived(data, newMsg, index);
|
||||
}
|
||||
}
|
||||
|
||||
function onError(error) {
|
||||
@@ -173,6 +182,10 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
toggleTyping(false);
|
||||
window.removeEventListener("unload", handleUnload);
|
||||
handleUnload();
|
||||
// 调用外部传入的onComplete回调
|
||||
if (options.onComplete) {
|
||||
options.onComplete();
|
||||
}
|
||||
resolve();
|
||||
}
|
||||
|
||||
|
||||
BIN
unpackage/.DS_Store
vendored
BIN
unpackage/dist/.DS_Store
vendored
BIN
unpackage/dist/build/.DS_Store
vendored
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"hash": "ab0eb594",
|
||||
"configHash": "554cced5",
|
||||
"lockfileHash": "5d26acb0",
|
||||
"browserHash": "86a09ddc",
|
||||
"hash": "6baa819c",
|
||||
"configHash": "7c25a4d3",
|
||||
"lockfileHash": "e3b0c442",
|
||||
"browserHash": "1418816b",
|
||||
"optimized": {},
|
||||
"chunks": {}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import parseHtml from '@/lib/html-parser.js';
|
||||
// import DOMPurify from '@/lib/dompurify@3.2.4es.js';
|
||||
|
||||
export let codeDataList = []
|
||||
export let jobMoreMap = new Map()
|
||||
|
||||
const md = new MarkdownIt({
|
||||
html: true, // 允许 HTML 标签
|
||||
@@ -16,23 +17,31 @@ const md = new MarkdownIt({
|
||||
highlight: function(str, lang) {
|
||||
if (lang === 'job-json') {
|
||||
const result = safeExtractJson(str);
|
||||
const jobId = result.appJobUrl.split('jobId=')[1]
|
||||
return `
|
||||
<a class="custom-card" data-job-id="${jobId}">
|
||||
<div class="card-title">
|
||||
<span class="title-text" >${result.jobTitle}</span>
|
||||
<div class="card-salary">${result.salary}</div>
|
||||
</div>
|
||||
<div class="card-company">${result.location}·${result.companyName}</div>
|
||||
<div class="card-info">
|
||||
<div class="info-item">
|
||||
<div class="card-tag">${result.education}</div>
|
||||
<div class="card-tag">${result.experience}</div>
|
||||
if (result) { // json解析成功
|
||||
const jobId = result.appJobUrl.split('jobId=')[1]
|
||||
let domContext = `
|
||||
<a class="custom-card" data-job-id="${jobId}">
|
||||
<div class="card-title">
|
||||
<span class="title-text" >${result.jobTitle}</span>
|
||||
<div class="card-salary">${result.salary}</div>
|
||||
</div>
|
||||
<div class="info-item">查看详情<div class="position-nav"></div></div>
|
||||
</div>
|
||||
</a>
|
||||
`
|
||||
<div class="card-company">${result.location}·${result.companyName}</div>
|
||||
<div class="card-info">
|
||||
<div class="info-item">
|
||||
<div class="card-tag">${result.education}</div>
|
||||
<div class="card-tag">${result.experience}</div>
|
||||
</div>
|
||||
<div class="info-item">查看详情<div class="position-nav"></div></div>
|
||||
</div>
|
||||
</a>
|
||||
`
|
||||
if (result.data) {
|
||||
jobMoreMap.set(jobId, result.data)
|
||||
domContext +=
|
||||
`<a class="custom-more" data-job-id="${jobId}">查看更多岗位<div class="more-icon"></div></a>`
|
||||
}
|
||||
return domContext
|
||||
}
|
||||
}
|
||||
// <div class="card-tag">${result.location}</div>
|
||||
// <div class="info-item">${result.salary}</div>
|
||||
@@ -68,18 +77,54 @@ const md = new MarkdownIt({
|
||||
}
|
||||
})
|
||||
|
||||
function extractFirstJson(text) {
|
||||
let stack = [];
|
||||
let startIndex = -1;
|
||||
let endIndex = -1;
|
||||
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
const char = text[i];
|
||||
|
||||
if (char === '{') {
|
||||
if (stack.length === 0) startIndex = i; // 记录第一个 '{' 的位置
|
||||
stack.push(char);
|
||||
} else if (char === '}') {
|
||||
stack.pop();
|
||||
if (stack.length === 0) {
|
||||
endIndex = i; // 找到配对的 '}'
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (startIndex !== -1 && endIndex !== -1) {
|
||||
const jsonString = text.slice(startIndex, endIndex + 1);
|
||||
try {
|
||||
const jsonObject = JSON.parse(jsonString);
|
||||
return jsonObject;
|
||||
} catch (e) {
|
||||
return null; // 如果不是有效的 JSON
|
||||
}
|
||||
}
|
||||
|
||||
return null; // 如果没有找到有效的 JSON 对象
|
||||
}
|
||||
|
||||
|
||||
function safeExtractJson(text) {
|
||||
try {
|
||||
const match = text.match(/\{[\s\S]*?\}/); // 提取第一个完整的 JSON 块
|
||||
if (match) {
|
||||
return JSON.parse(match[0]);
|
||||
}
|
||||
const jsonObject = extractFirstJson(text);
|
||||
return jsonObject
|
||||
} catch (e) {
|
||||
console.error('JSON 解析失败:', e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function clearJobMoreMap() { // 切换对话清空
|
||||
jobMoreMap.clear()
|
||||
}
|
||||
|
||||
export function parseMarkdown(content) {
|
||||
if (!content) {
|
||||
return //处理特殊情况,比如网络异常导致的响应的 content 的值为空
|
||||
|
||||
@@ -31,13 +31,19 @@ export default function StreamRequest(url, data = {}, onDataReceived, onError, o
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
|
||||
let buffer = "";
|
||||
let retryCount = 0;
|
||||
const maxRetries = 3;
|
||||
|
||||
while (true) {
|
||||
const {
|
||||
done,
|
||||
value
|
||||
} = await reader.read();
|
||||
|
||||
if (done) break;
|
||||
if (done) {
|
||||
console.log("📡 Stream reading completed");
|
||||
break;
|
||||
}
|
||||
|
||||
buffer += decoder.decode(value, {
|
||||
stream: true
|
||||
@@ -45,6 +51,9 @@ export default function StreamRequest(url, data = {}, onDataReceived, onError, o
|
||||
|
||||
let lines = buffer.split("\n");
|
||||
buffer = lines.pop(); // 可能是不完整的 JSON 片段,留待下次解析
|
||||
|
||||
console.log(`📦 Processing ${lines.length} lines, buffer length: ${buffer.length}`);
|
||||
|
||||
for (let line of lines) {
|
||||
if (line.startsWith("data: ")) {
|
||||
const jsonData = line.slice(6).trim();
|
||||
@@ -55,20 +64,84 @@ export default function StreamRequest(url, data = {}, onDataReceived, onError, o
|
||||
}
|
||||
|
||||
try {
|
||||
const parsedData = JSON.parse(jsonData);
|
||||
const content = parsedData?.choices?.[0]?.delta?.content ??
|
||||
parsedData?.choices?.[0]?.delta?.reasoning_content ??
|
||||
"";
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
// 检查JSON数据是否完整
|
||||
if (jsonData && jsonData.trim() && jsonData !== "[DONE]") {
|
||||
const parsedData = JSON.parse(jsonData);
|
||||
|
||||
// 处理标准的choices格式
|
||||
if (parsedData?.choices?.[0]?.delta?.content) {
|
||||
const content = parsedData.choices[0].delta.content;
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
}
|
||||
}
|
||||
// 处理reasoning_content
|
||||
else if (parsedData?.choices?.[0]?.delta?.reasoning_content) {
|
||||
const content = parsedData.choices[0].delta.reasoning_content;
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
}
|
||||
}
|
||||
// 处理tool响应
|
||||
else if (parsedData?.tool?.response) {
|
||||
const content = parsedData.tool.response;
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
}
|
||||
}
|
||||
// 处理其他格式的数据(如jobs_array_number, durationSeconds等)
|
||||
else {
|
||||
console.log("📦 收到非内容数据:", Object.keys(parsedData));
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("JSON 解析失败:", e, "原始数据:", jsonData);
|
||||
console.error("JSON 解析失败:", e.message, "原始数据长度:", jsonData.length, "数据预览:", jsonData.substring(0, 100) + "...");
|
||||
// 不抛出错误,继续处理下一个数据块
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理剩余的缓冲区数据
|
||||
if (buffer.trim()) {
|
||||
console.log("📦 Processing remaining buffer:", buffer.substring(0, 100) + "...");
|
||||
const lines = buffer.split("\n");
|
||||
for (let line of lines) {
|
||||
if (line.startsWith("data: ")) {
|
||||
const jsonData = line.slice(6).trim();
|
||||
if (jsonData && jsonData !== "[DONE]") {
|
||||
try {
|
||||
const parsedData = JSON.parse(jsonData);
|
||||
|
||||
// 处理标准的choices格式
|
||||
if (parsedData?.choices?.[0]?.delta?.content) {
|
||||
const content = parsedData.choices[0].delta.content;
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
}
|
||||
}
|
||||
// 处理reasoning_content
|
||||
else if (parsedData?.choices?.[0]?.delta?.reasoning_content) {
|
||||
const content = parsedData.choices[0].delta.reasoning_content;
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
}
|
||||
}
|
||||
// 处理tool响应
|
||||
else if (parsedData?.tool?.response) {
|
||||
const content = parsedData.tool.response;
|
||||
if (content) {
|
||||
onDataReceived && onDataReceived(content);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("处理剩余数据时JSON解析失败:", e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onComplete && onComplete();
|
||||
resolve();
|
||||
} catch (error) {
|
||||
|
||||
95
用户类型导航功能说明.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# 用户类型导航功能实现说明
|
||||
|
||||
## 功能概述
|
||||
|
||||
根据用户类型动态显示不同的底部导航栏:
|
||||
- **企业用户(userType=0)**:显示"发布岗位"导航,隐藏"招聘会"导航
|
||||
- **其他用户(userType=1,2,3)**:显示"招聘会"导航
|
||||
|
||||
## 实现内容
|
||||
|
||||
### 1. 用户信息扩展
|
||||
- 在 `stores/useUserStore.js` 中添加了模拟的 `userType` 字段
|
||||
- 默认设置为企业用户(userType=0)
|
||||
|
||||
### 2. 导航栏组件修改
|
||||
- 修改了 `components/tabbar/midell-box.vue`
|
||||
- 根据 `userInfo.userType` 动态生成不同的导航配置
|
||||
- 企业用户显示"发布岗位",其他用户显示"招聘会"
|
||||
- 修复了跳转逻辑:tabBar页面使用 `switchTab`,普通页面使用 `navigateTo`
|
||||
- 更新了发布岗位图标:使用自定义SVG图标
|
||||
- 未选中状态:深灰色 (#666666) - 新图标设计
|
||||
- 选中状态:蓝色 (#256BFA) - 新图标设计
|
||||
|
||||
### 3. 发布岗位页面
|
||||
- 创建了 `pages/job/publishJob.vue` 发布岗位页面
|
||||
- 包含完整的岗位信息表单
|
||||
- 支持岗位基本信息、薪资待遇、任职要求、岗位描述、联系方式等
|
||||
|
||||
### 4. 测试组件
|
||||
- 创建了 `components/UserTypeSwitcher/UserTypeSwitcher.vue` 用于测试
|
||||
- 创建了 `pages/test/userTypeTest.vue` 测试页面
|
||||
- 在首页添加了用户类型切换器(可控制显示/隐藏)
|
||||
|
||||
## 用户类型定义
|
||||
|
||||
```javascript
|
||||
const userTypes = [
|
||||
{ value: 0, label: '企业用户' },
|
||||
{ value: 1, label: '求职者' },
|
||||
{ value: 2, label: '网格员' },
|
||||
{ value: 3, label: '政府人员' }
|
||||
];
|
||||
```
|
||||
|
||||
## 导航栏配置
|
||||
|
||||
### 企业用户(userType=0)
|
||||
- 首页
|
||||
- 发布岗位(招聘会导航完全隐藏)
|
||||
- AI助手
|
||||
- 消息
|
||||
- 我的
|
||||
|
||||
### 其他用户(userType=1,2,3)
|
||||
- 首页
|
||||
- 招聘会
|
||||
- AI助手
|
||||
- 消息
|
||||
- 我的
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 1. 切换用户类型
|
||||
```javascript
|
||||
// 在组件中切换用户类型
|
||||
userInfo.value.userType = 0; // 切换到企业用户
|
||||
uni.setStorageSync('userInfo', userInfo.value);
|
||||
```
|
||||
|
||||
### 2. 测试功能
|
||||
- 访问 `/pages/test/userTypeTest` 页面进行测试
|
||||
- 在首页可以看到用户类型切换器(测试用)
|
||||
|
||||
### 3. 生产环境
|
||||
- 移除测试相关的组件和代码
|
||||
- 从后端接口获取真实的用户类型信息
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 当前是模拟实现,实际项目中需要从后端接口获取用户类型
|
||||
2. 发布岗位页面已存在:`/packageA/pages/addPosition/addPosition`
|
||||
3. 招聘会页面已存在:`/pages/careerfair/careerfair`
|
||||
4. 测试完成后可以隐藏用户类型切换器
|
||||
|
||||
## 文件修改清单
|
||||
|
||||
- `stores/useUserStore.js` - 添加 userType 字段
|
||||
- `components/tabbar/midell-box.vue` - 动态导航配置
|
||||
- `pages/job/publishJob.vue` - 发布岗位页面
|
||||
- `static/tabbar/publish-job.svg` - 发布岗位图标(普通状态)
|
||||
- `static/tabbar/publish-job-selected.svg` - 发布岗位图标(选中状态)
|
||||
- `components/UserTypeSwitcher/UserTypeSwitcher.vue` - 测试组件
|
||||
- `pages/test/userTypeTest.vue` - 测试页面
|
||||
- `pages/index/components/index-one.vue` - 添加测试组件
|
||||
- `pages.json` - 添加页面配置
|
||||