113 Commits

Author SHA1 Message Date
francis_fh
f5bd523985 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-09 17:53:46 +08:00
francis_fh
be47e94196 H5端显示三列岗位列表 2025-12-09 17:53:45 +08:00
hanguangpu01
99aea9e243 feat(careerfair): 优化招聘会页面加载逻辑
- 异步加载招聘会数据
- 移除调试代码
- 简化登录状态检查逻辑
- 优化 exhibitors 页面跳转条件判断
- 移除冗余的登录提示信息
2025-12-09 17:48:07 +08:00
francis_fh
aa4b185aa2 优化展示 2025-12-09 16:24:41 +08:00
francis_fh
92c6488d18 字典映射修改 2025-12-09 16:23:32 +08:00
francis_fh
f1c8d0457b 111 2025-12-09 16:16:21 +08:00
francis_fh
5378031a58 设置密码 2025-12-08 21:54:30 +08:00
francis_fh
d2f61bcc45 岗位对比修改 2025-12-08 21:38:38 +08:00
francis_fh
d79d79f750 111 2025-12-08 21:31:18 +08:00
francis_fh
40127060b8 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-08 21:20:34 +08:00
francis_fh
16d1e50c85 bug修复 2025-12-08 21:20:33 +08:00
hanguangpu01
6006f5cd28 feat(auth): 实现第三方登录集成
- 在 careerfair.vue 中新增 thirdLogin 方法处理单点登录逻辑
- 修改 goDetail 方法,在跳转前执行第三方登录验证
- 在 packageB/train/index.vue 中增加 onLoad 钩子调用 thirdLogin
- 修改 jumps 方法,确保页面跳转前完成登录验证
- 在 request.js 中注释掉全局错误提示,避免重复提示
- 优化 videoDetail.vue 中的 getHeart 方法,移除冗余跳转逻辑
- 在 videoList.vue 中新增 playVideo 前的登录校验
- 统一多个页面中的 thirdLogin 实现,确保登录态一致性
2025-12-08 21:17:05 +08:00
d78382ba08 Merge remote-tracking branch 'origin/main' into CareerMap 2025-12-08 20:24:39 +08:00
a74cdcc850 Fix career map missing info redirect flow 2025-12-08 20:22:40 +08:00
d89b566ad3 修改政策 2025-12-08 16:11:01 +08:00
3c66e16e49 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-08 16:02:20 +08:00
ccbb5008bd 修改跳转 2025-12-08 16:01:34 +08:00
bc48d7fff0 fix:修改跳转逻辑 2025-12-05 17:59:37 +08:00
francis_fh
6baacfcf20 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-05 17:11:56 +08:00
sh
e290340b8c Merge branch 'CareerMap'
# Conflicts:
#	config.js
2025-12-05 17:07:38 +08:00
francis_fh
c4f7d6d998 服务指导页面优化 2025-12-05 17:06:22 +08:00
fa7749da9d fix: 更新 appUserInfo 完整地址 2025-12-05 17:02:44 +08:00
francis_fh
b2016378fb 服务指导页面开发 2025-12-05 17:01:50 +08:00
francis_fh
a812c7b1d6 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-05 16:29:49 +08:00
francis_fh
85a6066494 优化页面栈 2025-12-05 16:29:47 +08:00
hanguangpu01
ad69929666 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-05 16:21:00 +08:00
hanguangpu01
75a8edad10 feat(video): 优化视频详情页加载逻辑
- 添加 v-if 条件渲染确保视频封面存在时才加载视频组件
- 设置 preload="metadata" 提高页面初始加载性能
- 保留原有事件监听器和样式配置
2025-12-05 16:20:56 +08:00
francis_fh
27b2b721d3 Merge branch 'CareerMap' 2025-12-05 16:11:22 +08:00
francis_fh
0fbba1d868 附近页面滚动问题修复 2025-12-05 13:31:15 +08:00
francis_fh
ed077fd93c Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-05 11:26:08 +08:00
francis_fh
d76b8b664e 1 2025-12-05 11:26:05 +08:00
2880e674a2 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-04 19:51:00 +08:00
f20efdaa0a 优化素质测评功能体验 2025-12-04 19:50:47 +08:00
2268e4fad5 Merge remote-tracking branch 'origin/main' 2025-12-04 18:33:00 +08:00
16ebe3078b 单点,删除错题本,首页跳转修改 2025-12-04 18:32:38 +08:00
francis_fh
770239b4da Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-04 17:18:47 +08:00
francis_fh
d564281671 图片上传开发。详情页面图片展示 2025-12-04 17:18:45 +08:00
592ea8dd24 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-04 15:08:07 +08:00
cf7d228e0f 修改职业搜索id传值bug 2025-12-04 15:08:01 +08:00
lip
ec9f49b569 修改菜单名称 2025-12-04 14:47:01 +08:00
f8b9d3730b feat: 完善职业图谱功能 2025-12-04 14:38:54 +08:00
255f275552 修改接口地址 2025-12-04 14:04:58 +08:00
francis_fh
f7e20aa6a0 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-12-02 13:35:50 +08:00
francis_fh
9c8e182706 删除技能功能修复 2025-12-02 13:35:48 +08:00
f83a5d88ba 修改跳转bug 2025-11-28 15:13:42 +08:00
8293cb8bf6 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-28 13:56:37 +08:00
a31ea56a70 优化素质测评功能 2025-11-28 13:55:54 +08:00
7ae6d8f340 feat: 更新职业图谱接口配置和appUserInfo接口路径 2025-11-27 19:10:42 +08:00
francis_fh
714b06100a 移动端获取位置开发 2025-11-27 18:12:26 +08:00
francis_fh
dea4726e50 H5登录之后跳转修改 2025-11-27 17:07:04 +08:00
690c0fd6db 素质测评测试优化 2025-11-21 14:27:32 +08:00
90f1e9186d Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-20 18:39:26 +08:00
555dd66a47 职业素养功能修改 2025-11-20 18:37:15 +08:00
冯辉
5dfb1c0053 111 2025-11-19 18:40:27 +08:00
冯辉
d12383ed50 11 2025-11-19 18:31:57 +08:00
冯辉
5ac102cacc Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-19 18:31:05 +08:00
冯辉
f9e4394f87 1111 2025-11-19 18:31:04 +08:00
lip
0f9b34ea6f 修改地址 2025-11-19 18:27:35 +08:00
冯辉
75ac5338c3 111 2025-11-19 17:59:58 +08:00
冯辉
b5a1c58864 薪酬信息,简历指导页面开发 2025-11-19 17:51:01 +08:00
冯辉
fd2579fb5d 简历制作111 2025-11-19 13:02:40 +08:00
冯辉
be0ff1f725 111 2025-11-19 11:55:26 +08:00
冯辉
38c85282ce 筛选样式修改 2025-11-19 11:53:19 +08:00
冯辉
25dbbcd073 111 2025-11-18 22:13:57 +08:00
冯辉
4dd938e886 注释定位失败提示代码 2025-11-18 19:31:17 +08:00
冯辉
b6e3e2749e H5展示附近工作 2025-11-18 11:43:22 +08:00
冯辉
75ea9732fe 登录成功演示跳转 2025-11-18 11:14:48 +08:00
冯辉
33474fae1b 社保卡登录成功 2025-11-18 11:09:38 +08:00
冯辉
5c7bd3a6bc H5端首页显示内容修改 2025-11-18 10:57:59 +08:00
冯辉
7ee291158e 111 2025-11-14 19:54:14 +08:00
冯辉
77fafb0bd8 语法错误修改 2025-11-14 19:16:47 +08:00
冯辉
251770c057 身份证号码登录开发 2025-11-14 19:05:03 +08:00
冯辉
c798f1bdf2 一体机登录功能开发 2025-11-14 18:10:59 +08:00
冯辉
9cda4eacb3 优化发布职位选择定位按钮 2025-11-14 12:08:45 +08:00
冯辉
70aa72930d 测试git提示 2025-11-13 19:33:31 +08:00
冯辉
4ab0bc2f6e 企业用户bug修复 2025-11-13 19:28:00 +08:00
冯辉
1863cd8f62 单位详情页面发布时间优化 2025-11-13 12:23:13 +08:00
冯辉
b31e7d3913 技能字段修改 2025-11-13 12:14:34 +08:00
冯辉
76484a8194 技能等级维护 2025-11-13 11:49:08 +08:00
7f00dc69a8 merge: 合并 main 分支最新代码到 careermap 2025-11-13 10:52:38 +08:00
冯辉
cd59ed6696 使用微信小程序原生头部导航 2025-11-13 10:51:14 +08:00
冯辉
2e9a1106d7 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-13 10:32:54 +08:00
冯辉
a50ce27448 pages.json修改,gitigonre修改 2025-11-13 10:32:53 +08:00
75a4c235c1 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-13 10:31:32 +08:00
a57ef32532 fix:修复路由 2025-11-13 10:31:06 +08:00
冯辉
8cbd0d1fba 单位详情样式修改 2025-11-13 00:09:20 +08:00
冯辉
e2108b0f0c 单位详情页面优化 2025-11-13 00:01:52 +08:00
冯辉
d5a2198278 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-12 22:48:51 +08:00
冯辉
c69b332836 个人信息页面技能模块修改。 2025-11-12 22:48:49 +08:00
727297428b fix: 修复appUserInfo接口前缀问题 2025-11-12 22:38:22 +08:00
c01524616c merge: 合并 CareerMap 分支到 main(职业图谱功能) 2025-11-12 22:15:00 +08:00
505a3e4841 feat: 合并兼容 2025-11-12 22:02:32 +08:00
48ae762d10 merge: 合并main分支到CareerMap 2025-11-12 21:31:30 +08:00
76ece8bfe7 revert: 还原合并冲突文件 2025-11-12 21:14:53 +08:00
59435dc963 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-12 19:34:08 +08:00
b7cdf23c7e merge: 合并 CareerMap 分支到 main 2025-11-12 19:33:53 +08:00
967317367c fix: 修复 2025-11-12 19:31:46 +08:00
冯辉
4953bee633 11 2025-11-12 17:42:27 +08:00
1468002fe2 提交 2025-11-12 12:20:58 +08:00
冯辉
73f5cb8750 1 2025-11-12 11:45:14 +08:00
冯辉
b864904507 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-12 11:17:57 +08:00
冯辉
0450d28fd1 111 2025-11-12 11:17:55 +08:00
97c56e74e4 修改 2025-11-11 19:20:22 +08:00
b94eed3c9f 错题详情 2025-11-11 16:00:34 +08:00
b618b61ff6 错题练习 2025-11-11 14:32:05 +08:00
冯辉
44847c2b82 企业信息补全页面样式优化 2025-11-10 19:37:16 +08:00
冯辉
89529eb0f1 优化地区选择下拉 2025-11-10 19:21:34 +08:00
冯辉
07f6d0e93f 个人信息页面优化,增加技能等级和技能名称 2025-11-10 16:57:48 +08:00
冯辉
2f105af801 个人信息页面需求更改 2025-11-10 15:44:44 +08:00
冯辉
b485c5d760 Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2025-11-10 15:27:36 +08:00
冯辉
1a204549c4 优化个人中心页面 2025-11-10 15:27:34 +08:00
e75733af3f 错题本 2025-11-10 09:24:31 +08:00
8764849cd6 flat:职业图谱小程序端页面完成 2025-11-04 19:00:41 +08:00
154 changed files with 14017 additions and 7018 deletions

26
.gitignore vendored
View File

@@ -1,2 +1,26 @@
/unpackage/
/node_modules/
/node_modules/
/docs/
/.qoder/
/.idea/
.DS_Store
/dist/
/build/
.vscode/
*.log
*.tmp
*.swp
.env
.env.*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
/coverage/
/.nyc_output/
/.turbo/
/cache/
/output/
/hs_err_pid*
*.local
yarn.lock

46
apiRc/jobPath.js Normal file
View File

@@ -0,0 +1,46 @@
/*
* @Date: 2025-11-12
* @Description: 职业路径相关接口
*/
import request from '@/utilsRc/request'
// 根据职业名称获取路径列表
export function getJobPathPage(params) {
return request({
url: '/jobPath/getJobPathPage',
method: 'get',
params,
baseUrlType: 'zytp'
})
}
// 根据职业路径ID获取详情
export function getJobPathDetail(params) {
const requestParams = {};
if (params?.jobPathId !== undefined && params?.jobPathId !== null && params?.jobPathId !== '') {
requestParams.id = params.jobPathId;
} else if (params?.id !== undefined && params?.id !== null && params?.id !== '') {
requestParams.id = params.id;
}
if (!requestParams.id) {
return Promise.reject('缺少必需的 id 参数');
}
return request({
url: '/jobPath/getJobPathById',
method: 'get',
params: requestParams,
baseUrlType: 'zytp'
})
}
// 获取职业路径数量
export function getJobPathNum() {
return request({
url: '/jobPath/getJobPathNum',
method: 'get',
baseUrlType: 'zytp'
})
}

33
apiRc/jobRecommend.js Normal file
View File

@@ -0,0 +1,33 @@
/*
* @Date: 2025-11-12
* @Description: 职业推荐相关接口
*/
import request from '@/utilsRc/request'
function createFormData(payload = {}) {
if (typeof FormData !== 'undefined') {
const formData = new FormData()
Object.keys(payload).forEach(key => {
const value = payload[key]
if (value !== undefined && value !== null && value !== '') {
formData.append(key, value)
}
})
return formData
}
return payload
}
export function recommendJob(data) {
const params = {};
if (data?.jobName !== undefined && data?.jobName !== null && data?.jobName !== '') {
params.jobName = String(data.jobName);
}
return request({
url: '/job/recommendJobByJobName',
method: 'get',
params: params,
baseUrlType: 'zytp'
})
}

55
apiRc/jobSkill.js Normal file
View File

@@ -0,0 +1,55 @@
/*
* @Date: 2025-11-12
* @Description: 职业技能相关接口
*/
import request from '@/utilsRc/request'
export function getJobSkillDetail(params) {
return request({
url: '/jobSkillDet/getJobSkillDet',
method: 'get',
params,
baseUrlType: 'zytp'
})
}
// 获取技能权重
export function getJobSkillWeight(params) {
return request({
url: '/jobSkillDet/getJobSkillWeight',
method: 'get',
params,
baseUrlType: 'zytp'
})
}
// 暂未使用 - 如果需要在 CareerPath.vue 中点击路径职位查看详细技能信息时使用
// 使用场景:获取职业路径中某个职位的详细技能信息(包含技能分数、类型等)
// export function getJobPathSkill(data) {
// let formData
// if (typeof FormData !== 'undefined') {
// formData = new FormData()
// if (data?.pathId !== undefined && data?.pathId !== null) {
// formData.append('pathId', data.pathId)
// }
// if (data?.currentJobName !== undefined && data?.currentJobName !== null) {
// formData.append('currentJobName', data.currentJobName)
// }
// } else {
// formData = {
// pathId: data?.pathId ?? '',
// currentJobName: data?.currentJobName ?? ''
// }
// }
// return request({
// url: '/jobSkillDet/getJobPathSkill',
// method: 'post',
// data: formData,
// baseUrlType: 'zytp',
// header: {
// 'content-type': 'multipart/form-data'
// }
// })
// }

View File

@@ -44,10 +44,34 @@ export function register(data) {
})
}
// 身份证号码登录
export function idCardLogin(data) {
return request({
method: 'post',
url: '/app/idCardLogin',
data,
headers: {
isToken: false
}
})
}
// 手机号登录
export function phoneLogin(data) {
return request({
method: 'post',
url: '/app/phoneLogin',
data,
headers: {
isToken: false
}
})
}
// 获取用户详细信息
export function getInfo() {
return request({
url: '/getInfo',
method: 'get'
})
}
}

14
apiRc/user/user.js Normal file
View File

@@ -0,0 +1,14 @@
/*
* @Date: 2025-01-XX
* @LastEditors:
* @LastEditTime:
*/
import request from '@/utilsRc/request'
// 获取用户信息(职业规划推荐用)
export function appUserInfo() {
return request({
fullUrl: 'http://222.80.110.161:11111/api/ks/app/user/appUserInfo',
method: 'get'
})
}

View File

@@ -50,7 +50,8 @@ const prePage = () => {
return prePage.$vm;
}
export const urls ='http://10.110.145.145/images/train/'
// export const urls ='http://10.110.145.145/images/train/'
export const urls ='http://222.80.110.161:11111/images/train/'
/**
* 页面跳转封装,支持 query 参数传递和返回回调
@@ -60,34 +61,74 @@ export const urls ='http://10.110.145.145/images/train/'
* @param {object} options.query - 携带参数
* @param {function} options.onBack - 页面返回时的回调(目标页调用 uni.navigateBack 时传递数据)
*/
export const navTo = function(url, {
needLogin = false,
query = {},
onBack = null
} = {}) {
const userStore = useUserStore();
if (needLogin && !userStore.hasLogin) {
uni.navigateTo({
url: '/pages/complete-info/complete-info'
});
return;
}
const queryStr = Object.entries(query)
.map(([key, val]) => `${key}=${encodeURIComponent(val)}`)
.join('&');
const finalUrl = queryStr ? `${url}?${queryStr}` : url;
if (onBack) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
currentPage.__onBackCallback__ = onBack;
}
uni.navigateTo({
url: finalUrl
});
export const navTo = function(url, {
needLogin = false,
query = {},
onBack = null
} = {}) {
const userStore = useUserStore();
if (needLogin && !userStore.hasLogin) {
const pages = getCurrentPages();
if (pages.length >= 10) {
uni.redirectTo({
url: '/pages/complete-info/complete-info',
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
} else {
uni.navigateTo({
url: '/pages/complete-info/complete-info',
fail: (err) => {
console.error('页面跳转失败:', err);
uni.redirectTo({
url: '/pages/complete-info/complete-info',
fail: (err2) => {
console.error('redirectTo也失败:', err2);
}
});
}
});
}
return;
}
const queryStr = Object.entries(query)
.map(([key, val]) => `${key}=${encodeURIComponent(val)}`)
.join('&');
const finalUrl = queryStr ? `${url}?${queryStr}` : url;
if (onBack) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
currentPage.__onBackCallback__ = onBack;
}
const pages = getCurrentPages();
if (pages.length >= 10) {
// 页面栈已满使用redirectTo替代
uni.redirectTo({
url: finalUrl,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
} else {
uni.navigateTo({
url: finalUrl,
fail: (err) => {
console.error('页面跳转失败:', err);
// 失败后尝试redirectTo
uni.redirectTo({
url: finalUrl,
fail: (err2) => {
console.error('redirectTo也失败:', err2);
}
});
}
});
}
};
export const navBack = function({

View File

@@ -90,6 +90,10 @@ const handleScrollToLower = () => {
width: 100vw;
height: calc(100% - var(--window-bottom));
overflow: hidden;
/* H5环境安全区域适配 */
/* #ifdef H5 */
height: 100vh;
/* #endif */
}
.app-container {
// background-image: url('@/static/icon/background2.png');
@@ -140,7 +144,13 @@ const handleScrollToLower = () => {
.container-main {
flex: 1;
overflow: hidden;
padding-bottom: 20rpx;
}
/* #ifdef H5 */
.container-main {
padding-bottom: 120rpx!important;
}
/* #endif */
.main-scroll {
width: 100%;

View File

@@ -4,7 +4,8 @@
class="tabbar-item"
v-for="(item, index) in tabbarList"
:key="index"
@click="switchTab(item, index)"
@click.stop="switchTab(item, index)"
@tap.stop="switchTab(item, index)"
>
<view class="tabbar-icon">
<image
@@ -25,6 +26,7 @@ import { ref, computed, watch, onMounted } from 'vue';
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import { useReadMsg } from '@/stores/useReadMsg';
import { checkLoginAndNavigate } from '@/utils/loginHelper';
const props = defineProps({
currentPage: {
@@ -110,6 +112,8 @@ const generateTabbarList = () => {
});
} else {
// 求职者用户(包括未登录状态):显示招聘会
// H5端隐藏招聘会
// #ifndef H5
baseItems.splice(1, 0, {
id: 1,
text: '招聘会',
@@ -119,6 +123,7 @@ const generateTabbarList = () => {
centerItem: false,
badge: readMsg.badges[1]?.count || 0,
});
// #endif
}
return baseItems;
@@ -154,77 +159,77 @@ watch(() => userInfo.value, (newUserInfo, oldUserInfo) => {
// 切换tab
const switchTab = (item, index) => {
// 检查是否为"发布岗位"页面,需要判断企业信息是否完整
if (item.path === '/pages/job/publishJob') {
// 检查用户是否已登录
const token = uni.getStorageSync('token') || '';
const hasLogin = userStore.hasLogin;
if (!token || !hasLogin) {
// 未登录,发送事件显示登录弹窗
uni.$emit('showLoginModal');
return; // 不进行页面跳转
}
// 已登录,检查企业信息是否完整
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const storeUserInfo = userInfo.value || {};
const currentUserInfo = storeUserInfo.id ? storeUserInfo : cachedUserInfo;
// 判断企业信息字段company是否为null或undefined
if (!currentUserInfo.company || currentUserInfo.company === null) {
// 企业信息为空,跳转到企业信息补全页面
uni.navigateTo({
url: '/pages/complete-info/company-info',
});
} else {
// 企业信息完整,跳转到发布岗位页面
uni.navigateTo({
url: '/pages/job/publishJob',
});
}
currentItem.value = item.id;
return;
}
console.log('switchTab called', item, index);
// 检查是否为"我的"页面,需要登录验证和用户类型判断
if (item.path === '/pages/mine/mine') {
// 检查是否为需要登录的页面
const loginRequiredPages = [
'/pages/job/publishJob',
'/pages/mine/mine',
'/pages/mine/company-mine'
];
if (loginRequiredPages.includes(item.path)) {
// 检查用户是否已登录
const token = uni.getStorageSync('token') || '';
const hasLogin = userStore.hasLogin;
if (!token || !hasLogin) {
// 未登录,发送事件显示登录弹窗
uni.$emit('showLoginModal');
// 未登录,根据平台类型跳转到对应的登录页面
checkLoginAndNavigate();
return; // 不进行页面跳转
}
// 已登录,根据用户类型跳转到不同的"我的"页面
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const storeIsCompanyUser = userInfo.value?.isCompanyUser;
const cachedIsCompanyUser = cachedUserInfo.isCompanyUser;
// 获取用户类型
const userType = Number(storeIsCompanyUser !== undefined ? storeIsCompanyUser : (cachedIsCompanyUser !== undefined ? cachedIsCompanyUser : 1));
let targetPath = '/pages/mine/mine'; // 默认求职者页面
if (userType === 0) {
// 企业用户,跳转到企业我的页面
targetPath = '/pages/mine/company-mine';
} else {
// 求职者或其他用户类型,跳转到普通我的页面
targetPath = '/pages/mine/mine';
// 已登录,处理特定页面的逻辑
if (item.path === '/pages/job/publishJob') {
// 检查企业信息是否完整
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const storeUserInfo = userInfo.value || {};
const currentUserInfo = storeUserInfo.id ? storeUserInfo : cachedUserInfo;
// 判断企业信息字段company是否为null或undefined
if (!currentUserInfo.company || currentUserInfo.company === null) {
// 企业信息为空,跳转到企业信息补全页面
uni.navigateTo({
url: '/pages/complete-info/company-info',
});
} else {
// 企业信息完整,跳转到发布岗位页面
uni.navigateTo({
url: '/pages/job/publishJob',
});
}
currentItem.value = item.id;
return;
}
// 跳转到对应的页面
uni.navigateTo({
url: targetPath,
});
currentItem.value = item.id;
return;
if (item.path === '/pages/mine/mine') {
// 根据用户类型跳转到不同的"我的"页面
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const storeIsCompanyUser = userInfo.value?.isCompanyUser;
const cachedIsCompanyUser = cachedUserInfo.isCompanyUser;
// 获取用户类型
const userType = Number(storeIsCompanyUser !== undefined ? storeIsCompanyUser : (cachedIsCompanyUser !== undefined ? cachedIsCompanyUser : 1));
let targetPath = '/pages/mine/mine'; // 默认求职者页面
if (userType === 0) {
// 企业用户,跳转到企业我的页面
targetPath = '/pages/mine/company-mine';
} else {
// 求职者或其他用户类型,跳转到普通我的页面
targetPath = '/pages/mine/mine';
}
// 跳转到对应的页面
uni.navigateTo({
url: targetPath,
});
currentItem.value = item.id;
return;
}
}
// 判断是否为 tabBar 页面
@@ -270,8 +275,9 @@ onMounted(() => {
display: flex;
align-items: center;
padding-bottom: env(safe-area-inset-bottom);
z-index: 999;
z-index: 9999;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
pointer-events: auto;
}
.tabbar-item {
@@ -285,6 +291,8 @@ onMounted(() => {
font-size: 22rpx;
position: relative;
cursor: pointer;
pointer-events: auto;
-webkit-tap-highlight-color: transparent;
}
.tabbar-icon {

View File

@@ -13,10 +13,10 @@
</view>
<text class="text-content button-click">{{ content }}</text>
<template v-if="showButton">
<button class="popup-button button-click" v-if="isTip" @click="close">{{ buttonText }}</button>
<button class="popup-button button-click reset-button" v-if="isTip" @click="close">{{ buttonText }}</button>
<view v-else class="confirm-btns">
<button class="popup-button button-click" @click="close">{{ cancelText }}</button>
<button class="popup-button button-click" @click="confirm">{{ confirmText }}</button>
<button class="popup-button button-click reset-button" @click="close">{{ cancelText }}</button>
<button class="popup-button button-click reset-button" @click="confirm">{{ confirmText }}</button>
</view>
</template>
</view>
@@ -138,8 +138,8 @@ export default {
}
}
// 重置button样式
button {
// 重置button样式,使用类选择器代替标签选择器
.reset-button {
padding: 0;
margin: 0;
border: none;
@@ -148,7 +148,7 @@ button {
line-height: inherit;
}
button::after {
.reset-button::after {
border: none;
}
</style>

View File

@@ -70,6 +70,7 @@ const openPicker = () => {
| cancel | Function | 否 | - | 取消选择的回调函数 |
| change | Function | 否 | - | 选择变化的回调函数 |
| defaultValue | Object | 否 | null | 默认选中的地址(暂未实现) |
| forceRefresh | Boolean | 否 | false | 是否强制刷新数据(忽略缓存) |
#### success 回调参数
@@ -107,6 +108,14 @@ const openPicker = () => {
areaPicker.value?.close()
```
### clearCache()
清除地址数据缓存
```javascript
areaPicker.value?.clearCache()
```
## 数据格式
组件使用树形结构的地址数据,格式如下:
@@ -209,12 +218,73 @@ const selectLocation = () => {
</script>
```
## 性能优化
### 懒加载方案(已实现)⭐
组件已实现**懒加载**机制大幅优化90M+地址数据的加载性能:
#### 核心优化
1. **首次加载**:只加载省份列表(< 1MB3-5秒完成
2. **按需加载**用户选择省份后再加载该省份的详细数据2-5MB5-10秒
3. **智能缓存**已加载的数据会缓存切换省份时秒开
4. **自动降级**如果服务器不支持分片接口自动从完整数据中提取
#### 性能对比
| 场景 | 优化前 | 优化后懒加载 |
|------|--------|------------------|
| 首次打开选择器 | 加载90M+3-5分钟 | 加载省份列表< 1MB3-5秒 |
| 选择省份 | 无需加载 | 加载该省份数据2-5MB5-10秒 |
| 切换省份 | 无需加载 | 从缓存读取< 1秒 |
#### 使用方式
组件已自动使用懒加载模式无需修改调用代码
```javascript
// 正常使用,自动懒加载
areaPicker.value?.open({
success: (addressData) => {
console.log('选择的地址:', addressData)
}
})
// 强制刷新数据(忽略缓存)
areaPicker.value?.open({
forceRefresh: true, // 强制从服务器重新加载
success: (addressData) => {
console.log('选择的地址:', addressData)
}
})
// 清除缓存
areaPicker.value?.clearCache()
```
### 服务器分片接口(最佳方案)🚀
如果服务器可以提供分片接口性能会进一步提升详见[地址数据懒加载优化方案.md](../../docs/地址数据懒加载优化方案.md)
需要的接口
- 省份列表接口`/address_provinces.json`轻量级< 1MB
- 省份详情接口`/address_province_{code}.json`按需加载每个2-5MB
### 缓存机制
1. **自动缓存**已加载的数据会自动缓存到 IndexedDBH5 uni.storage小程序
2. **缓存有效期**默认7天过期后自动重新加载
3. **离线支持**网络失败时自动使用缓存数据
4. **存储方案**优先使用 IndexedDB自动降级到 uni.storage
## 注意事项
1. **数据来源**:当前使用本地模拟数据,生产环境建议接入后端API
1. **数据来源**当前从远程JSON文件加载生产环境建议接入后端API
2. **数据更新**如需接入后端API修改 `loadAreaData` 方法即可
3. **性能优化**:地址数据量大时,建议使用懒加载
3. **性能优化**已集成缓存机制首次加载后速度大幅提升
4. **兼容性**支持 H5微信小程序等多端
5. **存储限制**小程序环境有存储限制如遇问题会自动清理旧缓存
## 接入后端API
@@ -242,6 +312,21 @@ async loadAreaData() {
## 更新日志
### v1.2.0 (2025-01-XX)
- 🚀 **懒加载优化**实现按需加载首次加载从几分钟减少到几秒
- 首次只加载省份列表< 1MB3-5秒
- 按需加载省份详情选择省份时才加载
- 智能缓存已加载的数据切换省份秒开
- 支持服务器分片接口最佳性能
- 自动降级方案兼容完整数据
### v1.1.0 (2025-01-XX)
- 🚀 **性能优化**集成智能缓存系统优化90M+地址数据加载
- 支持 IndexedDB uni.storage 双缓存方案
- 支持缓存过期管理和自动清理
- 支持强制刷新数据
- 优化首次加载体验后续加载秒开
### v1.0.0 (2025-10-21)
- 初始版本
- 实现五级联动选择功能

View File

@@ -85,34 +85,35 @@
</template>
<script>
// 改为动态加载,避免主包过大
let addressJson = null;
import { createRequest } from '@/utils/request';
export default {
name: 'AreaCascadePicker',
data() {
return {
maskClick: false,
title: '选择地址',
confirmCallback: null,
cancelCallback: null,
changeCallback: null,
selectedIndex: [0, 0, 0, 0, 0],
// 原始数据
areaData: [],
// 各级列表
provinceList: [],
cityList: [],
districtList: [],
streetList: [],
communityList: [],
// 当前选中的项
selectedProvince: null,
selectedCity: null,
selectedDistrict: null,
selectedStreet: null,
selectedCommunity: null,
};
},
return {
maskClick: false,
title: '选择地址',
confirmCallback: null,
cancelCallback: null,
changeCallback: null,
selectedIndex: [0, 0, 0, 0, 0],
// 原始数据(懒加载模式下,只存储省份列表)
areaData: [],
// 各级列表
provinceList: [],
cityList: [],
districtList: [],
streetList: [],
communityList: [],
// 当前选中的项
selectedProvince: null,
selectedCity: null,
selectedDistrict: null,
selectedStreet: null,
selectedCommunity: null,
// 加载状态
isLoading: false,
};
},
methods: {
async open(newConfig = {}) {
const {
@@ -122,6 +123,7 @@ export default {
change,
maskClick = false,
defaultValue = null,
forceRefresh = false, // 是否强制刷新数据
} = newConfig;
this.reset();
@@ -132,61 +134,103 @@ export default {
this.maskClick = maskClick;
// 加载地区数据
await this.loadAreaData();
// 初始化列表
this.initLists();
this.$nextTick(() => {
this.$refs.popup.open();
});
},
async loadAreaData() {
this.isLoading = true;
try {
// 尝试调用后端API获取地区数据
// 如果后端API不存在将使用模拟数据
console.log('正在加载地区数据...');
// const resp = await uni.request({
// url: '/app/common/area/cascade',
// method: 'GET'
// });
// if (resp.statusCode === 200 && resp.data && resp.data.data) {
// this.areaData = resp.data.data;
// }
// 先显示弹窗,避免长时间等待
this.$nextTick(() => {
this.$refs.popup.open();
});
// 动态加载JSON文件使用require支持动态加载
if (!addressJson) {
try {
// 优先从主包加载(如果存在)
addressJson = require('http://124.243.245.42/ks_cms/address.json');
} catch (e) {
console.warn('无法加载地址数据,使用空数据', e);
addressJson = [];
}
// 加载省份数据
await this.loadAreaData(forceRefresh);
// 只有当provinceList有数据时才初始化后续列表
if (this.areaData && this.areaData.length > 0) {
await this.initLists();
console.log('地址选择器初始化完成');
} else {
console.warn('没有加载到省份数据');
// 即使没有数据,也保持弹窗打开,让用户可以关闭它
}
// 使用模拟数据
this.areaData = this.getMockData();
} catch (error) {
console.error('加载地区数据失败:', error);
// 如果加载失败,使用空数据
this.areaData = addressJson || [];
console.error('打开地址选择器失败:', error);
// 注意由于loadAreaData已经处理了错误这里不应该会被触发
// 但保留作为额外的安全措施
} finally {
this.isLoading = false;
}
},
initLists() {
async loadAreaData(forceRefresh = false) {
try {
console.log('正在加载省份列表...');
const resp = await createRequest('/cms/dict/sysarea/list', { parentCode: '' }, 'GET', false);
console.log('省份列表接口响应:', resp);
// 处理正确的数据格式
if (resp && resp.code === 200 && resp.data) {
// 数据在data字段中
this.areaData = resp.data.map(item => ({
code: item.code,
name: item.name
}));
console.log('省份列表加载成功:', this.areaData);
if (this.areaData.length === 0) {
console.warn('省份列表为空');
}
} else {
console.error('获取省份列表失败:', resp);
throw new Error(`获取省份列表失败: ${resp?.msg || '未知错误'}`);
}
} catch (error) {
console.error('加载省份列表失败:', error);
// 不抛出错误,避免阻止页面打开
// 而是使用默认空数据,让用户可以继续操作
this.areaData = [];
// 显示更友好的错误提示
uni.showToast({
title: error.message || '加载地址数据失败,请检查网络连接',
icon: 'none',
duration: 3000
});
}
},
async initLists() {
// 初始化省列表
this.provinceList = this.areaData;
this.provinceList = this.areaData || [];
if (this.provinceList.length > 0) {
this.selectedProvince = this.provinceList[0];
this.updateCityList();
// 懒加载:首次选择第一个省份时,加载其详情
await this.updateCityList();
// 如果有城市数据,初始化第一个城市的区县数据
if (this.cityList.length > 0) {
this.selectedCity = this.cityList[0];
await this.updateDistrictList();
// 如果有区县数据,初始化第一个区县的街道数据
if (this.districtList.length > 0) {
this.selectedDistrict = this.districtList[0];
await this.updateStreetList();
// 如果有街道数据,初始化第一个街道的社区数据
if (this.streetList.length > 0) {
this.selectedStreet = this.streetList[0];
await this.updateCommunityList();
}
}
}
// 更新选中索引
this.selectedIndex = [0, 0, 0, 0, 0];
}
},
updateCityList() {
if (!this.selectedProvince || !this.selectedProvince.children) {
async updateCityList() {
if (!this.selectedProvince) {
this.cityList = [];
this.districtList = [];
this.streetList = [];
@@ -194,55 +238,168 @@ export default {
return;
}
this.cityList = this.selectedProvince.children;
try {
console.log(`正在加载城市列表,父级编码: ${this.selectedProvince.code}`);
// 使用createRequest工具调用接口
const resp = await createRequest('/cms/dict/sysarea/list', { parentCode: this.selectedProvince.code }, 'GET', false);
console.log('城市列表接口响应:', resp);
// 处理正确的数据格式
let cityData = [];
if (resp && resp.code === 200 && resp.data) {
cityData = resp.data;
this.cityList = cityData.map(item => ({
code: item.code,
name: item.name
}));
console.log('城市列表加载成功:', this.cityList);
} else {
console.error('获取城市列表失败:', resp);
this.cityList = [];
}
} catch (error) {
console.error('加载城市列表失败:', error);
this.cityList = [];
}
this.selectedIndex[1] = 0;
if (this.cityList.length > 0) {
this.selectedCity = this.cityList[0];
this.updateDistrictList();
await this.updateDistrictList();
} else {
this.districtList = [];
this.streetList = [];
this.communityList = [];
}
},
updateDistrictList() {
if (!this.selectedCity || !this.selectedCity.children) {
async updateDistrictList() {
if (!this.selectedCity) {
this.districtList = [];
this.streetList = [];
this.communityList = [];
return;
}
this.districtList = this.selectedCity.children;
try {
console.log(`正在加载区县列表,父级编码: ${this.selectedCity.code}`);
// 使用createRequest工具调用接口
const resp = await createRequest('/cms/dict/sysarea/list', { parentCode: this.selectedCity.code }, 'GET', false);
console.log('区县列表接口响应:', resp);
// 处理正确的数据格式
let districtData = [];
if (resp && resp.code === 200 && resp.data) {
districtData = resp.data;
this.districtList = districtData.map(item => ({
code: item.code,
name: item.name
}));
console.log('区县列表加载成功:', this.districtList);
} else {
console.error('获取区县列表失败:', resp);
this.districtList = [];
}
} catch (error) {
console.error('加载区县列表失败:', error);
this.districtList = [];
}
this.selectedIndex[2] = 0;
if (this.districtList.length > 0) {
this.selectedDistrict = this.districtList[0];
this.updateStreetList();
await this.updateStreetList();
} else {
this.streetList = [];
this.communityList = [];
}
},
updateStreetList() {
if (!this.selectedDistrict || !this.selectedDistrict.children) {
async updateStreetList() {
if (!this.selectedDistrict) {
this.streetList = [];
this.communityList = [];
return;
}
this.streetList = this.selectedDistrict.children;
try {
console.log(`正在加载街道列表,父级编码: ${this.selectedDistrict.code}`);
// 使用createRequest工具调用接口
const resp = await createRequest('/cms/dict/sysarea/list', { parentCode: this.selectedDistrict.code }, 'GET', false);
console.log('街道列表接口响应:', resp);
// 处理正确的数据格式
let streetData = [];
if (resp && resp.code === 200 && resp.data) {
streetData = resp.data;
this.streetList = streetData.map(item => ({
code: item.code,
name: item.name
}));
console.log('街道列表加载成功:', this.streetList);
} else {
console.error('获取街道列表失败:', resp);
this.streetList = [];
}
} catch (error) {
console.error('加载街道列表失败:', error);
this.streetList = [];
}
this.selectedIndex[3] = 0;
if (this.streetList.length > 0) {
this.selectedStreet = this.streetList[0];
this.updateCommunityList();
await this.updateCommunityList();
} else {
this.communityList = [];
}
},
updateCommunityList() {
if (!this.selectedStreet || !this.selectedStreet.children) {
async updateCommunityList() {
if (!this.selectedStreet) {
this.communityList = [];
return;
}
this.communityList = this.selectedStreet.children;
try {
console.log(`正在加载社区列表,父级编码: ${this.selectedStreet.code}`);
// 使用createRequest工具调用接口
const resp = await createRequest('/cms/dict/sysarea/list', { parentCode: this.selectedStreet.code }, 'GET', false);
console.log('社区列表接口响应:', resp);
// 处理正确的数据格式
let communityData = [];
if (resp && resp.code === 200 && resp.data) {
communityData = resp.data;
this.communityList = communityData.map(item => ({
code: item.code,
name: item.name
}));
console.log('社区列表加载成功:', this.communityList);
} else {
console.error('获取社区列表失败:', resp);
this.communityList = [];
}
} catch (error) {
console.error('加载社区列表失败:', error);
this.communityList = [];
}
this.selectedIndex[4] = 0;
if (this.communityList.length > 0) {
@@ -250,7 +407,7 @@ export default {
}
},
bindChange(e) {
async bindChange(e) {
const newIndex = e.detail.value;
// 检查哪一列发生了变化
@@ -260,21 +417,21 @@ export default {
// 根据变化的列更新后续列
if (i === 0) {
// 省变化
// 省变化 - 需要加载新省份的城市
this.selectedProvince = this.provinceList[newIndex[0]];
this.updateCityList();
await this.updateCityList();
} else if (i === 1) {
// 市变化
this.selectedCity = this.cityList[newIndex[1]];
this.updateDistrictList();
await this.updateDistrictList();
} else if (i === 2) {
// 区县变化
this.selectedDistrict = this.districtList[newIndex[2]];
this.updateStreetList();
await this.updateStreetList();
} else if (i === 3) {
// 街道变化
this.selectedStreet = this.streetList[newIndex[3]];
this.updateCommunityList();
await this.updateCommunityList();
} else if (i === 4) {
// 社区变化
this.selectedCommunity = this.communityList[newIndex[4]];
@@ -335,22 +492,48 @@ export default {
}
},
/**
* 重置所有状态(内部使用)
*/
reset() {
this.maskClick = false;
this.confirmCallback = null;
this.cancelCallback = null;
this.changeCallback = null;
this.selectedIndex = [0, 0, 0, 0, 0];
this.selectedProvince = null;
this.selectedCity = null;
this.selectedDistrict = null;
this.selectedStreet = null;
this.selectedCommunity = null;
this.provinceList = [];
this.cityList = [];
this.districtList = [];
this.streetList = [];
this.communityList = [];
this.areaData = [];
},
// 模拟数据(用于演示)
getMockData() {
return addressJson || []
/**
* 清除地址数据缓存(供外部调用)
*/
async clearCache() {
try {
// 清除内存缓存
this.reset();
uni.showToast({
title: '缓存已清除',
icon: 'success',
duration: 2000
});
} catch (error) {
console.error('清除缓存失败:', error);
uni.showToast({
title: '清除缓存失败',
icon: 'none',
duration: 2000
});
}
}
},
};

View File

@@ -2,8 +2,8 @@
<view class="empty" :style="{ background: bgcolor, marginTop: mrTop + 'rpx' }">
<view class="ty_content" :style="{ paddingTop: pdTop + 'rpx' }">
<view class="content_top btn-shaky">
<image v-if="pictrue" :src="pictrue" mode=""></image>
<image v-else src="@/static/icon/empty.png" mode=""></image>
<image v-if="pictrue" :src="pictrue" mode="" class="empty-image"></image>
<image v-else src="@/static/icon/empty.png" mode="" class="empty-image"></image>
</view>
<view class="content_c">{{ content }}</view>
</view>
@@ -47,7 +47,8 @@ export default {
</script>
<style lang="scss" scoped>
image {
// 使用类选择器代替标签选择器
.empty-image {
width: 100%;
height: 100%;
}

View File

@@ -5,7 +5,7 @@
<input class="uni-input searchinput" confirm-type="search" />
</view>
<view class="sex-content">
<scroll-view :show-scrollbar="false" :scroll-y="true" class="sex-content-left">
<scroll-view ref="leftScroll" :show-scrollbar="false" :scroll-y="true" class="sex-content-left">
<view
v-for="item in copyTree"
:key="item.id"
@@ -57,6 +57,8 @@ export default {
stationCateLog: 0,
copyTree: [],
scrollTop: 0,
scrollTimer: null,
lastScrollTime: 0,
};
},
props: {
@@ -89,14 +91,131 @@ export default {
}
},
},
beforeDestroy() {
// 组件销毁前清除定时器
if (this.scrollTimer) {
clearTimeout(this.scrollTimer);
this.scrollTimer = null;
}
},
methods: {
changeStationLog(item) {
this.leftValue = item;
this.rightValue = item.children;
this.scrollTop = 0;
// 使用更激进的防抖策略,避免频繁的左侧滚动
if (this.scrollTimer) {
clearTimeout(this.scrollTimer);
}
this.scrollTimer = setTimeout(() => {
// 确保左侧列表滚动到正确位置,让当前选中的标签可见
const index = this.copyTree.findIndex(i => i.id === item.id);
if (index !== -1 && this.$refs.leftScroll) {
const itemHeight = 160; // 每个选项高度
const visibleHeight = 4 * itemHeight; // 可见区域高度
// 计算目标位置
const targetTop = index * itemHeight;
// 获取当前左侧列表的滚动位置
const currentLeftScrollTop = this.$refs.leftScroll.scrollTop || 0;
// 只有当目标位置不在当前可见区域内时才滚动
if (targetTop < currentLeftScrollTop || targetTop > currentLeftScrollTop + visibleHeight - itemHeight) {
let targetScrollTop = targetTop;
// 如果选中的标签在底部,确保它不会滚动出可见区域
if (targetTop > this.$refs.leftScroll.scrollHeight - visibleHeight) {
targetScrollTop = Math.max(0, this.$refs.leftScroll.scrollHeight - visibleHeight);
}
this.$refs.leftScroll.scrollTo({
top: targetScrollTop,
duration: 100 // 进一步减少滚动动画时间
});
}
}
}, 100);
},
scrollTopBack(e) {
this.scrollTop = e.detail.scrollTop;
const currentTime = Date.now();
// 更严格的防抖处理:如果距离上次滚动时间太短,则跳过处理
if (currentTime - this.lastScrollTime < 80) {
return;
}
this.lastScrollTime = currentTime;
// 清除之前的定时器
if (this.scrollTimer) {
clearTimeout(this.scrollTimer);
}
// 设置新的定时器,延迟处理滚动事件
this.scrollTimer = setTimeout(() => {
this.scrollTop = e.detail.scrollTop;
// 滚动时自动选中对应的左侧标签
const scrollTop = e.detail.scrollTop;
let currentSection = null;
let minDistance = Infinity;
// 遍历所有右侧的二级标题,找到当前最接近顶部的那个
this.rightValue.forEach((section, index) => {
// 更精确地估算每个section的位置考虑标题高度和内容高度
const sectionTop = index * 280; // 增加估算高度,避免过于敏感
const distance = Math.abs(sectionTop - scrollTop);
if (distance < minDistance) {
minDistance = distance;
currentSection = section;
}
});
// 只有当距离足够近时才切换左侧标签,避免过于敏感
if (currentSection && minDistance < 100 && this.leftValue.id !== currentSection.parentId) {
const parentItem = this.copyTree.find(item => item.id === currentSection.parentId);
if (parentItem) {
this.leftValue = parentItem;
// 使用更激进的防抖策略,避免频繁的左侧滚动
if (this.scrollTimer) {
clearTimeout(this.scrollTimer);
}
this.scrollTimer = setTimeout(() => {
// 只在必要时滚动左侧列表,避免频繁滚动导致的抖动
const index = this.copyTree.findIndex(i => i.id === parentItem.id);
if (index !== -1 && this.$refs.leftScroll) {
// 获取当前左侧列表的滚动位置
const currentLeftScrollTop = this.$refs.leftScroll.scrollTop || 0;
const itemHeight = 160; // 每个选项高度
const visibleHeight = 4 * itemHeight; // 可见区域高度
// 计算目标位置
const targetTop = index * itemHeight;
// 只有当目标位置不在当前可见区域内时才滚动
if (targetTop < currentLeftScrollTop || targetTop > currentLeftScrollTop + visibleHeight - itemHeight) {
let targetScrollTop = targetTop;
// 如果选中的标签在底部,确保它不会滚动出可见区域
if (targetTop > this.$refs.leftScroll.scrollHeight - visibleHeight) {
targetScrollTop = Math.max(0, this.$refs.leftScroll.scrollHeight - visibleHeight);
}
this.$refs.leftScroll.scrollTo({
top: targetScrollTop,
duration: 100 // 进一步减少滚动动画时间
});
}
}
}, 150); // 增加延迟,避免滚动冲突
}
}
}, 80); // 增加防抖延迟到80ms
},
addItem(item) {
let titiles = [];
@@ -189,6 +308,10 @@ export default {
.sex-content-left
width: 198rpx;
padding: 20rpx 0 0 0;
/* 添加硬件加速优化 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
will-change: transform;
.left-list-btn
padding: 0 40rpx 0 24rpx;
display: grid;
@@ -199,6 +322,9 @@ export default {
font-size: 28rpx;
position: relative
margin-top: 60rpx
/* 优化渲染性能 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
.left-list-btn:first-child
margin-top: 0
// .positionNum
@@ -227,6 +353,10 @@ export default {
// border-left: 2px solid #D9D9D9;
background: #F6F6F6;
flex: 1;
/* 添加硬件加速优化 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
will-change: transform;
.grid-sex
display: grid;
grid-template-columns: 50% 50%;
@@ -244,6 +374,9 @@ export default {
margin-top: 30rpx;
background: #E8EAEE;
color: #606060;
/* 优化渲染性能 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
.sex-right-btned
font-weight: 500
width: 224rpx;
@@ -251,4 +384,7 @@ export default {
background: rgba(37,107,250,0.06);
border: 2rpx solid #256BFA;
color: #256BFA
/* 优化渲染性能 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
</style>

View File

@@ -54,7 +54,7 @@
</view>
<view class="job-info">
<view class="job-name">{{ item.jobTitle }}</view>
<view class="salary">{{ item.salaryRange }}/</view>
<view class="salary">{{ item.minSalary }} - {{ item.maxSalary }}/</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,52 @@
<!-- #ifdef H5 -->
<template>
<view></view>
</template>
<script>
// #ifdef H5
export default {
name: 'Keypress',
props: {
disable: {
type: Boolean,
default: false
}
},
mounted () {
const keyNames = {
esc: ['Esc', 'Escape'],
tab: 'Tab',
enter: 'Enter',
space: [' ', 'Spacebar'],
up: ['Up', 'ArrowUp'],
left: ['Left', 'ArrowLeft'],
right: ['Right', 'ArrowRight'],
down: ['Down', 'ArrowDown'],
delete: ['Backspace', 'Delete', 'Del']
}
const listener = ($event) => {
if (this.disable) {
return
}
const keyName = Object.keys(keyNames).find(key => {
const keyName = $event.key
const value = keyNames[key]
return value === keyName || (Array.isArray(value) && value.includes(keyName))
})
if (keyName) {
// 避免和其他按键事件冲突
setTimeout(() => {
this.$emit(keyName, {})
}, 0)
}
}
document.addEventListener('keyup', listener)
// this.$once('hook:beforeDestroy', () => {
// document.removeEventListener('keyup', listener)
// })
}
}
// #endif
</script>
<!-- #endif -->

View File

@@ -206,6 +206,7 @@ defineExpose({
.popup-content {
color: #000000;
height: 80vh;
padding-bottom: 90rpx;;
}
.popup-bottom {
padding: 40rpx 28rpx 20rpx 28rpx;

View File

@@ -17,6 +17,7 @@
</view>
<view class="popup-list">
<expected-station
style="height: 100%;"
:search="false"
@onChange="changeJobTitleId"
:station="state.stations"
@@ -125,6 +126,12 @@ const cleanup = () => {
};
const changeJobTitleId = (e) => {
if (!e.ids) {
count.value = 0;
JobsIdsValue.value = '';
JobsLabelValue.value = '';
return;
}
const ids = e.ids.split(',').map((id) => Number(id));
count.value = ids.length;
JobsIdsValue.value = e.ids;
@@ -147,9 +154,9 @@ function serchforIt(defaultId) {
if (state.stations.length) {
const ids = defaultId
? defaultId.split(',').map((id) => Number(id))
: userInfo.value.jobTitleId.split(',').map((id) => Number(id));
: (userInfo.value.jobTitleId ? userInfo.value.jobTitleId.split(',').map((id) => Number(id)) : []);
count.value = ids.length;
state.jobTitleId = defaultId ? defaultId : userInfo.value.jobTitleId;
state.jobTitleId = defaultId ? defaultId : (userInfo.value.jobTitleId || '');
setCheckedNodes(state.stations, ids);
state.visible = true;
return;
@@ -160,7 +167,7 @@ function serchforIt(defaultId) {
count.value = ids.length;
setCheckedNodes(resData.data, ids);
}
state.jobTitleId = userInfo.value.jobTitleId;
state.jobTitleId = userInfo.value.jobTitleId || '';
state.stations = resData.data;
state.visible = true;
});

View File

@@ -9,7 +9,7 @@
<!-- Logo和标题 -->
<view class="auth-header">
<image class="auth-logo" src="@/static/logo.png" mode="aspectFit"></image>
<image class="auth-logo" src="@/static/logo2-S.png" mode="aspectFit"></image>
<view class="auth-title">欢迎使用就业服务</view>
<view class="auth-subtitle">需要您授权手机号登录</view>
</view>
@@ -139,13 +139,15 @@ const validateRole = () => {
const getPhoneNumber = (e) => {
console.log('获取手机号:', e);
console.log('userType.value', userType.value)
// 验证角色是否已选择
if (!validateRole()) {
return;
}
if (e.detail.errMsg === 'getPhoneNumber:ok') {
if (userType.value === null) {
$api.msg('请先选择您的角色');
return true;
}
uni.login({
provider: 'weixin',
success: (loginRes) => {
@@ -227,65 +229,12 @@ const wxLogin = () => {
}
// #ifdef H5
// H5网页微信登录逻辑
uni.showLoading({ title: '登录中...' });
// 获取微信授权code
uni.login({
provider: 'weixin',
success: (loginRes) => {
console.log('微信登录成功:', loginRes);
// 调用后端接口进行登录
$api.createRequest('/app/appLogin', {
code: loginRes.code,
userType: userType.value
}, 'post').then((resData) => {
uni.hideLoading();
if (resData.token) {
loginSetToken(resData.token).then((resume) => {
console.log(resData, 'resData.isCompanyUser');
// 更新用户类型到缓存
if (resData.isCompanyUser) {
console.log(resData.isCompanyUser, 'resData.isCompanyUser');
const userInfo = uni.getStorageSync('userInfo') || {};
userInfo.isCompanyUser = Number(resData.isCompanyUser); // 0-企业用户1-求职者
uni.setStorageSync('userInfo', userInfo);
}
$api.msg('登录成功');
close();
emit('success');
if (!resume.data.jobTitleId) {
if (userType.value === 1) {
// 求职者跳转到个人信息补全页面
uni.navigateTo({
url: '/pages/complete-info/complete-info?step=1'
});
} else if (userType.value === 0) {
// 招聘者跳转到企业信息补全页面
uni.navigateTo({
url: '/pages/complete-info/company-info'
});
}
}
});
} else {
$api.msg('登录失败,请重试');
}
}).catch((err) => {
uni.hideLoading();
$api.msg(err.msg || '登录失败,请重试');
});
},
fail: (err) => {
uni.hideLoading();
console.error('微信登录失败:', err);
$api.msg('微信登录失败');
}
// H5端跳转到H5登录页面
close();
uni.navigateTo({
url: '/pages/login/h5-login'
});
return;
// #endif
// #ifdef APP-PLUS
@@ -561,4 +510,3 @@ defineExpose({
button::after
border: none
</style>

View File

@@ -1,12 +1,16 @@
export default {
// baseUrl: 'http://39.98.44.136:8080', // 测试
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
baseUrl: 'http://222.80.110.161:11111/api/ks', // 测试
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
LCBaseUrl:'http://10.110.145.145:9100',//招聘、培训、帮扶
LCBaseUrlInner:'http://10.110.145.145:10100',//内网端口
imgBaseUrl:'http://10.110.145.145/images', //图片基础url
trainVideoImgUrl:'http://10.110.145.145:9100/file/file/minio',
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶
// imgBaseUrl:'http://10.110.145.145/images', //图片基础url
// trainVideoImgUrl:'http://10.110.145.145:9100/file/file/minio',
LCBaseUrl:'http://222.80.110.161:11111/prod-api',//内网端口
LCBaseUrlInner:'http://222.80.110.161:11111/prod-psout-api',//招聘、培训、帮扶
imgBaseUrl:'http://222.80.110.161:11111/images', //图片基础url
trainVideoImgUrl:'http://222.80.110.161:11111/prod-api/file/file/minio',
// sseAI+
// StreamBaseURl: 'http://39.98.44.136:8000',
StreamBaseURl: 'https://qd.zhaopinzao8dian.com/ai',
@@ -21,7 +25,7 @@ export default {
// 只使用本地缓寸的数据
OnlyUseCachedDB: true,
// 使用模拟定位
UsingSimulatedPositioning: true,
UsingSimulatedPositioning: false,
// 应用信息
appInfo: {
// 应用名称

View File

@@ -1 +0,0 @@

View File

@@ -1,318 +0,0 @@
# H5端CSS引入问题解决方案
## ❌ 错误提示
```
iconfont.css:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css". Strict MIME type checking is enforced for module scripts per HTML spec.
```
## 🔍 问题原因
`main.js` 中使用了 **错误的方式** 引入CSS文件
```javascript
// ❌ 错误尝试将CSS作为JavaScript模块导入
import './static/iconfont/iconfont.css'
```
这种 `import` 语法在H5端会导致浏览器尝试将CSS文件作为JavaScript模块加载从而产生MIME类型错误。
## ✅ 解决方案
### 方案一:在 App.vue 中使用 @import推荐
`App.vue``<style>` 标签中使用CSS的 `@import` 语法:
```vue
<style>
/* 引入阿里图标库 */
@import url("/static/iconfont/iconfont.css");
</style>
```
**优点:**
- ✅ 所有平台兼容H5、小程序、App
- ✅ 符合CSS规范
- ✅ 全局生效
### 方案二:条件编译(如果必须在 main.js 中引入)
如果确实需要在 `main.js` 中引入,使用条件编译:
```javascript
// #ifndef H5
import './static/iconfont/iconfont.css'
// #endif
```
然后在 `App.vue` 中单独为H5引入
```vue
<style>
/* #ifdef H5 */
@import url("/static/iconfont/iconfont.css");
/* #endif */
</style>
```
## 📋 CSS引入方式对比
### JavaScript import不推荐用于CSS
```javascript
// ❌ 在 main.js 中
import './static/iconfont/iconfont.css'
```
**问题:**
- H5端会报MIME类型错误
- 将CSS当作JavaScript模块处理
### CSS @import推荐
```vue
<!-- App.vue 或其他 .vue 文件中 -->
<style>
@import url("/static/iconfont/iconfont.css");
</style>
```
**优点:**
- 所有平台兼容
- 符合CSS标准
- 不会产生MIME类型错误
### 使用 <style> 标签的 src 属性(可选)
```vue
<style src="/static/iconfont/iconfont.css"></style>
```
## 🔧 修复步骤
### Step 1: 删除 main.js 中的CSS import
打开 `main.js`,找到并删除或注释掉:
```javascript
// import './static/iconfont/iconfont.css' // 删除这行
```
### Step 2: 确认 App.vue 中的引入
确保 `App.vue` 中有正确的CSS引入
```vue
<style>
@import '@/common/animation.css';
@import '@/common/common.css';
/* 引入阿里图标库 */
@import url("/static/iconfont/iconfont.css");
</style>
```
### Step 3: 清除缓存并重新编译
1. 关闭开发服务器
2. 清除浏览器缓存
3. 重新运行 `npm run dev:h5` 或点击HBuilderX的运行按钮
## 🎯 最佳实践
### 全局CSS引入位置
**推荐顺序:**
```vue
<!-- App.vue -->
<style>
/* 1. 重置样式 / 通用样式 */
@import '@/common/reset.css';
@import '@/common/common.css';
/* 2. 第三方库样式 */
@import url("/static/iconfont/iconfont.css");
/* 3. 动画效果 */
@import '@/common/animation.css';
/* 4. 项目全局样式 */
/* 自定义全局样式 */
</style>
```
### 路径写法
**绝对路径(推荐):**
```css
@import url("/static/iconfont/iconfont.css");
```
**相对路径:**
```css
@import url("./static/iconfont/iconfont.css");
@import url("@/static/iconfont/iconfont.css");
```
**注意:** 在不同平台上路径解析可能有差异,推荐使用绝对路径。
## 🚫 常见错误
### 错误1在 main.js 中 import CSS
```javascript
// ❌ 错误
import './styles/global.css'
import '@/static/iconfont/iconfont.css'
```
**解决:** 改用 App.vue 的 `@import`
### 错误2路径不正确
```css
/* ❌ 错误:路径错误 */
@import url("static/iconfont/iconfont.css");
/* ✅ 正确:使用正确的路径 */
@import url("/static/iconfont/iconfont.css");
```
### 错误3缺少分号
```css
/* ❌ 错误:缺少分号 */
@import url("/static/iconfont/iconfont.css")
/* ✅ 正确:添加分号 */
@import url("/static/iconfont/iconfont.css");
```
### 错误4在 scoped 样式中引入
```vue
<!-- 不推荐 scoped 样式中引入全局CSS -->
<style scoped>
@import url("/static/iconfont/iconfont.css");
</style>
<!-- 推荐全局样式不要加 scoped -->
<style>
@import url("/static/iconfont/iconfont.css");
</style>
```
## 📊 平台兼容性
| 引入方式 | H5 | 小程序 | App | 推荐 |
|---------|----|----|-----|-----|
| main.js import | ❌ | ✅ | ✅ | ❌ |
| App.vue @import | ✅ | ✅ | ✅ | ✅ |
| style src | ✅ | ✅ | ✅ | ✅ |
| 条件编译 | ✅ | ✅ | ✅ | ⚠️ |
## 🔍 调试方法
### 1. 检查CSS是否加载
在浏览器开发者工具中:
```
F12 → Network → Filter: CSS → 查找 iconfont.css
```
**成功标志:**
- 状态码200
- Type: stylesheet
- Size: 文件大小正常
### 2. 检查字体文件
```
F12 → Network → Filter: Font → 查找 iconfont.ttf/woff
```
### 3. 检查控制台错误
```
F12 → Console → 查看是否有错误信息
```
### 4. 验证样式生效
```javascript
// 在控制台执行
document.querySelector('.iconfont')
// 应该能找到使用了 iconfont 类的元素
```
## ✅ 验证成功
修复后,应该看到:
1. ✅ H5端控制台无CSS加载错误
2. ✅ 图标正常显示
3. ✅ Network 中 iconfont.css 状态码为 200
4. ✅ 字体文件正常加载
## 📝 注意事项
### uni-app 项目特点
1. **多平台编译**
- H5端使用浏览器标准
- 小程序有自己的规范
- App使用原生渲染
2. **路径处理**
- `@/` 代表项目根目录
- `/static/` 代表静态资源目录
- 不同平台路径解析略有差异
3. **样式隔离**
- `scoped` 样式只在当前组件生效
- 全局样式在 App.vue 中引入
- 不要在 scoped 中引入全局CSS
### Vite 项目特点
如果使用 Vite 构建HBuilderX 3.2+
```javascript
// main.js 中可以使用(但不推荐)
import './static/iconfont/iconfont.css'
```
但为了兼容性,仍然推荐在 App.vue 中使用 `@import`
## 🎉 总结
### 问题
`main.js` 中使用 `import` 引入CSS导致H5端报错。
### 解决
1. ✅ 删除 `main.js` 中的 CSS import
2. ✅ 在 `App.vue``<style>` 中使用 `@import`
3. ✅ 重启开发服务器
### 最佳实践
- 所有全局CSS在 `App.vue` 中通过 `@import` 引入
- 使用绝对路径:`/static/...`
- 不要在 `scoped` 样式中引入全局CSS
- 保持引入顺序:重置 → 第三方 → 动画 → 自定义
## 📚 相关文档
- [uni-app 样式导入](https://uniapp.dcloud.net.cn/tutorial/syntax-css.html#%E6%A0%B7%E5%BC%8F%E5%AF%BC%E5%85%A5)
- [CSS @import](https://developer.mozilla.org/zh-CN/docs/Web/CSS/@import)
- [Vite 静态资源处理](https://cn.vitejs.dev/guide/assets.html)
---
**该问题已解决!** 🎉
现在H5端应该可以正常加载CSS文件了。如果还有问题请检查
1. 文件路径是否正确
2. 是否清除了浏览器缓存
3. 是否重启了开发服务器

View File

@@ -1,220 +0,0 @@
# 微信小程序主包体积优化方案
## 当前主包体积分析
根据代码依赖分析图,主包体积为 **2.74MB**,主要组成部分:
### 1. 静态资源 (848KB)
- **images (507KB)**: 包含多个大图片文件
- `video-bj2.png`: 156KB
- `video-jt.png`: 126KB
- `spxx-k.png`: 54KB
- `bj.jpg`: 52KB
- `imgs/avatar.jpg`: 48KB
- **icon (187KB)**: 图标文件
### 2. JavaScript 库文件
- **uni_modules/lime-echart/static/echarts.min.js**: 568KB ⚠️
- **lib/lunar-javascript@1.7.2.js**: 301KB ⚠️
- **lib/highlight/highlight-uni.min.js**: 166KB
- **common/vendor.js**: 293KB (未找到,可能已删除)
### 3. 其他
- **uni_modules**: 751KB
- **pages**: 363KB
- **common**: 316KB
---
## 优化方案
### 方案一:删除主包中未使用的大文件(立即执行)
#### 1.1 删除主包中的 echarts.min.js
**问题**: `uni_modules/lime-echart/static/echarts.min.js` (568KB) 在主包中,但只在 `packageCa` 分包中使用。
**解决方案**:
- ✅ 确认 `packageCa` 分包中已有 `packageCa/utilCa/echarts.min.js`
- ✅ 删除主包中的 `uni_modules/lime-echart/static/echarts.min.js`(如果不需要在主包使用)
- ⚠️ 注意:如果主包页面也需要使用 echarts需要保留或按需加载
**操作步骤**:
```bash
# 检查主包中是否有页面使用 echarts
# 如果没有,可以删除或移动到分包
```
#### 1.2 删除主包中的 lunar-javascript@1.7.2.js
**问题**: `lib/lunar-javascript@1.7.2.js` (301KB) 在主包中,但只在 `packageA/pages/selectDate/selectDate.vue` 中使用。
**解决方案**:
- ✅ 确认 `packageA/lib/lunar-javascript@1.7.2.js` 已存在
- ✅ 删除主包中的 `lib/lunar-javascript@1.7.2.js`
- ✅ 更新 `packageA/pages/selectDate/selectDate.vue` 中的引用路径
**操作步骤**:
1. 确认 `packageA/lib/lunar-javascript@1.7.2.js` 存在
2. 删除 `lib/lunar-javascript@1.7.2.js`
3. 确保 `packageA/pages/selectDate/selectDate.vue` 使用分包内的文件
---
### 方案二:优化图片资源(预计减少 300-400KB
#### 2.1 压缩大图片文件
**目标图片**:
- `static/images/train/video-bj2.png` (156KB) → 目标: <80KB
- `static/images/train/video-jt.png` (126KB) 目标: <60KB
- `static/images/train/spxx-k.png` (54KB) 目标: <30KB
- `static/images/train/bj.jpg` (52KB) 目标: <30KB
- `static/imgs/avatar.jpg` (48KB) 目标: <25KB
**工具推荐**:
- [TinyPNG](https://tinypng.com/) - PNG压缩
- [Squoosh](https://squoosh.app/) - 在线图片压缩
- [ImageOptim](https://imageoptim.com/) - 批量压缩
#### 2.2 将非首屏必需图片移到分包
**策略**:
- `static/images/train/` 目录下的图片移到 `packageB` 分包培训相关
- 只在需要时加载这些图片
**操作步骤**:
1. 创建 `packageB/static/images/train/` 目录
2. 移动图片文件到分包
3. 更新相关页面的图片路径
---
### 方案三:优化 markdown 相关库(预计减少 166KB
#### 3.1 将 highlight-uni.min.js 移到分包
**问题**: `lib/highlight/highlight-uni.min.js` (166KB) `utils/markdownParser.js` 中使用主要用于 chat 页面
**解决方案**:
- 方案A: markdown 相关库移到独立分包按需加载
- 方案B: 使用更轻量的代码高亮库
- 方案C: 如果只在 chat 页面使用可以移到 chat 页面所在的分包
**推荐方案**: 方案C - markdown 相关库移到 chat 页面附近
**操作步骤**:
1. 创建 `pages/chat/lib/` 目录
2. 移动 `lib/highlight/` `lib/markdown-it.min.js` 到该目录
3. 更新 `utils/markdownParser.js` 中的引用路径
---
### 方案四:清理未使用的 uni_modules预计减少 100-200KB
#### 4.1 检查 uni_modules 使用情况
**需要检查的模块**:
- `custom-waterfalls-flow` - 检查是否在主包使用
- `uni-data-select` - 检查是否在主包使用
- `uni-dateformat` - 检查是否在主包使用
- `uni-load-more` - 检查是否在主包使用
- `uni-popup` - 检查是否在主包使用
- `uni-steps` - 检查是否在主包使用
- `uni-swipe-action` - 检查是否在主包使用
- `uni-transition` - 检查是否在主包使用
**操作步骤**:
1. 搜索每个模块在主包中的使用情况
2. 如果只在分包中使用可以考虑移除主包的引用
3. 使用 `easycom` 配置确保组件能正确加载
---
### 方案五:代码分割和按需加载
#### 5.1 使用分包预加载
`pages.json` 中配置分包预加载优化用户体验
```json
{
"preloadRule": {
"pages/index/index": {
"network": "all",
"packages": ["packageA"]
}
}
}
```
#### 5.2 动态导入大型库
对于只在特定场景使用的大型库使用动态导入
```javascript
// 示例:按需加载 echarts
const loadEcharts = async () => {
if (typeof require !== 'undefined') {
return require('../../utilCa/echarts.min.js');
} else {
return await import('../../utilCa/echarts.min.js');
}
};
```
---
## 优化效果预估
| 优化项 | 预计减少体积 | 优先级 |
|--------|------------|--------|
| 删除主包 echarts.min.js | 568KB | 🔴 |
| 删除主包 lunar-javascript | 301KB | 🔴 |
| 压缩图片资源 | 300-400KB | 🟡 |
| 优化 markdown | 166KB | 🟡 |
| 清理未使用模块 | 100-200KB | 🟢 |
**总计预计减少**: 1.4MB - 1.6MB
**优化后主包体积**: 1.1MB - 1.3MB
---
## 实施步骤
### 第一阶段:立即执行(预计减少 869KB
1. 删除主包中未使用的 `echarts.min.js`
2. 删除主包中未使用的 `lunar-javascript@1.7.2.js`
3. 验证分包中的文件引用正确
### 第二阶段:图片优化(预计减少 300-400KB
1. 压缩大图片文件
2. 将非首屏图片移到分包
3. 更新图片路径引用
### 第三阶段:代码优化(预计减少 166-366KB
1. 优化 markdown 相关库的位置
2. 清理未使用的 uni_modules
3. 配置分包预加载
---
## 注意事项
1. **备份**: 在执行删除操作前请先备份项目
2. **测试**: 每个优化步骤后都要进行完整测试
3. **引用路径**: 确保所有文件引用路径正确更新
4. **分包限制**: 注意微信小程序分包大小限制单个分包不超过 2MB
5. **主包限制**: 主包大小建议控制在 1.5MB 以内
---
## 验证方法
1. 使用微信开发者工具上传代码查看主包体积
2. 使用代码依赖分析工具验证优化效果
3. 测试各个功能模块确保正常工作
4. 检查分包加载是否正常
---
## 后续维护建议
1. **定期检查**: 每月检查主包体积防止体积反弹
2. **图片规范**: 建立图片压缩和优化规范
3. **依赖管理**: 新增依赖时评估对主包体积的影响
4. **代码审查**: 在代码审查时关注主包体积变化

View File

@@ -1,207 +0,0 @@
# 企业地址选择功能说明
## 功能概述
在企业信息补全页面company-info.vue点击"企业注册地点"字段的箭头时,会弹出一个五级联动选择器,用户可以选择省市区县街道社区的完整地址。
## 实现的功能
### 1. 五级联动选择
- **省级选择**:选择省/直辖市/自治区
- **市级选择**:根据选择的省,显示对应的市/地区
- **区县选择**:根据选择的市,显示对应的区/县
- **街道选择**:根据选择的区县,显示对应的街道/乡镇
- **社区选择**:根据选择的街道,显示对应的社区/居委会
### 2. 联动逻辑
- 当选择省级时,自动更新并重置市级及以下选项
- 当选择市级时,自动更新并重置区县及以下选项
- 当选择区县时,自动更新并重置街道及以下选项
- 当选择街道时,自动更新社区选项
- 所有联动过程均实时响应,无需额外操作
### 3. 地址格式
- 选择完成后,地址格式为:`省/市/区/街道/社区`
- 示例:`新疆维吾尔自治区/喀什地区/喀什市/学府街道/学府社区居委会`
- 地址各级信息都会保存,包括代码和名称
### 4. 数据存储
- 保存完整的地址字符串(`registeredAddress`
- 保存各级行政区划代码和名称:
- 省:`provinceCode``provinceName`
- 市:`cityCode``cityName`
- 区县:`districtCode``districtName`
- 街道:`streetCode``streetName`
- 社区:`communityCode``communityName`
## 技术实现
### 组件架构
- **组件名称**`area-cascade-picker`
- **组件位置**`components/area-cascade-picker/area-cascade-picker.vue`
- **依赖组件**`uni-popup`uni-app官方弹窗组件
### 核心技术
- **picker-view**uni-app的多列选择器组件
- **五级联动**:通过监听选择变化,动态更新下级选项
- **树形数据结构**:地区数据采用嵌套的树形结构,每级都有`children`属性
### 数据格式
```javascript
{
code: '650000', // 行政区划代码
name: '新疆维吾尔自治区', // 名称
children: [ // 下级行政区
{
code: '653100',
name: '喀什地区',
children: [...]
}
]
}
```
### 数据流程
1. **打开地址选择器**
```javascript
// company-info.vue
const selectLocation = () => {
areaPicker.value?.open({
title: '选择企业注册地点',
maskClick: true,
success: (addressData) => {
// 处理选择结果
formData.registeredAddress = addressData.address
// 保存各级信息
formData.provinceCode = addressData.province?.code
formData.provinceName = addressData.province?.name
// ... 其他字段
}
})
}
```
2. **选择地址过程**
```javascript
// area-cascade-picker.vue
bindChange(e) {
// 检测哪一级发生变化
// 更新对应级别及其下级的选项列表
// 触发change回调可选
}
```
3. **确认选择**
```javascript
// area-cascade-picker.vue
confirm() {
const addressData = {
address: '新疆维吾尔自治区/喀什地区/喀什市/学府街道/学府社区居委会',
province: { code: '650000', name: '新疆维吾尔自治区' },
city: { code: '653100', name: '喀什地区' },
district: { code: '653101', name: '喀什市' },
street: { code: '65310101', name: '学府街道' },
community: { code: '6531010101', name: '学府社区居委会' }
}
// 调用success回调
callback(addressData)
}
```
## 文件结构
```
components/
└── area-cascade-picker/
└── area-cascade-picker.vue # 五级联动地址选择组件
pages/complete-info/
└── company-info.vue # 企业信息补全页面
```
## 数据字段
在 `company-info.vue` 的 `formData` 中的地址相关字段:
- `registeredAddress`: string - 完整地址(格式:省/市/区/街道/社区)
- `registeredAddressName`: string - 地址名称
- `provinceCode`: string - 省级行政区划代码
- `provinceName`: string - 省级名称
- `cityCode`: string - 市级行政区划代码
- `cityName`: string - 市级名称
- `districtCode`: string - 区县行政区划代码
- `districtName`: string - 区县名称
- `streetCode`: string - 街道行政区划代码
- `streetName`: string - 街道名称
- `communityCode`: string - 社区行政区划代码
- `communityName`: string - 社区名称
## 使用方法
### 用户操作流程
1. 在企业信息页面,点击"企业注册地点"右侧的箭头图标
2. 弹出五级联动地址选择器
3. 依次选择:
- 第一列:选择省/直辖市/自治区
- 第二列:选择市/地区(根据第一列自动更新)
- 第三列:选择区/县(根据第二列自动更新)
- 第四列:选择街道/乡镇(根据第三列自动更新)
- 第五列:选择社区/居委会(根据第四列自动更新)
4. 确认选择无误后,点击右上角"确认"按钮
5. 选择器关闭,地址自动填充到表单中
### 界面说明
- **顶部标题栏**
- 左侧"取消"按钮:关闭选择器,不保存
- 中间标题:显示"选择企业注册地点"
- 右侧"确认"按钮:确认选择并保存
- **五列选择器**
- 每列显示当前级别的所有选项
- 可上下滑动选择
- 选中项高亮显示
- 各列之间自动联动
## 注意事项
1. **数据来源**
- 当前使用本地模拟数据,包含主要城市的五级地址
- 生产环境建议接入后端API提供完整的全国地址数据
- 后端API接口`/app/common/area/cascade`(需要实现)
2. **数据格式要求**
- 必须是树形结构,每级通过`children`属性嵌套
- 每个节点必须包含`code`(行政区划代码)和`name`(名称)
- 最深五级:省 → 市 → 区县 → 街道 → 社区
3. **性能考虑**
- 地址数据量大时,建议使用懒加载方式
- 可以先加载省市区,街道和社区按需加载
- 考虑使用缓存机制,避免重复加载
4. **兼容性**
- 支持H5、微信小程序等多端
- 使用uni-app原生组件兼容性好
## 后续优化建议
1. **数据优化**
- 接入后端API提供完整的全国地址数据
- 实现地址数据的懒加载
- 添加地址数据缓存机制
2. **功能增强**
- 支持默认值回显(编辑时显示已选地址)
- 添加搜索功能,快速定位地址
- 支持手动输入详细地址(如门牌号)
- 增加常用地址保存功能
3. **用户体验**
- 优化滑动选择的流畅度
- 添加选择预览功能
- 支持快速选择最近使用的地址
4. **数据扩展**
- 支持国际地址选择
- 添加邮政编码自动填充
- 提供经纬度坐标(结合地理编码服务)

View File

@@ -1,117 +0,0 @@
# 企业我的页面功能说明
## 功能概述
本功能为企业用户提供了专门的"我的"页面和企业信息展示页面,实现了根据用户类型显示不同内容的功能。
## 页面结构
### 1. 企业我的页面 (`pages/mine/company-mine.vue`)
- **功能**: 企业用户的个人中心页面
- **特点**:
- 显示企业头像、名称和信息完整度
- 包含服务专区(实名认证、通知与提醒)
- 提供退出登录功能
- 点击头像区域可跳转到企业信息页面
### 2. 企业信息展示页面 (`pages/mine/company-info.vue`)
- **功能**: 显示详细的企业信息
- **特点**:
- 显示企业头像编辑功能
- 展示完整的企业信息(名称、统一社会代码、注册地点等)
- 支持编辑各项企业信息
- 包含企业联系人和法人信息
### 3. 修改后的我的页面 (`pages/mine/mine.vue`)
- **功能**: 根据用户类型显示不同的内容
- **特点**:
- 企业用户显示企业信息卡片
- 求职者用户显示个人简历信息
- 自动根据 `userInfo.isCompanyUser` 字段判断用户类型
## 用户类型判断
系统通过 `userInfo.isCompanyUser` 字段来判断用户类型:
- `0` = 企业用户
- `1` = 求职者
- `2` = 网格员
- `3` = 政府人员
## 页面跳转逻辑
### 从我的页面跳转
- **企业用户**: 点击头像区域 → 跳转到企业信息页面 (`/pages/mine/company-info`)
- **求职者用户**: 点击头像区域 → 跳转到简历页面 (`/packageA/pages/myResume/myResume`)
### 企业信息页面功能
- 点击头像 → 编辑头像(调用相册选择图片)
- 点击各项信息 → 跳转到对应的编辑页面(需要后续开发)
## 路由配置
新增的路由配置:
```json
{
"path": "pages/mine/company-mine",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
}
},
{
"path": "pages/mine/company-info",
"style": {
"navigationBarTitleText": "企业信息",
"navigationStyle": "custom"
}
}
```
## 测试页面
创建了测试页面 `pages/test/company-mine-test.vue` 用于测试功能:
- 用户类型切换测试
- 页面跳转测试
- 用户信息显示
## 样式特点
### 企业信息卡片
- 白色背景,圆角设计
- 阴影效果现代化UI
- 头像圆形显示
- 信息完整度显示
### 企业信息页面
- 清晰的信息层级
- 可点击的编辑区域
- 统一的视觉风格
## 数据流
1. 用户登录时设置 `userInfo.isCompanyUser` 字段
2. 我的页面根据此字段判断显示内容
3. 企业用户点击头像跳转到企业信息页面
4. 企业信息页面展示详细的企业数据
## 后续开发建议
1. **编辑功能**: 为每个信息项创建对应的编辑页面
2. **数据接口**: 连接真实的企业信息API
3. **头像上传**: 完善头像上传功能
4. **表单验证**: 添加企业信息编辑的表单验证
5. **权限控制**: 根据用户权限控制可编辑的字段
## 使用方法
1. 在测试页面切换用户类型为企业用户
2. 访问我的页面,查看企业信息卡片
3. 点击头像区域跳转到企业信息页面
4. 在企业信息页面查看详细的企业信息
## 注意事项
- 确保用户类型字段正确设置
- 企业信息数据需要从后端API获取
- 头像上传功能需要配置服务器接口
- 编辑页面需要根据实际需求进行开发

View File

@@ -1,187 +0,0 @@
# 企业搜索功能实现说明
## 功能概述
根据用户类型对发布岗位页面的"招聘公司"输入框进行不同的交互处理:
- **企业用户**:直接输入公司名称
- **网格员**:点击输入框跳转到企业搜索页面,支持模糊查询
## 实现细节
### 1. 用户类型判断
通过 `userInfo.isCompanyUser` 字段判断用户类型:
- `0`: 企业用户
- `1`: 求职者
- `2`: 网格员
- `3`: 政府人员
### 2. 页面修改
#### 发布岗位页面 (`pages/job/publishJob.vue`)
**模板修改:**
```vue
<!-- 企业用户直接输入 -->
<input
v-if="isCompanyUser"
class="input"
placeholder="请输入公司名称"
v-model="formData.companyName"
/>
<!-- 网格员点击跳转到搜索页面 -->
<view
v-else
class="company-selector"
@click="openCompanySearch"
>
<view class="selector-text" :class="{ 'placeholder': !formData.companyName }">
{{ formData.companyName || '请选择企业' }}
</view>
<view class="selector-icon">
<view class="arrow-icon">></view>
</view>
</view>
```
**脚本修改:**
- 添加用户类型判断逻辑
- 添加打开企业搜索页面的方法
- 添加页面显示时处理返回数据的逻辑
#### 企业搜索页面 (`pages/job/companySearch.vue`)
**功能特性:**
- 搜索框支持实时输入
- 防抖节流500ms延迟执行搜索
- 调用接口:`/app/company/likeList`,参数:`name`
- 支持企业选择和数据回传
- 空状态和加载状态处理
**核心代码:**
```javascript
// 防抖搜索
const onSearchInput = () => {
if (debounceTimer) {
clearTimeout(debounceTimer);
}
debounceTimer = setTimeout(() => {
if (searchKeyword.value.trim()) {
searchCompanies();
} else {
searchResults.value = [];
}
}, 500);
};
// 搜索企业
const searchCompanies = async () => {
const response = await createRequest('/app/company/likeList', {
name: searchKeyword.value.trim()
}, 'GET', false);
if (response.code === 200) {
searchResults.value = response.data || [];
}
};
// 选择企业
const selectCompany = (company) => {
uni.navigateBack({
success: () => {
getApp().globalData = getApp().globalData || {};
getApp().globalData.selectedCompany = company;
}
});
};
```
### 3. 数据传递
使用全局数据传递选中的企业信息:
**企业搜索页面:**
```javascript
// 选择企业后设置全局数据
getApp().globalData.selectedCompany = company;
```
**发布岗位页面:**
```javascript
// 页面显示时检查全局数据
onShow(() => {
const app = getApp();
if (app.globalData && app.globalData.selectedCompany) {
const selectedCompany = app.globalData.selectedCompany;
formData.companyName = selectedCompany.name;
formData.companyId = selectedCompany.id;
// 清除全局数据
app.globalData.selectedCompany = null;
}
});
```
### 4. 页面配置
`pages.json` 中添加了企业搜索页面配置:
```json
{
"path": "pages/job/companySearch",
"style": {
"navigationBarTitleText": "选择企业",
"navigationStyle": "custom",
"disableScroll": false,
"enablePullDownRefresh": false,
"backgroundColor": "#f5f5f5"
}
}
```
### 5. 测试页面
创建了测试页面 `pages/test/company-search-test.vue` 用于验证功能:
- 用户类型切换
- 功能说明展示
- 直接跳转到发布岗位页面测试
## 使用说明
### 企业用户
1. 进入发布岗位页面
2. 招聘公司输入框为普通输入框
3. 直接输入公司名称
### 网格员
1. 进入发布岗位页面
2. 点击"招聘公司"输入框
3. 跳转到企业搜索页面
4. 输入企业名称进行搜索(支持防抖)
5. 选择企业后自动返回
6. 企业名称显示在输入框中
## 技术特点
1. **防抖节流**搜索输入500ms延迟避免频繁请求
2. **用户类型判断**:根据 `isCompanyUser` 字段动态显示不同交互
3. **数据传递**:使用全局数据实现页面间数据传递
4. **响应式设计**:支持不同屏幕尺寸
5. **错误处理**:完善的错误提示和空状态处理
## 接口说明
**搜索企业接口:**
- 地址:`/app/company/likeList`
- 方法:`GET`
- 参数:`name` (企业名称)
- 返回:企业列表数据
## 注意事项
1. 确保用户类型字段 `isCompanyUser` 正确设置
2. 搜索接口需要支持模糊查询
3. 企业数据需要包含 `id``name` 字段
4. 防抖时间可根据实际需求调整

View File

@@ -1,284 +0,0 @@
# 微信小程序组件依赖问题解决方案
## 问题描述
```
components/IconfontIcon/IconfontIcon.js 已被代码依赖分析忽略,无法被其他模块引用。
你可根据控制台中的【代码依赖分析】告警信息修改代码,或关闭【过滤无依赖文件】功能。
```
## 问题原因
1. **组件未被正确引用** - 组件文件存在但没有被任何页面或组件引用
2. **缺少 easycom 配置** - uni-app 项目需要在 `pages.json` 中配置组件自动引入
3. **文件路径问题** - 组件路径不正确或文件名不匹配
## ✅ 解决方案
### 方案一:配置 easycom 自动引入(推荐)✨
`pages.json` 中添加 `easycom` 配置:
```json
{
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
"^IconfontIcon$": "@/components/IconfontIcon/IconfontIcon.vue",
"^WxAuthLogin$": "@/components/WxAuthLogin/WxAuthLogin.vue"
}
}
}
```
**配置说明:**
- `autoscan: true` - 自动扫描 `components` 目录
- `custom` - 自定义组件路径映射
- `^IconfontIcon$` - 组件名称(大小写敏感)
- 配置后无需 import直接在模板中使用
**使用方式:**
```vue
<template>
<!-- 无需 import直接使用 -->
<IconfontIcon name="home" :size="48" />
<WxAuthLogin ref="loginRef" />
</template>
```
### 方案二:手动引入组件
如果不想使用 easycom可以在需要的页面手动引入
```vue
<script setup>
import IconfontIcon from '@/components/IconfontIcon/IconfontIcon.vue'
</script>
<template>
<IconfontIcon name="home" />
</template>
```
### 方案三:关闭"过滤无依赖文件"功能
如果组件确实暂时不需要使用,可以在微信开发者工具中关闭此功能:
1. 打开微信开发者工具
2. 点击右上角"详情"
3. 找到"本地设置"标签
4. 取消勾选"过滤无依赖文件"
**注意:** 不推荐此方法,因为会增加打包体积。
## 🔧 完整操作步骤
### Step 1: 确认文件结构
确保组件文件存在且路径正确:
```
components/
├── IconfontIcon/
│ └── IconfontIcon.vue ✅ 文件存在
└── WxAuthLogin/
└── WxAuthLogin.vue ✅ 文件存在
```
### Step 2: 修改 pages.json
已为你自动添加了 easycom 配置,位置在 `globalStyle` 后面。
### Step 3: 重启微信开发者工具
1. 关闭微信开发者工具
2. 重新打开项目
3. 等待编译完成
### Step 4: 清除缓存
如果问题仍然存在:
1. 点击顶部菜单"工具" → "清除缓存"
2. 选择"清除文件缓存"
3. 重新编译项目
### Step 5: 验证组件可用
在任意页面中测试:
```vue
<template>
<view>
<IconfontIcon name="home" :size="48" color="#13C57C" />
</view>
</template>
<script setup>
// 使用 easycom 后无需 import
</script>
```
## 📋 配置详解
### easycom 规则说明
```json
{
"easycom": {
// 是否自动扫描 components 目录
"autoscan": true,
// 自定义规则
"custom": {
// 格式: "匹配规则": "组件路径"
"^IconfontIcon$": "@/components/IconfontIcon/IconfontIcon.vue"
}
}
}
```
**匹配规则说明:**
- `^` - 字符串开始
- `$` - 字符串结束
- `^IconfontIcon$` - 精确匹配 `IconfontIcon`
- `^uni-(.*)` - 匹配所有 `uni-` 开头的组件
### 组件命名规范
**推荐命名:**
-`IconfontIcon` - 大驼峰命名
-`WxAuthLogin` - 大驼峰命名
-`MyCustomComponent` - 大驼峰命名
**不推荐:**
-`iconfontIcon` - 小驼峰
-`iconfont-icon` - 短横线
-`Iconfont_Icon` - 下划线
## 🎯 常见问题
### Q1: 配置后仍然报错?
**解决方法:**
1. 检查 `pages.json` 语法是否正确JSON格式
2. 确认组件路径是否正确
3. 重启微信开发者工具
4. 清除缓存后重新编译
### Q2: 组件找不到?
**检查清单:**
- [ ] 文件路径是否正确:`@/components/IconfontIcon/IconfontIcon.vue`
- [ ] 文件名大小写是否一致
- [ ] 组件名称是否与配置匹配
- [ ] 是否重启了开发者工具
### Q3: 在页面中使用组件报错?
**常见原因:**
```vue
<!-- 错误使用了短横线命名 -->
<iconfont-icon name="home" />
<!-- 正确使用大驼峰命名 -->
<IconfontIcon name="home" />
```
### Q4: 多个组件如何配置?
```json
{
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
"^IconfontIcon$": "@/components/IconfontIcon/IconfontIcon.vue",
"^WxAuthLogin$": "@/components/WxAuthLogin/WxAuthLogin.vue",
"^CustomButton$": "@/components/CustomButton/CustomButton.vue"
}
}
}
```
### Q5: autoscan 和 custom 的区别?
**autoscan自动扫描**
```
components/
├── CustomButton/
│ └── CustomButton.vue → 自动识别为 <CustomButton>
├── MyCard/
│ └── MyCard.vue → 自动识别为 <MyCard>
```
**custom自定义规则**
```json
{
"custom": {
"^Button$": "@/components/CustomButton/CustomButton.vue"
}
}
```
使用 `<Button>` 会映射到 `CustomButton.vue`
## 🔍 调试方法
### 1. 查看编译日志
在微信开发者工具控制台查看编译信息:
```
点击顶部"编译" → 查看控制台输出
```
### 2. 检查组件是否被打包
1. 打开"详情" → "本地设置"
2. 查看"代码依赖分析"信息
3. 确认组件是否在依赖树中
### 3. 手动引入测试
```vue
<script setup>
// 临时测试:手动引入
import IconfontIcon from '@/components/IconfontIcon/IconfontIcon.vue'
console.log('组件加载成功:', IconfontIcon)
</script>
```
## ✅ 验证成功标志
配置成功后,应该看到:
1. ✅ 微信开发者工具控制台无警告
2. ✅ 组件可以正常显示
3. ✅ 无需 import 即可使用
4. ✅ 组件出现在代码依赖分析中
## 📚 相关文档
- [uni-app easycom 文档](https://uniapp.dcloud.net.cn/collocation/pages.html#easycom)
- [微信小程序代码依赖分析](https://developers.weixin.qq.com/miniprogram/dev/devtools/codecompile.html)
- [组件化开发文档](https://uniapp.dcloud.net.cn/tutorial/vue3-components.html)
## 🎉 总结
该问题已通过以下方式解决:
1. ✅ 在 `pages.json` 中添加了 `easycom` 配置
2. ✅ 配置了 `IconfontIcon``WxAuthLogin` 组件的自动引入
3. ✅ 组件现在可以在任何页面中直接使用,无需 import
**下一步:**
- 重启微信开发者工具
- 清除缓存
- 开始使用组件
如果问题仍然存在,请检查:
1. 文件路径是否正确
2. 文件名大小写是否一致
3. pages.json 语法是否正确
4. 是否已重启开发者工具

View File

@@ -1,321 +0,0 @@
# 微信授权登录功能说明
## 功能概述
本次开发实现了微信授权登录功能,当用户点击首页的特定功能时,会检查用户是否已登录,如果未登录则弹出授权弹窗,而不是直接跳转到登录页面。
## 主要功能点
### 1. 需要登录验证的功能入口
以下功能在点击时会进行登录验证:
- **附近工作** - 点击后跳转到附近工作列表页
- **九宫格服务功能** - 包含9个服务项
- 服务指导
- 事业单位招录
- 简历制作
- 劳动政策指引
- 技能培训信息
- 技能评价指引
- 题库和考试
- 素质测评
- AI智能面试
- **职位列表** - 点击任意职位卡片查看详情
### 2. 登录弹窗功能
#### 弹窗特性
- 使用 `uni-popup` 组件实现弹窗效果
- 弹窗居中显示,支持关闭按钮
- 不可点击遮罩关闭,确保用户必须做出选择
#### 弹窗内容
- **Logo和标题** - 显示应用logo和欢迎信息
- **授权说明** - 列出三个要点:
- 保护您的个人信息安全
- 为您推荐更合适的岗位
- 享受完整的就业服务
- **授权按钮**
- 微信小程序:使用 `open-type="getPhoneNumber"` 获取手机号
- H5/App使用微信登录接口
- 测试登录按钮仅H5/App环境显示
- **用户协议** - 显示用户协议和隐私政策链接
### 3. 登录流程
#### 微信小程序登录流程
1. 用户点击"微信授权登录"按钮
2. 触发微信小程序的手机号授权
3. 获取到 `code``encryptedData``iv`
4. 调用后端 `/app/wxLogin` 接口
5. 后端返回 `token`
6. 存储 `token` 并获取用户信息
7. 如果用户信息不完整,跳转到完善信息页面
8. 关闭弹窗,继续用户之前的操作
#### H5/App登录流程
1. 用户点击"微信授权登录"按钮
2. 调用 `uni.login` 获取微信授权 `code`
3. 调用后端 `/app/wxLogin` 接口
4. 后续流程同上
#### 测试登录流程(仅开发环境)
1. 用户点击"测试账号登录"按钮
2. 使用测试账号密码登录
3. 后续流程同上
### 4. 登录状态管理
#### 状态恢复
- 应用启动时自动从本地缓存恢复用户信息
- 验证 `token` 是否有效
- 如果 `token` 失效,清除缓存但不跳转登录页
#### 状态检查
- 使用 `checkLogin()` 函数统一检查登录状态
- 检查 `token` 是否存在
- 检查 `hasLogin` 状态
- 如果未登录,自动打开授权弹窗
## 文件结构
```
ks-app-employment-service/
├── components/
│ └── WxAuthLogin/
│ └── WxAuthLogin.vue # 微信授权登录弹窗组件
├── pages/
│ └── index/
│ └── components/
│ └── index-one.vue # 首页组件(已修改)
├── stores/
│ └── useUserStore.js # 用户状态管理(已修改)
├── App.vue # 应用入口(已修改)
└── docs/
└── 微信授权登录功能说明.md # 本文档
```
## 核心代码说明
### 1. WxAuthLogin.vue 组件
这是一个可复用的微信授权登录弹窗组件,提供以下接口:
**Props**
-
**Events**
- `success` - 登录成功时触发
- `cancel` - 取消登录时触发
**Methods**
- `open()` - 打开弹窗
- `close()` - 关闭弹窗
**使用示例**
```vue
<template>
<WxAuthLogin ref="wxAuthLoginRef" @success="handleLoginSuccess" />
</template>
<script setup>
import WxAuthLogin from '@/components/WxAuthLogin/WxAuthLogin.vue';
const wxAuthLoginRef = ref(null);
const handleLoginSuccess = () => {
console.log('登录成功');
// 执行登录后的操作
};
// 打开登录弹窗
const showLogin = () => {
wxAuthLoginRef.value?.open();
};
</script>
```
### 2. 登录检查函数
`index-one.vue` 中添加了统一的登录检查函数:
```javascript
// 登录检查函数
const checkLogin = () => {
const tokenValue = uni.getStorageSync('token') || '';
if (!tokenValue || !hasLogin.value) {
// 未登录,打开授权弹窗
wxAuthLoginRef.value?.open();
return false;
}
return true;
};
```
### 3. 点击事件处理
所有需要登录的功能都使用统一的检查逻辑:
```javascript
// 处理附近工作点击
const handleNearbyClick = () => {
if (checkLogin()) {
navTo('/pages/nearby/nearby');
}
};
// 处理服务功能点击
const handleServiceClick = (serviceType) => {
if (checkLogin()) {
navToService(serviceType);
}
};
// 处理职位详情点击
function nextDetail(job) {
if (checkLogin()) {
// 记录岗位类型,用作数据分析
if (job.jobCategory) {
const recordData = recommedIndexDb.JobParameter(job);
recommedIndexDb.addRecord(recordData);
}
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
}
}
```
### 4. 状态管理优化
`useUserStore.js` 中优化了 `logOut` 函数:
```javascript
const logOut = (redirect = true) => {
hasLogin.value = false;
token.value = ''
resume.value = {}
userInfo.value = {}
role.value = {}
uni.removeStorageSync('userInfo')
uni.removeStorageSync('token')
// 只有在明确需要跳转时才跳转到补全信息页
if (redirect) {
uni.redirectTo({
url: '/pages/complete-info/complete-info',
});
}
}
```
## 后端接口要求
### 1. 微信登录接口
**接口地址**: `/app/appLogin`
**请求方法**: `POST`
**请求参数**:
#### 微信小程序
```json
{
"code": "string", // 微信登录凭证
"encryptedData": "string", // 加密数据
"iv": "string" // 加密算法初始向量
}
```
#### H5/App
```json
{
"code": "string" // 微信登录凭证
}
```
**返回数据**:
```json
{
"token": "string", // 用户token
"msg": "string", // 返回消息
"code": 200 // 状态码
}
```
### 2. 获取用户信息接口
**接口地址**: `/app/user/resume`
**请求方法**: `GET`
**请求头**: `Authorization: Bearer {token}`
**返回数据**:
```json
{
"code": 200,
"data": {
"name": "string",
"phone": "string",
"jobTitle": ["string"],
"jobTitleId": "string",
// ... 其他用户信息
}
}
```
## 注意事项
1. **小程序配置**
- 需要在微信小程序后台配置服务器域名
- 需要申请手机号授权权限
2. **H5配置**
- 需要配置微信公众号的授权回调域名
- 需要引入微信JSSDK
3. **安全性**
- Token存储在本地缓存中注意加密
- 敏感操作前需要重新验证token有效性
4. **用户体验**
- 登录弹窗不可通过点击遮罩关闭,确保用户必须做出选择
- 提供测试登录按钮方便开发调试
- 登录成功后自动刷新数据
5. **兼容性**
- 使用条件编译确保在不同平台上正常运行
- 小程序、H5、App使用不同的登录逻辑
## 测试建议
### 功能测试
1. 未登录状态点击"附近工作",应弹出登录弹窗
2. 未登录状态点击九宫格任意服务,应弹出登录弹窗
3. 未登录状态点击职位列表,应弹出登录弹窗
4. 登录成功后,能够正常访问所有功能
5. 关闭登录弹窗后,不会自动跳转到登录页
### 登录流程测试
1. 微信小程序:测试手机号授权流程
2. H5测试微信网页授权流程
3. 测试账号登录功能(开发环境)
4. 测试登录失败的错误提示
5. 测试用户取消授权的处理
### 状态管理测试
1. 测试应用重启后登录状态的恢复
2. 测试token失效后的处理
3. 测试退出登录功能
4. 测试多次登录的状态切换
## 更新日志
### v1.0.0 (2024-10-20)
- 创建微信授权登录弹窗组件
- 添加登录状态检查逻辑
- 优化用户状态管理
- 更新首页各功能的登录验证
- 完善登录流程和错误处理
## 开发者
- 开发时间: 2024-10-20
- 涉及模块: 登录模块、首页模块、用户状态管理

View File

@@ -1,138 +0,0 @@
# 编译器内存溢出解决方案
## 问题描述
编译时出现 `FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory` 错误,表示 Node.js 内存不足。
## 解决方案
### 方案一:增加 Node.js 内存限制(推荐)
#### 在 HBuilderX 中设置
1. **修改 HBuilderX 配置文件**
- 关闭 HBuilderX
- 找到 HBuilderX 安装目录
- 打开 `HBuilderX\plugins\node\node_modules\@dcloudio\vite-plugin-uni\dist` 目录
- 或者在项目根目录创建 `vue.config.js` 文件
2. **创建或修改项目根目录下的 `vue.config.js`**
```javascript
module.exports = {
transpileDependencies: [],
// 增加 Node.js 内存限制
configureWebpack: {
devServer: {
disableHostCheck: true
}
}
}
```
3. **修改 HBuilderX 启动配置**
- 找到 HBuilderX 安装目录
- 编辑 `HBuilderX.exe` 的启动参数
- 创建一个批处理文件 `start-hbuilderx.bat`
```bat
@echo off
set NODE_OPTIONS=--max-old-space-size=8192
start "" "HBuilderX安装路径\HBuilderX.exe"
```
- 将内存设置为 8GB8192MB可根据实际情况调整为 4096、8192 或更大
#### 在命令行中运行(如果使用 CLI
如果您使用命令行方式编译,可以设置环境变量:
**Windows PowerShell**
```powershell
$env:NODE_OPTIONS="--max-old-space-size=8192"
```
**Windows CMD**
```cmd
set NODE_OPTIONS=--max-old-space-size=8192
```
**永久设置Windows 系统环境变量):**
1. 右键"此电脑" → "属性" → "高级系统设置" → "环境变量"
2. 在"用户变量"或"系统变量"中新建变量:
- 变量名:`NODE_OPTIONS`
- 变量值:`--max-old-space-size=8192`
3. 重启 HBuilderX
### 方案二:清理缓存
1. **清理 HBuilderX 缓存**
- 在 HBuilderX 中:运行 → 清理项目缓存
- 或者手动删除 `unpackage` 目录
2. **删除 node_modules 并重新安装**
```powershell
Remove-Item -Recurse -Force node_modules
# 如果有 package.json重新安装依赖
npm install
```
### 方案三:优化项目
1. **检查大文件**
- 检查 `static` 目录下是否有过大的图片或资源文件
- 当前项目中有 85 个 icon 图片,建议:
- 压缩图片文件
- 使用雪碧图或字体图标代替多个小图标
- 将不常用的资源移到云存储
2. **检查第三方库**
- 检查 `lib` 目录中的第三方库是否必需
- 当前已引入的库:
- dompurify@3.2.4es.js
- markdown-it.min.js
- highlight-uni.min.js
- lunar-javascript@1.7.2.js
- string-similarity.min.js
- 考虑按需引入或延迟加载
3. **优化编译配置**
在 `manifest.json` 中的 `h5.optimization` 已启用 `treeShaking`,这很好。
4. **分包加载**
- 已使用 `packageA` 分包,继续保持
- 考虑将更多页面移到分包中
### 方案四:升级 HBuilderX
确保使用最新版本的 HBuilderX新版本通常有更好的内存管理。
## 推荐操作步骤
1. **立即执行:** 设置 `NODE_OPTIONS` 环境变量为 `--max-old-space-size=8192`
2. **清理缓存:** 在 HBuilderX 中清理项目缓存
3. **重启 HBuilderX** 使用新的环境变量启动
4. **长期优化:** 压缩静态资源,优化第三方库引入
## 验证
设置完成后,重新编译项目,查看是否还会出现内存溢出错误。
## 参考资料
- [uni-app 官方文档 - 内存溢出问题](https://uniapp.dcloud.net.cn/tutorial/run/OOM.html)
- Node.js 内存限制说明:
- 默认限制:约 1.4GB32位或 1.7GB64位
- 建议设置4096MB4GB或 8192MB8GB
- 最大可设置:取决于系统可用内存
## 常见问题
**Q: 设置后仍然内存溢出?**
A: 尝试增大内存限制值,如 `--max-old-space-size=16384`16GB
**Q: 如何检查当前 Node.js 内存限制?**
A: 在命令行运行:`node -e "console.log(require('v8').getHeapStatistics().heap_size_limit/(1024*1024))"`
**Q: 编译特别慢?**
A: 内存充足但编译慢,可能是 CPU 性能问题,考虑:
- 关闭不必要的后台程序
- 使用 SSD 硬盘
- 升级硬件配置

View File

@@ -0,0 +1,237 @@
# 职业图谱功能接口说明
## 📋 目录
- [一、职业路径相关接口](#一职业路径相关接口)
- [二、职业技能相关接口](#二职业技能相关接口)
- [三、职业推荐相关接口](#三职业推荐相关接口)
- [四、接口使用场景](#四接口使用场景)
---
## 一、职业路径相关接口
### 1. `getJobPathPage` - 根据职业名称获取路径列表
- **接口路径**: `/jobPath/getJobPathPage`
- **请求方法**: `GET`
- **接口类型**: `zytp`
- **参数**:
- `jobName` (可选): 职业名称,用于搜索
- `pageNo`: 页码
- `pageSize`: 每页数量
- **返回数据**:
```json
{
"code": 0,
"data": {
"list": [
{
"id": 1,
"startJobId": 1,
"startJob": "AI产品经理",
"endJobId": 1,
"endJob": "推荐算法",
"jobOrder": "AI产品经理AI训练师图像识别导航算法推荐算法",
"jobCount": 5
}
],
"total": 16
}
}
```
- **使用场景**:
- ✅ **CareerPath.vue**: 获取目标职业选项列表(下拉选择器)
- ✅ **CareerRecommend.vue**: 通过 `jobName` 查询获取 `jobId`(当缺少 jobId 时)
- ✅ **CareerPath.vue**: 查询时如果没有 jobPathId通过 jobName 查找
---
### 2. ``getJobPathById`- 根据职业路径ID获取详情
- **接口路径**: `/jobPath/getJobPathById`
- **请求方法**: `GET`
- **接口类型**: `zytp`
- **参数**:
- `jobPathId`: 职业路径ID
- **返回数据**:
```json
{
"data": [
{
"name": "职位名称",
"skillNameList": "技能1,技能2,技能3"
}
]
}
```
- **使用场景**:
- ✅ **CareerPath.vue**: 获取职业路径的详细信息(起点、中间步骤、终点及每个职位的技能列表)
- 用于显示完整的职业发展路径时间线
---
### 3. `getJobPathNum` - 获取职业路径数量
- **接口路径**: `/jobPath/getJobPathNum`
- **请求方法**: `GET`
- **接口类型**: `zytp`
- **参数**: 无
- **返回数据**:
```json
{
"data": 16 // 路径总数
}
```
- **使用场景**:
- ✅ **CareerPath.vue**: 显示"系统已收录 X 条职业路径"
---
## 二、职业技能相关接口
### 4. `getJobSkillDetail` - 获取职位技能详情
- **接口路径**: `/jobSkillDet/getJobSkillDet`
- **请求方法**: `GET`
- **接口类型**: `zytp`
- **参数**:
- `jobId` (必需): 职位ID
- `jobName` (可选): 职位名称
- **返回数据**:
```json
{
"data": [
{
"skillName": "技能名称",
"skillScore": "技能分数"
}
]
}
```
- **使用场景**:
- ✅ **career-planning.vue**: 点击推荐职位卡片时,获取该职位的技能详情(用于技能详情弹窗 `SkillDetailPopup`
- **调用位置**: `handleJobCardClick` 函数中
---
### 5. `getJobPathSkill` - 获取职业路径技能(已隐藏,暂未使用)
- **接口路径**: `/jobSkillDet/getJobPathSkill`
- **请求方法**: `POST`
- **接口类型**: `zytp`
- **参数**:
- `pathId`: 路径ID
- `currentJobName`: 当前职位名称
- **返回数据**: `List<JobSkillDetVO>` (包含技能分数、类型等详细信息)
- **使用场景**:
- ❌ 暂未在代码中使用
- 💡 **潜在使用场景**: 在 `CareerPath.vue` 中,如果用户点击路径中的某个职位,需要查看该职位在路径中的详细技能信息(包含技能分数、类型等)时,可以使用此接口
- **当前状态**: 接口已注释隐藏,如需使用请取消注释
---
## 三、职业推荐相关接口
### 8. `recommendJob` - 推荐职位
- **接口路径**: `/job/recommendJobByJobName`
- **请求方法**: `GET`
- **接口类型**: `zytp`
- **参数**:
- `jobName` (必需): 当前职位名称(从缓存中获取),通过 URL 参数传递,格式:`/job/recommendJobByJobName?jobName=职位名称`
- **返回数据**:
```json
{
"data": [
{
"jobId": 123,
"jobName": "推荐职位名称",
"skillList": [
{
"skillName": "技能名称"
}
]
}
]
}
```
- **使用场景**:
- ✅ **CareerRecommend.vue**: 根据当前职位名称(从缓存中获取),获取相似推荐职位列表(显示在"相似推荐职位"区域)
---
## 四、接口使用场景
### 📍 页面结构
```
career-planning.vue (主页面)
├── Tab 0: 职业推荐 (CareerRecommend.vue)
├── Tab 1: 职业路径 (CareerPath.vue)
└── Tab 2: 技能发展 (SkillDevelopment.vue)
```
### 📍 职业推荐 Tab (CareerRecommend.vue)
1. **进入页面时**:
- `getJobSkillDetail` - 获取当前职位的技能标签(需要 `jobId`,如果没有 `jobId` 则跳过)
- `recommendJob` - 获取相似推荐职位(需要 `jobId`
2. **点击职位卡片时**:
- `getJobSkillDetail` - 获取该职位的技能详情(显示在技能详情弹窗中)
**注意**: `getJobPathPage` 接口**只在职业路径流程中使用**,不在职业推荐流程中使用。
### 📍 职业路径 Tab (CareerPath.vue)
1. **进入页面时**:
- `getJobPathPage` - 获取所有职业路径列表(填充目标职业下拉选择器)
- `getJobPathNum` - 获取职业路径总数(显示"系统已收录 X 条职业路径"
2. **选择目标职业并点击查询时**:
- `getJobPathPage` - 如果没有 `jobPathId`,通过 `jobName` 查找
- `getJobPathDetail` (实际: `getJobPathById`) - 获取职业路径详情(显示完整路径时间线)
### 📍 技能发展 Tab (SkillDevelopment.vue)
1. **进入页面时**:
- 暂无接口调用
---
## 🔑 关键接口调用流程
### 流程1: 获取当前职位技能
```
CareerRecommend.vue
└── getJobSkillDetail(jobId, jobName) → 获取技能列表
(如果没有 jobId则跳过获取技能
```
### 流程2: 查询职业路径
```
CareerPath.vue
├── getJobPathPage() → 获取路径列表(填充下拉选择器)
├── 用户选择目标职业
└── getJobPathById(jobPathId) → 获取路径详情(显示时间线)
```
### 流程3: 获取推荐职位
```
CareerRecommend.vue
└── recommendJob(jobId) → 获取相似推荐职位列表
```
---
## ⚠️ 注意事项
1. **接口返回码**:
- `code: 0` 和 `code: 200` 都表示成功
- 已在 `request.js` 中处理
2. **参数要求**:
- `getJobSkillDetail` 必须提供 `jobId`,如果没有 `jobId` 则跳过获取技能
- `getJobPathPage` **只在职业路径流程中使用**,不在职业推荐流程中使用
3. **数据格式**:
- `getJobPathPage` 返回的 `list` 在 `response.data.list` 中
- `getJobPathById` 返回的详情在 `response.data` 中(数组格式)
4. **接口使用范围**:
- `getJobPathPage` **只在职业路径流程CareerPath.vue中使用**
- 职业推荐流程CareerRecommend.vue**不使用** `getJobPathPage` 接口
5. **接口前缀**:
- 所有 `zytp` 类型的接口使用: `http://ks.zhaopinzao8dian.com/api/ks_zytp/admin-api/zytp`

View File

@@ -1,129 +0,0 @@
# 自定义TabBar使用说明
## 功能概述
本项目实现了基于用户类型的动态自定义TabBar支持根据用户登录状态和类型显示不同的导航项
- **未登录状态**默认显示求职者tabbar职位 + 招聘会 + AI+ + 消息 + 我的)
- **企业用户userType=0**:显示"发布岗位"导航
- **求职者用户userType=1,2,3**:显示"招聘会"导航
## 实现方案
### 1. 微信小程序原生自定义TabBar
`custom-tab-bar/` 目录下创建了微信小程序原生自定义TabBar组件
- `index.js` - 组件逻辑根据用户类型动态生成TabBar配置
- `index.wxml` - 模板文件
- `index.wxss` - 样式文件
- `index.json` - 组件配置文件
### 2. UniApp兼容的自定义TabBar组件
创建了 `components/CustomTabBar/CustomTabBar.vue` 组件,支持多端兼容:
- 支持微信小程序、H5、APP等多端
- 响应式设计,根据用户类型动态显示
- 支持消息徽章显示
- 支持页面跳转逻辑
### 3. 配置修改
`pages.json` 中启用了自定义TabBar
```json
"tabBar": {
"custom": true,
// ... 其他配置
}
```
## 使用方法
### 1. 在页面中引入自定义TabBar
```vue
<template>
<view class="page">
<!-- 页面内容 -->
<!-- 自定义tabbar -->
<CustomTabBar :currentPage="0" />
</view>
</template>
```
### 2. 用户类型判断
组件会自动从 `useUserStore` 中获取用户信息,根据用户登录状态和 `userInfo.userType` 字段判断用户类型:
```javascript
// 用户类型说明
// 未登录: 默认显示求职者tabbar
// 0: 企业用户 - 显示"发布岗位"
// 1: 求职者 - 显示"招聘会"
// 2: 网格员 - 显示"招聘会"
// 3: 政府人员 - 显示"招聘会"
```
### 3. 动态切换用户类型
当用户登录状态或类型发生变化时TabBar会自动更新
```javascript
// 未登录状态自动显示求职者tabbar
// 登录后根据用户类型显示对应tabbar
// 切换用户类型
userInfo.value.userType = 1; // 切换到求职者
uni.setStorageSync('userInfo', userInfo.value);
// 登出时清除用户信息,自动回到未登录状态
userStore.logOut(false);
```
## 页面配置
### 已配置的页面
- `pages/index/index.vue` - 首页currentPage: 0
- `pages/careerfair/careerfair.vue` - 招聘会页面currentPage: 1
- `pages/chat/chat.vue` - AI+页面currentPage: 2
- `pages/msglog/msglog.vue` - 消息页面currentPage: 3
- `pages/mine/mine.vue` - 我的页面currentPage: 4
### 测试页面
- `pages/test/tabbar-test.vue` - TabBar功能测试页面
## 技术特点
1. **响应式设计**:根据用户类型动态显示不同的导航项
2. **多端兼容**支持微信小程序、H5、APP等平台
3. **消息徽章**:支持显示未读消息数量
4. **页面跳转**智能判断tabBar页面和普通页面的跳转方式
5. **用户类型监听**实时监听用户类型变化并更新TabBar
## 注意事项
1. 确保在 `pages.json` 中设置了 `"custom": true`
2. 每个页面的 `currentPage` 参数需要正确设置
3. 用户类型存储在 `userInfo.userType` 字段中
4. 组件会自动监听用户类型变化并更新显示
## 测试方法
1. 访问测试页面:`/pages/test/tabbar-test`
2. 切换不同的用户类型
3. 观察底部TabBar的变化
4. 测试页面跳转功能
## 故障排除
如果TabBar不显示或显示异常
1. 检查 `pages.json` 中的 `custom: true` 配置
2. 确认用户信息是否正确存储
3. 检查组件是否正确引入
4. 查看控制台是否有错误信息

View File

@@ -1,429 +0,0 @@
# 阿里图标库iconfont引入指南
## 📦 方式一:使用字体文件(推荐)
### 第一步:下载图标资源
1. 访问 [阿里图标库](https://www.iconfont.cn/)
2. 注册/登录账号
3. 搜索需要的图标,点击"添加入库"
4. 点击右上角购物车图标
5. 点击"添加至项目"(如果没有项目,先创建一个)
6. 进入"我的项目"
7. 点击"下载至本地"按钮
### 第二步:解压并复制文件
下载的压缩包中包含以下文件:
```
iconfont.css
iconfont.ttf
iconfont.woff
iconfont.woff2
iconfont.json
demo_index.html
demo.css
```
**需要的文件:**
- `iconfont.css` - 样式文件
- `iconfont.ttf` - 字体文件
- `iconfont.woff` - 字体文件
- `iconfont.woff2` - 字体文件
### 第三步:创建项目目录
在项目中创建 `static/iconfont/` 目录(如果不存在):
```
ks-app-employment-service/
├── static/
│ ├── iconfont/ ← 新建此目录
│ │ ├── iconfont.css
│ │ ├── iconfont.ttf
│ │ ├── iconfont.woff
│ │ └── iconfont.woff2
│ └── ...
```
### 第四步:修改 CSS 文件
打开 `static/iconfont/iconfont.css`,修改字体文件路径:
**原始路径:**
```css
@font-face {
font-family: "iconfont";
src: url('iconfont.woff2?t=1234567890') format('woff2'),
url('iconfont.woff?t=1234567890') format('woff'),
url('iconfont.ttf?t=1234567890') format('truetype');
}
```
**修改为(相对路径):**
```css
@font-face {
font-family: "iconfont";
src: url('./iconfont.woff2?t=1234567890') format('woff2'),
url('./iconfont.woff?t=1234567890') format('woff'),
url('./iconfont.ttf?t=1234567890') format('truetype');
}
```
**或修改为(绝对路径,推荐):**
```css
@font-face {
font-family: "iconfont";
src: url('/static/iconfont/iconfont.woff2?t=1234567890') format('woff2'),
url('/static/iconfont/iconfont.woff?t=1234567890') format('woff'),
url('/static/iconfont/iconfont.ttf?t=1234567890') format('truetype');
}
```
### 第五步:在项目中引入
#### 方法 A全局引入App.vue
`App.vue` 中引入:
```vue
<style>
/* 引入阿里图标库 */
@import url("/static/iconfont/iconfont.css");
/* 其他全局样式 */
@import '@/common/animation.css';
@import '@/common/common.css';
</style>
```
#### 方法 B在 main.js 中引入
```javascript
// main.js
import './static/iconfont/iconfont.css'
```
### 第六步:使用图标
#### 使用方式 1Unicode 方式
```vue
<template>
<view class="icon">&#xe600;</view>
</template>
<style>
.icon {
font-family: "iconfont" !important;
font-size: 32rpx;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
```
#### 使用方式 2Font Class 方式(推荐)
```vue
<template>
<view class="iconfont icon-home"></view>
<view class="iconfont icon-user"></view>
<view class="iconfont icon-search"></view>
</template>
<style scoped>
.iconfont {
font-size: 32rpx;
color: #333;
}
</style>
```
#### 使用方式 3封装为组件
创建 `components/IconfontIcon/IconfontIcon.vue`
```vue
<template>
<text class="iconfont" :class="iconClass" :style="iconStyle"></text>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
name: {
type: String,
required: true
},
size: {
type: [String, Number],
default: 32
},
color: {
type: String,
default: '#333'
}
})
const iconClass = computed(() => `icon-${props.name}`)
const iconStyle = computed(() => ({
fontSize: `${props.size}rpx`,
color: props.color
}))
</script>
<style scoped>
.iconfont {
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
```
**使用组件:**
```vue
<template>
<IconfontIcon name="home" :size="48" color="#13C57C" />
<IconfontIcon name="user" :size="36" color="#256BFA" />
</template>
<script setup>
import IconfontIcon from '@/components/IconfontIcon/IconfontIcon.vue'
</script>
```
---
## 📦 方式二:使用在线链接(不推荐小程序)
### 第一步:获取在线链接
1. 在阿里图标库"我的项目"中
2. 点击"Font class"
3. 点击"查看在线链接"
4. 复制 CSS 链接
### 第二步:引入在线 CSS
`App.vue` 中:
```vue
<style>
/* 注意:小程序不支持在线字体 */
@import url("//at.alicdn.com/t/c/font_xxxxx.css");
</style>
```
**⚠️ 注意:** 微信小程序不支持外部字体文件,必须使用方式一!
---
## 📦 方式三:使用 Symbol 方式SVG
### 第一步:获取 Symbol 代码
1. 在"我的项目"中
2. 点击"Symbol"
3. 点击"生成代码"
4. 复制生成的 JS 链接
### 第二步:下载 JS 文件
将 JS 文件下载到 `static/iconfont/iconfont.js`
### 第三步:引入并使用
`App.vue` 或需要的页面中:
```vue
<template>
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-home"></use>
</svg>
</template>
<script>
// 引入 Symbol 脚本
// 注意:需要在 main.js 中引入 iconfont.js
</script>
<style>
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>
```
**⚠️ 注意:** 小程序对 SVG 支持有限,推荐使用方式一!
---
## 🎯 最佳实践建议
### 1. 使用 Font Class 方式(方式一)
**优点:**
- ✅ 兼容性好,支持所有平台
- ✅ 可以自定义颜色和大小
- ✅ 语义化强,易于维护
- ✅ 体积小,加载快
**缺点:**
- ❌ 只支持单色图标
### 2. 创建图标组件库
```
components/
├── IconfontIcon/
│ └── IconfontIcon.vue # 通用图标组件
```
### 3. 统一管理图标名称
创建 `config/icons.js`
```javascript
// 图标配置
export const ICONS = {
HOME: 'home',
USER: 'user',
SEARCH: 'search',
LOCATION: 'location',
PHONE: 'phone',
// ... 更多图标
}
```
使用:
```vue
<script setup>
import { ICONS } from '@/config/icons'
</script>
<template>
<IconfontIcon :name="ICONS.HOME" />
</template>
```
---
## 🔧 常见问题
### Q1: 小程序中图标不显示?
**解决方案:**
- 确保使用本地字体文件,不要使用在线链接
- 检查 CSS 中的字体路径是否正确
- 确保字体文件已正确复制到 `static/iconfont/` 目录
### Q2: 图标显示为方框?
**解决方案:**
- 检查字体文件是否完整
- 检查 `@font-face``font-family` 名称是否一致
- 清除缓存重新编译
### Q3: 如何更新图标库?
1. 在阿里图标库添加新图标到项目
2. 重新下载至本地
3. 替换 `static/iconfont/` 下的所有文件
4. 清除缓存,重新编译
### Q4: H5 和小程序路径不一致?
**解决方案:**
使用条件编译:
```css
@font-face {
font-family: "iconfont";
/* #ifdef H5 */
src: url('/static/iconfont/iconfont.woff2') format('woff2');
/* #endif */
/* #ifdef MP-WEIXIN */
src: url('./iconfont.ttf') format('truetype');
/* #endif */
}
```
---
## 📝 示例代码
### 完整示例:登录按钮
```vue
<template>
<button class="login-btn">
<text class="iconfont icon-phone"></text>
<text>手机号登录</text>
</button>
</template>
<style scoped>
.login-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 40rpx;
background: #13C57C;
border-radius: 12rpx;
color: #fff;
}
.iconfont {
font-size: 32rpx;
margin-right: 12rpx;
}
</style>
```
---
## 🎨 推荐使用的图标
### 常用图标
- `icon-home` - 首页
- `icon-user` - 用户
- `icon-search` - 搜索
- `icon-location` - 位置
- `icon-phone` - 电话
- `icon-message` - 消息
- `icon-setting` - 设置
- `icon-star` - 收藏
- `icon-share` - 分享
- `icon-close` - 关闭
---
## 📚 相关资源
- [阿里图标库官网](https://www.iconfont.cn/)
- [uni-app 字体图标文档](https://uniapp.dcloud.net.cn/tutorial/syntax-css.html#%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87)
- [CSS @font-face](https://developer.mozilla.org/zh-CN/docs/Web/CSS/@font-face)
---
## ✅ 检查清单
- [ ] 已下载图标文件到 `static/iconfont/` 目录
- [ ] 已修改 CSS 中的字体文件路径
- [ ] 已在 App.vue 中引入 iconfont.css
- [ ] 已测试图标显示正常
- [ ] 已封装图标组件(可选)
- [ ] 已统一管理图标名称(可选)

View File

@@ -1,407 +0,0 @@
# 阿里图标库快速开始 🚀
## 一、5分钟快速上手
### Step 1: 下载图标文件2分钟
1. 访问 https://www.iconfont.cn/
2. 登录后搜索图标,点击"添加入库"
3. 购物车 → 添加至项目(没有项目先创建)
4. 我的项目 → 下载至本地
### Step 2: 放置文件1分钟
解压下载的文件将以下4个文件复制到 `static/iconfont/` 目录:
```
✅ iconfont.css
✅ iconfont.ttf
✅ iconfont.woff
✅ iconfont.woff2
```
### Step 3: 修改CSS路径1分钟
打开 `static/iconfont/iconfont.css`,将字体路径修改为相对路径:
```css
@font-face {
font-family: "iconfont";
src: url('./iconfont.woff2?t=xxx') format('woff2'),
url('./iconfont.woff?t=xxx') format('woff'),
url('./iconfont.ttf?t=xxx') format('truetype');
}
```
### Step 4: 全局引入1分钟
`App.vue``<style>` 标签中添加:
```vue
<style>
/* 引入阿里图标库 */
@import url("/static/iconfont/iconfont.css");
</style>
```
### Step 5: 开始使用 ✨
```vue
<template>
<!-- 直接使用 -->
<text class="iconfont icon-home"></text>
<!-- 或使用组件 -->
<IconfontIcon name="home" :size="48" color="#13C57C" />
</template>
```
---
## 二、推荐使用方式
### 方式 A使用封装的组件最推荐👍
```vue
<template>
<IconfontIcon name="phone" :size="40" color="#13C57C" />
</template>
<script setup>
import IconfontIcon from '@/components/IconfontIcon/IconfontIcon.vue'
</script>
```
**优点:**
- ✅ 统一管理,易于维护
- ✅ 支持动态修改大小和颜色
- ✅ 语义清晰
- ✅ 支持点击事件
### 方式 B使用配置常量推荐
```vue
<template>
<IconfontIcon
:name="ICONS.HOME"
:size="ICON_SIZES.LARGE"
:color="ICON_COLORS.PRIMARY"
/>
</template>
<script setup>
import IconfontIcon from '@/components/IconfontIcon/IconfontIcon.vue'
import { ICONS, ICON_SIZES, ICON_COLORS } from '@/config/icons'
</script>
```
**优点:**
- ✅ 统一图标名称
- ✅ 避免拼写错误
- ✅ IDE 自动补全
- ✅ 便于重构
### 方式 C直接使用类名
```vue
<template>
<text class="iconfont icon-home" style="font-size: 32rpx; color: #333;"></text>
</template>
```
---
## 三、常用场景示例
### 场景1导航栏图标
```vue
<template>
<view class="navbar">
<IconfontIcon name="arrow-left" :size="40" @click="goBack" />
<text class="title">页面标题</text>
<IconfontIcon name="share" :size="36" @click="share" />
</view>
</template>
<script setup>
const goBack = () => {
uni.navigateBack()
}
const share = () => {
// 分享逻辑
}
</script>
```
### 场景2按钮图标
```vue
<template>
<button class="primary-btn">
<IconfontIcon name="phone" :size="32" color="#FFFFFF" />
<text>手机号登录</text>
</button>
</template>
<style>
.primary-btn {
display: flex;
align-items: center;
gap: 12rpx;
}
</style>
```
### 场景3列表项图标
```vue
<template>
<view class="list-item">
<IconfontIcon name="location" :size="36" color="#13C57C" />
<text class="text">工作地点</text>
<IconfontIcon name="arrow-right" :size="28" color="#999" />
</view>
</template>
```
### 场景4状态图标
```vue
<template>
<view class="status-box">
<IconfontIcon
:name="status.icon"
:size="64"
:color="status.color"
/>
<text>{{ status.text }}</text>
</view>
</template>
<script setup>
import { computed } from 'vue'
const orderStatus = ref('success')
const status = computed(() => {
const map = {
success: { icon: 'success', color: '#13C57C', text: '提交成功' },
error: { icon: 'error', color: '#F44336', text: '提交失败' },
loading: { icon: 'loading', color: '#256BFA', text: '处理中...' }
}
return map[orderStatus.value]
})
</script>
```
---
## 四、组件API说明
### IconfontIcon 组件
**Props:**
| 参数 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| name | String | - | 图标名称(必填),如:'home' 或 'icon-home' |
| size | String/Number | 32 | 图标大小单位rpx |
| color | String | - | 图标颜色支持十六进制、rgb等 |
| bold | Boolean | false | 是否加粗 |
**Events:**
| 事件名 | 说明 | 回调参数 |
|--------|------|----------|
| click | 点击图标时触发 | event |
**使用示例:**
```vue
<IconfontIcon
name="home"
:size="48"
color="#13C57C"
:bold="true"
@click="handleClick"
/>
```
---
## 五、配置说明
### 图标名称配置config/icons.js
```javascript
export const ICONS = {
HOME: 'home',
USER: 'user',
SEARCH: 'search',
// ... 更多图标
}
```
### 尺寸预设
```javascript
export const ICON_SIZES = {
MINI: 24, // 24rpx
SMALL: 28, // 28rpx
NORMAL: 32, // 32rpx默认
LARGE: 40, // 40rpx
XLARGE: 48, // 48rpx
}
```
### 颜色预设
```javascript
export const ICON_COLORS = {
PRIMARY: '#13C57C', // 主色调
SECONDARY: '#256BFA', // 次要色
SUCCESS: '#13C57C', // 成功
WARNING: '#FF9800', // 警告
DANGER: '#F44336', // 危险
TEXT: '#333333', // 文本色
}
```
---
## 六、常见问题
### Q1: 图标不显示?
**检查清单:**
- [ ] 文件是否已复制到 `static/iconfont/` 目录
- [ ] CSS路径是否正确修改
- [ ] 是否已在 App.vue 中引入
- [ ] 图标类名是否正确(如:`icon-home`
- [ ] 清除缓存并重新编译
### Q2: 如何查看可用的图标?
1. 打开下载包中的 `demo_index.html`
2. 或查看 `iconfont.css` 中的类名
3. 类名格式通常为 `.icon-xxx:before`
### Q3: 如何更新图标?
1. 在阿里图标库添加新图标到项目
2. 重新下载至本地
3. 替换 `static/iconfont/` 下的所有文件
4. 清除缓存,重新编译
### Q4: 小程序能用在线链接吗?
❌ 不能!微信小程序必须使用本地字体文件。
---
## 七、最佳实践
### ✅ 推荐做法
1. **统一管理图标名称**
```javascript
// 使用配置文件
import { ICONS } from '@/config/icons'
```
2. **使用封装的组件**
```vue
<IconfontIcon name="home" />
```
3. **预设常用尺寸和颜色**
```javascript
import { ICON_SIZES, ICON_COLORS } from '@/config/icons'
```
4. **语义化命名**
```javascript
const ICONS = {
HOME: 'home', // ✅ 语义清晰
USER_CENTER: 'user', // ✅ 明确用途
}
```
### ❌ 不推荐做法
1. **硬编码图标名称**
```vue
<text class="iconfont icon-home"></text> <!-- ❌ 不推荐 -->
```
2. **使用在线链接(小程序)**
```css
@import url("//at.alicdn.com/xxx.css"); /* ❌ 小程序不支持 */
```
3. **直接使用 Unicode**
```vue
<text class="iconfont">&#xe600;</text> <!-- ❌ 不直观 -->
```
---
## 八、测试页面
已为你创建了测试页面,可以查看各种使用方式:
**路径:** `pages/demo/iconfont-demo.vue`
在 `pages.json` 中添加页面配置即可访问:
```json
{
"path": "pages/demo/iconfont-demo",
"style": {
"navigationBarTitleText": "图标示例"
}
}
```
---
## 九、相关文件
```
项目结构:
├── components/
│ └── IconfontIcon/
│ └── IconfontIcon.vue # 图标组件
├── config/
│ └── icons.js # 图标配置
├── static/
│ └── iconfont/
│ ├── iconfont.css # 样式文件
│ ├── iconfont.ttf # 字体文件
│ ├── iconfont.woff # 字体文件
│ ├── iconfont.woff2 # 字体文件
│ └── README.md # 说明文档
├── pages/
│ └── demo/
│ └── iconfont-demo.vue # 测试页面
└── docs/
├── 阿里图标库引入指南.md # 详细文档
└── 阿里图标库快速开始.md # 本文档
```
---
## 十、总结
✅ **记住这三步:**
1. **下载** - 从阿里图标库下载文件
2. **放置** - 复制到 `static/iconfont/` 目录
3. **引入** - 在 `App.vue` 中引入 CSS
🎉 **就是这么简单!**
如有问题,请参考详细文档:`docs/阿里图标库引入指南.md`

View File

@@ -19,37 +19,47 @@ export function useColumnCount(onChange = () => {}) {
// columnCount.value = count < 2 ? 2 : count
// }
// }
const calcColumn = () => {
// 使用新的API替代已废弃的getSystemInfoSync
let width
// #ifdef MP-WEIXIN
const mpSystemInfo = uni.getWindowInfo()
width = mpSystemInfo.windowWidth
// #endif
// #ifndef MP-WEIXIN
const otherSystemInfo = uni.getSystemInfoSync()
width = otherSystemInfo.windowWidth
// #endif
let count = 2
if (width >= 1000) {
count = 5
} else if (width >= 750) {
count = 4
} else if (width >= 500) {
count = 3
} else {
count = 2
}
if (count !== columnCount.value) {
columnCount.value = count
}
// 计算间距count=2 => 1count=5 => 2中间线性插值
const spacing = 2 - (count - 2) * (1 / 3)
// console.log('列数:', count, '间距:', spacing.toFixed(2))
columnSpace.value = spacing
const calcColumn = () => {
// 使用新的API替代已废弃的getSystemInfoSync
let width
// #ifdef MP-WEIXIN
const mpSystemInfo = uni.getWindowInfo()
width = mpSystemInfo.windowWidth
// #endif
// #ifndef MP-WEIXIN
const otherSystemInfo = uni.getSystemInfoSync()
width = otherSystemInfo.windowWidth
// #endif
let count = 2
if (width >= 1000) {
// #ifdef H5
count = 3 // H5端最多显示3列
// #endif
// #ifndef H5
count = 5
// #endif
} else if (width >= 750) {
// #ifdef H5
count = 3 // H5端最多显示3列
// #endif
// #ifndef H5
count = 4
// #endif
} else if (width >= 500) {
count = 3
} else {
count = 2
}
if (count !== columnCount.value) {
columnCount.value = count
}
// 计算间距count=2 => 1count=5 => 2中间线性插值
const spacing = 2 - (count - 2) * (1 / 3)
// console.log('列数:', count, '间距:', spacing.toFixed(2))
columnSpace.value = spacing
}
onMounted(() => {

View File

@@ -17,6 +17,7 @@
})();
</script>
<title></title>
<link rel="icon" type="image/png" href="./static/logo2-S.png">
<!-- vconsole -->
<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script>
@@ -28,4 +29,4 @@
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>
</html>

File diff suppressed because one or more lines are too long

28
package-lock.json generated
View File

@@ -1,4 +1,6 @@
{
"name": "ks-app",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
@@ -27,35 +29,9 @@
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"license": "MIT",
"dependencies": {
"jsbn": "^1.1.0"
}
}
},
"dependencies": {
"@dcloudio/uni-ui": {
"version": "1.5.11",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
},
"dayjs": {
"version": "1.11.19",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
},
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"sm-crypto": {
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"requires": {
"jsbn": "^1.1.0"
}
}
}
}

View File

@@ -7,7 +7,7 @@
</template>
<template #headerright>
<view class="btn mar_ri10">
<image src="@/static/icon/collect3.png" v-if="!companyInfo.isCollection"></image>
<image src="@/static/icon/collect3.png" v-if="!companyInfo?.isCollection"></image>
<image src="@/static/icon/collect2.png" v-else></image>
</view>
</template>
@@ -17,16 +17,16 @@
<image src="@/static/icon/companyIcon.png" mode=""></image>
</view>
<view class="companyinfo-right">
<view class="row1">{{ companyInfo?.companyName }}</view>
<view class="row2">
{{ companyInfo?.scale }}
</view>
<view class="row1">{{ companyInfo?.name || '未知公司' }}</view>
<view class="row2">
{{ getScaleLabel(companyInfo?.scale) }}
</view>
</view>
</view>
<view class="conetent-info" :class="{ expanded: isExpanded }">
<view class="info-title">公司介绍</view>
<view class="info-desirption">{{
companyInfo.companyIntroduction
companyInfo?.description || '暂无公司介绍'
}}</view>
<!-- <view class="info-title title2">公司地址</view>
<view class="locationCompany"></view> -->
@@ -38,41 +38,37 @@
</view>
<scroll-view scroll-y class="Detailscroll-view">
<view class="views">
<view class="Detail-title"><text class="title">在招职位</text></view>
<template v-if="companyInfo.jobInfoList.length != 0">
<view v-for="job in companyInfo.jobInfoList" :key="job.id">
<!-- @click="navTo(`/packageA/pages/post/post?jobId=${JSON.stringify(job)}`)" -->
<!-- :style="getItemBackgroundStyle('bj2.png')" -->
<view class="cards">
<view class="card-company">
<text class="company">{{ job.jobTitle }}</text>
<view class="salary"> {{ job.salaryRange }}/ </view>
<view class="Detail-title"><text class="title">在招职位</text></view>
<template v-if="companyInfo.jobList && companyInfo.jobList.length != 0">
<view v-for="job in companyInfo.jobList" :key="job.jobId">
<view class="cards" @click="navToJobDetail(job.jobId)">
<view class="card-company">
<text class="company">{{ job.jobTitle }}</text>
<view class="salary"> {{ job.minSalary }}-{{ job.maxSalary }}/ </view>
</view>
<view class="card-tags">
<view class="tag jy">
{{ getExperienceLabel(job.experience) }}
</view>
<view class="card-tags">
<view class="tag jy">
<image :src="`${baseUrl}/jobfair/jy.png`" mode=""></image>
{{ job.experienceRequirement }}
</view>
<view class="tag xl">
<image :src="`${baseUrl}/jobfair/xx.png`" mode=""></image>
{{ job.educationRequirement }}
</view>
<view class="tag yd" v-if="job.jobRequirement">
<image :src="`${baseUrl}/jobfair/lx-1.png`" mode=""></image>
{{ job.jobRequirement }}
</view>
<view class="tag xl">
{{ getEducationLabel(job.education) }}
</view>
<view class="card-companyName">
{{ job.jobDescription }}
<view class="tag yd" v-if="job.vacancies">
招聘{{ job.vacancies }}
</view>
<view class="deliver-box">
<view class="deliver-btn" @click="deliverResume(job)">
简历投递
</view>
</view>
<view class="card-info">
<view class="company-address" v-if="job.jobLocation">
<image class="point3" src="/static/icon/point3.png"></image>
{{ job.jobLocation }}
</view>
<view class="push-time" v-if="job.postingDate">
{{ formatPublishTime(job.postingDate) }}
</view>
</view>
</view>
</template>
</view>
</template>
<empty v-else pdTop="200"></empty>
</view>
</scroll-view>
@@ -95,9 +91,9 @@
} from "@dcloudio/uni-app";
import dictLabel from "@/components/dict-Label/dict-Label.vue";
import config from "@/config.js";
import {
storeToRefs
} from "pinia";
import { storeToRefs } from "pinia";
import useDictStore from '@/stores/useDictStore';
const dictStore = useDictStore();
import useLocationStore from "@/stores/useLocationStore";
const {
longitudeVal,
@@ -118,9 +114,8 @@
pageSize: 10,
});
const companyInfo = ref({
jobInfoList: [],
jobList: [],
});
const baseUrl = config.imgBaseUrl;
const getItemBackgroundStyle = (imageName) => ({
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`,
@@ -129,9 +124,47 @@
backgroundRepeat: "no-repeat",
});
onLoad((options) => {
companyInfo.value = JSON.parse(options.job);
});
// 已移除重复的onLoad函数保留下面的async版本
// 根据公司ID获取公司详情
function getCompanyDetailsById(companyId) {
// 使用全局注入的$api调用接口
$api.createRequest('/app/company/' + companyId).then((resData) => {
if (resData && resData.code === 200 && resData.data) {
console.log('Company details:', resData.data);
// 确保数据格式符合页面需求,并为关键字段提供默认值
companyInfo.value = {
...resData.data,
name: resData.data.name || '未知公司',
scale: resData.data.scale || '未知规模',
description: resData.data.description || '暂无公司介绍',
isCollection: resData.data.isCollection || 0,
jobList: resData.data.jobList || [] // 使用正确的jobList字段
};
console.log('Company details loaded successfully');
} else {
console.error('Failed to load company details:', resData?.msg || 'Unknown error');
// 设置默认值,避免页面白屏
companyInfo.value = {
name: '加载失败',
scale: '-',
description: '无法获取公司信息,请稍后重试',
isCollection: 0,
jobList: []
};
}
}).catch((error) => {
console.error('API error when fetching company details:', error);
// 错误情况下也设置默认值
companyInfo.value = {
name: '请求失败',
scale: '-',
description: '网络请求失败,请检查网络连接',
isCollection: 0,
jobList: []
};
});
}
function expand() {
isExpanded.value = !isExpanded.value;
@@ -148,9 +181,9 @@
if (resData1.code == 200) {
$api.myRequest("/system/user/login/user/info", {}, "GET", 10100, headers).then((resData) => {
$api.myRequest("/jobfair/public/job-fair-person-job/insert", {
jobFairId: companyInfo.value.jobFairId, // 招聘会id
jobFairId: companyInfo.value?.jobFairId, // 招聘会id
personId: resData.info.userId, // 当前登录用户id
enterpriseId: companyInfo.value.companyId, // 企业id
enterpriseId: companyInfo.value?.companyId, // 企业id
jobId: job.jobId, // 岗位id
idCard:resData.info.personCardNo
}, "post", 9100, {
@@ -169,6 +202,168 @@
});
}
// 获取企业规模字典数据
onLoad(async (options) => {
// 初始化companyInfo
companyInfo.value = { jobList: [] };
// 加载字典数据
await dictStore.getDictData();
if (options.job && typeof options.job === 'string') {
try {
companyInfo.value = JSON.parse(options.job);
} catch (error) {
console.error('Error parsing job data:', error);
companyInfo.value = { jobList: [] };
}
// 处理companyId参数
} else if (options.companyId) {
console.log('Getting company details by companyId:', options.companyId);
// 调用API获取公司详情
getCompanyDetailsById(options.companyId);
// 处理bussinessId参数如果需要
} else if (options.bussinessId) {
console.log('Handling bussinessId:', options.bussinessId);
// 这里可以根据需要处理bussinessId
// 目前先作为companyId处理
getCompanyDetailsById(options.bussinessId);
} else {
console.warn('No valid parameters provided');
companyInfo.value = { jobList: [] };
}
});
// 根据scale值获取对应的文本
function getScaleLabel(scale) {
// 处理空值、undefined、null等情况
if (scale === undefined || scale === null || scale === '') return '-';
try {
// 调试日志追踪scale值处理
console.log('Processing scale value:', scale);
// 确保scale是字符串类型
const scaleStr = String(scale);
// 使用dictStore获取企业规模标签
const label = dictStore.dictLabel('scale', scaleStr);
console.log('Retrieved scale label:', label, 'for scale:', scaleStr);
// 如果字典中没有找到对应标签,使用预设的默认映射
if (!label) {
const defaultScaleMap = {
'1': '少于50人',
'2': '50-100人',
'3': '100-500人',
'4': '500-1000人',
'5': '1000人以上'
};
const defaultLabel = defaultScaleMap[scaleStr];
console.log('Using default label:', defaultLabel, 'for scale:', scaleStr);
return defaultLabel || '-';
}
return label;
} catch (error) {
console.error('获取企业规模标签失败:', error);
return '-';
}
}
// 根据experience值获取对应的文本
function getExperienceLabel(experience) {
if (experience === undefined || experience === null || experience === '') return '经验不限';
try {
const experienceStr = String(experience);
const label = dictStore.dictLabel('experience', experienceStr);
if (!label) {
const defaultExperienceMap = {
'0': '经验不限',
'1': '1年以内',
'2': '1-3年',
'3': '3-5年',
'4': '5-10年',
'5': '10年以上'
};
return defaultExperienceMap[experienceStr] || '经验不限';
}
return label;
} catch (error) {
console.error('获取经验标签失败:', error);
return '经验不限';
}
}
// 根据education值获取对应的文本
function getEducationLabel(education) {
if (education === undefined || education === null || education === '') return '学历不限';
try {
const educationStr = String(education);
const label = dictStore.dictLabel('education', educationStr);
if (!label) {
const defaultEducationMap = {
'-1': '学历不限',
'1': '初中及以下',
'2': '高中',
'3': '中专',
'4': '大专',
'5': '本科',
'6': '硕士',
'7': '博士'
};
return defaultEducationMap[educationStr] || '学历不限';
}
return label;
} catch (error) {
console.error('获取学历标签失败:', error);
return '学历不限';
}
}
// 格式化发布时间为相对时间
function formatPublishTime(publishTime) {
if (!publishTime) return '';
try {
const date = new Date(publishTime);
const now = new Date();
const diffTime = Math.abs(now - date);
const diffSeconds = Math.floor(diffTime / 1000);
const diffMinutes = Math.floor(diffSeconds / 60);
const diffHours = Math.floor(diffMinutes / 60);
const diffDays = Math.floor(diffHours / 24);
const diffWeeks = Math.floor(diffDays / 7);
const diffMonths = Math.floor(diffDays / 30);
const diffYears = Math.floor(diffDays / 365);
if (diffSeconds < 60) {
return '刚刚发布';
} else if (diffMinutes < 60) {
return `${diffMinutes}分钟前`;
} else if (diffHours < 24) {
return `${diffHours}小时前`;
} else if (diffDays === 1) {
return '昨天发布';
} else if (diffDays < 7) {
return `${diffDays}天前`;
} else if (diffWeeks < 4) {
return `${diffWeeks}周前`;
} else if (diffMonths < 12) {
return `${diffMonths}个月前`;
} else {
return `${diffYears}年前`;
}
} catch (error) {
console.error('格式化发布时间失败:', error);
return '';
}
}
// 跳转到职位详情页面
function navToJobDetail(jobId) {
if (jobId) {
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
}
}
</script>
<style lang="stylus" scoped>
@@ -316,24 +511,23 @@
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 22rpx;
padding-bottom: 18rpx;
background: #f2f8fc;
background: #FFFFFF;
.card-company {
display: flex;
justify-content: space-between;
align-items: flex-start;
border-bottom: 1rpx solid #c2d7ea;
.company {
font-weight: 600;
font-weight: 400;
font-size: 32rpx;
color: #207AC7;
color: #333333;
}
.salary {
font-weight: 600;
// font-weight: 600;
font-size: 28rpx;
color: #F83A3C;
color: #1677FF;
white-space: nowrap;
line-height: 48rpx;
}
@@ -371,7 +565,7 @@
.card-tags {
display: flex;
flex-wrap: wrap;
margin: 25rpx 0 35rpx;
margin: 25rpx 0 20rpx;
image {
width: 24rpx;
@@ -380,18 +574,18 @@
}
.jy {
background: #D9EDFF;
color: #0086FF;
background: #F5F5F5;
color: #333333;
}
.xl {
background: #FFF1D5;
color: #FF7F01;
background: #F5F5F5;
color: #333333;
}
.yd {
background: #FFD8D8;
color: #F83A3C;
background: #F5F5F5;
color: #333333;
}
.tag {
@@ -410,6 +604,62 @@
}
}
.card-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
flex-wrap: wrap;
.point3 {
width: 12rpx;
height: 12rpx;
}
.company-address {
display: flex;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #6C7282;
line-height: 34rpx;
flex: 1;
min-width: 0;
margin-right: 20rpx;
image {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.push-time {
display: flex;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #6C7282;
line-height: 34rpx;
flex-shrink: 0;
white-space: nowrap;
image {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
}
}
.card-bottom {
margin-top: 32rpx;
display: flex;

View File

@@ -2,82 +2,83 @@
<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 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 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
v-if="job"
: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 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 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 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 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 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 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>
@@ -85,9 +86,9 @@
<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"
v-if="job.company && job.company.industry"
dictType="industry"
:value="jobInfo.company.industry"
:value="job.company.industry"
></dict-tree-Label>
</view>
</view>
@@ -98,7 +99,7 @@
</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>
<dict-Label dictType="scale" :value="job.company?.scale"></dict-Label>
</view>
</view>
</view>
@@ -108,7 +109,7 @@
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>
{{ job.isHot ? '是' : '否' }}
{{ job?.isHot ? '是' : '否' }}
</view>
</view>
</view>
@@ -125,7 +126,7 @@ const jobs = ref([]);
onLoad(() => {
let compareData = uni.getStorageSync('compare');
jobs.value = compareData;
jobs.value = Array.isArray(compareData) ? compareData : [];
});
</script>

View File

@@ -81,10 +81,16 @@ const fromValue = reactive({
area: '',
jobTitleId: [],
});
onLoad(async () => {
const needSkill = ref(false);
onLoad(async (options) => {
// 初始化字典数据
await getDictData();
initLoad();
// 检查是否需要继续跳转到技能页面
if (options && options.needSkill === 'true') {
needSkill.value = true;
}
});
const confirm = () => {
if (!fromValue.jobTitleId) {
@@ -94,7 +100,12 @@ const confirm = () => {
$api.msg('完成');
state.disbleDate = true;
getUserResume().then(() => {
navBack();
// 如果需要继续跳转到技能页面,则跳转到个人信息页面(携带 needSkill 标记,便于返回两级)
if (needSkill.value) {
navTo('/packageA/pages/personalInfo/personalInfo?needSkill=true');
} else {
navBack();
}
});
});
};

View File

@@ -17,6 +17,19 @@
<view class="input-titile">姓名</view>
<input class="input-con" v-model="fromValue.name" placeholder="请输入您的姓名" />
</view>
<view class="content-input" :class="{ 'input-error': passwordError }">
<view class="input-titile">设置密码</view>
<input
class="input-con"
v-model="fromValue.ytjPassword"
placeholder="请输入密码"
type="password"
maxlength="8"
@input="validatePassword"
/>
<view v-if="passwordError" class="error-message">{{ passwordError }}</view>
<view v-if="fromValue.ytjPassword && !passwordError" class="success-message"> 密码格式正确</view>
</view>
<view class="content-sex">
<view class="sex-titile">性别</view>
<view class="sext-ri">
@@ -52,67 +65,298 @@
</view>
<view class="content-input">
<view class="input-titile">身份证</view>
<input class="input-con" v-model="fromValue.idcard" placeholder="" />
<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="请输入您的手机号码" />
</view>
<view class="content-skills">
<view class="skills-header">
<view class="input-titile">技能信息</view>
<view
class="add-skill-btn"
@click="addSkill"
:class="{ 'disabled': state.skills.length >= 3 }"
>
+ 添加技能
</view>
</view>
<view class="skills-list">
<view class="skill-item" v-for="(skill, index) in state.skills" :key="index">
<view class="skill-header">
<view class="skill-number">技能 {{ index + 1 }}</view>
<view class="skill-actions" v-if="state.skills.length > 1">
<view class="action-btn delete-btn" @click="removeSkill(index)">删除</view>
</view>
</view>
<view class="skill-fields">
<view class="skill-field" @click="changeSkillName(index)">
<view class="field-label">技能名称</view>
<input
class="field-input triangle"
disabled
:value="skill.name"
placeholder="请选择技能名称"
/>
</view>
<view class="skill-field" @click="changeSkillLevel(index)">
<view class="field-label">技能等级</view>
<input
class="field-input triangle"
disabled
:value="getSkillLevelText(skill.level)"
placeholder="请选择技能等级"
/>
</view>
</view>
</view>
<view class="empty-skills" v-if="state.skills.length === 0">
<text class="empty-text">暂无技能信息点击上方按钮添加</text>
</view>
</view>
</view>
</view>
<SelectPopup ref="selectPopupRef"></SelectPopup>
</AppLayout>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { reactive, inject, watch, ref, onMounted, onUnmounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, navBack, checkingPhoneRegExp } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
import SelectPopup from '@/components/selectPopup/selectPopup.vue';
const { userInfo } = storeToRefs(useUserStore());
const { getUserResume } = useUserStore();
const { dictLabel, oneDictData } = useDictStore();
const openSelectPopup = inject('openSelectPopup');
const dictStore = useDictStore();
const { dictLabel, oneDictData, complete: dictComplete, getDictSelectOption } = dictStore;
// #ifdef H5
const injectedOpenSelectPopup = inject('openSelectPopup', null);
// #endif
// #ifdef MP-WEIXIN
const selectPopupRef = ref();
// #endif
// 创建本地的 openSelectPopup 函数,兼容 H5 和微信小程序
const openSelectPopup = (config) => {
// #ifdef MP-WEIXIN
if (selectPopupRef.value) {
selectPopupRef.value.open(config);
}
// #endif
// #ifdef H5
if (injectedOpenSelectPopup) {
injectedOpenSelectPopup(config);
}
// #endif
};
const percent = ref('0%');
// 当从“先职位后技能”链路进入时,提交后需直接返回职业规划页
const needGoBackTwoStep = ref(false);
const state = reactive({
educationText: '',
politicalAffiliationText: '',
skills: [], // 新的技能数据结构包含id字段
currentEditingSkillIndex: -1 // 当前正在编辑的技能索引
});
const fromValue = reactive({
name: '',
ytjPassword: '', // 新增密码字段
sex: 0,
birthDate: '',
education: '',
politicalAffiliation: '',
idcard: '',
});
onLoad(() => {
initLoad();
// setTimeout(() => {
// const { age, birthDate } = useUserStore().userInfo;
// const newAge = calculateAge(birthDate);
// // 计算年龄是否对等
// if (age != newAge) {
// completeResume();
// }
// }, 1000);
idCard: '',
phone: ''
});
// 输入校验相关
const passwordError = ref('');
// 移除重复的onLoad定义已在上方实现
// 在onLoad中初始化数据确保页面加载时就能获取技能信息
onLoad((options = {}) => {
if (options.needSkill === 'true') {
needGoBackTwoStep.value = true;
}
// 初始化页面数据
initLoad();
});
// 监听页面显示,接收从技能查询页面返回的数据
onShow(() => {
// 通过事件总线接收技能选择结果
uni.$on('skillSelected', handleSkillSelected);
});
// 页面卸载时移除事件监听
onUnmounted(() => {
uni.$off('skillSelected', handleSkillSelected);
});
// 监听 userInfo 变化,确保数据及时更新
watch(() => userInfo.value, (newVal) => {
if (newVal && Object.keys(newVal).length > 0) {
initLoad();
}
}, { deep: true, immediate: false });
// 监听字典数据加载完成,自动更新学历显示
watch(() => dictComplete.value, (newVal) => {
if (newVal) {
console.log('字典数据加载完成,更新学历显示');
// 确保有学历值(如果没有则使用默认值"4"本科)
if (!fromValue.education) {
fromValue.education = '4';
}
// 直接遍历字典数据查找对应标签
const eduValue = String(fromValue.education);
const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
}
}
});
// 监听学历字典数据变化
watch(() => dictStore.state.education, (newVal) => {
if (newVal && newVal.length > 0) {
console.log('学历字典数据变化,更新显示');
// 确保有学历值(如果没有则使用默认值"4"本科)
if (!fromValue.education) {
fromValue.education = '4';
}
// 直接遍历字典数据查找对应标签
const eduValue = String(fromValue.education);
const eduItem = newVal.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
}
}
}, { deep: true });
function initLoad() {
fromValue.name = userInfo.value.name;
fromValue.sex = Number(userInfo.value.sex);
fromValue.phone = userInfo.value.phone;
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);
// 优先从 store 获取,如果没有则从本地缓存获取
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const currentUserInfo = userInfo.value && Object.keys(userInfo.value).length > 0 ? userInfo.value : cachedUserInfo;
fromValue.name = currentUserInfo.name || '';
fromValue.ytjPassword = ''; // 密码输入框默认为空,不加载已有密码
fromValue.sex = currentUserInfo.sex !== undefined ? Number(currentUserInfo.sex) : 0;
fromValue.phone = currentUserInfo.phone || '';
fromValue.birthDate = currentUserInfo.birthDate || '';
// 将学历转换为字符串类型,确保类型一致
// 如果没有学历值,默认设置为本科(值为"4"
fromValue.education = currentUserInfo.education ? String(currentUserInfo.education) : '4';
fromValue.politicalAffiliation = currentUserInfo.politicalAffiliation || '';
fromValue.idCard = currentUserInfo.idCard || '';
// 初始化技能数据 - 从appSkillsList获取保留原始id
if (currentUserInfo.appSkillsList && Array.isArray(currentUserInfo.appSkillsList)) {
// 过滤掉name为空的技能项
const validSkills = currentUserInfo.appSkillsList.filter(item => item.name && item.name.trim() !== '');
if (validSkills.length > 0) {
// 将appSkillsList转换为新的技能数据结构保留原始id
state.skills = validSkills.map(skill => ({
id: skill.id, // 保留服务器返回的原始id
name: skill.name,
level: skill.levels || ''
}));
} else {
state.skills = [];
}
} else {
state.skills = [];
}
// 初始化学历显示文本(需要等待字典数据加载完成)
initEducationText();
// 回显政治面貌
if (currentUserInfo.politicalAffiliation) {
state.politicalAffiliationText = dictLabel('affiliation', currentUserInfo.politicalAffiliation);
}
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
// 初始化学历显示文本
function initEducationText() {
// 确保有学历值(如果没有则使用默认值"4"本科)
if (!fromValue.education) {
fromValue.education = '4';
}
console.log('初始化学历显示,当前学历值:', fromValue.education);
// 直接遍历字典数据查找对应标签不依赖dictLabel函数确保准确性
const findLabelFromDict = () => {
if (dictStore.state.education && dictStore.state.education.length > 0) {
const eduValue = String(fromValue.education);
const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
return true;
} else {
console.log('字典数据中未找到匹配的学历标签');
}
}
return false;
};
// 立即尝试查找
if (!findLabelFromDict() && dictComplete.value) {
// 如果字典数据已加载完成但未找到标签,尝试重新获取字典数据
loadEducationDictAndUpdate();
}
// 等待字典数据加载完成
const checkDictData = () => {
if (dictComplete.value && dictStore.state.education && dictStore.state.education.length > 0) {
findLabelFromDict();
} else {
// 如果字典数据未加载,等待一段时间后重试
setTimeout(() => {
if (dictComplete.value && dictStore.state.education && dictStore.state.education.length > 0) {
findLabelFromDict();
} else {
// 尝试主动加载字典数据
loadEducationDictAndUpdate();
}
}, 500);
}
};
// 主动加载学历字典数据并更新显示
function loadEducationDictAndUpdate() {
getDictSelectOption('education').then((data) => {
console.log('主动加载学历字典数据:', data);
dictStore.state.education = data;
findLabelFromDict();
}).catch((error) => {
console.error('加载学历字典数据失败:', error);
});
}
checkDictData();
}
const confirm = () => {
if (!fromValue.name) {
return $api.msg('请输入姓名');
@@ -129,19 +373,156 @@ const confirm = () => {
if (!checkingPhoneRegExp(fromValue.phone)) {
return $api.msg('请输入正确手机号');
}
// 密码校验
validatePassword();
if (fromValue.ytjPassword && passwordError.value) {
return $api.msg(passwordError.value);
}
// 构建appSkillsList数据结构 - 使用新的技能数据结构包含id字段
const appSkillsList = state.skills
.filter(skill => skill.name && skill.name.trim() !== '')
.map(skill => ({
id: skill.id, // 包含技能id用于更新操作
name: skill.name,
levels: skill.level || ''
}));
const params = {
...fromValue,
age: calculateAge(fromValue.birthDate),
appSkillsList: appSkillsList
};
$api.createRequest('/app/user/resume', params, 'post').then((resData) => {
$api.msg('完成');
state.disbleDate = true;
getUserResume().then(() => {
navBack();
// 如果从“缺职位+技能”链路进入,回退两层直接返回职业规划页
if (needGoBackTwoStep.value) {
navBack({ delta: 2 });
} else {
navBack();
}
});
});
};
// 添加技能
function addSkill() {
if (state.skills.length >= 3) {
$api.msg('最多只能添加3个技能');
return;
}
// 添加新的技能对象新增技能不需要id后端会自动生成
state.skills.push({
name: '',
level: ''
});
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
// 删除技能
function removeSkill(index) {
const skill = state.skills[index];
// 如果有技能id调用删除接口
if (skill && skill.id) {
$api.createRequest(`/app/appskill/${skill.id}`, {}, 'DELETE').then(() => {
// 接口调用成功,从本地数组中移除
state.skills.splice(index, 1);
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
$api.msg('删除成功');
}).catch((err) => {
console.error('删除技能失败:', err);
$api.msg('删除失败,请重试');
});
} else {
// 没有id的技能新增的直接从本地数组中移除
state.skills.splice(index, 1);
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
}
// 获取技能等级文本
function getSkillLevelText(level) {
const levelMap = {
'1': '初级',
'2': '中级',
'3': '高级'
};
return levelMap[level] || '';
}
// 选择技能名称
function changeSkillName(index) {
state.currentEditingSkillIndex = index;
// 将当前已选中的技能名称传递给查询页面
const selectedSkills = state.skills.map(skill => skill.name).filter(name => name);
uni.navigateTo({
url: `/pages/complete-info/skill-search?selected=${encodeURIComponent(JSON.stringify(selectedSkills))}`
});
}
// 选择技能等级
function changeSkillLevel(index) {
const skillLevels = [
{ label: '初级', value: '1' },
{ label: '中级', value: '2' },
{ label: '高级', value: '3' }
];
// 查找当前技能等级在数据中的索引
let defaultIndex = [0];
const currentSkill = state.skills[index];
if (currentSkill && currentSkill.level) {
const index = skillLevels.findIndex(item => item.value === currentSkill.level);
if (index >= 0) {
defaultIndex = [index];
}
}
openSelectPopup({
title: '技能等级',
maskClick: true,
data: [skillLevels],
defaultIndex: defaultIndex,
success: (_, [value]) => {
state.skills[index].level = value.value;
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
},
});
}
// 技能选择回调函数
const handleSkillSelected = (skillName) => {
if (skillName && state.currentEditingSkillIndex >= 0) {
// 更新当前编辑的技能名称
state.skills[state.currentEditingSkillIndex].name = skillName;
// 重置当前编辑索引
state.currentEditingSkillIndex = -1;
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
};
const changeDateBirt = () => {
const datearray = generateDatePickerArrays();
const defaultIndex = getDatePickerIndexes(fromValue.birthDate);
@@ -161,21 +542,149 @@ const changeDateBirt = () => {
},
});
};
const changeEducation = () => {
async function changeEducation() {
// 确保字典数据已加载
if (!dictComplete.value || !dictStore.state.education || dictStore.state.education.length === 0) {
// 如果字典数据未加载,先加载数据
try {
await getDictSelectOption('education').then((data) => {
dictStore.state.education = data;
});
} catch (error) {
console.error('加载学历字典数据失败:', error);
}
}
// 等待数据加载完成后再获取数据
let educationData = oneDictData('education');
// 如果数据还是为空,等待一下再试
if (!educationData || educationData.length === 0) {
await new Promise(resolve => setTimeout(resolve, 100));
educationData = oneDictData('education');
if (!educationData || educationData.length === 0) {
$api.msg('学历数据加载中,请稍后再试');
return;
}
}
// 确保有默认值
if (!fromValue.education) {
fromValue.education = '4'; // 默认设置为本科
}
// 将当前学历值转换为字符串,用于查找默认索引
const currentEducation = String(fromValue.education);
// 查找当前学历在数据中的索引
let defaultIndex = [0];
if (currentEducation && educationData && educationData.length > 0) {
// 同时支持字符串和数字类型的匹配
const index = educationData.findIndex(item => {
const itemValue = String(item.value);
return itemValue === currentEducation;
});
if (index >= 0) {
defaultIndex = [index];
console.log('找到学历默认索引:', index, '当前值:', currentEducation);
} else {
// 如果字符串匹配失败,尝试数字匹配
const currentNum = Number(currentEducation);
if (!isNaN(currentNum)) {
const numIndex = educationData.findIndex(item => {
const itemValue = Number(item.value);
return !isNaN(itemValue) && itemValue === currentNum;
});
if (numIndex >= 0) {
defaultIndex = [numIndex];
console.log('通过数字匹配找到学历默认索引:', numIndex, '当前值:', currentNum);
} else {
console.warn('未找到匹配的学历值:', currentEducation, '可用值:', educationData.map(item => item.value));
}
}
}
}
openSelectPopup({
title: '学历',
maskClick: true,
data: [oneDictData('education')],
data: [educationData],
defaultIndex: defaultIndex,
success: (_, [value]) => {
fromValue.education = value.value;
state.educationText = value.label;
console.log('切换学历选择,新值:', value.value);
fromValue.education = String(value.value); // 确保存储为字符串
// 使用相同的字典数据查找逻辑
const eduValue = String(value.value);
const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
} else {
// 如果没找到,尝试重新加载字典数据
console.log('字典中未找到对应标签,尝试重新加载字典数据');
getDictSelectOption('education').then((data) => {
dictStore.state.education = data;
const newEduItem = data.find(item => String(item.value) === eduValue);
if (newEduItem && newEduItem.label) {
state.educationText = newEduItem.label;
}
});
}
},
});
};
}
const changeSex = (sex) => {
fromValue.sex = sex;
};
// 密码实时校验
const validatePassword = () => {
const password = (fromValue.ytjPassword || '').trim();
// 如果为空,清除错误信息
if (!password) {
passwordError.value = '';
return;
}
// 校验规则长度8位包含大小写字母和数字至少各有一个
if (password.length !== 8) {
passwordError.value = '密码长度必须为8位';
return;
}
// 检查是否包含大写字母
const hasUpperCase = /[A-Z]/.test(password);
// 检查是否包含小写字母
const hasLowerCase = /[a-z]/.test(password);
// 检查是否包含数字
const hasNumber = /[0-9]/.test(password);
if (!hasUpperCase) {
passwordError.value = '密码必须包含至少一个大写字母';
return;
}
if (!hasLowerCase) {
passwordError.value = '密码必须包含至少一个小写字母';
return;
}
if (!hasNumber) {
passwordError.value = '密码必须包含至少一个数字';
return;
}
// 检查是否只包含字母和数字
if (!/^[A-Za-z0-9]+$/.test(password)) {
passwordError.value = '密码只能包含大小写字母和数字';
return;
}
// 校验通过
passwordError.value = '';
};
const changePoliticalAffiliation = () => {
openSelectPopup({
title: '政治面貌',
@@ -188,6 +697,7 @@ const changePoliticalAffiliation = () => {
});
};
function generateDatePickerArrays(startYear = 1975, endYear = new Date().getFullYear()) {
const years = [];
const months = [];
@@ -207,14 +717,39 @@ function generateDatePickerArrays(startYear = 1975, endYear = new Date().getFull
}
function isValidDate(dateString) {
const [year, month, day] = dateString.split('-').map(Number);
// 添加空值检查
if (!dateString || typeof dateString !== 'string' || dateString.trim() === '') {
return false;
}
const dateParts = dateString.split('-');
if (dateParts.length !== 3) {
return false;
}
const [year, month, day] = dateParts.map(Number);
// 检查是否为有效数字
if (isNaN(year) || isNaN(month) || isNaN(day)) {
return false;
}
const date = new Date(year, month - 1, day); // 月份从0开始
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
}
const calculateAge = (birthDate) => {
// 添加空值检查
if (!birthDate) {
return '';
}
const birth = new Date(birthDate);
// 检查日期是否有效
if (isNaN(birth.getTime())) {
return '';
}
const today = new Date();
let age = today.getFullYear() - birth.getFullYear();
const monthDiff = today.getMonth() - birth.getMonth();
@@ -249,13 +784,33 @@ function getFormCompletionPercent(form) {
}
// 主函数
function getDatePickerIndexes(dateStr) {
const [year, month, day] = dateStr.split('-');
// 添加空值检查如果dateStr为空或null返回默认值当前日期
if (!dateStr || typeof dateStr !== 'string' || dateStr.trim() === '') {
const today = new Date();
const year = today.getFullYear().toString();
const month = (today.getMonth() + 1).toString().padStart(2, '0');
const day = today.getDate().toString().padStart(2, '0');
dateStr = `${year}-${month}-${day}`;
}
let dateParts = dateStr.split('-');
if (dateParts.length !== 3) {
// 如果分割后不是3部分使用当前日期作为默认值
const today = new Date();
const year = today.getFullYear().toString();
const month = (today.getMonth() + 1).toString().padStart(2, '0');
const day = today.getDate().toString().padStart(2, '0');
dateStr = `${year}-${month}-${day}`;
dateParts = dateStr.split('-');
}
const [year, month, day] = dateParts;
const [years, months, days] = generateDatePickerArrays();
const yearIndex = years.indexOf(year);
const monthIndex = months.indexOf(month);
const dayIndex = days.indexOf(day);
const yearIndex = years.indexOf(year) >= 0 ? years.indexOf(year) : 0;
const monthIndex = months.indexOf(month) >= 0 ? months.indexOf(month) : 0;
const dayIndex = days.indexOf(day) >= 0 ? days.indexOf(day) : 0;
return [yearIndex, monthIndex, dayIndex];
}
@@ -287,6 +842,19 @@ function getDatePickerIndexes(dateStr) {
height: 80rpx;
border-bottom: 2rpx solid #EBEBEB
position: relative;
.error-message
color: #ff4757;
font-size: 24rpx;
margin-top: 10rpx;
line-height: 1.4;
.success-message
color: #2ed573;
font-size: 24rpx;
margin-top: 10rpx;
line-height: 1.4;
.input-error
.input-con
border-bottom-color: #ff4757;
.triangle::before
position: absolute;
right: 20rpx;
@@ -307,6 +875,28 @@ function getDatePickerIndexes(dateStr) {
border-radius: 2rpx
background: #697279;
transform: rotate(45deg)
.input-nx
position: relative
border-bottom: 2rpx solid #EBEBEB
padding-bottom: 30rpx
display: flex
flex-wrap: wrap
.nx-item
padding: 16rpx 24rpx
width: fit-content
border-radius: 20rpx
border: 2rpx solid #E8EAEE
background-color: #f8f9fa
margin-right: 16rpx
margin-top: 16rpx
font-size: 28rpx
color: #333333
transition: all 0.2s ease
&:hover
background-color: #e9ecef
border-color: #256bfa
color: #256bfa
.content-sex
height: 110rpx;
display: flex
@@ -343,4 +933,130 @@ function getDatePickerIndexes(dateStr) {
color: #FFFFFF;
text-align: center;
line-height: 90rpx
// 技能信息样式
.content-skills
margin-bottom: 52rpx
.skills-header
display: flex
justify-content: space-between
align-items: center
margin-bottom: 32rpx
.input-titile
font-weight: 400
font-size: 28rpx
color: #6A6A6A
.add-skill-btn
padding: 16rpx 32rpx
background: #256BFA
color: #FFFFFF
border-radius: 8rpx
font-size: 26rpx
font-weight: 500
transition: all 0.3s ease
&:active
background: #1a5cd9
transform: scale(0.98)
&.disabled
background: #CCCCCC
color: #999999
cursor: not-allowed
&:active
background: #CCCCCC
transform: none
.skills-list
.skill-item
background: #FFFFFF
border: 2rpx solid #E8EAEE
border-radius: 12rpx
padding: 24rpx
margin-bottom: 24rpx
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05)
transition: all 0.3s ease
&:hover
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1)
border-color: #256BFA
.skill-header
display: flex
justify-content: space-between
align-items: center
margin-bottom: 20rpx
.skill-number
font-weight: 500
font-size: 28rpx
color: #333333
.skill-actions
.action-btn
padding: 8rpx 16rpx
border-radius: 6rpx
font-size: 24rpx
font-weight: 400
transition: all 0.2s ease
&.delete-btn
background: #FF4D4F
color: #FFFFFF
&:active
background: #D9363E
transform: scale(0.95)
.skill-fields
display: flex
flex-direction: column
gap: 20rpx
.skill-field
.field-label
font-weight: 400
font-size: 26rpx
color: #6A6A6A
margin-bottom: 8rpx
.field-input
font-weight: 400
font-size: 28rpx
color: #333333
line-height: 72rpx
height: 72rpx
border: 2rpx solid #E8EAEE
border-radius: 8rpx
padding: 0 20rpx
background: #F8F9FA
transition: all 0.3s ease
&:focus
border-color: #256BFA
background: #FFFFFF
&.triangle::before
right: 30rpx
top: calc(50% - 2rpx)
&.triangle::after
right: 30rpx
top: 50%
.empty-skills
text-align: center
padding: 60rpx 0
background: #F8F9FA
border-radius: 12rpx
border: 2rpx dashed #E8EAEE
.empty-text
font-size: 28rpx
color: #999999
font-weight: 400
</style>

View File

@@ -1,5 +1,5 @@
<template>
<AppLayout title="" backGorundColor="#F4F4F4">
<AppLayout backGorundColor="#F4F4F4">
<template #headerleft>
<view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image>
@@ -10,11 +10,12 @@
<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/collect3.png" v-if="jobInfo.isCollection!==0" @click="jobCollection"></image>
<image src="@/static/icon/collect2.png" v-else @click="jobCollection"></image>
</view>
</template>
<view class="content" v-show="!isEmptyObject(jobInfo)">
<view class="content-top btn-feel">
<view style="background: #ffffff;padding: 24rpx;box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);border-radius: 20rpx 20rpx 20rpx 20rpx;position: relative;overflow: hidden;">
<view class="top-salary">
@@ -35,10 +36,19 @@
<dict-Label dictType="education" :value="jobInfo.education"></dict-Label>
</view>
</view>
<view class="position-source">
<text>来源&nbsp;</text>
{{ jobInfo.dataSource }}
</view>
<!-- <view class="position-source">
<text>来源&nbsp;</text>
{{ jobInfo.dataSource }}
</view> -->
<view class="position-source">
<view class="btn">
<image src="@/static/icon/collect3.png" v-if="jobInfo.isCollection!==0" @click="jobCollection"></image>
<image src="@/static/icon/collect2.png" v-else @click="jobCollection"></image>
</view>
</view>
<view class="publish-time" v-if="jobInfo.postingDate">
{{ formatPublishTime(jobInfo.postingDate) }}
</view>
</view>
</view>
<view class="ai-explain" v-if="jobInfo.isExplain">
@@ -58,6 +68,39 @@
{{ jobInfo.description }}
</view>
</view>
<!-- 职位图片 -->
<view class="content-card" v-if="jobInfo.filesList && jobInfo.filesList.length > 0">
<view class="card-title">
<text class="title">职位图片</text>
</view>
<view class="job-images">
<view class="image-item" v-for="(file, index) in jobInfo.filesList" :key="file.id">
<image :src="file.fileUrl" mode="aspectFit" @click="previewImage(file.fileUrl, index)"></image>
</view>
</view>
</view>
<!-- 联系人信息 -->
<view class="content-card" v-if="jobInfo.jobContactList && jobInfo.jobContactList.length > 0">
<view class="card-title">
<text class="title">联系人信息</text>
</view>
<view class="contact-list">
<view class="contact-item" v-for="(contact, index) in jobInfo.jobContactList" :key="index">
<view class="contact-info">
<view class="contact-label">联系人</view>
<view class="contact-value">{{ contact.contactPerson }}</view>
</view>
<view class="contact-info">
<view class="contact-label">职位</view>
<view class="contact-value">{{ contact.position }}</view>
</view>
<view class="contact-info">
<view class="contact-label">电话</view>
<view class="contact-value">{{ contact.contactPersonPhone }}</view>
</view>
</view>
</view>
</view>
<!-- 公司信息 -->
<view class="content-card">
<view class="card-title">
@@ -128,7 +171,7 @@
</view>
</view>
</view>
<view class="content-card" v-else>
<!-- <view class="content-card" v-if="false">
<view class="card-title">
<view class="title">申请人列表</view>
</view>
@@ -171,12 +214,12 @@
</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>
<view class="btn-wq button-click" @click="jobApply">投递简历</view>
</view>
</template>
<VideoPlayer ref="videoPalyerRef" />
@@ -397,17 +440,23 @@ function getCompetivetuveness(jobId) {
// 申请岗位
function jobApply() {
const jobId = jobInfo.value.jobId;
if (jobInfo.value.isApply) {
const jobUrl = jobInfo.value.jobUrl;
return window.open(jobUrl);
} else {
$api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
$api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
getDetail(jobId);
$api.msg('申请成功');
const jobUrl = jobInfo.value.jobUrl;
return window.open(jobUrl);
// return window.open(jobUrl);
});
}
// if (jobInfo.value.isApply) {
// const jobUrl = jobInfo.value.jobUrl;
// return window.open(jobUrl);
// } else {
// $api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
// getDetail(jobId);
// $api.msg('申请成功');
// const jobUrl = jobInfo.value.jobUrl;
// return window.open(jobUrl);
// });
// }
}
// 取消/收藏岗位
@@ -440,6 +489,47 @@ function getClass(index) {
return '';
}
}
// 格式化发布时间
function formatPublishTime(dateString) {
if (!dateString) return '';
const date = new Date(dateString);
const now = new Date();
const diffTime = Math.abs(now - date);
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
if (diffDays === 0) {
return '今天发布';
} else if (diffDays === 1) {
return '昨天发布';
} else if (diffDays < 7) {
return `${diffDays}天前发布`;
} else if (diffDays < 30) {
const weeks = Math.floor(diffDays / 7);
return `${weeks}周前发布`;
} else {
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
}
}
// 预览图片
function previewImage(url, index) {
// 获取所有图片的URL列表
const allImageUrls = jobInfo.value.filesList.map(file => file.fileUrl);
uni.previewImage({
urls: allImageUrls,
current: index
});
}
// 查看简历
function viewResume(userId) {
navTo(`/packageA/pages/myResume/myResume?userId=${userId}`);
}
</script>
<style lang="stylus" scoped>
@@ -541,6 +631,55 @@ for i in 0..100
}
}
}
// 职位图片样式
.job-images{
margin-top: 30rpx
display: flex
flex-wrap: wrap
gap: 20rpx
.image-item{
width: calc(50% - 10rpx)
height: 300rpx
border-radius: 12rpx
overflow: hidden
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1)
image{
width: 100%
height: 100%
object-fit: cover
}
}
}
// 联系人信息样式
.contact-list{
margin-top: 30rpx
.contact-item{
padding: 20rpx
background-color: #f8f9fa
border-radius: 12rpx
.contact-info{
display: flex
align-items: center
margin-bottom: 15rpx
&:last-child{
margin-bottom: 0
}
.contact-label{
font-weight: 500
font-size: 28rpx
color: #333333
width: 120rpx
}
.contact-value{
font-weight: 400
font-size: 28rpx
color: #495265
}
}
}
}
// ai
.ai-explain{
margin-top: 28rpx
@@ -621,7 +760,7 @@ for i in 0..100
top: 0
right: 0
width: fit-content;
height: 76rpx;
height: 65rpx;
padding: 0 24rpx
background: rgba(37,107,250,0.1);
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
@@ -707,6 +846,20 @@ for i in 0..100
}
}
}
/* #ifdef H5 */
.footer{
position: fixed;
bottom: 0;
width: 100%;
padding: 20rpx 0!important
z-index: 1000;
.btn-wq{
display: block;
width: 94%;
margin: 0 auto;
}
}
/* #endif */
.footer{
background: #FFFFFF;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11,44,112,0.12);

View File

@@ -1,7 +1,7 @@
<template>
<AppLayout title="" :use-scroll-view="false">
<view class="wrap">
<view class="login_index">
<!-- <view class="login_index">
<input class="input" placeholder="请输入账号" placeholder-class="inputplace" v-model="form.username" />
<view class="login_yzm">
<input class="input" type="password" placeholder="请输入密码" placeholder-class="inputplace"
@@ -13,7 +13,7 @@
</view>
<button class="com-btn" @click="register"> </button>
</view>
</view> -->
</view>
</AppLayout>
</template>
@@ -43,8 +43,8 @@
const flag=ref('hlw')
const form = reactive({
username: 'langchaojituan',
password: 'Aa123456?',
username: '913700004941904564',
password: '913700004941904564',
rememberMe: false,
code: '',
uuid: ''
@@ -57,7 +57,43 @@
})
onMounted(() => {
getCodeImg()
// getCodeImg()
let form={}
if (uni.getStorageSync('userInfo').isCompanyUser=='1') {
form={
usertype: '1',
idno: uni.getStorageSync('userInfo').idCard,
name: uni.getStorageSync('userInfo').name,
enterprisecode:"",
enterprisename: "",
contactperson: "",
contactphone: "",
}
}else if (uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={
usertype: "2",
enterprisecode: uni.getStorageSync('userInfo').idCard,
enterprisename: uni.getStorageSync('userInfo').name,
contactperson: "",
contactphone: "",
idno: "",
name: ""
}
}
$api.myRequest('/auth/login2/ks',form,'post',10100).then((res) => {
if (res.code=='200') {
uni.setStorageSync('Padmin-Token', res.data.access_token)
uni.navigateBack({
delta:2
})
}
}).catch(() => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '登录失败,请重试'
})
})
})
function register() {

View File

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 219 B

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

View File

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View File

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 464 B

View File

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 455 B

View File

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 632 B

View File

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

View File

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,51 +1,51 @@
<template>
<!-- <AppLayout title=""> -->
<view class="tab-container">
<image src="../../static/images/train/bj.jpg" mode=""></image>
<image src="/packageB/static/images/train/bj.jpg" mode=""></image>
<view>
<view class="btns" @click="jumps('/packageB/train/video/videoList')">
<image src="/static/images/train/spxx-k.png" mode=""></image>
<!-- <view class="btns" @click="jumps('/packageB/train/video/videoList')">
<image src="/packageB/static/images/train/spxx-k.png" mode=""></image>
<view>
<text>培训视频</text>
<view class="btn">
<text>立即查看</text>
<image src="/static/images/train/arrow.png" mode=""></image>
<image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view>
</view>
</view>
</view> -->
<view class="btns" @click="jumps('/packageB/train/practice/startPracticing')">
<image src="/static/images/train/zxxl-k.png" mode=""></image>
<image src="/packageB/static/images/train/zxxl-k.png" mode=""></image>
<view>
<text>专项练习</text>
<view class="btn">
<text>立即查看</text>
<image src="/static/images/train/arrow.png" mode=""></image>
<image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view>
</view>
</view>
<view class="btns" @click="jumps('/packageB/train/mockExam/examList')">
<image src="/static/images/train/mnks-k.png" mode=""></image>
<image src="/packageB/static/images/train/mnks-k.png" mode=""></image>
<view>
<text>模拟考试</text>
<view class="btn">
<text>立即查看</text>
<image src="/static/images/train/arrow.png" mode=""></image>
<image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view>
</view>
</view>
<view class="btns" @click="jumps('')">
<image src="/static/images/train/ctb-k.png" mode=""></image>
<!-- <view class="btns" @click="jumps('/packageB/train/wrongAnswer/mistakeNotebook')">
<image src="/packageB/static/images/train/ctb-k.png" mode=""></image>
<view>
<text>错题本 </text>
<view class="btn" style="margin-left: 13%;">
<text>立即查看</text>
<image src="/static/images/train/arrow.png" mode=""></image>
<image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view>
</view>
</view>
</view> -->
</view>
</view>
<!-- </AppLayout> -->
@@ -58,8 +58,57 @@ const { $api, navTo, vacanciesTo, formatTotal, config } = inject('globalFunction
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
function jumps(url){
navTo(url);
onLoad(() => {
thirdLogin()
});
async function jumps(url){
if(await thirdLogin()){
navTo(url);
}
}
async function thirdLogin(){
let form={}
if (uni.getStorageSync('userInfo').isCompanyUser=='1') {
form={
usertype: '1',
idno: uni.getStorageSync('userInfo').idCard,
name: uni.getStorageSync('userInfo').name,
enterprisecode:"",
enterprisename: "",
contactperson: "",
contactphone: "",
}
}else if (uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={
usertype: "2",
enterprisecode: uni.getStorageSync('userInfo').idCard,
enterprisename: uni.getStorageSync('userInfo').name,
contactperson: "",
contactphone: "",
idno: "",
name: ""
}
}else{
uni.showToast({
icon: 'none',
title: '请先登录'
})
return false;
}
var resLogin = await $api.myRequest('/auth/login2/ks',form,'post',10100);
if (resLogin.code=='200') {
uni.setStorageSync('Padmin-Token', resLogin.data.access_token)
return true;
}else{
uni.showToast({
icon: 'none',
title: '单点异常'
})
return false;
}
}
</script>

View File

@@ -1,32 +1,30 @@
<template>
<div class="app-box">
<div class="con-box">
<template #headContent>
<view class="collection-search">
<view class="search-content">
<view class="header-input button-click">
<uni-icons class="iconsearch" color="#6A6A6A" type="search" size="22"></uni-icons>
<input
class="input"
v-model="searchKeyword"
@confirm="searchVideo"
placeholder="输入考试名称"
placeholder-class="inputplace"
/>
<uni-icons
v-if="searchKeyword"
class="clear-icon"
type="clear"
size="24"
color="#999"
@click="clearSearch"
/>
</view>
</view>
</view>
</template>
<view class="collection-search">
<view class="search-content">
<view class="header-input button-click">
<uni-icons class="iconsearch" color="#6A6A6A" type="search" size="22"></uni-icons>
<input
class="input"
v-model="searchKeyword"
@confirm="searchVideo"
placeholder="输入考试名称"
placeholder-class="inputplace"
/>
<uni-icons
v-if="searchKeyword"
class="clear-icon"
type="clear"
size="24"
color="#999"
@click="clearSearch"
/>
</view>
</view>
</view>
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<div class="cards" v-for="(item,index) in dataList">
<div class="cards" v-for="(item,index) in dataList" :key="item.examPaperId">
<div class="cardHead">
<div class="cardHeadLeft">
<div class="cardTitle">{{item.name}}</div>
@@ -45,7 +43,7 @@
<div class="conten">考试时长{{item.timeLimit}}分钟</div>
<div class="conten">题目数量{{item.totalQuestions}}</div>
<div class="conten">分类
<span v-for="(val, key) in classification">
<span v-for="val in classification" :key="val.dictValue">
<template v-if="item.category==val.dictValue">{{ val.dictLabel }}</template>
</span>
</div>
@@ -130,7 +128,7 @@
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, navBack,urls } = inject('globalFunction');
import config from "@/config.js"
const userInfo = ref({});
@@ -147,9 +145,12 @@ const examInfo = ref({})
const baseUrl = config.imgBaseUrl
const dialogVisible = ref(false);
const handleScrollToLower = () => {
getDataList('add');
};
onLoad(() => {
});
onShow(()=>{
getDictionary()
const date = new Date();
let year = date.getFullYear();
@@ -160,7 +161,7 @@ onLoad(() => {
dates.value=year+'-'+month+'-'+day
Authorization.value=uni.getStorageSync('Padmin-Token')||''
getHeart();
});
})
function getHeart() {
const raw =Authorization.value;
const token = typeof raw === "string" ? raw.trim() : "";
@@ -517,4 +518,4 @@ function handleOperation(row,i) {
width: 2px;
background-color: #C3E1FF;
}
</style>
</style>

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-box">
<image src="../../../static/images/train/bj.jpg" class="bjImg" mode=""></image>
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
<div class="con-box">
<div class="header">
<div style="font-weight: 600;font-size: 32rpx;">{{rows.name}}</div>

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-box">
<image src="../../../static/images/train/bj.jpg" class="bjImg" mode=""></image>
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
<div class="con-box">
<div class="header">
<div style="font-weight: 600;font-size: 32rpx;">{{rows.name}}</div>

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-box">
<image src="../../../static/images/train/bj.jpg" class="bjImg" mode=""></image>
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
<div class="con-box">
<div class="header">
<div>正确率{{accuracyRate}}%</div>
@@ -51,7 +51,7 @@
<div class="parse1">正确答案</div>
<div class="parse2" v-if="item.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(item.answer))}}.</div>
<div class="parse2" v-if="item.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(val-1)}}.</span>
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(Number(val))}}.</span>
</div>
<div class="parse2" v-if="item.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{item.answer}}</div>
</div>

View File

@@ -9,7 +9,9 @@
<view class="video-detail-container">
<!-- 视频播放组件 -->
<view class="video-wrapper">
<video id="myVideo" :src="videoInfo.currentUrl" :poster="trainVideoImgUrl+ videoInfo.cover" @seeked="onSeeked"
<video v-if="videoInfo && videoInfo.cover" id="myVideo" :src="videoInfo.currentUrl" :poster="trainVideoImgUrl+ videoInfo.cover" @seeked="onSeeked"
preload="metadata"
enable-danmu controls style="width: 100%;" @pause="onPause" @timeupdate="onTimeupdate" @ended="onEnded"></video>
</view>
</view>
@@ -200,12 +202,10 @@ function getData() {
function getHeart() {
const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
const headers = token ? { Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
getUserInfo();
} else {
navTo('/packageB/login')
}
});
}
@@ -216,6 +216,7 @@ function getUserInfo(){
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
userId.value=resData.info.userId
getData()
updateVideoInfo()
});
}
function getDictionary(){
@@ -275,15 +276,20 @@ function updateVideoInfo(){
'Authorization':uni.getStorageSync('Padmin-Token'),
'Content-Type': "application/x-www-form-urlencoded"
}
if(videoInfo.value.isCollect===null && videoInfo.value.process ===null){
$api.myRequest('/train/public/videoUser/add', paramsData,'post',9100,header).then((resData) => {
console.log("视频播放时长更新成功")
});
}else{
$api.myRequest('/train/public/videoUser/update', paramsData,'post',9100,header).then((resData) => {
console.log("视频播放时长更新成功")
});
}
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, header).then((resData) => {
if (resData.code == 200) {
if(videoInfo.value.isCollect===null && videoInfo.value.process ===null){
$api.myRequest('/train/public/videoUser/add', paramsData,'post',9100,header).then((resData) => {
console.log("视频播放时长更新成功")
});
}else{
$api.myRequest('/train/public/videoUser/update', paramsData,'post',9100,header).then((resData) => {
console.log("视频播放时长更新成功")
});
}
}
})
}
// 计算并上报停留时长
function reportPageDuration() {

View File

@@ -80,7 +80,8 @@ const getItemBackgroundStyle = (imageName) => ({
});
const trainVideoImgUrl=config.trainVideoImgUrl
onLoad(() => {
onLoad(async () => {
await thirdLogin()
getDataList('refresh');
});
@@ -135,8 +136,53 @@ function getDataList(type = 'add') {
// 播放视频
function playVideo(video) {
navTo(`/packageB/train/video/videoDetail?id=${video.videoId}`);
async function playVideo(video) {
if(await thirdLogin()){
navTo(`/packageB/train/video/videoDetail?id=${video.videoId}`);
}
}
async function thirdLogin(){
let form={}
if (uni.getStorageSync('userInfo').isCompanyUser=='1') {
form={
usertype: '1',
idno: uni.getStorageSync('userInfo').idCard,
name: uni.getStorageSync('userInfo').name,
enterprisecode:"",
enterprisename: "",
contactperson: "",
contactphone: "",
}
}else if (uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={
usertype: "2",
enterprisecode: uni.getStorageSync('userInfo').idCard,
enterprisename: uni.getStorageSync('userInfo').name,
contactperson: "",
contactphone: "",
idno: "",
name: ""
}
}else{
uni.showToast({
icon: 'none',
title: '请先登录'
})
return false;
}
var resLogin = await $api.myRequest('/auth/login2/ks',form,'post',10100);
if (resLogin.code=='200') {
uni.setStorageSync('Padmin-Token', resLogin.data.access_token)
return true;
}else{
uni.showToast({
icon: 'none',
title: '单点异常'
})
return false;
}
}
</script>

View File

@@ -0,0 +1,583 @@
<template>
<div class="app-box">
<div class="con-box">
<view class="collection-search">
<view class="search-content">
<view class="header-input button-click">
<uni-icons class="iconsearch" color="#6A6A6A" type="search" size="22"></uni-icons>
<input
class="input"
v-model="searchKeyword"
@confirm="searchVideo"
placeholder="输入题目关键词"
placeholder-class="inputplace"
/>
<uni-icons
v-if="searchKeyword"
class="clear-icon"
type="clear"
size="24"
color="#999"
@click="clearSearch"
/>
</view>
</view>
<view>
<checkbox-group>
<label>
<checkbox :value="checkeds" :checked="checkeds" @click="selects()" />全选
</label>
</checkbox-group>
</view>
</view>
<div class="serchBtns">
<div class="btn" @click="startPractice" style="background-color: #4B9FF5;">开始练习</div>
<div class="btn" @click="batchMark" style="background-color: #FF9F51;">批量标记</div>
<div class="btn" @click="clearNotebook" style="background-color: #F1705F;">清空错题本</div>
</div>
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<div class="cards" v-for="(item,index) in dataList" :key="item.questionId">
<div class="choices">
<checkbox-group>
<label>
<checkbox value="cb" :checked="item.checked" @click="choice(index)" color="#FFCC33" style="transform:scale(0.7)" />
</label>
</checkbox-group>
</div>
<div class="cardHead">
<div class="cardHeadLeft">
<div class="cardTitle">{{item.content}}</div>
</div>
<div class="titleType primary2" v-if="item.status==0">未复习</div>
<div class="titleType primary" v-if="item.status==1">已复习</div>
<div class="titleType success" v-if="item.status==2">已掌握</div>
</div>
<div class="heng"></div>
<div class="cardCon">
<div class="conten" style="width: 40%;">类型
<div class="titleType primary" v-if="item.type=='single'">单选</div>
<div class="titleType success" v-if="item.type=='multiple'">多选</div>
<div class="titleType tertiary" v-if="item.type=='judge'">判断</div>
</div>
<div class="conten" style="width: 60%;">错误时间{{item.errorTime}}</div>
<div class="conten" style="width: 40%;">等级
<div class="titleType success" v-if="item.diffculty=='easy'">初级</div>
<div class="titleType tertiary" v-if="item.diffculty=='medium'">中级</div>
<div class="titleType primary2" v-if="item.diffculty=='hard'">高级</div>
</div>
<div class="conten" style="width: 60%;">最后复习{{item.reviewTime || '未复习'}}</div>
</div>
<div class="flooter">
<div @click="handleDetail(item)">查看详情</div>
<div @click="removeFromNotebook(item.questionId,3)">移出错题</div>
</div>
</div>
</scroll-view>
</div>
<div class="cards2" v-if="dialogVisible">
<div class="cardCon" style="height: 50%;">
<div class="cardHead" style="margin-bottom: 30rpx;">
<div>批量标记</div>
<div style="font-size: 40rpx;" @click="clones()">×</div>
</div>
<div class="detailTitle">已选择{{selectedItems.length}}道错题</div>
<div class="status-tags">
<radio-group @change="radioChange">
<label class="uni-list-cell uni-list-cell-pd">
<view style="margin: 20rpx 20%;">
<radio :value="1" :checked="1 === current" />标记为已复习
</view>
<view style="margin: 20rpx 20%;">
<radio :value="2" :checked="2 === current" />标记为已掌握
</view>
<view style="margin: 20rpx 20%;">
<radio :value="3" :checked="3 === current" />移出错题本
</view>
<!-- <view>{{item.name}}</view> -->
</label>
</radio-group>
</div>
<div style="display: flex;justify-content: center;margin-top: 30rpx;">
<div class="rightBtn" @click="mark()">标记</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { inject, ref, reactive,watch } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, navBack,urls } = inject('globalFunction');
import config from "@/config.js"
const userInfo = ref({});
const Authorization = ref('');
const searchKeyword = ref('');
const dataList=ref([])
const pageSize=ref(10)
const pageNum=ref(1)
const totalNum=ref(0)
const dates=ref('')
// const classification=ref([])
// const levalLabels=ref([])
const examInfo = ref({})
const baseUrl = config.imgBaseUrl
const dialogVisible = ref(false);
const checkeds = ref(false);
const selectedItems = ref([]);
const current = ref("");
const handleScrollToLower = () => {
getDataList('add');
};
function selects(){
checkeds.value=!checkeds.value;
dataList.value.forEach(item=>{
item.checked=checkeds.value
})
};
function choice(i){
dataList.value[i].checked=!dataList.value[i].checked;
}
onLoad(() => {
// getDictionary()
// const date = new Date();
// let year = date.getFullYear();
// let month = date.getMonth() + 1; // 月份从0开始需要加1
// let day = date.getDate();
// month=month>9?month:'0'+month
// day=day>9?day:'0'+day
// dates.value=year+'-'+month+'-'+day
// Authorization.value=uni.getStorageSync('Padmin-Token')||''
// getHeart();
});
onShow(()=>{
Authorization.value=uni.getStorageSync('Padmin-Token')||''
getHeart();
})
function getHeart() {
const raw =Authorization.value;
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
getUserInfo();
} else {
navTo('/packageB/login')
}
});
};
function getUserInfo(){
let header={
'Authorization':Authorization.value
}
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
userInfo.value = resData.info || {};
getDataList('refresh');
});
};
// function getDictionary(){
// $api.myRequest('/system/public/dict/data/type/question_classification', {},'get',9100).then((resData) => {
// classification.value=resData.data
// });
// $api.myRequest('/system/public/dict/data/type/question_level', {},'get',9100).then((resData) => {
// levalLabels.value=resData.data
// });
// }
// 搜索
function searchVideo() {
getDataList('refresh');
}
// 清除搜索内容
function clearSearch() {
searchKeyword.value = '';
getDataList('refresh');
}
// 获取错题列表
function getDataList(type = 'add') {
let maxPage=Math.ceil(totalNum.value/pageSize.value)
let params={}
if (type === 'refresh') {
pageNum.value = 1;
params={
content:searchKeyword.value,
pageSize:pageSize.value,
pageNum:pageNum.value,
userId:userInfo.value.userId
}
$api.myRequest('/train/public/mistackUser/mistackTable', params).then((resData) => {
if(resData.code==200){
dataList.value=resData.rows
totalNum.value=resData.total
dataList.value.forEach(item=>{
item.checked=false
})
}
});
}
if (type === 'add' && pageNum.value < maxPage) {
pageNum.value += 1;
params={
content:searchKeyword.value,
pageSize:pageSize.value,
pageNum:pageNum.value,
userId:userInfo.value.userId
}
$api.myRequest('/train/public/mistackUser/mistackTable', params).then((resData) => {
if(resData.code==200){
dataList.value=dataList.value.concat(resData.rows)
totalNum.value=resData.total
dataList.value.forEach(item=>{
item.checked=false
})
}
});
}
}
function handleDetail(row){
navTo(`/packageB/train/wrongAnswer/wrongDetail?questionId=${row.questionId}`);
}
function startPractice(row){
navTo('/packageB/train/wrongAnswer/questionPractice');
}
function clones(){
dialogVisible.value=false
}
function radioChange(evt) {
current.value=evt.detail.value;
}
function clearNotebook() {
$api.myRequest('/train/public/mistackUser/clear', {
userId:userInfo.value.userId,
}).then((resData) => {
if(resData&&resData.code==200){
getDataList('refresh');
}
});
};
function batchMark() {
// 批量标记逻辑
dataList.value.forEach(item=>{
if(item.checked){
selectedItems.value.push(item)
}
})
if(selectedItems.value.length>0){
dialogVisible.value=true
}else{
$api.msg('请先选择要标记的错题!')
}
};
function mark(){
let ids=[]
selectedItems.value.forEach(item=>{
ids.push(item.questionId)
})
$api.myRequest('/train/public/mistackUser/batchUpdate', {
userId:userInfo.value.userId,
questionIds:ids.join(","),
status:current.value
}).then((resData) => {
if(resData&&resData.code==200){
if(current.value==3){
$api.msg('移出成功!')
}else{
$api.msg('标记成功!')
}
dialogVisible.value=false
getDataList('refresh');
}
});
};
function removeFromNotebook(id,i) {
$api.myRequest('/train/public/mistackUser/batchUpdate', {
userId:userInfo.value.userId,
questionId:id,
status:i
}).then((resData) => {
if(resData&&resData.code==200){
if(i==3){
$api.msg('移出成功!')
}else{
$api.msg('标记成功!')
}
getDataList('refresh');
}
});
}
</script>
<style lang="stylus" scoped>
.app-box{
width: 100%;
height: 100vh;
position: relative;
.con-box{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top:0;
z-index: 10;
padding: 20rpx 28rpx;
box-sizing: border-box;
overflow: hidden;
.serchBtns{
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.btn{
width: 30%;
height: 50rpx;
line-height: 50rpx;
text-align: center
color: #fff;
border-radius: 10rpx
}
}
.collection-search{
padding: 10rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
.search-content{
width: 80%;
position: relative
display: flex
align-items: center
padding: 14rpx 0
.header-input{
padding: 0
width: calc(100%);
position: relative
.iconsearch{
position: absolute
left: 30rpx;
top: 50%
transform: translate(0, -50%)
z-index: 1
}
.input{
padding: 0 80rpx 0 80rpx
height: 80rpx;
background: #FFFFFF;
border-radius: 75rpx 75rpx 75rpx 75rpx;
border: 2rpx solid #ECECEC
font-size: 28rpx;
}
.clear-icon{
position: absolute
right: 30rpx;
top: 50%
transform: translate(0, -50%)
z-index: 1
cursor: pointer
}
.inputplace{
font-weight: 400;
font-size: 28rpx;
color: #B5B5B5;
}
}
}
}
.main-scroll {
width: 100%;
height: 85%;
.cards{
width: 100%;
height: 280rpx;
background: linear-gradient(0deg, #E3EFFF 0%, #FBFDFF 100%);
// box-shadow: 0px 0px 6px 0px rgba(0,71,200,0.32);
border-radius: 12rpx;
border: 2px solid #EDF5FF;
margin-bottom: 30rpx;
padding: 30rpx 40rpx 0;
box-sizing: border-box;
position: relative;
.choices{
position: absolute;
top: 0;
left: -10rpx;
}
.cardHead{
display: flex;
align-items: center;
justify-content: space-between;
.cardHeadLeft{
display: flex;
align-items: center
width: 75%;
.cardTitle{
font-weight: bold;
font-size: 28rpx;
color: #0069CB;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.titleType{
border-radius: 4px;
font-size: 22rpx;
color: #157EFF;
width: 100rpx;
height: 38rpx;
text-align: center;
line-height: 38rpx;
margin-left: 10rpx;
}
}
}
.heng{
width: 120rpx;
height: 4rpx;
background: linear-gradient(88deg, #015EEA 0%, #00C0FA 100%);
margin: 10rpx 0 20rpx;
}
.cardCon{
display: flex;
flex-wrap: wrap;
.conten{
width: 50%;
font-size: 22rpx;
color: #666666;
display: flex;
align-items: center
margin-bottom: 20rpx;
}
.status-tags{
display: flex;
align-items: center;
}
}
.flooter{
border-top: 1px solid #ccc;
display: flex;
justify-content: flex-end;
align-items: center;
view{
font-size: 28rpx;
margin-left: 30rpx;
color: #2175F3;
padding-top: 10rpx;
}
}
}
}
}
.cards2{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100vh;
background-color: rgba(0,0,0,0.5);
z-index: 10000;
padding: 100rpx 50rpx;
box-sizing: border-box;
.cardCon{
height: 70%;
background-color: #fff;
padding: 20rpx;
box-sizing: border-box;
.cardHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
font-weight: 600;
}
}
}
}
.titleType{
display: inline-block
border-radius: 4px;
font-size: 22rpx;
color: #157EFF;
width: 100rpx;
height: 38rpx;
text-align: center;
line-height: 38rpx;
margin-left: 10rpx;
}
.primary{
border: 1px solid #157EFF!important;
color: #157EFF!important
}
.success{
border: 1px solid #05A636!important;
color: #05A636!important
}
.info{
border: 1px solid #898989!important;
color: #898989!important
}
.tertiary{
border: 1px solid #E6A340!important;
color: #E6A340!important
}
.primary2{
border: 1px solid #F56C6C!important;
color: #F56C6C!important
}
.rightBtn{
width: 140rpx;
height: 44rpx;
line-height: 44rpx;
background: linear-gradient(90deg, #00C0FA 0%, #1271FF 100%);
border-radius: 4px;
color: #fff;
font-size: 24rpx;
text-align: center;
}
.detailTitle{
font-size: 28rpx;
font-weight: 600;
margin: 30rpx 0;
}
.detailCon{
font-size: 28rpx;
line-height: 40rpx;
}
.exam-info {
display: flex;
justify-content: space-between;
margin-bottom: 35rpx;
margin-top: 20rpx;
}
.info-item {
flex: 1;
text-align: center;
}
.info-value {
font-family: 'D-DIN-Medium';
font-size: 26rpx;
font-weight: 600;
color: #409EFF;
margin-bottom: 8rpx;
}
.info-label {
font-size: 26rpx;
color: #333;
}
.info-divider {
width: 2px;
background-color: #C3E1FF;
}
</style>

View File

@@ -0,0 +1,540 @@
<template>
<div class="app-box">
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
<div class="con-box">
<div class="header">
<div>错题练习</div>
<div class="headBtn" @click="complete()">退出</div>
</div>
<div class="problemCard">
<div v-for="(item,index) in problemData" :key="index">
<template v-if="questionIndex==(index+1)">
<div class="problemTitle">
<span class="titleType" v-if="item.type=='single'">单选题</span>
<span class="titleType" v-if="item.type=='multiple'">多选题</span>
<span class="titleType" v-if="item.type=='judge'">判断题</span>
<span>{{item.content}}</span>
</div>
<div class="options" v-if="item.type=='single'">
<div class="opt" @click="selected(i)" :class="radio!==''&&i==radio?'active':''" v-for="(val,i) in parseOptions(item.trainChooses)">
<div class="optLab">{{indexToLetter(i)}}</div>
<span>{{val}}</span>
</div>
</div>
<div class="options" v-if="item.type=='multiple'">
<div class="opt" @click="selected2(i)" :class="judgment(i)?'active':''" v-for="(val,i) in parseOptions(item.trainChooses)">
<div class="optLab">{{indexToLetter(i)}}</div>
<span>{{val}}</span>
</div>
</div>
<div class="options" v-if="item.type=='judge'">
<div class="opt" @click="selected3('正确')" :class="radio2=='正确'?'active':''">
<span>正确</span>
</div>
<div class="opt" @click="selected3('错误')" :class="radio2=='错误'?'active':''">
<span>错误</span>
</div>
</div>
<div class="analysis" v-if="analysis">
<div class="analysisHead correct" v-if="judgWhether=='正确'">
<div>回答正确</div>
<div></div>
</div>
<div class="analysisHead errors" v-if="judgWhether=='错误'">
<div>回答错误</div>
<div></div>
</div>
<div class="analysisCon">
<div class="parse1">正确答案</div>
<div class="parse2" v-if="item.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(item.answer))}}.</div>
<div class="parse2" v-if="item.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(Number(val))}}.</span>
</div>
<div class="parse2" v-if="item.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{item.answer}}</div>
</div>
<div class="analysisCon">
<div class="parse1">答案解析</div>
<div class="parse2">{{item.answerDesc}}</div>
</div>
<div class="analysisCon">
<div class="parse1">知识点</div>
<div>
<el-tag style="margin-right: 10px;">{{item.knowledgePoint}}</el-tag>
</div>
</div>
</div>
<div class="problemBtns">
<div v-if="analysis&&judgWhether!=''&&questionIndex!=problemData.length" @click="questionIndex+=1">下一题</div>
<div v-else :class="((radio===''&&radio2===''&&checkList.length==0&&isRunning)||analysis)?'events':''" @click="submit()">提交答案</div>
</div>
</template>
</div>
</div>
<div class="footer">
<div class="footerLeft">
<div class="zuo" :class="questionIndex==1?'events':''" @click="questionIndex-=1"></div>
<div class="you" :class="questionIndex==problemData.length?'events':''" @click="questionIndex+=1"></div>
</div>
<div class="footerLeft">
<div>
<div class="icons" style="background-color: #1CADF5;"></div>
<div class="texts" style="color: #1CADF5;">{{correctIndex}}</div>
</div>
<div>
<div class="icons" style="background-color: #FF6668;">×</div>
<div class="texts" style="color: #FF6668;">{{errorsIndex}}</div>
</div>
<div @click="dialogVisible=true">
<div><span style="color: #1CADF5;">{{questionIndex}}</span>/{{problemData.length}}</div>
<div>题号</div>
</div>
</div>
</div>
</div>
<div class="cards" v-if="dialogVisible">
<div class="cardCon">
<div class="cardHead">
<div>题号</div>
<div style="font-size: 40rpx;" @click="clones()">×</div>
</div>
<div class="questionNums">
<div class="questions" :class="item.whether=='正确'?'questionCorrect':item.whether=='错误'?'questionError':questionIndex==(index+1)?'questionsActive':''" @click="switchs(index)" v-for="(item,index) in problemList" :key="index">{{index+1}}</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted,onBeforeUnmount,computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api,urls , navTo,navBack , vacanciesTo, formatTotal, config } = inject('globalFunction');
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
const userInfo = ref({});
const Authorization = ref('');
const radio = ref('');
const radio2 = ref('');
const checkList = ref([]);
const questionIndex = ref(1);
const correctIndex = ref(0);
const errorsIndex = ref(0);
const analysis = ref(false);
const judgWhether = ref('');
const isRunning = ref(false);
const dialogVisible = ref(false);
const problemData = ref([]);
const problemList = ref([]);
watch(questionIndex, (newVal, oldVal) => {
radio.value=""
radio2.value=""
checkList.value=[]
analysis.value=false
judgWhether.value=""
});
onLoad((options) => {
Authorization.value=uni.getStorageSync('Padmin-Token')||''
getHeart();
});
onShow(()=>{
})
function getHeart() {
const raw =Authorization.value;
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
getUserInfo();
} else {
navTo('/packageB/login')
}
});
};
function getUserInfo(){
let header={
'Authorization':Authorization.value
}
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
userInfo.value = resData.info || {};
// userId.value=resData.info.userId
queryData()
});
};
function queryData(){
problemData.value=[]
let header={
'Authorization':Authorization.value,
'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/mistackUser/getMistackPractice', {
userId: userInfo.value.userId
},'post',9100,header).then((resData) => {
if(resData&&resData.code==200){
resData.data.forEach((item,i)=>{
problemData.value.push(item)
problemList.value.push({index:i+1,whether:""})
})
}
});
}
//提交答案
function submit(){
let indexs=questionIndex.value-1
let parm={
questionId:problemData.value[indexs].questionId,
userId:userInfo.value.userId,
trueAnswer:problemData.value[indexs].answer
}
if(problemData.value[indexs].type=='single'){
parm.submitAnswer=radio.value
}else if(problemData.value[indexs].type=='multiple'){
parm.submitAnswer=checkList.value.join(',')
}else if(problemData.value[indexs].type=='judge'){
parm.submitAnswer=radio2.value
}
let header={
'Authorization':Authorization.value,
'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/mistackUser/submitAnswer', parm,'post',9100,header).then((resData) => {
if(resData&&resData.code==200){
analysis.value=true
judgWhether.value=resData.msg
problemList.value[indexs].whether=resData.msg
if(resData.msg=='正确'){
correctIndex.value++
}else if(resData.msg=='错误'){
errorsIndex.value++
}
if(questionIndex.value==problemData.value.length){
$api.msg('已经是最后一题了')
}
}
});
};
function selected(i){
radio.value=i
};
//多选
function selected2(i){
let arr=checkList.value.join(",")
if(arr.indexOf(i) !== -1){
const index = checkList.value.indexOf(i);
if (index !== -1) {
checkList.value.splice(index, 1);
}
}else{
checkList.value.push(i)
}
};
function judgment(i){
let arr=checkList.value.join(",")
if(arr.indexOf(i) !== -1){
return true
}else{
return false
}
};
function selected3(i){
radio2.value=i
};
// 解析选项
function parseOptions(options) {
if (!options) return [];
// 假设options是字符串格式以分号分隔
if (typeof options === 'string') {
return options.split(',').filter(opt => opt.trim());
}
// 如果是数组,直接返回
if (Array.isArray(options)) {
return options;
}
return [];
};
function indexToLetter(index) {
// 将索引转换为对应的字母
return String.fromCharCode(65 + index);
};
function clones(){
dialogVisible.value=false
};
function switchs(i){
questionIndex.value=(i+1)
dialogVisible.value=false
};
function complete(){
navBack()
}
</script>
<style lang="stylus" scoped>
.app-box{
width: 100%;
height: 100vh;
position: relative;
.bjImg{
position: absolute;
width: 100%;
height: 100%;
}
.con-box{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top:0;
z-index: 10;
padding: 20rpx 28rpx;
box-sizing: border-box;
.header{
height: 100rpx;
padding: 0 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(0deg, #4285EC 0%, #0BBAFB 100%);
color: #fff;
font-size: 26rpx;
border-radius: 10rpx
.headBtn{
background: #499FFF;
border-radius: 4px;
width: 100rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
}
}
.problemCard{
margin-top: 30rpx;
.problemTitle{
font-size: 30rpx;
.titleType{
display: inline-block;
background-color: #499FFF;
border-radius: 10rpx 10rpx 10rpx 0;
padding: 8rpx 12rpx;
color: #fff;
font-size: 26rpx;
margin-right: 20rpx;
}
}
.options{
margin-top: 30rpx;
.opt{
height: 60rpx;
/* background-color: #F8F9FA; */
border-radius: 5px;
margin-bottom: 15px;
display: flex;
align-items: center;
padding-left: 30rpx;
box-sizing: border-box;
color: #808080;
font-size: 30rpx;
.optLab{
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
background-color: #8C8C8C;
color: #fff;
font-weight: 600;
font-size: 32rpx;
margin-right: 20rpx;
}
}
.active{
background: linear-gradient(90deg, #25A9F5 0%, #B1DBFF 100%);
color: #fff!important;
font-weight: bold;
}
.active>view{
background-color: #fff!important;
color: #25A9F5!important;
}
}
.analysis{
margin-top: 30rpx;
background-color: #fff;
border-radius: 6px;
margin-bottom: 15rpx;
border: 1px solid #10A8FF;
padding: 20rpx;
box-sizing: border-box;
.analysisHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
font-family: Microsoft YaHei;
font-weight: bold;
letter-spacing: 2px;
}
.correct{
color: #67C23A;
}
.errors{
color: #F06A6A;
}
.analysisCon{
margin-top: 30rpx;
.parse1{
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: bold;
}
.parse2{
font-size: 26rpx;
color: #333;
margin-top: 10px;
}
}
}
.problemBtns{
display: flex
align-items: center
justify-content: center
view{
width: 140rpx
height: 50rpx
text-align: center
line-height: 50rpx
background-color: #10A8FF
color: #fff
font-size: 28rpx
border-radius: 5rpx
margin-right: 10rpx;
}
}
}
.footer{
width: 100%;
height: 120rpx;
border-top: 1px solid #ddd
position: fixed
bottom: 0
left: 0
display: flex
align-items: center
justify-content: space-between
.footerLeft{
display: flex
align-items: center
font-size: 30rpx;
text-align: center
.zuo{
width: 26rpx;
height: 26rpx;
border-top: 2px solid #666
border-left: 2px solid #666
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
margin-left: 60rpx;
}
.you{
width: 26rpx;
height: 26rpx;
border-right: 2px solid #666
border-bottom: 2px solid #666
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
// margin-left: 30rpx;
margin-right: 50rpx;
}
.icons{
width: 30rpx;
height: 30rpx;
color: #fff;
text-align: center;
line-height: 30rpx;
border-radius: 50%
}
.texts{
font-size: 24rpx;
}
}
.footerLeft>view{
margin-right: 40rpx;
}
.footerBtn{
width: 140rpx
height: 50rpx
text-align: center
line-height: 50rpx
background-color: #67C23A
color: #fff
font-size: 28rpx
border-radius: 5rpx
}
}
}
.cards{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100vh;
background-color: rgba(0,0,0,0.5);
z-index: 1000;
padding: 100rpx 50rpx;
box-sizing: border-box;
.cardCon{
height: 100%;
background-color: #fff;
padding: 20rpx;
box-sizing: border-box;
.cardHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
font-weight: 600;
}
.questionNums{
width: 100%;
display: flex;
flex-wrap: wrap;
}
.questions{
width: 60rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 8rpx;
border: 2px solid #E0E0E0;
font-size: 28rpx;
margin-right: 15px;
cursor: pointer;
}
.questionsActive{
background-color: #F0F9FF;
border: 2px solid #409EFF;
}
.questionCorrect{
background-color: #F0F9FF;
border: 2px solid #64BC38;
color: #6BC441;
}
.questionError{
background-color: #FFF1F0;
border: 2px solid #F56C6C;
color: #F36B6B;
}
}
}
}
.events{
pointer-events: none; /* 这会禁用所有指针事件 */
opacity: 0.5; /* 可选:改变透明度以视觉上表示不可点击 */
cursor: not-allowed; /* 可选:改变鼠标光标样式 */
}
</style>

View File

@@ -0,0 +1,442 @@
<template>
<div class="app-box">
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
<div class="con-box">
<div class="problemCard">
<div>
<div class="problemTitle">
<span class="titleType" v-if="problemData.type=='single'">单选题</span>
<span class="titleType" v-if="problemData.type=='multiple'">多选题</span>
<span class="titleType" v-if="problemData.type=='judge'">判断题</span>
<span>{{problemData.content}}</span>
</div>
<div class="options" v-if="problemData.type=='single'">
<div class="opt" :class="problemData.submitAnswer!==''&&i==problemData.submitAnswer?'active':''" v-for="(val,i) in parseOptions(problemData.trainChooses)">
<div class="optLab">{{indexToLetter(i)}}</div>
<span>{{val}}</span>
</div>
</div>
<div class="options" v-if="problemData.type=='multiple'">
<div class="opt" :class="judgment(i)?'active':''" v-for="(val,i) in parseOptions(problemData.trainChooses)">
<div class="optLab">{{indexToLetter(i)}}</div>
<span>{{val}}</span>
</div>
</div>
<div class="options" v-if="problemData.type=='judge'">
<div class="opt" :class="problemData.submitAnswer=='正确'?'active':''">
<span>正确</span>
</div>
<div class="opt" :class="problemData.submitAnswer=='错误'?'active':''">
<span>错误</span>
</div>
</div>
<div class="analysis">
<div class="analysisHead correct" v-if="problemData.submitAnswer==problemData.trueAnswer">
<div>回答正确</div>
<div></div>
</div>
<div class="analysisHead errors" v-else>
<div>回答错误</div>
<div></div>
</div>
<div class="analysisCon">
<div class="parse1">正确答案</div>
<div class="parse2" v-if="problemData.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(problemData.trueAnswer))}}.</div>
<div class="parse2" v-if="problemData.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
<span v-for="(val,i) in parseOptions(problemData.trueAnswer)">{{indexToLetter(Number(val))}}.</span>
</div>
<div class="parse2" v-if="problemData.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{problemData.trueAnswer}}</div>
</div>
<div class="analysisCon">
<div class="parse1">答案解析</div>
<div class="parse2">{{problemData.answerDesc}}</div>
</div>
<div class="analysisCon">
<div class="parse1">知识点</div>
<div>
<el-tag style="margin-right: 10px;">{{problemData.knowledgePoint}}</el-tag>
</div>
</div>
</div>
<div class="problemBtns">
<div @click="removeFromNotebook(2)">标记掌握</div>
<div @click="removeFromNotebook(3)">移出错题</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted,onBeforeUnmount,computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api,urls , navTo,navBack , vacanciesTo, formatTotal, config } = inject('globalFunction');
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
const userInfo = ref({});
const rows = ref({});
const Authorization = ref('');
const radio = ref('');
const radio2 = ref('');
const checkList = ref([]);
const questionIndex = ref(1);
const judgWhether = ref('');
const problemData = ref({});
onLoad((options) => {
rows.value=options
Authorization.value=uni.getStorageSync('Padmin-Token')||''
getHeart();
});
onShow(()=>{
})
function getHeart() {
const raw =Authorization.value;
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
getUserInfo();
} else {
navTo('/packageB/login')
}
});
};
function getUserInfo(){
let header={
'Authorization':Authorization.value
}
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
userInfo.value = resData.info || {};
// userId.value=resData.info.userId
queryData()
});
};
function queryData(){
let header={
'Authorization':Authorization.value,
'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/mistackUser/detail', {
userId: userInfo.value.userId,
questionId:rows.value.questionId,
},'post',9100,header).then((resData) => {
if(resData&&resData.code==200){
problemData.value=resData.data;
}
});
}
function removeFromNotebook(i) {
$api.myRequest('/train/public/mistackUser/batchUpdate', {
userId:userInfo.value.userId,
questionId:rows.value.questionId,
status:i
}).then((resData) => {
if(resData&&resData.code==200){
if(i==3){
$api.msg('移出成功!')
}else{
$api.msg('标记成功!')
}
navBack()
}
});
}
function judgment(i){
let arr=checkList.value.join(",")
if(arr.indexOf(i) !== -1){
return true
}else{
return false
}
};
// 解析选项
function parseOptions(options) {
if (!options) return [];
// 假设options是字符串格式以分号分隔
if (typeof options === 'string') {
return options.split(',').filter(opt => opt.trim());
}
// 如果是数组,直接返回
if (Array.isArray(options)) {
return options;
}
return [];
};
function indexToLetter(index) {
// 将索引转换为对应的字母
return String.fromCharCode(65 + index);
};
</script>
<style lang="stylus" scoped>
.app-box{
width: 100%;
height: 100vh;
position: relative;
.bjImg{
position: absolute;
width: 100%;
height: 100%;
}
.con-box{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top:0;
z-index: 10;
padding: 20rpx 28rpx;
box-sizing: border-box;
.header{
height: 100rpx;
padding: 0 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(0deg, #4285EC 0%, #0BBAFB 100%);
color: #fff;
font-size: 26rpx;
border-radius: 10rpx
.headBtn{
background: #499FFF;
border-radius: 4px;
width: 100rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
}
}
.problemCard{
margin-top: 30rpx;
.problemTitle{
font-size: 30rpx;
.titleType{
display: inline-block;
background-color: #499FFF;
border-radius: 10rpx 10rpx 10rpx 0;
padding: 8rpx 12rpx;
color: #fff;
font-size: 26rpx;
margin-right: 20rpx;
}
}
.options{
margin-top: 30rpx;
.opt{
height: 60rpx;
/* background-color: #F8F9FA; */
border-radius: 5px;
margin-bottom: 15px;
display: flex;
align-items: center;
padding-left: 30rpx;
box-sizing: border-box;
color: #808080;
font-size: 30rpx;
.optLab{
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
background-color: #8C8C8C;
color: #fff;
font-weight: 600;
font-size: 32rpx;
margin-right: 20rpx;
}
}
.active{
background: linear-gradient(90deg, #25A9F5 0%, #B1DBFF 100%);
color: #fff!important;
font-weight: bold;
}
.active>view{
background-color: #fff!important;
color: #25A9F5!important;
}
}
.analysis{
margin-top: 30rpx;
background-color: #fff;
border-radius: 6px;
margin-bottom: 40rpx;
border: 1px solid #10A8FF;
padding: 20rpx;
box-sizing: border-box;
.analysisHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
font-family: Microsoft YaHei;
font-weight: bold;
letter-spacing: 2px;
}
.correct{
color: #67C23A;
}
.errors{
color: #F06A6A;
}
.analysisCon{
margin-top: 30rpx;
.parse1{
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: bold;
}
.parse2{
font-size: 26rpx;
color: #333;
margin-top: 10px;
}
}
}
.problemBtns{
display: flex
align-items: center
justify-content: center
view{
width: 140rpx
height: 50rpx
text-align: center
line-height: 50rpx
background-color: #10A8FF
color: #fff
font-size: 28rpx
border-radius: 5rpx
margin-right: 20rpx;
}
}
}
.footer{
width: 100%;
height: 120rpx;
border-top: 1px solid #ddd
position: fixed
bottom: 0
left: 0
display: flex
align-items: center
justify-content: space-between
.footerLeft{
display: flex
align-items: center
font-size: 30rpx;
text-align: center
.zuo{
width: 26rpx;
height: 26rpx;
border-top: 2px solid #666
border-left: 2px solid #666
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
margin-left: 60rpx;
}
.you{
width: 26rpx;
height: 26rpx;
border-right: 2px solid #666
border-bottom: 2px solid #666
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
// margin-left: 30rpx;
margin-right: 50rpx;
}
.icons{
width: 30rpx;
height: 30rpx;
color: #fff;
text-align: center;
line-height: 30rpx;
border-radius: 50%
}
.texts{
font-size: 24rpx;
}
}
.footerLeft>view{
margin-right: 40rpx;
}
.footerBtn{
width: 140rpx
height: 50rpx
text-align: center
line-height: 50rpx
background-color: #67C23A
color: #fff
font-size: 28rpx
border-radius: 5rpx
}
}
}
.cards{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100vh;
background-color: rgba(0,0,0,0.5);
z-index: 1000;
padding: 100rpx 50rpx;
box-sizing: border-box;
.cardCon{
height: 100%;
background-color: #fff;
padding: 20rpx;
box-sizing: border-box;
.cardHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
font-weight: 600;
}
.questionNums{
width: 100%;
display: flex;
flex-wrap: wrap;
}
.questions{
width: 60rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 8rpx;
border: 2px solid #E0E0E0;
font-size: 28rpx;
margin-right: 15px;
cursor: pointer;
}
.questionsActive{
background-color: #F0F9FF;
border: 2px solid #409EFF;
}
.questionCorrect{
background-color: #F0F9FF;
border: 2px solid #64BC38;
color: #6BC441;
}
.questionError{
background-color: #FFF1F0;
border: 2px solid #F56C6C;
color: #F36B6B;
}
}
}
}
.events{
pointer-events: none; /* 这会禁用所有指针事件 */
opacity: 0.5; /* 可选:改变透明度以视觉上表示不可点击 */
cursor: not-allowed; /* 可选:改变鼠标光标样式 */
}
</style>

View File

@@ -2,11 +2,11 @@ import request from '@/packageCa/utilCa/request.js'
const api = {}
// 获取职业大类 中类
api.queryJobDictionaryListByParentCode = (code) => request.globalRequest(`/Job/QueryJobDictionaryListByParentCode?code=${code}`,'GET', {}, 1,3)
api.queryJobDictionaryListByParentCode = (code) => request.globalRequest(`/Job/QueryJobDictionaryListByParentCode?code=${code}`,'GET', {}, 1)
// 搜索
api.queryJobListByParentCode = (name,code) => request.globalRequest(`/Job/QueryJobListByParentCode?name=${name}&code=${code}`,'GET', {}, 1,3)
api.queryJobListByParentCode = (name,code) => request.globalRequest(`/Job/QueryJobListByParentCode?name=${name}&code=${code}`,'GET', {}, 1)
// 职业详情
api.queryJobDetailById = (id) => request.globalRequest(`/Job/QueryJobDetailById?id=${id}`,'GET', {}, 2,3)
api.queryJobDetailById = (id) => request.globalRequest(`/Job/QueryCeremonyDetail?id=${id}`,'GET', {}, 2)
export default api

View File

@@ -2,31 +2,32 @@ import request from '@/packageCa/utilCa/request.js'
const api = {}
// 获取生涯罗盘
api.getCareerCompassList = (name) => request.globalRequest(`/StudentProfile/GetCareerCompassList`,'GET', {}, 1)
api.getCareerCompassList = (name) => request.globalRequest(`/GXCareerPlan/GetGXWechatCoursePlanList`,'GET', {})
// 保存生涯罗盘--职业方向
api.saveGXCareerPlan = (jobId) => request.globalRequest(`/StudentProfile/SaveGXCareerPlan?jobId=${jobId}`,'POST', {}, 1)
api.saveGXCareerPlan = (jobId) => request.globalRequest(`/GXCareerPlan/SaveGXCareerPlan?jobId=${jobId}`,'POST', {})
// 生涯罗盘--获取职业规划
api.getGXCareerPlanList = (keyword,page,ps) => request.globalRequest(`/StudentProfile/GetGXCareerPlanList?keyword=${keyword}&page=${page}&ps=${ps}`,'GET', {}, 1)
api.getGXCareerPlanList = (keyword,page,ps) => request.globalRequest(`/GXCareerPlan/GetGXCareerPlanList?keyword=${keyword}&page=${page}&ps=${ps}`,'GET', {})
// smart目标制定获取学习目标
api.querySmartTargets = () => request.globalRequest(`/StudentProfile/QuerySmartTargets`,'GET', {}, 1)
api.querySmartTargets = () => request.globalRequest(`/GXStudent/QuerySmartTargets`,'GET', {})
// smart目标制定获取单个目标
api.querySmartInfo = (encodeId) => request.globalRequest(`/StudentProfile/QuerySmartInfo?encodeId=${encodeId}`,'GET', {}, 1)
api.querySmartInfo = (encodeId) => request.globalRequest(`/GXStudent/QuerySmartInfo?encodeId=${encodeId}`,'GET', {})
// smart目标制定保存smart目标
api.saveSmartTarget = (data) => request.globalRequest(`/StudentProfile/SaveSmartTarget`,'POST', data, 1)
api.saveSmartTarget = (data) => request.globalRequest(`/GXStudent/SaveSmartTargetNew`,'POST', data)
// smart目标制定删除Smart目标
api.deleteSmartTarg = (encodeId) => request.globalRequest(`/StudentProfile/DeleteSmartTarg?encodeId=${encodeId}`,'POST', {}, 1)
api.deleteSmartTarg = (encodeId) => request.globalRequest(`/GXStudent/DeleteSmartTarg?encodeId=${encodeId}`,'POST', {})
// smart目标制定获取年度计划
api.queryPlanList = (encodeId) => request.globalRequest(`/StudentProfile/QueryPlanList?encodeId=${encodeId}`,'GET', {}, 1)
api.queryPlanList = (encodeId) => request.globalRequest(`/GXStudent/QueryPlanList?encodeId=${encodeId}`,'GET', {})
// smart目标制定保存年度计划
api.savePlanList = (data) => request.globalRequest(`/StudentProfile/SavePlanList`,'POST', data, 1)
api.savePlanList = (data) => request.globalRequest(`/GXStudent/SavePlanListNew`,'POST', data)
// 获取生涯档案(高校
api.getGXWechatStudentProfile = () => request.globalRequest(`/StudentProfile/GetGXWechatStudentProfile`,'GET', {}, 1)
api.getGXWechatStudentProfile = () => request.globalRequest(`/GXStudentProfile/GetGXStudentProfile`,'GET', {})
//获取职业路径职业列表
api.queryCareerPath = () => request.globalRequest(`/StudentManage/QueryCareerPath`,'POST', {}, 1)
api.queryCareerPath = () => request.globalRequest(`/GXStudent/QueryCareerPath`,'POST', {})
// 获取职业详情参数encodeId 加密id
api.queryPathInfo = (encodeId) => request.globalRequest(`/StudentManage/QueryPathInfo?encodeId=${encodeId}`,'POST', {}, 1)
api.queryPathInfo = (encodeId) => request.globalRequest(`/GXStudent/QueryPathInfo?encodeId=${encodeId}`,'POST', {})
export default api

View File

@@ -2,124 +2,52 @@ import request from '@/packageCa/utilCa/request.js'
const api = {}
// 检查综合解释是否完成
api.checkUnionTest = () => request.globalRequest(`/TaskManage/CheckUnionTest`,'GET', {}, 2,5)
api.queryUnionTestResult = () => request.globalRequest(`/Test/QueryUnionTestResult`,'GET', {}, 2,5)
// 测评列表
api.queryTaskListForWeChart = (eduLevel) => request.globalRequest(`/TaskManage/QueryTaskListForWeChart?eduLevel=${eduLevel}`,'GET', {}, 2,5)
api.queryTaskListForWeChart = () => request.globalRequest(`/TestRecordProcess/GetTestTypeList`,'GET', {})
// 获取测评题目
api.queryTestContent = (type) => request.globalRequest(`/TaskManage/QueryTestContent?type=${type}`,'GET', {}, 2,5)
api.queryTestContent = (type) => request.globalRequest(`/TestManage/QueryTestContent?type=${type}`,'GET', {})
// 保存学科信心测评结果
api.saveSubjectTest = (testStr) => request.globalRequest(`/TaskManage/SaveSubjectTest?testStr=${testStr}`,'POST', "", 2,5)
// 保存自我评估
api.saveStudentSscoreResult = (data) => request.globalRequest(`/Test/SaveStudentSscoreResult`,'POST', data, 2,5)
// 保存MBTI
api.saveMBTITest = (data) => request.globalRequest(`/TaskManage/SaveMBTITest`,'POST', data, 2,5)
// 保存工作价值
api.saveWorkValuesResult = (data) => request.globalRequest(`/TaskManage/SaveWorkValuesResult`,'POST', data, 2,5)
// 保存多元智能
api.saveMultipleIntelligenceResult = (data) => request.globalRequest(`/TaskManage/SaveMultipleIntelligenceResult`,'POST', data, 2,5)
api.saveWorkValuesResult = (data) => request.globalRequest(`/TestManagenew/SaveWorkValuesResultNew`,'POST', data)
// 保存人格测评
api.saveCharacterTestResult = (data) => request.globalRequest(`/TaskManage/SaveCharacterTestResult`,'POST', data, 2,5)
api.saveCharacterTestResult = (data) => request.globalRequest(`/TestManagenew/SavePersonTestNew`,'POST', data)
// 保存兴趣测评
api.saveInterestTestResult = (data) => request.globalRequest(`/TaskManage/SaveInterestTestResult`,'POST', data, 2,5)
// 保存初中测评结果
api.querySaveTestRecord = (data) => request.globalRequest(`/ResearchStudy/QuerySaveTestRecord`,'POST', data, 1)
// 保存简易测评
api.saveCustomerTestResult = (data) => request.globalRequest(`/TaskManage/SaveCustomerTestResult`,'POST', data, 2,5)
api.saveInterestTestResult = (data) => request.globalRequest(`/TestManagenew/SaveInterestTestNew`,'POST', data)
//保存测评结果(通用能力,多元能力,领导力)
api.saveCustomTestResult = (data) => request.globalRequest(`/TaskManage/SaveCustomTestResult`,'POST', data, 2,5)
//保存结果(学习力相关测评(文本类),图形类(-45推理能力测评),(生涯构建)(生涯适应力))
api.saveStudyCustomTestResult = (data) => request.globalRequest(`/TestManage/SaveStudyCustomTestResult`,'POST', data, 1,0)
//保存结果(学习力:图形类22注意力测评23记忆力测评25场独立-场依存认知风格测评)
api.saveStudyGraphic_TestResult = (data) => request.globalRequest(`/TestManage/SaveStudyGraphic_TestResult`,'POST', data, 1,0)
//保存结果(学习力:图形类:沉思型-冲动型认知风格测评,
api.saveStudyGraphic_DependencyResult = (data) => request.globalRequest(`/TestManage/SaveStudyGraphic_DependencyResult`,'POST', data, 1,0)
api.saveCustomTestResult = (data) => request.globalRequest(`/TestManagenew/SaveCustomTestResultNew`,'POST', data)
// 获取自我评估结果
api.querySubjectScoreResult = () => request.globalRequest(`/TaskManage/QuerySubjectScoreResult`,'GET', {}, 2,5)
// 获取兴趣测评结果
api.queryInterestTestResult = (year,term,recordId) => request.globalRequest(`/TestManage/QueryInterestTestResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1)
// 获取学科信心结果
api.querySubjectResult = (year,term,recordId) => request.globalRequest(`/TestManage/QuerySubjectResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {},1)
// 获取MBTI结果
api.queryMBTIResult = (year,term,recordId)=> request.globalRequest(`/TestManage/QueryMBTIResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1)
// 获取多元智能结果
api.multipleIntelligenceResult = (year,term,recordId) => request.globalRequest(`/TestManage/MultipleIntelligenceResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1)
api.queryInterestTestResult = (year,term,recordId) => request.globalRequest(`/TestManage/QueryInterestTestResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {})
// 获取工作价值结果
api.workValuesResult = (year,term,recordId) => request.globalRequest(`/TestManage/WorkValuesResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1)
api.workValuesResult = (year,term,recordId) => request.globalRequest(`/TestManage/QueryWorkValuesResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {})
// 获取人格测评结果
api.personalityTestResult = (year,term,recordId) => request.globalRequest(`/TestManage/PersonalityTestResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {},1)
// 获取初中兴趣题目
api.getTestTitle = (testtype) => request.globalRequest(`/ResearchStudy/GetTestTitle?testtype=${testtype}`,'GET', {}, 1)
// 获取初中测评结果
api.queryJuniorTestRecord = (year,term,recordId) => request.globalRequest(`/ResearchStudy/QueryJuniorTestRecord?year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1)
// 获取简易测评
api.queryCustomerTestTite = (testtype) => request.globalRequest(`/TaskManage/QueryTestContent?type=${testtype}`,'GET', {}, 2,5)
// 获取简易测评报告
api.queryPrimaryInterestResult = () => request.globalRequest(`/TaskManage/QueryPrimaryInterestResult`,'GET', {}, 2,5)
// 获取多元智能结果(简版)
api.multipleIntelligenceSimpleResult = () => request.globalRequest(`/Test/MultipleIntelligenceSimpleResult`,'GET', {}, 2,5)
api.personalityTestResult = (year,term,recordId) => request.globalRequest(`/TestManage/QueryPersonalityTestResult?year=${year}&term=${term}&recordId=${recordId}`,'GET', {})
// 获取测评结果(通用能力,多元能力,领导力)
api.queryCustomTestResult = (testType,year,term,recordId) => request.globalRequest(`/TestManage/QueryCustomTestResult?type=${testType}&year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1)
//获取测评结果(生涯构建和学习力相关测评)
api.getStudyCustomTestResult = (testType,year,term,recordId) => request.globalRequest(`/TestManage/GetStudyCustomTestResult?testType=${testType}&year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1,0)
//获取结果时间维度对比(生涯构建和学习力相关测评)
api.getStudyTimeGroupTestResult = (testType,userId,year,term,recordId) => request.globalRequest(`/TestManage/GetStudyTimeGroupTestResult?testType=${testType}&userId=${userId}&year=${year}&term=${term}&recordId=${recordId}`,'GET', {}, 1,0)
//小程序获取时间维度接口(所有生涯测评)
api.getCareerYearAndTermList = (testType) => request.globalRequest(`/TestManage/GetCareerYearAndTermList?testType=${testType}`,'GET', {}, 1,0)
api.queryCustomTestResult = (testType,year,term,recordId) => request.globalRequest(`/TestManage/QueryCustomTestResult?type=${testType}&year=${year}&term=${term}&recordId=${recordId}`,'GET', {})
//小程序获取时间维度接口(所有生涯测评)
api.getCareerYearAndTermList = (testType) => request.globalRequest(`/TestManage/GetCareerYearAndTermList?testType=${testType}`,'GET', {})
//兴趣测评对比数据
api.getInterestTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetInterestTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
api.getInterestTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetInterestTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {})
//人格测评对比数据
api.getPersonTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetPersonTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//多元智能测评对比数据
api.getMultipleTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetMultipleTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
api.getPersonTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetPersonTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {})
//工作价值观测评对比数据
api.getWorkValuesTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetWorkValuesTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//MBTI测评对比数据
api.getMBTITestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetMBTITestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//学科信心测评对比数据
api.getSubjectTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetSubjectTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//SCL-90对比/领导力数据
api.getCustomTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,typeId,userId,recordId) => request.globalRequest(`/TestManage/GetCustomTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&typeId=${typeId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
api.getWorkValuesTestGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetWorkValuesTestGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {})
//多元能力测评对比数据
api.getMultipleAbilityGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetMultipleAbilityGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
api.getMultipleAbilityGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetMultipleAbilityGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {})
//通用职业能力测评对比数据
api.getBeCurrentJobGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetBeCurrentJobGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//获取学习力测评(文本类)群体维度对比数据,(生涯构建)
api.getStudyTestGroupResult = (typeId,year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetStudyTestGroupResult?typeId=${typeId}&year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//记忆力测评群体维度对比数据
api.getLearningMemoryGroupResult = (typeId,year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetLearningMemoryGroupResult?typeId=${typeId}&year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//场独立-场依存认知风格测评群体维度对比数据
api.getLearningUniqueGroupResult = (typeId,year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetLearningUniqueGroupResult?typeId=${typeId}&year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//沉思型-冲动型认知风格测评群体维度对比数据
api.getLearningDependencyGroupResult = (typeId,year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetLearningDependencyGroupResult?typeId=${typeId}&year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
//学习力(图形类)测评群体维度对比数据(22注意力测评-45推理能力测评)
api.getGraphic_TestGroupResult = (typeId,year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetGraphic_TestGroupResult?typeId=${typeId}&year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {}, 1,0)
api.getBeCurrentJobGroupResult = (year,term,schoolId,gradeId,classId,sex,departId,userId,recordId) => request.globalRequest(`/TestManage/GetBeCurrentJobGroupResult?year=${year}&term=${term}&schoolId=${schoolId}&gradeid=${gradeId}&classid=${classId}&sex=${sex}&departId=${departId}&userId=${userId}&recordId=${recordId}`,'GET', {})
//获取测评分类标签
api.getTestTypeTagLIst = () => request.globalRequest(`/TestManage/GetTestTypeTagLIst`,'GET', {}, 1)
api.getTestTypeTagLIst = () => request.globalRequest(`/TestRecordProcess/GetTestTypeList`,'GET', {})
//获取测评报告日期列表
api.getCareerYearAndTermListNew = (testType,userId) => request.globalRequest(`/TestManage/GetCareerYearAndTermListNew?testType=${testType}&userId=${userId}`,'GET', {}, 1)
api.getCareerYearAndTermListNew = (testType,userId) => request.globalRequest(`/TestManage/GetCareerYearAndTermListNew?testType=${testType}&userId=${userId}`,'GET', {})
// 保存测评答题过程记录
api.saveTestRecordProcess = (data) => request.globalRequest(`/TestRecordProcess/SaveTestRecordProcess`,'POST', data, 1)
//获取测评答题记录
api.getTestRecordProcessList = (testType) => request.globalRequest(`/TestRecordProcess/GetTestRecordProcessList?testType=${testType}`,'GET', {}, 1)
// 删除测评数据
api.removeTestRecordProcess = (testType) => request.globalRequest(`/TestRecordProcess/RemoveTestRecordProcess?testType=${testType}`,'POST', {}, 1)
// 获取测评列表答题记录状态
api.getUserTestTypeProcessList = (testTypes) => request.globalRequest(`/TestRecordProcess/GetUserTestTypeProcessList?testTypes=${testTypes}`,'GET', {}, 1)
api.saveTestRecordProcess = (data) => request.globalRequest(`/TestRecordProcess/SaveTestRecordProcess`,'POST', data)
export default api

View File

@@ -3,79 +3,14 @@ import request from '@/packageCa/utilCa/request.js'
const api = {}
//根据openId,获取token,并判断用户是否已绑定账号
api.queryKaShiToken = (userId,name) => request.globalRequest(`/KaShi/QueryKaShiToken?userId=${userId}&name=${name}&schoolId=2268`,'GET', {})
api.queryKaShiToken = (idCard,name) => request.globalRequest(`/Home/QueryKaShiToken?userIdNO=${idCard}&name=${name}&schoolId=2371`,'GET', {})
// 获取ai面试路径
api.queryAIUrl = (userId,name) => request.globalRequest(`/KaShi/QueryAIUrl?userId=${userId}&name=${name}&schoolId=2268`,'GET', {})
//根据openId,获取token,并判断用户是否已绑定账号
api.getAccessTokenAndUser = (params) => request.globalRequest(`/WeChartToken/GetAccessTokenAndUser?openId=${params}`,'GET', {})
//获取用户token 生涯平台token
api.queryWechartToken = (userId,schoolId,userType) => request.globalRequest(`/Auth/QueryWechartToken?userId=${userId}&schoolId=${schoolId}&userType=${userType}`,'GET', {},1,4)
// 获取openid
api.getOpenId = (params) => request.globalRequest(`/WishOrder/GetOpenId?code=${params}`,'GET', {}, "")
// 微信支付
api.createWeiXinOrder = (data) => request.globalRequest(`/TenpayOrder/CreateWeiXinOrder`, 'POST', data)
// 用户绑定登录
api.userBindLogin = (data) => request.globalRequest(`/user/UserBindLogin`, 'POST', data)
//用户解绑账号或切换账号有返回User, Token话,前端重新绑定到header上
api.userUnBindOrChangeCodeNumber = (userId,type) => request.globalRequest(`/user/UserUnBindOrChangeCodeNumber?userId=${userId}&type=${type}`,'GET', {}, 1)
//获取当前微信用户已绑定的账号列表
api.getUserCodeNumber = () => request.globalRequest(`/user/GetUserCodeNumber`,'GET', {}, 1)
//根据学号获取学校列表
api.getSchoolByCodeNumber = (params) => request.globalRequest(`/user/GetSchoolByCodeNumber?codeNumber=${params}`,'GET', {}, 1)
// 判断学生是否完成生涯成熟度问卷, taskId大于0需要进行问卷taskId 等于0不需要问卷
// api.getQuestionnaireTitlePower = () => request.globalRequest(`/CareerMaturityTask/GetQuestionnaireTitlePower`,'GET', {}, 1)
// 获取生涯成熟度题目
// api.getTestTitleListList = () => request.globalRequest(`/CareerMaturityTask/GetTestTitleListList`,'GET', {}, 1)
// 保存生涯成熟度测评结果
// api.saveCareerMaturityTestResult = (data) => request.globalRequest(`/CareerMaturityTask/SaveCareerMaturityTestResult`, 'POST', data, 1)
// 获取手机验证码
api.getMobileCode = (mobile) => request.globalRequest(`/WeChartUser/GetMobileCode?mobile=${mobile}&token=SQEIfNmlFufmOMNVPZCvNVWpDeldYjH`,'GET', {}, 1)
// 提交手机注册
api.checkSmsCode = (data) => request.globalRequest(`/user/CheckSmsCode`, 'POST', data, 1)
api.queryAIUrl = (idCard,name) => request.globalRequest(`/Home/QueryAIUrl?userIdNO=${idCard}&name=${name}&schoolId=2371`,'GET', {})
// 获取个人档案
api.queryStudentProfile = () => request.globalRequest(`/StudentResource/QueryStudentProfile`,'GET', {}, 2,4)
// 添加,取消个人意向
api.doIntention = (type,id,actionType) => request.globalRequest(`/StudentResource/DoIntention?type=${type}&actionType=${actionType}&id=${id}`,'GET', {}, 2,4)
//绑vip卡
api.bindCard = (data) => request.globalRequest(`/user/BindCard`,'POST', data, 1)
api.queryStudentProfile = () => request.globalRequest(`/StudentResource/QueryStudentProfile`,'GET', {})
// 一体机激活 绑定 获取列表
api.queryMachineOrderCountList = (machineNumber) => request.globalRequest(`/Onemachine/QueryMachineOrderCountList?machineNumber=${machineNumber}`,'GET', {}, 1)
// 绑定设备
api.activityMachine = (data) => request.globalRequest(`/Onemachine/ActivityMachine`,'POST', data, 1)
// 解绑
api.removeMachine = (orderId,machineModelId,machineNumber) => request.globalRequest(`/Onemachine/RemoveMachine?orderId=${orderId}&machineModelId=${machineModelId}&machineNumber=${machineNumber}`,'POST', {}, 1)
// ai咨询问题
api.aISearch = (keyword,sessionId) => request.globalRequest(`/AIAgents/search?keyword=${keyword}&sessionId=${sessionId}`,'GET', {}, 1)
// ai获取历史咨询
api.aIGetHistoryRecord = (page) => request.globalRequest(`/AIAgents/GetHistoryRecord?page=${page}&pageSize=20`,'GET', {}, 1)
// 保存人脸图片
api.queryUploadPhoto = (address) => request.globalRequest(`/user/QueryUploadPhoto?address=${address}`,'GET', {}, 1)
// 保存操作日志
api.saveUserOperationLog = (data) => request.globalRequest(`/UserOperationLog/SaveUserOperationLog`,'POST', data, 3)
// 获取操作日志
api.getUserOperationLogList = (pageIndex,pageSize,keyword,operationType) => request.globalRequest(`/UserOperationLog/GetUserOperationLogList?pageIndex=${pageIndex}&pageSize=${pageSize}&keyword=${keyword}&operationType=${operationType}`,'GET', {}, 1)
// 设备登录
api.loginOneMachine = (machineNo) => request.globalRequest(`/user/LoginOneMachine?machineNo=${machineNo}`,'POST', {}, 1)
// 获取系统菜单权限
api.querySchoolMenu = () => request.globalRequest(`/user/QuerySchoolMenu`,'GET', {}, 1)
// 保存高校个人信息
api.saveUserBasisInfo = (mobileCode,data) => request.globalRequest(`/user/SaveUserBasisInfo?mobileCode=${mobileCode}`,'POST', data, 1)
// 获取高校个人信息
api.getUserBasisInfo = () => request.globalRequest(`/user/GetUserBasisInfo`,'GET', {}, 1)
export default api

View File

@@ -3,125 +3,80 @@
<view class="content">
<view class="head">
<view class="h3">
{{jobDetailData.Name}}
{{jonInfo.Name}}
</view>
<view class="h2">所属大类<text>{{jobDetailData.BigCategoryName}}</text></view>
<view class="h2">所属中类<text>{{jobDetailData.MidCategoryName}}</text></view>
<view class="h2">所属小类<text>{{jobDetailData.SmallCategoryName}}</text></view>
<view class="intention-btn" v-if="jobDetailData.ShowIntention" v-text="jobDetailData.IsIntention?'取消意向':'加入意向'" @click="changeIntention"></view>
<view class="h2">所属大类<text>{{bigType}}</text></view>
<view class="h2">所属中类<text>{{midType}}</text></view>
<view class="h2">所属小类<text>{{smallType}}</text></view>
</view>
<view class="txt-content">
<view class="article-item" v-if="jobDetailData.VideoUrl">
<view class="article-item" v-if="jonInfo.VideoUrl">
<text class="h4">职业新说</text>
<video :src="jobDetailData.VideoUrl"></video>
<video :src="jonInfo.VideoUrl"></video>
</view>
<view class="article-item" v-if="jobDetailData.TopIntroduction">
<view class="article-item" v-if="jonInfo.TopIntroduction">
<text class="h4">职业说明</text>
<view class="article-content" v-html="jobDetailData.TopIntroduction"></view>
<view class="article-content" v-html="jonInfo.TopIntroduction"></view>
</view>
<view class="article-item" v-if="jobDetailData.TopWorkContent">
<view class="article-item" v-if="jonInfo.TopWorkContent">
<text class="h4">工作内容</text>
<view class="article-content" v-html="jobDetailData.TopWorkContent"></view>
<view class="article-content" v-html="jonInfo.TopWorkContent"></view>
</view>
<view class="article-item" v-if="jobDetailData.QualityRequirements">
<view class="article-item" v-if="jonInfo.QualityRequirements">
<text class="h4">从业要求</text>
<view class="article-content" v-html="jobDetailData.QualityRequirements"></view>
<view class="article-content" v-html="jonInfo.QualityRequirements"></view>
</view>
<view class="article-item" v-if="jobDetailData.AbilityRequirements">
<view class="article-item" v-if="jonInfo.AbilityRequirements">
<text class="h4">能力要求</text>
<view class="article-content" v-html="jobDetailData.AbilityRequirements"></view>
<view class="article-content" v-html="jonInfo.AbilityRequirements"></view>
</view>
<view class="article-item" v-if="jobDetailData.SalaryStr">
<view class="article-item" v-if="jonInfo.SalaryStr">
<text class="h4">薪资范围</text>
<view class="article-content" v-html="jobDetailData.SalaryStr"></view>
<view class="article-content" v-html="jonInfo.SalaryStr"></view>
</view>
<view class="article-item" v-if="jobDetailData.CareerProspects">
<view class="article-item" v-if="jonInfo.CareerProspects">
<text class="h4">就业前景</text>
<view class="article-content" v-html="jobDetailData.CareerProspects"></view>
<view class="article-content" v-html="jonInfo.CareerProspects"></view>
</view>
<view class="article-item" v-if="listOne.length > 0">
<view class="article-item" v-if="jonInfo.JobSkill">
<text class="h4">职业技能</text>
<view class="attr-wrap">
<view class="row" v-for="(item,index) in listOne" :key="index">
<view class="name">
<text class="label">{{index + 1}}</text>{{item.Name}}
</view>
<view class="desc">
{{item.Explain}}
</view>
</view>
</view>
<view class="article-content" v-html="jonInfo.JobSkill"></view>
</view>
<view class="article-item" v-if="listTwo.length > 0">
<view class="article-item" v-if="jonInfo.JobAbility">
<text class="h4">职业能力</text>
<view class="attr-wrap">
<view class="row" v-for="(item,index) in listTwo" :key="index">
<view class="name">
<text class="label">{{index + 1}}</text>{{item.Name}}
</view>
<view class="desc">
{{item.Explain}}
</view>
</view>
</view>
<view class="article-content" v-html="jonInfo.JobAbility"></view>
</view>
<view class="article-item" v-if="listThree.length > 0">
<view class="article-item" v-if="jonInfo.JobKnowledge">
<text class="h4">具备知识</text>
<view class="attr-wrap">
<view class="row" v-for="(item,index) in listThree" :key="index">
<view class="name">
<text class="label">{{index + 1}}</text>{{item.Name}}
</view>
<view class="desc">
{{item.Explain}}
</view>
</view>
</view>
<view class="article-content" v-html="jonInfo.JobKnowledge"></view>
</view>
<view class="article-item" v-if="listFour.length > 0">
<view class="article-item" v-if="jonInfo.JobRequire">
<text class="h4">职业素养</text>
<view class="attr-wrap">
<view class="row" v-for="(item,index) in listFour" :key="index">
<view class="name">
<text class="label">{{index + 1}}</text>{{item.Name}}
</view>
<view class="desc">
{{item.Explain}}
</view>
</view>
</view>
<view class="article-content" v-html="jonInfo.JobRequire"></view>
</view>
<view class="article-item" v-if="listFive.length > 0">
<view class="article-item" v-if="jonInfo.JobActivity">
<text class="h4">职业活动</text>
<view class="attr-wrap">
<view class="row" v-for="(item,index) in listFive" :key="index">
<view class="name">
<text class="label">{{index + 1}}</text>{{item.Name}}
</view>
<view class="desc">
{{item.Explain}}
</view>
</view>
</view>
<view class="article-content" v-html="jonInfo.JobActivity"></view>
</view>
<view class="article-item" v-if="jobDetailData.DevelopmentPath">
<view class="article-item" v-if="jonInfo.JobPath">
<text class="h4">发展路径</text>
<view class="article-content" v-html="jobDetailData.DevelopmentPath"></view>
<view class="article-content" v-html="jonInfo.JobPath"></view>
</view>
<view class="article-item" v-if="jobDetailData.SpecialtyList != null && jobDetailData.SpecialtyList.length > 0">
<view class="article-item" v-if="jonInfo.TopWorkContent">
<text class="h4">推荐专业</text>
<view class="sp-wrap">
<view class="item" v-for="(item,index) in jobDetailData.SpecialtyList":key="index">
{{item.Name}}
</view>
</view>
<view class="article-content" v-html="jonInfo.TopWorkContent"></view>
</view>
<view class="article-item" v-if="jonInfo.SalaryStr">
<text class="h4">薪资范围</text>
<view class="article-content" v-html="jonInfo.SalaryStr"></view>
</view>
<view class="article-item" v-if="jonInfo.CareerProspects">
<text class="h4">就业前景</text>
<view class="article-content" v-html="jonInfo.CareerProspects"></view>
</view>
</view>
</view>
<view class="fiexd-visitor" v-if="isVisitor">
<navigator class="btn" url="/pagesUserInfo/binding/binding?routeType=6">请先登录</navigator>
</view>
<!-- <u-modal :show="showLogin" content='观看完整内容,请先登录' width='500rpx' @confirm="showLogin=false"></u-modal> -->
</view>
</template>
@@ -135,21 +90,27 @@ import api1 from "@/packageCa/apiCa/user.js"
isVisitor: false, //游客
user: uni.getStorageSync("CAuserInfo").user,
id: 0,
jobDetailData: {
Name: "",
BigCategoryName: "",
MidCategoryName: "",
SmallCategoryName: "",
VideoUrl: "",
TopIntroduction: "",
TopWorkContent: "",
QualityRequirements: "",
},
listOne: [],//职业技能
listTwo: [],//职业能力
listThree: [],//具备知识
listFour: [],//职业素养
listFive: [],//职业活动
// jonInfo: {
// Name: "",
// BigCategoryName: "",
// MidCategoryName: "",
// SmallCategoryName: "",
// VideoUrl: "",
// TopIntroduction: "",
// TopWorkContent: "",
// QualityRequirements: "",
// },
// listOne: [],//职业技能
// listTwo: [],//职业能力
// listThree: [],//具备知识
// listFour: [],//职业素养
// listFive: [],//职业活动
jonInfo: {},
isIntention: "",
bigType: "",
midType: "",
smallType: "",
}
},
onLoad(e) {
@@ -162,23 +123,15 @@ import api1 from "@/packageCa/apiCa/user.js"
this.queryJobDetailById();
},
methods: {
showConfirmInfor(){
uni.showModal({
content:"观看完整内容,请先登录",
confirmText:"确认",
confirmColor:"#1677ff",
showCancel:false
})
},
changeIntention(){
uni.showLoading({
title: "加载中"
})
let isIntention = this.jobDetailData.IsIntention;
let isIntention = this.jonInfo.IsIntention;
api1.doIntention(2,this.id,isIntention?1:0).then((res)=>{
uni.hideLoading();
if(res.Result == 1){
this.jobDetailData.IsIntention = !this.jobDetailData.IsIntention;
this.jonInfo.IsIntention = !this.jonInfo.IsIntention;
}
})
},
@@ -190,44 +143,11 @@ import api1 from "@/packageCa/apiCa/user.js"
api.queryJobDetailById(this.id).then((res) => {
uni.hideLoading();
if(res.Result == 1){
this.jobDetailData = res.Data;
let attList = res.Data.AttList;
if(attList != null){
let listOne = [],//职业技能
listTwo = [],//职业能力
listThree = [],//具备知识
listFour = [],//职业素养
listFive = [];//职业活动
attList.forEach(item => {
switch(item.Identify){
case 1 :{
listOne.push(item);
break;
}
case 2 :{
listTwo.push(item);
break;
}
case 3 :{
listThree.push(item);
break;
}
case 5 :{
listFour.push(item);
break;
}
case 6 :{
listFive.push(item);
break;
}
}
});
this.listOne = listOne;
this.listTwo = listTwo;
this.listThree = listThree;
this.listFour = listFour;
this.listFive = listFive;
}
this.jonInfo = res.Data.info;
this.isIntention = res.Data.exit;
this.bigType = res.Data.parent3
this.midType = res.Data.parent2
this.smallType = res.Data.parent1
}
})
},

View File

@@ -10,7 +10,7 @@
<text class="icon icon-search"></text>
<input type="search" v-model="kw" placeholder="请输入职业名称" @input="inputKeywrok"/>
<view class="list-wrap" v-show="kw != ''">
<navigator class="link" :url="'/packageCa/job/details?id='+item.Id" v-for="(item, index) in jobDataList" :key="index">{{item.Name}}</navigator>
<navigator class="link" :url="'/packageCa/job/details?id='+item.EnCodeId" v-for="(item, index) in jobDataList" :key="index">{{item.Name}}</navigator>
</view>
</view>
</view>
@@ -37,17 +37,6 @@
</view>
</scroll-view>
</view>
<view class="fiexd-visitor" v-if="isVisitor">
<navigator class="btn" url="/packageB/pagesUserInfo/binding/binding?routeType=6">请先登录</navigator>
</view>
<!-- <u-modal :show="showTip" @confirm="showTip=false" @cancel="showTip=false" confirmText="我明白了">
<view class="slot-content">
<view class="tip-layer">
<view class="title">{{layerTitile}}</view>
<view class="desc" v-html="layerDesc"></view>
</view>
</view>
</u-modal> -->
</view>
</template>
@@ -59,7 +48,6 @@
return {
kw: "", //搜索关键
user: uni.getStorageSync("CAuserInfo").user,
isVisitor: false, //游客
barHeight: wx.getWindowInfo().statusBarHeight,
winHeight: wx.getWindowInfo().windowHeight,
jobDataList: [],
@@ -81,10 +69,8 @@
},
onLoad(e) {
if(this.user == undefined || this.user == null){
this.isVisitor = true;
this.loginHeight=99;
}else {
this.isVisitor = false;
this.loginHeight=0;
}
this.scrollRightTop = 1;

View File

@@ -75,7 +75,7 @@
//this.showLogin = true;
}else {
uni.navigateTo({
url: `/packageCa/job/details?id=${item.Id}&name=${item.Name}`
url: `/packageCa/job/details?id=${item.EnCodeId}&name=${item.Name}`
})
}
},

View File

@@ -1,9 +1,5 @@
<template>
<view class="title-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" v-if="taskId ==0" @click="goback"></view>
<text v-if="testTitle != ''">{{testTitle}}</text>
</view>
<view class="title-wrap" style="padding-top: 40rpx;">
<view class="progress-block">
<view class="row">
<view class="title-index">
@@ -104,7 +100,7 @@
this.taskId = e.taskId
}
this.computeTitle(this.testType);
this.getHistoryTitle();
this.getTitle();
},
methods: {
// 返回
@@ -141,16 +137,6 @@
}
}
},
//获取答题记录
getHistoryTitle(){
api.getTestRecordProcessList(this.testType).then(res => {
if (res.Result === 1) {
let data = res.Data;
this.historyTitle = data;
this.getTitle();
}
})
},
// 获取题目
getTitle() {
uni.showLoading({
@@ -162,45 +148,7 @@
let list = res.Data.List.Item1;
list.forEach(item => {
item.Value = "";
this.historyTitle.forEach(ritem=>{
if(item.Id == ritem.TestTitleId){
switch (ritem.TestResult) {
case "A": {
item.Value = 1;
break;
}
case "B": {
item.Value = 2;
break;
}
case "C": {
item.Value = 3;
break;
}
case "D": {
item.Value = 4;
break;
}
case "E": {
item.Value = 5;
break;
}
case "F": {
item.Value = 6;
break;
}
}
}
})
})
if(this.historyTitle.length == 0){
this.pageIndex = 0;
}else if(this.historyTitle.length == list.length){
this.pageIndex = list.length - 1;
}else {
this.pageIndex = this.historyTitle.length;
}
this.allNum = list.length;
this.list = list;
this.testTitle = res.Data.List.Item2;
@@ -225,54 +173,14 @@
console.log('单击事件被触发');
this.lastTapTime = now;
this.list[INDEX].Value = NUM;
this.saveTestRecordProcess(this.list[INDEX].Id,NUM);
setTimeout(() => {
if (this.pageIndex != this.list.length - 1) {
this.pageIndex = INDEX + 1;
}
if(this.pageIndex != this.list.length - 1){
this.pageIndex = INDEX + 1;
}
}, 300)
}
},
//存储答题记录
saveTestRecordProcess(ID,VALUE){
let val = ""
switch (VALUE) {
case 1: {
val = "A";
break;
}
case 2: {
val = "B";
break;
}
case 3: {
val = "C";
break;
}
case 4: {
val = "D";
break;
}
case 5: {
val = "E";
break;
}
case 6: {
val = "F";
break;
}
}
let data = {
testType: this.testType,
testTitleId: ID,
testResult: val
}
api.saveTestRecordProcess(data).then(res => {
if (res.Result === 1) {
}
})
},
// 提交题目
// 提交题目
submitTitle() {
let testStr = "";
this.list.forEach(item => {
@@ -308,42 +216,41 @@
title: "提交中"
})
let data = {
testType: this.testType,
testType: Number(this.testType),
taskId: this.taskId,
testStr
}
api.removeTestRecordProcess(this.testType).then((res) => {
return api.saveCustomTestResult(data);
}).then((res) => {
uni.hideLoading();
if (res.Result === 1) {
uni.showToast({
title: "提交成功",
icon: "success"
})
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
if (beforePage != undefined) {
beforePage.data.refreshIfNeeded = true;
}
setTimeout(() => {
if (this.testType == -27) {
uni.redirectTo({
url: `/packageCa/testReport/multipleAbilityTestReport?id=${res.Data.TestId}`
})
} else if (this.testType == -28) {
uni.redirectTo({
url: `/packageCa/testReport/generalCareerTestReport?id=${res.Data.TestId}`
})
}
}, 1000)
} else {
uni.showToast({
title: res.Message,
icon: "none"
})
}
})
api.saveCustomTestResult(data).then((res) => {
uni.hideLoading();
if (res.Result === 1) {
uni.showToast({
title: "提交成功",
icon: "success"
})
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
if (beforePage != undefined) {
beforePage.data.refreshIfNeeded = true;
}
setTimeout(() => {
if (this.testType == -27) {
uni.redirectTo({
url: `/packageCa/testReport/multipleAbilityTestReport`
})
} else if (this.testType == -28) {
uni.redirectTo({
url: `/packageCa/testReport/generalCareerTestReport`
})
}
}, 1000)
} else {
uni.hideLoading();
uni.showToast({
title: res.Message,
icon: "none"
})
}
})
}
}
}

View File

@@ -1,9 +1,5 @@
<template>
<view class="title-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>职业兴趣测评</text>
</view>
<view class="title-wrap" style="padding-top: 40rpx;">
<view class="progress-block">
<view class="row">
<view class="title-index">
@@ -158,7 +154,7 @@
}
},
onLoad(e) {
this.getHistoryTitle();
this.getTitle();
},
methods: {
// 返回
@@ -179,16 +175,6 @@
});
//uni.navigateBack(-1);
},
//获取答题记录
getHistoryTitle(){
api.getTestRecordProcessList(11).then(res => {
if (res.Result === 1) {
let data = res.Data;
this.historyTitle = data;
this.getTitle();
}
})
},
// 获取题目
getTitle() {
uni.showLoading({
@@ -200,26 +186,7 @@
let list = res.Data;
list.forEach(item => {
item.Value = 0
this.historyTitle.forEach(ritem=>{
if(item.Id == ritem.TestTitleId){
item.Value = Number(ritem.TestResult);
}
})
})
if(this.historyTitle.length > 180){
let len = this.historyTitle.length - 180;
for(let i = 0; i < len; i++){
this.checkTitleList[i].Value = this.historyTitle[i + 180];
this.checkTitleList[i].Checked = true;
}
}
if(this.historyTitle.length == 0){
this.pageIndex = 0;
}else if(this.historyTitle.length == list.length){
this.pageIndex = list.length - 1;
}else {
this.pageIndex = this.historyTitle.length;
}
this.allNum = list.length + 3;
this.list = list;
}
@@ -241,11 +208,8 @@
// 处理单击事件
this.lastTapTime = now;
this.list[INDEX].Value = NUM;
this.saveTestRecordProcess(this.list[INDEX].Id,NUM);
setTimeout(()=>{
if(this.pageIndex != this.allNum - 1){
this.pageIndex = INDEX + 1;
}
},400)
}
},
@@ -260,7 +224,6 @@
this.firstDescVal = ITEM.Value;
this.secondDescVal = "";
this.thirdDescVal = "";
this.saveTestRecordProcess(181,ITEM.Value);
break;
}
case 2: {
@@ -272,13 +235,11 @@
this.checkTitleList[INDEX].Checked = true;
this.secondDescVal = ITEM.Value;
this.thirdDescVal = "";
this.saveTestRecordProcess(182,ITEM.Value);
break;
}
case 3: {
this.checkTitleList[INDEX].Checked = true;
this.thirdDescVal = ITEM.Value;
this.saveTestRecordProcess(183,ITEM.Value);
break;
}
}
@@ -289,27 +250,8 @@
},400)
},
//存储答题记录
saveTestRecordProcess(ID,VALUE){
let data = {
testType: 11,
testTitleId: ID,
testResult: VALUE
}
api.saveTestRecordProcess(data).then(res => {
if (res.Result === 1) {
}
})
},
// 提交题目
submitTitle() {
// uni.showToast({
// title: "请选择三个特质描述",
// icon: "none"
// })
// return;
let testStr = "";
this.list.forEach(item => {
testStr += `${item.Id}|${item.Value - 1},`
@@ -319,9 +261,7 @@
title: "提交中"
})
let data = {testStr}
api.removeTestRecordProcess(11).then((res) => {
return api.saveInterestTestResult(data);
}).then((res) => {
api.saveInterestTestResult(data).then((res) => {
uni.hideLoading();
if (res.Result === 1) {
uni.showToast({

View File

@@ -1,9 +1,5 @@
<template>
<view class="title-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback()"></view>
<text>人格测评</text>
</view>
<view class="title-wrap" style="padding-top: 40rpx;">
<view class="progress-block">
<view class="row">
<view class="title-index">
@@ -86,7 +82,7 @@
}
},
created() {
this.getHistoryTitle();
this.getTitle();
},
methods: {
// 返回
@@ -107,16 +103,6 @@
});
//uni.navigateBack(-1);
},
//获取答题记录
getHistoryTitle(){
api.getTestRecordProcessList(15).then(res => {
if (res.Result === 1) {
let data = res.Data;
this.historyTitle = data;
this.getTitle();
}
})
},
// 获取题目
getTitle() {
uni.showLoading({
@@ -128,37 +114,7 @@
let list = res.Data.List;
list.forEach(item => {
item.Value = 0
this.historyTitle.forEach(ritem=>{
if(item.TitleId == ritem.TestTitleId){
switch (ritem.TestResult) {
case "A": {
item.Value = 4;
break;
}
case "B": {
item.Value = 3;
break;
}
case "C": {
item.Value = 2;
break;
}
case "D": {
item.Value = 1;
break;
}
}
}
})
})
if(this.historyTitle.length == 0){
this.pageIndex = 0;
}else if(this.historyTitle.length == list.length){
this.pageIndex = list.length - 1;
}else {
this.pageIndex = this.historyTitle.length;
}
this.allNum = list.length;
this.list = list;
}
@@ -180,7 +136,6 @@
// 处理单击事件
this.lastTapTime = now;
this.list[INDEX].Value = NUM;
this.saveTestRecordProcess(this.list[INDEX].TitleId,NUM);
setTimeout(()=>{
if(this.pageIndex != this.list.length - 1){
this.pageIndex = INDEX + 1;
@@ -188,37 +143,6 @@
},400)
}
},
//存储答题记录
saveTestRecordProcess(ID,VALUE){
let val = ""
switch (VALUE) {
case 4: {
val = "A";
break;
}
case 3: {
val = "B";
break;
}
case 2: {
val = "C";
break;
}
case 1: {
val = "D";
break;
}
}
let data = {
testType: 15,
testTitleId: ID,
testResult: val
}
api.saveTestRecordProcess(data).then(res => {
if (res.Result === 1) {
}
})
},
// 提交题目
submitTitle() {
let testStr = "";
@@ -249,9 +173,7 @@
testStr,
testType: 15
}
api.removeTestRecordProcess(15).then((res) => {
return api.saveCharacterTestResult(data);
}).then((res) => {
api.saveCharacterTestResult(data).then((res) => {
uni.hideLoading();
if (res.Result === 1) {
uni.showToast({
@@ -263,7 +185,7 @@
beforePage.data.refreshIfNeeded = true;
setTimeout(()=>{
uni.redirectTo({
url: `/packageCa/testReport/personalTestReport?year=${res.Data.Year}`
url: `/packageCa/testReport/personalTestReport`
})
},1000)

View File

@@ -1,25 +1,9 @@
<template>
<view class="test-list-wrap" style="display:block;">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>生涯测评</text>
</view>
<view class="contrast-box" >
<view class="desc">
<text class="icon"></text>
<view class="txt-item">
<text v-for="(item,index) in selectTypeStr" :key="index">{{item}}</text>
</view>
</view>
<view class="btn" @click="showContrastLayer">
筛选
</view>
</view>
<view class="content" style="overflow:hidden;">
<view class="p-item" v-for="(pitem,pindex) in filteredData" :key="pindex">
<view class="h1">{{pitem.title}}</view>
<view class="item" v-for="(item,index) in pitem.list" :key="index">
<view class="h2">{{item.TestName}}</view>
<view class="content" style="overflow:hidden; padding-top: 40rpx;" >
<view class="p-item" >
<view class="item" v-for="(item,index) in dataList" :key="index">
<view class="h2">{{item.Name}}</view>
<view class="do-time">
{{item.AvgTime == 0 ? '1' : item.AvgTime}}分钟
</view>
@@ -27,51 +11,16 @@
{{item.Brief}}
</view>
<view class="btn-wrap">
<view class="btn" v-if="item.HasTest" @click="navTest(item,1)">
重新测评
<view class="btn" @click="navTest(item,1)" v-text="item.RecordId>0?'重新测评':'开始测评'">
</view>
<view class="btn" v-else @click="navTest(item,1)">
开始测评
</view>
<view class="btn" v-if="item.HasTestRecordProcess && item.Type != 25" @click="navTest(item,2)">
继续测评
</view>
<view class="report-btn" v-if="item.HasTest" @click="navReport(item)">
<view class="report-btn" v-if="item.RecordId>0" @click="navReport(item)">
查看报告
</view>
</view>
</view>
</view>
</view>
<!-- 筛选 -->
<uni-popup ref="pop_card" type="bottom">
<view class="search-content">
<view class="head-title">
<text>筛选</text>
<view @click="closeDialog()" class="s_close"></view>
</view>
<view class="item-content">
<view class="title">测评等级</view>
<view class="options">
<view class="item" v-for="(item,index) in levelOption" :class="checkedTestLevel==item.value?'on':''" @click="checkedTestLevel = item.value" :key="index">{{item.name}}</view>
</view>
<view class="title">测评类型</view>
<view class="options">
<view class="item" v-for="(item,index) in typeOption" :class="checkedTestType==item.value?'on':''" @click="checkedTestType = item.value" :key="index">{{item.name}}</view>
</view>
<view class="title">测评功能</view>
<view class="options">
<view class="item" v-for="(item,index) in fnOption" :class="checkedTestFun==item.value?'on':''" @click="checkedTestFun = item.value" :key="index">{{item.name}}</view>
</view>
</view>
<view class="btn-wrap">
<view class="btn" v-on:click="confirmCompute">
确认筛选
</view>
</view>
</view>
</uni-popup>
</view>
</template>
@@ -83,145 +32,12 @@
barHeight: wx.getWindowInfo().statusBarHeight,
refreshIfNeeded: false, //是否返回刷新
dataList: [],
selectTypeStr: ["全部"],
showContrast: false,//显示筛选
levelOption: [
{
name: "全部",
value: 0
},
{
name: "基础型",
value: 1
},
{
name: "进阶型",
value: 2
},
{
name: "专项型",
value: 3
},
],
typeOption: [
{
name: "全部",
value: 0
},
{
name: "生涯类",
value: 1
},
{
name: "学习力类",
value: 2
},
{
name: "心理健康类",
value: 3
},
{
name: "其他",
value: 4
},
],
fnOption: [
{
name: "全部",
value: 0
},
{
name: "情感态度",
value: 1
},
{
name: "智力能力",
value: 2
},
{
name: "认知学习",
value: 3
},
{
name: "人格特质",
value: 4
},
{
name: "心理健康",
value: 5
}
],
testLevel:0 ,// 测评等级
testType: 0,// 测评类型
testFun: 0,// 测评功能
checkedTestLevel: 0,// 测评等级
checkedTestType: 0,// 测评类型
checkedTestFun: 0,// 测评功能
testList1: [], //情感
testList2: [], //智力
testList3: [], //认知学习
testList4: [], //人格特质
testList5: [], //心理健康
testList6: [], //其他测评
filteredData: [],//筛选后数据
}
},
onShow() {
this.queryTaskListForWeChart();
},
methods: {
closeDialog(){
this.$refs.pop_card.close();
},
//确认筛选
confirmCompute(){
this.testLevel = this.checkedTestLevel;
this.testType = this.checkedTestType;
this.testFun = this.checkedTestFun;
if(this.checkedTestLevel == 0 && this.checkedTestType == 0 && this.checkedTestFun == 0){
this.selectTypeStr = ["全部"];
}else {
let arr = [];
if(this.checkedTestLevel != 0){
arr.push(this.levelOption[this.checkedTestLevel].name);
}
if(this.checkedTestType != 0){
arr.push(this.typeOption[this.checkedTestType].name);
}
if(this.checkedTestFun != 0){
arr.push(this.fnOption[this.checkedTestFun].name);
}
this.selectTypeStr = arr;
}
this.filteredData = this.dataList.map(category => {
const filteredList = category.list.filter(item => {
// 处理TestLevel筛选
const levelMatch = this.testLevel === 0 || item.TestLevel === this.testLevel;
// 处理TestType特殊映射其他类对应TestType=0
const typeMatch = this.testType === 0 ? true :
this.testType === 4 ? item.TestType === 0 :
item.TestType === this.testType;
// 处理TestFun筛选
const funMatch = this.testFun === 0 || item.TestFun === this.testFun;
return levelMatch && typeMatch && funMatch;
});
return { ...category, list: filteredList };
}).filter(category => category.list.length > 0); // 过滤空分组
//this.showContrast = false;
this.$refs.pop_card.close();
},
// 显示筛选列表
showContrastLayer(){
//this.showContrast = true;
this.$refs.pop_card.open('bottom') //底部弹出
this.checkedTestLevel = this.testLevel;
this.checkedTestType = this.testType;
this.checkedTestFun = this.testFun;
},
// 返回
goback(){
uni.navigateBack(-1);
@@ -231,195 +47,16 @@
uni.showLoading({
title: "加载中"
})
let eduLevel = uni.getStorageSync("CAuserInfo").user.GradeLevel;
new Promise((resolve,reject)=>{
return api.getTestTypeTagLIst().then((res)=>{
resolve(res)
})
}).then((res)=>{
let arr = [];
res.Data.forEach(item=>{
return arr.push(item.Type);
})
return api.getUserTestTypeProcessList(JSON.stringify(arr)).then((res1)=>{
return [res, res1];
})
}).then(([res1, res2]) => {
if (res1.Result === 1 && res2.Result === 1) {
return api.queryTaskListForWeChart(eduLevel).then((res) => {
return [res, res1, res2];
});
}
}).then(([res, res1, res2]) => {
uni.hideLoading();
if (res && res.Result === 1) {
this.testList1 = [];
this.testList2 = [];
this.testList3 = [];
this.testList4 = [];
this.testList5 = [];
this.testList6 = [];
let list = res.Data.TestList;
list.forEach(item=>{
// 处理答题记录匹配
item.HasTestRecordProcess = false;
res2.Data.forEach(ritem=>{
if(item.TestType == ritem.TestType){
item.HasTestRecordProcess = ritem.HasTestRecordProcess;
}
})
})
let num = 0;
let arr = [];
let arr1 = [];
list.forEach(item=>{
if(item.HasTest){
num++
}
let isMatch = false;
// 处理测评分类匹配
res1.Data.forEach((yitem, yindex) => {
if (item.TestType == yitem.Type) {
item.Type = item.TestType;
item.TestType = yitem.TestType;
item.TestLevel = yitem.TestLevel;
item.TestFun = yitem.TestFun;
arr.push(item);
isMatch = true;
}
})
if (!isMatch) {
item.Type = item.TestType;
item.TestType = 0;
item.TestLevel = 0;
item.TestFun = 0;
arr1.push(item);
}
})
this.testList6 = arr1;
this.testList = list;
arr.forEach((item, index) => {
switch (item.Type) {
// 1 情感态度
// 高中大学职业兴趣11
// 工作价值观17
// 学习动机测评-33
// 自我效能感测评-34
// 小学兴趣测评-31
//初中兴趣测评18
case 11:
case 17:
// case 18:
// case -31:
// case -33:
// case -34:
{
this.testList1.push(item);
// this.interestList.push(item);
break;
}
// 2 智力能力
// 注意力22
// 记忆力23
// 多元智能16
// 小学多元智能 -32
// 多元性向潜能发展6
// 推理能力测评-45
// 批判性思维倾向测评-38
// 创造力倾向测评-37
// 多元(职业)能力测评-27
// 通用(职业)能力测评-28
// case 22:
// case 23:
// case 16:
// case 6:
// case -32:
// case -45:
// case -38:
// case -37:
case -27:
case -28: {
this.testList2.push(item);
break;
}
// 3认知学习
// 学科信心-2
// 学科能力测评20
// 学科自评-9999
// 学习习惯-36
// 领导力测评-29
// 生涯建构测评-42
// 生涯适应力测评-43
// 意志力测评 -35
// 场独立-场依存认知风格测评 25
// 沉思型-冲动型认知风格测评 26
// 儿童元认知测评 -39
// 元认知测评 -40
// 学习资源管理能力测评 -41
// 问题解决能力测评-44
// case -2:
// case 20:
// case -9999:
// case -36:
// case -29:
// case -42:
// case -43:
// case -35:
// case 25:
// case 26:
// case -39:
// case -40:
// case -41:
// case -44:
// {
// this.testList3.push(item);
// // this.workValueList.push(item);
// break;
// }
// 4.人格特质
// MBTI 4
// 人格测评15
// case 4:
case 15: {
this.testList4.push(item);
break;
}
// 5.心理健康
// SCL-90
// case -10: {
// this.testList5.push(item);
// break;
// }
}
})
let allList = [];
if(this.testList1.length>0){
allList.push({title: '情感态度', list: this.testList1});
}
if(this.testList2.length>0){
allList.push({title: '智力能力', list: this.testList2});
}
if(this.testList3.length>0){
allList.push({title: '认知学习', list: this.testList3});
}
if(this.testList4.length>0){
allList.push({title: '人格特质', list: this.testList4});
}
// if(this.testList5.length>0){
// allList.push({title: '心理健康', list: this.testList5});
// }
// if(this.testList6.length>0){
// allList.push({title: '其他测评', list: this.testList6});
// }
this.dataList = allList;
this.confirmCompute();
}
}).catch((error) => {
console.error('请求出错:', error);
});
api.queryTaskListForWeChart().then((res)=>{
uni.hideLoading();
if (res && res.Result === 1) {
this.dataList = res.Data.DataList.filter(item=>(item.Type !== 4 && item.Type != -29));
}
})
},
routerUrl(TYPE){
switch (TYPE) {
navTest(item,index) {
switch (item.Type) {
case 11: {
// 高中兴趣测评
uni.navigateTo({
@@ -458,21 +95,6 @@
}
}
},
navTest(item,index) {
if(index == 1){
uni.showLoading({
title: "加载中..."
})
api.removeTestRecordProcess(item.Type).then((res) => {
if (res.Result == 1) {
uni.hideLoading();
this.routerUrl(item.Type)
}
})
}else {
this.routerUrl(item.Type)
}
},
navReport(item) {
switch (item.Type) {
case 11: {
@@ -543,50 +165,7 @@
background-size: 38rpx 38rpx;
}
}
.progress-box {
display: flex;
align-items: center;
margin-bottom: 36rpx;
.progress-txt {
display: flex;
align-items: center;
font-size: 24rpx;
width: 175rpx;
color: #333333;
margin-right: 20rpx;
.strong {
font-size: 32rpx;
color: #20B664;
font-weight: 600;
margin-left: 6rpx;
}
}
.progress-bar {
width: 500rpx;
height: 24rpx;
background: #F8F8F8;
border-radius: 20rpx 20rpx 20rpx 20rpx;
.progress {
position: relative;
background-image: repeating-linear-gradient(-45deg, #20B664, #20B664 20rpx, #47C580 20rpx, #47C580 30rpx);
height: 24rpx;
border-radius: 20rpx;
transition: width 1s ease-in-out;
&::after {
display: block;
content: "";
position: absolute;
right: -20rpx;
top: -8rpx;
width: 40rpx;
height: 40rpx;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAA2FBMVEUAAAA60X84z4A60YE50X850n860H860IA6z4A4z4A60X850IA50X84z4Awz4D///860X8iv2khu2ciwmskyW8guWUlzHEky3Ajx20hvWglznEl0HMm0nQjxWwm1HUgt2Q3z3zk+O112KK67dGR47Yu03kyznktzXYuyHQz0nsvxXIqwm/I8NoqyHInv2ys6Mc9yHwr0Xbx+/Wt7Mpa15NZ0ZBO1os/0IEyynfI8tyD3Ktn1Jjx/PbW8+Of5b6E4q9LzYZA1oVLyYTW9eSf6cGf5r+C2qpp35/QM//cAAAAD3RSTlMA70B/37+vn2Agz7+PYBCLRPBlAAACh0lEQVQ4y6XV2XqqMBAAYKKI1i2DgNZWK6AHEHetS7X72d7/jc4kGBJFvTlzARf833yTySRo55HLV8oEgOhGNVdXP2RlEZ0MUsxdpSUdgRuEi8fHx05nMRwCQOEyvzNQhs1m8wGD887TD8bvLqQlSFutVhNDasZJ7dzmAYKmbaPmWOonLCafseG9jZHJjcmFlnZyf6/oh+u6hraL+EbuUtoHAlG3i/pGbiJ6UoDAsjIa+dfz36/hcZVGYnMAlpXVmxVl8ZLkFoUUILIyetunSXii37pMfKY3HhVxrBsgh7gIkWmmejsbD2zbp2l46c4XNa1OwDRTPeDf+XP18cJe/WNPFkBYFYEp9HwsMw5areAV379EB4dYRxWi9lH7HpXxjKv8ie+N6PcQt9GAUTvRPlVjZdtb1rl0LxdQ0XQw24nu05MYsz6/btK9XEBZI9BuNLieUbr0lvQkPuScdHCFAA3ETMf+Ghd5kn+gzgkAw1yLVc5Uq84gwwSxqt8VvLW5FphoZZg6nDM9f5vPFdxXZhCxrlUQOyL3mI7NwUmzZe4QDDxRsSP0H/zum/ulLFqZ7wCquN07R+j4e0aXezNeH2bHzMp8u7jdbIVcc+6h8D4ta83tb/U0AKmzER31hPZpf8wqsT6Z9aKu1CEU+fC7PaG//fbBm2MH9wyv1bPDhh9Dx9RpbmVO3tWzE0IhueXAbUiNPMFvJyeNJeZhQNQ7yx0ffKRSB1CQl8zoXGMoOpSXDBYC01t6AlBTL0ZXaoxTPclco9criaSVeudc0t2dsErUCLgjJ6MnLpDShR9QAcCNHbVuCykYd5f/gshhF0/bjE5HUQAAeun/fpoy6rmqoRN05Uo+I/8B7R+IPTrIPJ8AAAAASUVORK5CYII=');
background-size: 100%;
}
}
}
}
.test-list-wrap {
.test-list-wrap {
padding: 0 20rpx 130rpx;
.content {
@@ -747,196 +326,4 @@
}
}
}
.contrast-box {
display: flex;
align-items: center;
justify-content: space-between;
width: 666rpx;
height: 76rpx;
margin-bottom: 20rpx;
padding: 0 20rpx;
background: #E7F1FF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #FFFFFF;
.desc {
display: flex;
align-items: center;
.icon {
width: 28rpx;
height: 28rpx;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAHfSURBVEiJ1Va9btswEP5OlBNr01JAMgpUeYNm7FDAeoP2Ddq1UzK5Roc6Q6AoS7auzps4QDt0i4fu1lYVWThFP7Z4HSIpspC4cCMmyLeQR+nu4/GOvAOeAwYn+dQ9zWf/o0vtBSdIvE0KBpkvmfg7AKyY3i5T85eckLzRZS/NICvZnrBdze8kdMN8AWAj4V1gVfgkxFcwhqX8EcAFGeISYPl7tLtXb7jl2dZkJTww7FoyzFelLRsgzwm4tmu0NbcBMz6tVtiPx9Z5kvR8VoXPqvDjUe+oUKI+yjRDPa+P1AkSjwyx2IZQAW/+jHZ+3vd9EGbvlFIyHlsX1dqDPPznhpSSTU+1EjpBMiRDzEwTM3vCdXy1eljC7u/eJpSpiyXN+nPLyiMAiMcUaSeUE5IS2Guvaz1SN1yeuWF+9iiETpAMAT4AcNDZxd+E+y6+NsKrLztzYpwD6rD5gGtLGgC4TnuH7WqhM4aeZS0XbpitPZc6s9RD19ViE54macDvWRV+M47Pq1oQY7/qgZwg8ZwgGb44zl+XcvfVggjfSIgpAJAQ05Lg0gmSD43f1qpFTRiPrQhAtDWputGpxgpp1p8DHAEcNavFg9vEq8+9H7e6621iZ3BP89ngJJ92alQX/gLMKt2XTOFMygAAAABJRU5ErkJggg==") no-repeat;
background-size: 100%;
}
.txt-item {
width: 400rpx;
line-height: 21px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 20rpx;
text {
display: inline-block;
line-height: 50rpx;
font-size: 24rpx;
color: #1677ff;
margin-left: 16rpx;
&::after {
content: "";
display: inline-block;
width: 2rpx;
height: 12rpx;
margin-left: 16rpx;
background: #1677ff;
}
}
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 120rpx;
height: 48rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
font-size: 24rpx;
color: #333333;
&::after {
content: "";
display: block;
width: 0;
height: 0;
margin-left: 6rpx;
border-top: 12rpx solid #333;
border-left: 12rpx solid #fff;
border-right: 12rpx solid #fff;
}
}
}
.search-content {
width: 100%;
background: #fff;
border-top-left-radius: 28rpx;
border-top-right-radius: 28rpx;
overflow: hidden;
.head-title {
width: 100%;
height: 96rpx;
line-height: 96rpx;
text-align: center;
font-size: 36rpx;
color: #333;
font-weight:550;
margin-top:10rpx;
position:relative;
}
.item-content {
padding: 0 0 0 30rpx;
.s-line {
position: relative;
width: 630rpx;
margin: 15rpx auto 45rpx;
height: 2rpx;
background: #FAFAFA;
&:before {
content: "";
display: block;
position: absolute;
left: -85rpx;
top: -16rpx;
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: #EEF1F8;
}
&::after {
content: "";
display: block;
position: absolute;
right: -58rpx;
top: -16rpx;
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: #EEF1F8;
}
}
.title {
font-size: 28rpx;
color: #333333;
padding: 30rpx 0 20rpx;
}
.options {
display: flex;
flex-wrap: wrap;
.v-line {
border-bottom: 1px dotted #f1ececb8;
margin: 26rpx 0;
}
.item {
position: relative;
min-width: 170rpx;
margin-right: 30rpx;
height: 76rpx;
text-align: center;
line-height: 76rpx;
background: #F5F5F5;
margin-bottom: 30rpx;
padding: 0 20rpx;
border-radius: 12rpx;
font-size: 28rpx;
color: #333333;
&.disable {
color: #C6C6C6;
background: #F8F8F8;
}
&.on {
background: #E7F1FF;
color: #1677ff;
}
}
}
}
.btn-wrap {
display: flex;
justify-content: center;
padding-top: 10rpx;
padding-bottom: 40rpx;
.btn {
width: 688rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
background: #1677ff;
font-size: 32rpx;
color: #fff;
border-radius: 60rpx;
}
}
}
.s_close{position:absolute;top:30rpx;right:6%;width:30rpx;height:30rpx;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAYAAAAFQMh/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjkzQkY4QkFCMjY0MTFGMDlGOThGMzcyM0VCRTJGMkYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjkzQkY4QkJCMjY0MTFGMDlGOThGMzcyM0VCRTJGMkYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGOTNCRjhCOEIyNjQxMUYwOUY5OEYzNzIzRUJFMkYyRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGOTNCRjhCOUIyNjQxMUYwOUY5OEYzNzIzRUJFMkYyRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvssjGYAAAO/SURBVHjatJf7a5V1HMef5bN2tduObjp1hMlOTbCpaKTifpI0b1EKXgo0U4Lw/0j8ZSoohkpFKjLvUYrWREX8Qa0oQaw5O7Yzt45jbW7u4nZ8f+R14MvDOdtz9PSB13jOs+37/n6u3+/Ji0aj2zzPaxenxF9i2Mu9lYo66BG/+foxT3SLAXFUtORY9AUxWywTM0WvKDHhWlEkqsSgaBD/5kj0Rdb/VKzms0U34bMjs6jYIvLFd+JBDoTfYc1FiJr9IS6PiUQiteTgZVEhyghHC/l41vDOFRvEKtbuE1fEAXHehBOEOErIJxL2TnFH9GcpmifeFl8gWsJ7E90lfhRtJhzXQ5xqnuR4Pk4kRbN4lIXwfLFZvC9e5d1ZPD2DQ0kTHtLDfUJbgrcW+smiXHSJfwj/SJZPIW0U68QrTni/EqdZ66mZcOrZiumuvRNviUIxXkwl17dpuUw2S2wVK4ia2UWxQ5yjZb10whbWBK2U74S9nJANsrG+NKJzaJkPxGuO6H7xfVA0KJyyNhEjVNWiQEwRlfRgM5tIVe+btMzH4iVhqftV7BQnMnVGOmEPgTjP1YS9HPFOejH1O6velY6nl8Qe8YOb06D5I+TsBq1hLbaENnuXdHSQ7/lMpAieXhffiOPpwhtW2CNk9fSyDYNixMsI9wREk4jWZ8pp2FC7BdcO3bRZFUyh1xOIfU2f/hem2f2QQ+EavV5BXoucGR/nYGnIdqaGtQHyGLRhp8pD22ihTtkMsUYsZKLlBTafz6ZaRxkyoUNti74h1lNcZeSwiYKz0L/O7ycz9c6FOdVG83i6+Fx8SAWn+nQ7g7+HaBTSbjbtHoo/M6QllMc1TKPVDA+zX8QhcZLPCTa0lApfyEk2gOdd2Xo8jTG4gQXNbjLwjzvz2oTvkYIaUlOF5/c5z4fCCtsCm8RH5NBjOOxDNBHo81YmWQH1UIhwhN5Pe3MNCk+lUDaSsyS7tlPmIIMknf2NeITQF7NWKf/TFqx2PxDez2ib8by7JXaHvHleZaN2YVhLy9WhUciVZ8D1eAzh/YRCqnIK6VtxmHCOZkN43uWEeyztVsKGYqlh43MbXMpBnvK0idl7aITwZrKfKT5bezHjdTmbsd6/YJVvHn/JH1Q69969hLfVy96SVHQ7ua4h7BVgvd/lc0cqdnJ6BJ7nq4zlspFRauFewDXqPSo84n6TiHEFfV5R9/BoJPePcTCPm2ivz2Fv0+YncYwLXa6snxFbRE9Pp8jiPvfeDg7x2P/wFbWPVitAx3L8+xMBBgBa0QNtbOSplwAAAABJRU5ErkJggg==") center no-repeat;
background-size:30rpx;
}
</style>

View File

@@ -1,9 +1,5 @@
<template>
<view class="title-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>工作价值观测评</text>
</view>
<view class="title-wrap" style="padding-top: 40rpx;">
<view class="progress-block">
<view class="row">
<view class="title-index">
@@ -86,7 +82,7 @@
}
},
created() {
this.getHistoryTitle();
this.getTitle();
},
methods: {
// 返回
@@ -114,16 +110,6 @@
}
this.pageIndex--
},
//获取答题记录
getHistoryTitle(){
api.getTestRecordProcessList(17).then(res => {
if (res.Result === 1) {
let data = res.Data;
this.historyTitle = data;
this.getTitle();
}
})
},
// 获取题目
getTitle() {
uni.showLoading({
@@ -135,20 +121,7 @@
let list = res.Data.List;
list.forEach(item => {
item.Value = 0;
this.historyTitle.forEach(ritem=>{
if(item.TitleId == ritem.TestTitleId){
item.Value = Number(ritem.TestResult) + 1;
}
})
})
if(this.historyTitle.length == 0){
this.pageIndex = 0;
}else if(this.historyTitle.length == list.length){
this.pageIndex = list.length - 1;
}else {
this.pageIndex = this.historyTitle.length;
}
this.allNum = list.length;
this.list = list;
}
@@ -165,28 +138,14 @@
console.log('单击事件被触发');
this.lastTapTime = now;
this.list[INDEX].Value = NUM;
//
this.saveTestRecordProcess(this.list[INDEX].TitleId,NUM-1);
setTimeout(()=>{
if(this.pageIndex != this.list.length - 1){
this.pageIndex = INDEX + 1;
}
},300)
}
},
//存储答题记录
saveTestRecordProcess(ID,VALUE){
let data = {
testType: 17,
testTitleId: ID,
testResult: VALUE
}
api.saveTestRecordProcess(data).then(res => {
if (res.Result === 1) {
}
})
},
// 提交题目
submitTitle() {
let testStr = "";
@@ -217,9 +176,7 @@
let data = {
testStr
}
api.removeTestRecordProcess(17).then((res) => {
return api.saveWorkValuesResult(data);
}).then((res) => {
api.saveWorkValuesResult(data).then((res) => {
uni.hideLoading();
if (res.Result === 1) {
uni.showToast({
@@ -231,7 +188,7 @@
beforePage.data.refreshIfNeeded = true;
setTimeout(()=>{
uni.redirectTo({
url: `/packageCa/testReport/workValuesTestReport?year=${res.Data.Year}`
url: `/packageCa/testReport/workValuesTestReport`
})
},1000)
} else {

View File

@@ -1,10 +1,6 @@
<template>
<view class="index-wrap">
<view class="yanshi-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>素质测评</text>
</view>
<view class="section">
<view class="head-title">测评中心</view>
<view class="nav-block">
@@ -55,43 +51,16 @@
return {
barHeight: wx.getWindowInfo().statusBarHeight,
user: null,//用户信息
userId: 0,
name: ""
name: "",
idCard: ""
}
},
onLoad(e) {
this.userId = e.userId;
this.idCard = e.idCard;
this.name = e.name;
this.queryWechartToken();
this.queryKaShiToken();
},
methods: {
// 返回
goback() {
uni.navigateBack(-1);
},
async getUserInfor(){
const res = await api.getUserBasisInfo();
if (res.Result == 1) {
const data = res.Data.data;
if(data === null){
uni.showToast({
title: "请先完善个人信息",
duration:2000,
icon: "none"
})
setTimeout(() => {
uni.navigateTo({
url: "/packageCa/userCenter/fillInInformation"
})
}, 2000);
}
} else {
uni.showToast({
title: res.Message,
icon: "none"
})
}
},
// 演示入
navDetail(index){
switch (index){
@@ -137,44 +106,17 @@
// 登录获取用户信息
async queryKaShiToken() {
const res = await api.queryKaShiToken(this.userId,this.name)
const res = await api.queryKaShiToken(this.idCard,this.name)
if(res.Result == 1){
return res.Data;
let params = {
token:res.Data.token,
user: res.Data.userInfo
};
uni.setStorageSync('CAuserInfo',params);
}else {
return null
}
},
// 获取token
async queryWechartToken() {
uni.showLoading({
title: "加载中"
})
const data = await this.queryKaShiToken();
if(data.userInfo != null){
const res = await api.queryWechartToken(data.userInfo.Id,2268,1)
uni.hideLoading();
if(res.Result == 1){
let params = {
token:data.token,
user:data.userInfo,
userToken: res.Data.token
};
uni.setStorageSync('CAuserInfo',params);
this.getUserInfor();
}
}else {
uni.showToast({
title: "获取用户信息失败",
icon: "none"
})
setTimeout(()=>{
uni.reLaunch({
url: "/pages/index/index"
})
},1500)
}
}
}
}
</script>

View File

@@ -30,9 +30,9 @@
{{optionStr2}}
<view class="iocn"></view>
</view>
<!-- <view class="title">群体维度</view>
<view class="title">群体维度</view>
<view class="options">
<view class="item" :class="[schoolLevel == 1?'on':'', gradeShow?'':'disable']" v-on:click="selectSchoolLevel(1)" >班级</view>
<view class="item" :class="[schoolLevel == 1?'on':'', gradeShow?'':'disable']" v-on:click="selectSchoolLevel(1)" >班级</view>
<view class="item" :class="[schoolLevel == 2?'on':'', gradeShow?'':'disable']" v-on:click="selectSchoolLevel(2)">年级</view>
<view class="item" v-on:click="selectSchoolLevel(3)" :class="schoolLevel == 3?'on':''">学校</view>
</view>
@@ -40,7 +40,7 @@
<view class="options">
<view class="item" v-on:click="selectSex(1)" :class="sexType == 1?'on':''"></view>
<view class="item" v-on:click="selectSex(2)" :class="sexType == 2?'on':''"></view>
</view> -->
</view>
</view>
<view class="content" v-else>
<view class="title">我的报告</view>
@@ -54,19 +54,21 @@
{{optionStr2}}
<view class="iocn"></view>
</view>
<!-- <view class="title">群体维度</view>
<view class="title">群体维度</view>
<view class="options">
<view v-for="(item, index) in departList" :key="index">
<view class="item" v-on:click="selectSchoolLevel(item)" :class="schoolLevel == item.DepartId?'on':''">
<view >
<!-- v-for="(item, index) in departList" :key="index" -->
<!-- <view class="item" v-on:click="selectSchoolLevel(item)" :class="schoolLevel == item.DepartId?'on':''">
{{item.Name}}
</view>
</view> -->
<view class="item" v-on:click="selectSchoolLevel(3)" :class="schoolLevel == 3?'on':''">全体人员</view>
</view>
</view>
<view class="title">受测对象</view>
<view class="options">
<view class="item" v-on:click="selectSex(1)" :class="sexType == 1?'on':''"></view>
<view class="item" v-on:click="selectSex(2)" :class="sexType == 2?'on':''"></view>
</view> -->
</view>
</view>
<view class="btn-wrap">
<view class="btn" v-on:click="confirmCompute">
@@ -340,22 +342,25 @@
//选中群体维度
selectSchoolLevel(info) {
console.log(info);
if (this.platformType == 1) {
this.departName = info.Name;
//高校
this.schoolLevel = info.DepartId;
this.sexType = 0;
} else {
if(!this.gradeShow && info < 3){
return uni.showToast({
title: "当前学期未进行分班,无法进行对比",
icon: "none"
})
}
//普教
this.schoolLevel = info;
this.sexType = 0;
}
// if (this.platformType == 1) {
// this.departName = info.Name;
// //高校
// this.schoolLevel = info.DepartId;
// this.sexType = 0;
// } else {
// if(!this.gradeShow && info < 3){
// return uni.showToast({
// title: "当前学期未进行分班,无法进行对比",
// icon: "none"
// })
// }
// //普教
// this.schoolLevel = info;
// this.sexType = 0;
// }
this.departName = "全体人员"
this.sexType = 0;
this.schoolLevel = info;
this.optionStr2 = "";
this.selYTItem2 = null;
this.selRepItem2 = null;

View File

@@ -1,9 +1,5 @@
<template>
<view class="interest-report-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>我的报告</text>
</view>
<view class="content">
<contrastBox @updateValue="handleChildValueChange" :testType="testType" :userId="userId" :recordId="recordId" @compareParameters="opCompareParameters"></contrastBox>
<view class="section-block">
@@ -75,8 +71,8 @@
import contrastBox from "@/packageCa/testReport/components/contrastBox.vue"
import api from "@/packageCa/apiCa/testManage.js";
import theme from '@/uni_modules/lime-echart/static/walden.json';
const echarts = require('../../utilCa/echarts.min.js');
// import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';
const echarts = require('../utilCa/echarts.min.js');
import * as echarts1 from '../utilCa/echarts.min';
// // 注册主题
// echarts.registerTheme('theme', theme);
export default {

View File

@@ -1,9 +1,5 @@
<template>
<view class="interest-report-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>我的报告</text>
</view>
<view class="content">
<contrastBox :testType="testType" :userId="userId" :recordId="recordId" @compareParameters="opCompareParameters"></contrastBox>
<view class="section-block">
@@ -245,7 +241,7 @@
import contrastBox from "@/packageCa/testReport/components/contrastBox.vue"
import api from "@/packageCa/apiCa/testManage.js";
import theme from '@/uni_modules/lime-echart/static/walden.json';
const echarts = require('../../utilCa/echarts.min.js');
const echarts = require('../utilCa/echarts.min.js');
// import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';
// // 注册主题
// echarts.registerTheme('theme', theme);

View File

@@ -1,9 +1,5 @@
<template>
<view class="interest-report-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>我的报告</text>
</view>
<view class="content">
<contrastBox :testType="testType" :userId="userId" :recordId="recordId" @compareParameters="opCompareParameters"></contrastBox>
<view class="section-block">
@@ -115,7 +111,7 @@
import api from "@/packageCa/apiCa/testManage.js"
import wayData from "./multipleAbilityData.json";
import theme from '@/uni_modules/lime-echart/static/walden.json';
const echarts = require('../../utilCa/echarts.min.js');
const echarts = require('../utilCa/echarts.min.js');
// import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';
// // 注册主题
// echarts.registerTheme('theme', theme);

View File

@@ -1,9 +1,5 @@
<template>
<view class="interest-report-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>我的报告</text>
</view>
<view class="content">
<contrastBox :testType="testType" :userId="userId" :recordId="recordId" @compareParameters="opCompareParameters"></contrastBox>
<view class="section-block">
@@ -402,7 +398,7 @@
import opts from "./chartOpts.js"
import api from "@/packageCa/apiCa/testManage.js";
import theme from '@/uni_modules/lime-echart/static/walden.json';
const echarts = require('../../utilCa/echarts.min.js');
const echarts = require('../utilCa/echarts.min.js');
// import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';
// // 注册主题
// echarts.registerTheme('theme', theme);

View File

@@ -1,9 +1,5 @@
<template>
<view class="interest-report-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>我的报告</text>
</view>
<view class="content">
<contrastBox :testType="testType" :userId="userId" :recordId="recordId" @compareParameters="opCompareParameters"></contrastBox>
<view class="section-block">
@@ -43,8 +39,7 @@
import contrastBox from "@/packageCa/testReport/components/contrastBox.vue"
import api from "@/packageCa/apiCa/testManage.js";
import theme from '@/uni_modules/lime-echart/static/walden.json';
const echarts = require('../../utilCa/echarts.min.js');
// import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';
const echarts = require('../utilCa/echarts.min.js');
// // 注册主题
// echarts.registerTheme('theme', theme);
export default {

View File

@@ -1,15 +1,11 @@
<template>
<view class="index-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goBack"></view>
<text>生涯罗盘</text>
</view>
<view class="content">
<view class="title">
生涯罗盘
</view>
<view class="section">
<view class="table">
<view class="table" v-if="compassList.length > 0">
<view class="tr">
<view class="th">
</view>
@@ -44,6 +40,13 @@
</view>
</view>
</view>
<view class="empty" v-else>
<view class="icon"></view>
<view class="txt">暂无推荐职业请先进行兴趣测评</view>
<view class="nav-btn" @click="navTest">
去测评
</view>
</view>
</view>
<view class="title">
我的职业
@@ -119,13 +122,20 @@
this.getGXCareerPlanList();
},
methods: {
goBack() {
uni.navigateBack(-1);
},
// 去测评
navTest(){
uni.navigateTo({
url: `/packageCa/pagesTest/testList`
})
},
//选中职业添加
async checkedJob(ITEM){
uni.showLoading({
title: "添加中..."
})
this.checkedIndex = ITEM.JobId;
const res = await api.saveGXCareerPlan(ITEM.JobId);
uni.hideLoading();
if (res.Result == 1) {
uni.showToast({
title: "添加成功",
@@ -162,9 +172,9 @@
const res = await api.getGXCareerPlanList("",this.page,10);
if (res.Result == 1) {
this.jobList = res.Data.list;
// if(res.Data.list.length < 10){
// this.noMore = true;
// }
if(res.Data.list.length == 0){
this.noMore = true;
}
} else {
uni.showToast({
title: res.Message,
@@ -221,6 +231,36 @@
background-size: 38rpx 38rpx;
}
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 60rpx;
padding-bottom: 100rpx;
.icon {
width: 240rpx;
height: 240rpx;
background: url("#{$image-oss-url}/empty.png") no-repeat;
background-size: 100%;
margin-bottom: 20rpx;
}
.txt {
font-size: 28rpx;
color: #A4B3E5;
}
.nav-btn {
width: 335rpx;
height: 80rpx;
margin: 40rpx auto 0;
background-color: #1989fa;
border-radius: 40rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
line-height: 80rpx;
}
}
.index-wrap {
.content {
padding: 0 20rpx;

View File

@@ -1,563 +0,0 @@
<template>
<view class="index-wrap">
<view class="title-h1">
请先完善个人信息
</view>
<view class="item-list">
<view class="item">
<view class="title"><text>*</text>学历(必选)</view>
<view class="option">
<view class="subject-item" :class="eduLevel===3?'on':''" @click="changeEduLevel(3)">研究生</view>
<view class="subject-item" :class="eduLevel===2?'on':''" @click="changeEduLevel(2)">本科</view>
<view class="subject-item" :class="eduLevel===1?'on':''" @click="changeEduLevel(1)">专科</view>
</view>
</view>
<view class="item">
<view class="title"><text>*</text>专业类(必选)</view>
<view class="input-wrap">
<view class="input-value" :class="specialtyName!== ''?'':'placeholder'"
@click="showZhuanYeDialog(true)">
{{specialtyName !== ''? specialtyName: "请选择专业类"}}
</view>
<view class="icon-select">
</view>
</view>
</view>
</view>
<view class="btn-wrap">
<view class="btn" @click="commitForm">
确认提交
</view>
</view>
<uni-popup ref="pop_zhuanye" type="bottom" style="background: #fff !important;">
<view class="layer-inner">
<view class="head">
<text>选择专业类</text>
<view class="close-btn" @click="showZhuanYeDialog(false)"></view>
</view>
<view class="content">
<view class="li" :class="item.value == specialtyName?'on':''" v-for="(item,index) in showSpecialtyList"
:key="index" @click="checkSpecialty(item)">
<text>{{item.label}}</text>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import api from "@/packageCa/apiCa/user.js"
export default {
data() {
return {
schoolName: "", //
eduLevel: 2, //3研究生2本科1专科
specialtyName: "", //
showSpecialtyList: [{
label: '哲学',
value: '哲学'
},
{
label: '经济学',
value: '经济学'
},
{
label: '法学',
value: '法学'
},
{
label: '教育学',
value: '教育学'
},
{
label: '文学',
value: '文学'
},
{
label: '历史学',
value: '历史学'
},
{
label: '理学',
value: '理学'
},
{
label: '工学',
value: '工学'
},
{
label: '农学',
value: '农学'
},
{
label: '医学',
value: '医学'
},
{
label: '管理学',
value: '管理学'
},
{
label: '艺术学',
value: '艺术学'
},
{
label: '军事学',
value: '军事学'
},
{
label: '交叉学科',
value: '交叉学科'
},],
specialtyOption1: [{
label: '农林牧渔大类',
value: '农林牧渔大类'
},
{
label: '资源环境与安全大类',
value: '资源环境与安全大类'
},
{
label: '能源动力与材料大类',
value: '能源动力与材料大类'
},
{
label: '土木建筑大类',
value: '土木建筑大类'
},
{
label: '水利大类',
value: '水利大类'
},
{
label: '装备制造大类',
value: '装备制造大类'
},
{
label: '生物与化工大类',
value: '生物与化工大类'
},
{
label: '轻工纺织大类',
value: '轻工纺织大类'
},
{
label: '食品药品与粮食',
value: '食品药品与粮食'
},
{
label: '交通运输大类',
value: '交通运输大类'
},
{
label: '电子信息大类',
value: '电子信息大类'
},
{
label: '医药卫生大类',
value: '医药卫生大类'
},
{
label: '财经商贸大类',
value: '财经商贸大类'
},
{
label: '旅游大类',
value: '旅游大类'
},
{
label: '文化艺术大类',
value: '文化艺术大类'
},
{
label: '新闻传播大类',
value: '新闻传播大类'
},
{
label: '教育与体育大类',
value: '教育与体育大类'
},
{
label: '公安与司法大类',
value: '公安与司法大类'
},
{
label: '公共管理与服务大类',
value: '公共管理与服务大类'
},
],
specialtyOption2: [{
label: '哲学',
value: '哲学'
},
{
label: '经济学',
value: '经济学'
},
{
label: '法学',
value: '法学'
},
{
label: '教育学',
value: '教育学'
},
{
label: '文学',
value: '文学'
},
{
label: '历史学',
value: '历史学'
},
{
label: '理学',
value: '理学'
},
{
label: '工学',
value: '工学'
},
{
label: '农学',
value: '农学'
},
{
label: '医学',
value: '医学'
},
{
label: '管理学',
value: '管理学'
},
{
label: '艺术学',
value: '艺术学'
},
{
label: '军事学',
value: '军事学'
},
{
label: '交叉学科',
value: '交叉学科'
},
],
}
},
computed: {
},
created() {
// this.getUserInfor();
},
methods: {
async getUserInfor(){
const res = await api.getUserBasisInfo();
if (res.Result == 1) {
const data = res.Data.data;
this.specialtyName=data.SpecialtyName;
this.eduLevel=data.EduLevel;
} else {
uni.showToast({
title: res.Message,
icon: "none"
})
}
},
//显示专业弹窗
showZhuanYeDialog(type){
if(type==false){
this.$refs.pop_zhuanye.close();
}else{
this.$refs.pop_zhuanye.open('bottom');
}
},
// 改变学历
changeEduLevel(INDEX){
if(INDEX == 1){
this.showSpecialtyList = this.specialtyOption1;
}else {
this.showSpecialtyList = this.specialtyOption2;
}
this.specialtyName = "";
this.eduLevel = INDEX;
},
//选中专业类
checkSpecialty(ITEM) {
this.specialtyName = ITEM.value;
this.showZhuanYeDialog(false)
},
//确认表单
async commitForm() {
if (this.specialtyName == "") {
uni.showToast({
title: "请先选择专业类",
icon: "none"
})
return;
}
uni.showLoading({
title: "保存中..."
})
let mobileCode = this.code;
const data = {
//SchoolName: this.schoolName,
EduLevel: this.eduLevel,
SpecialtyName: this.specialtyName,
//Phone: this.mobile,
//StartYear: this.startYear
}
const res = await api.saveUserBasisInfo(mobileCode,data);
uni.hideLoading();
if (res.Result == 1) {
uni.navigateBack()
} else {
uni.showToast({
title: res.Message,
icon: "none"
})
}
},
}
}
</script>
<style lang="scss" scoped>
.index-wrap {
padding: 40rpx 20rpx 60rpx;
.title-h1 {
font-size: 36rpx;
color: #000000;
font-weight: 600;
margin-bottom: 40rpx;
}
.item-list {
.item {
padding-bottom: 20px;
.title {
font-size: 28rpx;
color: #333;
margin-bottom: 20rpx;
text{
color:red;
}
}
.input-wrap {
width: 670rpx;
height: 84rpx;
border-radius: 12rpx;
border: 2rpx solid #EEEEEE;
padding: 0 20rpx;
display: flex;
align-items: center;
.icon-input {
width: 32rpx;
height: 32rpx;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEUAAAAwMDAyMjIzMzMyMjIwMDAzMzMyMjIzMzMyMjIzMzMzMzM0NDQwMDAzMzMzMzMzMzNtKHn7AAAAEHRSTlMAIN+/fzDvYM9wn49AEK9QVfMC+gAAAGNJREFUKM/VzTsSgDAIRVEiIf8o+1+tGcOkIjQ2etvDPOAbdV/bztzBzH6DFHjULD21zURTUf0XHg1OM55KqolqNkuGHe63BtEwSIY5wyAuI7+KgmUQ5i5nEgrmkmXxwlWFV91t2QjwOGHVAgAAAABJRU5ErkJggg==") no-repeat;
background-size: 100%;
}
.icon-select {
width: 16rpx;
height: 16rpx;
margin-left: 24rpx;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAS5JREFUWEftltsRgjAQRXehEeyACQ1IJUolYiXSiRRAMnQgjTDRZdCJCOQhhB/yH+7JZnMWhI0XbpwPO8Bega4CjLELIuYeG7IBgJJznmGSJDcAOHsMV6MKAngAQLQRQEMA91c5jhsBFBjHcRSGIUH4rkLTtm3aNWEPQVfhbSFiWlVV+fGAT4h3OJ32S0SMsTMi0qtYbanhPwBrO0FKmQkhCvV0oypeQ0xSylwIcR2WdnIWLAxRkPXG7nUSgJoyCILTAoom5aZTTTU7DfuXQU3pKqrZ8NEmHJL+AaENNwJQRGVjy4ZzfjB5y8Y/JBbK7hRb1zWNXO0yBjBV9lA0OgIrAB2EbbhxDwxPMaZsl3BnAKUS9EQjRMxosunKbSUil4+57LHuAZeQuT07wF6BJ0iYZ7lPYQRvAAAAAElFTkSuQmCC") no-repeat;
background-size: 100%;
}
.input-value {
width: 580rpx;
height: 84rpx;
font-size: 28rpx;
color: #333;
line-height: 84rpx;
padding-left: 20rpx;
&.placeholder {
font-size: 28rpx;
color: #999;
}
&::-webkit-input-placeholder {
font-size: 28rpx;
color: #999;
}
}
.mb-input-value {
width: 440rpx;
height: 84rpx;
font-size: 28rpx;
color: #333;
border-radius: 12rpx;
border: 2rpx solid #EEEEEE;
line-height: 84rpx;
padding-left: 40rpx;
&::-webkit-input-placeholder {
font-size: 28rpx;
color: #999;
}
}
.get-code-btn {
width: 240rpx;
height: 80rpx;
margin-left: 30rpx;
line-height: 80rpx;
background-color: #1b88ff;
border-radius: 12rpx;
font-size: 32rpx;
text-align: center;
color: #ffffff;
z-index: 9;
&.disable {
background: #9f9f9f;
}
}
}
.option {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
.subject-item {
width: 210rpx;
height: 76rpx;
background: #F3F4F6;
border-radius: 12rpx;
font-size: 28rpx;
color: #333;
margin-bottom: 20rpx;
margin-right: 30rpx;
text-align: center;
line-height: 76rpx;
&:nth-child(3n) {
margin-right: 0;
}
&.on {
background: #F3F4F6;
color: #1677ff;
}
&.disadble {
color: #bbb;
}
}
}
}
}
.btn-wrap {
position: fixed;
bottom: 100rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
z-index: 9;
.btn {
width: 688rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
background: #1677ff;
font-size: 32rpx;
color: #fff;
border-radius: 60rpx;
&.disable {
background: #F3F4F6;
color: #bbb;
}
}
}
.layer-inner {
background:#fff;
border-radius:10px 10px 0 0;
.head {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 120rpx;
width: 100%;
font-size: 34rpx;
color: #000000;
.close-btn {
position: absolute;
top: 39rpx;
right: 27rpx;
width: 52rpx;
height: 52rpx;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAHdElNRQfmChMLCDGRh9c8AAAAmklEQVQ4y7WUMQ7DMAhFnzpmRO3979ABqVN8m/YWdLGcqEkM+lI92Qb+R3wAPgRPjMoxnOANQRCsLGnIwtq98X5pCZvRuucLHuMxY9tYGvffD0tYdsA2ZbsEvWabAp4b09SPDlYp0t4JSAt0YPOhYEH4ja0m+jg+QvzMfKuh/CE9oRBCyQVxhTYSGlYYDWEIpXGXFou0woRl+QUj09L9Yg66GgAAAABJRU5ErkJggg==") center no-repeat;
background-size: 50%;
}
}
.content {
max-height: 640rpx;
overflow: auto;
padding: 0 40rpx;
.li {
position: relative;
height: 114rpx;
line-height: 114rpx;
border-bottom: 2rpx solid #f5f5f5;
text {
font-size: 30rpx;
color: #000000;
margin-right: 20rpx;
}
&.on {
text {
color: #1b88ff;
}
&::after {
position: absolute;
right: 10rpx;
top: 50%;
transform: translateY(-50%);
content: "";
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAZCAMAAACM5megAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAATlBMVEUbiP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8biP8AAAAx8hE2AAAAGHRSTlMAH0f2c0SVAfc7bv6JI/hS+UhR+1D0jxRK42VSAAAAAWJLR0QZ7G61iAAAAAd0SU1FB+YKFBEcF+FCm4sAAABsSURBVCjPzdHHDoAwDANQs1cLlJn//1KGEIKqrY+QY/QOiQ2QiRgA4iTlRCTjJC9+QsqPSMVJ3ShGdCuiwgToegu5zrWQ+6MX8j39QMaby41MILoLmWC6JzKkgGFHI+voQKxGTLMshACrdu83CdwKBKKZxqUAAAAASUVORK5CYII=") no-repeat;
background-size: 100%;
display: block;
width: 35rpx;
height: 25rpx;
}
}
}
}
.op-block {
display: flex;
align-items: center;
justify-content: center;
padding: 30rpx 40rpx 0;
width: 670rpx;
height: 115rpx;
.commit-btn {
width: 361rpx;
height: 77rpx;
line-height: 77rpx;
text-align: center;
background-color: #1b88ff;
border-radius: 38rpx;
font-size: 30rpx;
color: #ffffff;
}
}
}
}
</style>

View File

@@ -1,9 +1,5 @@
<template>
<view class="index-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goBack"></view>
<text>学习计划制定</text>
</view>
<view class="content">
<view class="title-h1">PDCA 循环法</view>
<view class="banner"></view>
@@ -150,9 +146,6 @@
this.queryPlanList();
},
methods: {
goBack(){
uni.navigateBack(-1);
},
// 切换目标标签
changeTarget(ITEM){
if(ITEM.EncodeId == this.checkedTargetCode){
@@ -309,20 +302,21 @@
padding: 40rpx 30rpx 0;
margin-top: 40rpx;
.target-tabbar {
margin-bottom: 50rpx;
margin-bottom: 30rpx;
display: flex;
flex-wrap: wrap;
.item {
position: relative;
width: 155rpx;
width: 150rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
border-radius: 34rpx;
border: solid 2rpx #eeeeee;
font-size: 28rpx;
font-size: 26rpx;
color: #999999;
margin-right: 20rpx;
margin-bottom: 20rpx;
&.on {
color: #1989fa;
border-color: #1989fa;

View File

@@ -1,23 +1,6 @@
<template>
<view class="document">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goback"></view>
<text>生涯档案</text>
</view>
<view class="person-info" style="display:none;">
<view class="img-wrap">
<image v-if="customInfo.AllHeadimgUrl" :src="customInfo.AllHeadimgUrl"></image>
<image v-else src="https://51xuanxiao.oss-cn-hangzhou.aliyuncs.com/Resource/xcx_sygh/avatar.png" mode=""></image>
</view>
<view class="txt-wrap">
<view class="top">
<view class="name">{{user.RealName}}</view>
<!-- <view class="grades">{{user.GradeName}}{{user.ClassName}}</view> -->
</view>
<view class="bottom">{{user.SchoolName}}</view>
</view>
</view>
<view class="section" style="margin-top:60rpx;">
<!-- <view class="section" style="margin-top:60rpx;">
<view class="head">
<view class="left-txt">
<view class="icon icon-1"></view>
@@ -44,8 +27,8 @@
<view class="footer">
<navigator url="/packageCa/job/index" class="btn">添加意向职业</navigator>
</view>
</view>
<view class="section">
</view> -->
<view class="section" >
<view class="head">
<view class="left-txt">
<view class="icon icon-4"></view>
@@ -223,7 +206,7 @@
<view class="content" v-if="universalResult != null&&universalResult !=''">
<view class="text-wrap">
<view class="row">
<text class="label">的能力 </text>
<text class="label">的能力 </text>
<view class="long-value" v-if="universalResult != null && universalResult.length > 0 && universalGroupList1.length > 0">
<text v-for="(item, index) in universalGroupList1" :key="index">
{{item}} <text v-if="index < universalGroupList1.length -1"></text>
@@ -233,6 +216,17 @@
<text></text>
</view>
</view>
<view class="row">
<text class="label">优势的能力 </text>
<view class="long-value" v-if="universalResult != null && universalResult.length > 0 && universalGroupList2.length > 0">
<text v-for="(item, index) in universalGroupList2" :key="index">
{{item}} <text v-if="index < universalGroupList2.length -1"></text>
</text>
</view>
<view class="long-value" v-else>
<text></text>
</view>
</view>
</view>
</view>
<view class="content" v-else>
@@ -298,6 +292,7 @@ import api1 from "@/packageCa/apiCa/studentProfile.js"
multGroupList1: [],//多元能力能力强
universalResult: "",//通用能力
universalGroupList1: [],//通用能力 优势
universalGroupList2: [],//通用能力 优势
}
},
onShow() {
@@ -308,19 +303,16 @@ import api1 from "@/packageCa/apiCa/studentProfile.js"
created() {
},
methods: {
goback(){
uni.navigateBack(-1);
},
// 获取个人档案
async queryStudentProfile() {
uni.showLoading({
title: "加载中"
})
const gradeLevel = this.user.GradeLevel;
const res = gradeLevel == 3? await api1.getGXWechatStudentProfile() : await api.queryStudentProfile();
const res = await api1.getGXWechatStudentProfile();
uni.hideLoading();
if(res.Result == 1){
let data = gradeLevel == 3? res.Data.list : res.Data;
let data = res.Data;
// 意向职业
this.intentionJobList = data.IntentionJobList;
// 意向专业
@@ -373,6 +365,7 @@ import api1 from "@/packageCa/apiCa/studentProfile.js"
this.multResult = data.MultResult;
// 通用能力
this.universalGroupList1 = data.UniversalGroupList1;
this.universalGroupList2 = data.UniversalGroupList2;
this.universalResult = data.UniversalResult;
}
}

View File

@@ -1,9 +1,5 @@
<template>
<view class="index-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goBack"></view>
<text>职业路径</text>
</view>
<view class="content">
<view class="section">
<view class="title-h1">
@@ -22,9 +18,6 @@
<view class="th">
我的意向
</view>
<view class="th">
专业匹配
</view>
</view>
<view class="tr" v-for="(item,index) in jobList" @click="checkedJob(item)" :key="index">
<view class="td">
@@ -39,9 +32,9 @@
<view class="td">
<view class="is-has" v-if="item.IsIntention"></view>
</view>
<view class="td">
<!-- <view class="td">
<view class="is-has" v-if="item.IsSpecialtyMatch"></view>
</view>
</view> -->
</view>
</view>
<view class="empty" v-else>
@@ -51,7 +44,7 @@
去测评
</view>
</view>
<view class="title-h1">
<view class="title-h1" v-if="jobList.length > 0">
职业介绍
</view>
<view class="desc">
@@ -60,7 +53,7 @@
</view>
{{jobIntroduce}}
</view>
<view class="title-h1">
<view class="title-h1" v-if="jobList.length > 0">
发展路径
</view>
<view class="desc">
@@ -68,9 +61,9 @@
{{jobPath}}
</view>
</view>
<view class="path-map">
<view class="path-map" v-if="jobList.length > 0">
<view class="origin-item">
大学生
</view>
<view class="path-list" :class="isLoadingEnd?'show':'ing'">
<view class="line-1">
@@ -183,6 +176,9 @@
// 获取职业
async queryPathInfo(){
this.isLoadingEnd = false;
if(this.jobList.length == 0){
return;
}
const res = await api.queryPathInfo(this.checkedCode);
if (res.Result == 1) {
let data = res.Data;
@@ -207,7 +203,7 @@
// 去测评
navTest(){
uni.navigateTo({
url: `/pagesTest/interestTestCollect/interestTestTitle`
url: `/packageCa/pagesTest/interestTestTitle`
})
},
//选中职业
@@ -221,9 +217,6 @@
icon:"none"
});
},
goBack(){
uni.navigateBack(-1);
},
}
}
</script>
@@ -312,7 +305,7 @@
.tr {
display: -webkit-box;
.th {
width: 145rpx;
width: 170rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
@@ -331,7 +324,7 @@
display: flex;
justify-content: center;
align-items: center;
width: 145rpx;
width: 170rpx;
min-height: 72rpx;
font-size: 24rpx;
color: #333333;

View File

@@ -1,9 +1,5 @@
<template>
<view class="index-wrap">
<view class="head-bar" :style="{'margin-top': barHeight + 5 + 'px'}">
<view class="go-back" @click="goBack"></view>
<text>smart目标制定</text>
</view>
<view class="content">
<view class="banner-wrap"></view>
<view class="desc">
@@ -87,7 +83,7 @@
<view class="form-wrap" >
<view class="form-item">
<view class="label">
目标描述
<text>*</text>目标描述
</view>
<view class="input-wrap">
<textarea v-model="targetForm.TargetDesc"
@@ -96,7 +92,7 @@
</view>
<view class="form-item">
<view class="label">
目标类型
<text>*</text>目标类型
</view>
<view class="check-wrap">
<view class="checked-item" @click="targetForm.TargetType = 1">
@@ -186,6 +182,7 @@
tabs:['目标一 ', '目标二 ', '目标三 ', '目标四 ', '目标五 '],
targetList: [],////目标列表
checkedTargetCode: "",//// 目标码
videoUrlVisitor: "",
newTargetParams: {
Id: 0,
TargetDesc: "",
@@ -215,9 +212,6 @@
url:"/packageCa/userCenter/learningPlan"
})
},
goBack(){
uni.navigateBack(-1);
},
// 添加目标
addTarget(){
this.targetForm = {
@@ -234,6 +228,20 @@
},
// 保存目标
async saveTarget(){
if(this.targetForm.TargetDesc == ""){
uni.showToast({
title: "请输入目标描述",
icon: "none"
})
return;
}
if(this.targetForm.TargetType == ""){
uni.showToast({
title: "请选择目标类型",
icon: "none"
})
return;
}
const res = await api.saveSmartTarget(this.targetForm);
if (res.Result == 1) {
uni.showToast({
@@ -383,10 +391,18 @@
background-size: 38rpx 38rpx;
}
}
.video-content {
padding: 0;
width: 710rpx;
background: #000;
.video {
width: 100%;
// height: 400rpx;
}
}
.index-wrap {
.content {
padding-top: 60rpx;
padding-bottom: 60rpx;
.banner-wrap {
@@ -563,6 +579,9 @@
font-size: 28rpx;
color: #333333;
margin-bottom: 30rpx;
text {
color: #ff0000;
}
}
.check-wrap {
display: flex;

View File

@@ -1,40 +1,13 @@
let baseUrl = ""
let baseUrl1 = ""
let baseUrl2 = ""
let baseUrl3 = ""
let baseUrl4 = ""
let baseUrl5 = ""
let baseUrl6 = ""
let baseUrl7 = ""
let baseUrl8 = ""
let filestore_site = "";
// #ifdef MP-WEIXIN
// 编译项目因为使用插件lime-echartechart文件过大需要非压缩代码方式编译不然会很慢发布的时候才压缩代码方式编译
if (wx.getAccountInfoSync().miniProgram.envVersion === 'develop') {
baseUrl = 'http://dev.51xuanxiao.com:8005/api' // 开发环境
baseUrl3 = 'http://dev.51xuanxiao.com:8007/api' // 职业环境
baseUrl4 = 'http://dev.51xuanxiao.com:8009/api' // 用户环境
baseUrl5 = 'http://dev.51xuanxiao.com:8006/api' // 测评环境
filestore_site = 'http://192.168.1.168:31128' //文件地址
baseUrl = 'http://222.80.110.161:11111/career' // 开发环境
} else {
baseUrl = 'https://yanxueapi.51xuanxiao.com/api' // 生产环境
baseUrl3 = "https://jobapi.51xuanxiao.com/api"// 职业环境
baseUrl4 = "https://authapi.51xuanxiao.com/api"// 用户环境
baseUrl5 = "https://testapi.51xuanxiao.com/api"// 测评环境
filestore_site = 'https://filestore.plan.51xuanxiao.com' //文件地址
baseUrl = 'http://222.80.110.161:11111/career' // 生产环境
}
// #endif
export {
baseUrl,
baseUrl1,
baseUrl2,
baseUrl3,
baseUrl4,
baseUrl5,
baseUrl6,
baseUrl7,
baseUrl8,
filestore_site
baseUrl
}

View File

@@ -1,20 +0,0 @@
// 公共图片基地址
const BASE_IMAGE_URL = 'https://51xuanxiao.oss-cn-hangzhou.aliyuncs.com/Resource/xcx_sygh';
/**
* 图片地址拼接方法
* @param {string} path - 图片路径(相对于基地址的路径)
* @param {string} [process] - OSS图片处理参数例如'image/resize,m_fixed,w_348/quality,q_80'
* @returns {string} 完整的图片URL
*/
export function ossImageUrl(path, process) {
// 如果有处理参数,拼接处理参数
if (process) {
return `${BASE_IMAGE_URL}/${path}?x-oss-process=${process}`;
}
// 没有处理参数时,直接返回原始路径
return `${BASE_IMAGE_URL}/${path}`;
}

View File

@@ -1,14 +1,4 @@
import {
baseUrl,
baseUrl1,
baseUrl2,
baseUrl3,
baseUrl4,
baseUrl5,
baseUrl6,
baseUrl7,
baseUrl8
} from './config.js'
import { baseUrl} from './config.js'
const request = {}
const headers = {}
@@ -18,77 +8,23 @@ request.globalRequest = (url, method, data, power, type) => {
// 1 == 不通过access_token校验的接口
// 2 == 文件下载接口列表
const userInfo = uni.getStorageSync('CAuserInfo')
// console.log('缓存userinfo:',userInfo);
switch (power) {
case 1:
case 3:
headers['Token'] = userInfo.token
// if(power == 3){
// const deviceInfo = wx.getDeviceInfo()
// let data = {
// model: deviceInfo.model,
// system: deviceInfo.system,
// platform: deviceInfo.platform
// }
// headers['DeviceInfo'] = JSON.stringify(data)
// }
break;
case 2:
headers['Authorization'] = userInfo.userToken
break;
default:
break;
}
let host = "";
let key = "";
if (type == 1) {
host = baseUrl1;
} else if (type == 2) {
host = baseUrl2;
} else if (type == 3) {
host = baseUrl3;
} else if (type == 4) {
host = baseUrl4;
} else if (type == 5) {
host = baseUrl5;
} else if (type == 7) {
host = baseUrl7;
key = `?PartnerKey=51xuanxiao&PartnerSecret=mC6XRjDWUzGAdxcCqRBWGb88uR`;
} else if (type == 8) {
host = baseUrl8;
//key = `?AppKey=51xuanxiao&AppSecret=mC6XRjDWUzGAdxcCqRBWGb88uR`;
} else {
host = baseUrl;
}
console.log("ca用户",userInfo);
if(userInfo != ""){
headers['Token'] = userInfo.token
}
return uni.request({
timeout: 60000,
url: host + url + key,
url: baseUrl + url,
method,
data: data,
dataType: 'json',
header: headers
}).then(res => {
//console.log("ressss===="+JSON.stringify(res.data));
// console.log("type===="+type);
if (type == 7) {
if (res[1].data.code == 0) {
return res[1].data
} else {
throw res[1].data
}
} else if (type == 8) {
if (res[1].data.Code == 0) {
return res[1].data
} else {
throw res[1].data
}
} else {
if (res.data.Result) {
return res.data
} else {
throw res.data
}
}
if (res.data.Result) {
return res.data
} else {
throw res.data
}
}).catch(parmas => {
switch (parmas.status) {
case 401:

View File

@@ -117,7 +117,6 @@ import { getToken } from "@/utilsRc/auth";
name: 'file',
formData: {},
header: {
// 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJQSlUyVlJCc1E1aXRMMWgxdjNkcVh2eER1c2VVc0hvRiIsInVzZXJJZCI6MX0.z4Z2XqgXyU0GQU-i7Bsa5T-zCKApTxj1YQ73rk7bAVo'
'Authorization': 'Bearer ' + getToken(),
},
success: (res) => {

Some files were not shown because too many files have changed in this diff Show More